-/*******************************************************************************
- * video_text.c : text manipulation functions
- * (c)1999 VideoLAN
- *******************************************************************************/
-
-/*******************************************************************************
- * Preamble
- *******************************************************************************/
-#include <errno.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "common.h"
-#include "config.h"
-#include "video_text.h"
-#include "intf_msg.h"
-
-/*******************************************************************************
- * vout_font_t: bitmap font
- *******************************************************************************
- * This structure is used when the system doesn't provide a convenient function
- * to print simple characters in a buffer.
- * VOUT_FIXED_FONTs are stored in raw mode, character after character, with a
- * first array of characters followed by a second array of borders masks.
- * Therefore the border masks can't be complete if the font has pixels on the
- * border.
- *******************************************************************************/
-typedef struct vout_font_s
-{
- int i_type; /* font type */
- int i_width; /* character width in pixels */
- int i_height; /* character height in pixels */
- int i_interspacing; /* characters interspacing in pixels */
- int i_bytes_per_line; /* bytes per character line */
- int i_bytes_per_char; /* bytes per character */
- u16 i_first; /* first character */
- u16 i_last; /* last character */
- byte_t * p_data; /* font character data */
-} vout_font_t;
-
-/* Font types */
-#define VOUT_FIXED_FONT 0 /* simple fixed font */
-
-/*******************************************************************************
- * vout_put_byte_t: PutByte function
- *******************************************************************************
- * These functions will transform masks in a set of pixels. For each pixel,
- * character, then border and background masks are tested, and the first
- * encountered color is set.
- *******************************************************************************/
-typedef void (vout_put_byte_t)( void *p_pic, int i_byte, int i_char, int i_border,
- int i_bg, u32 i_char_color, u32 i_border_color, u32 i_bg_color );
-
-
-/*******************************************************************************
- * Macros
- *******************************************************************************/
-
-/* PUT_BYTE_MASK: put pixels from a byte-wide mask. It uses a branching tree
- * to optimize the number of tests. It is used in the PutByte functions.
- * This macro works for 1, 2 and 4 Bpp. */
-#define PUT_BYTE_MASK( i_mask, i_mask_color ) \
-if( i_mask & 0xf0 ) /* one from 1111 */ \
-{ \
- if( i_mask & 0xc0 ) /* one from 1100 */ \
- { \
- if( i_mask & 0x80 ) /* 1000 */ \
- { \
- p_pic[0] = i_mask_color; \
- if( i_mask & 0x40 ) /* 0100 */ \
- { \
- p_pic[1] = i_mask_color; \
- } \
- } \
- else /* not 1000 means 0100 */ \
- { \
- p_pic[1] = i_mask_color; \
- } \
- if( i_mask & 0x30 ) /* one from 0011 */ \
- { \
- if( i_mask & 0x20 ) /* 0010 */ \
- { \
- p_pic[2] = i_mask_color; \
- if( i_mask & 0x10 ) /* 0001 */ \
- { \
- p_pic[3] = i_mask_color; \
- } \
- } \
- else /* not 0010 means 0001 */ \
- { \
- p_pic[3] = i_mask_color; \
- } \
- } \
- } \
- else /* not 1100 means 0011 */ \
- { \
- if( i_mask & 0x20 ) /* 0010 */ \
- { \
- p_pic[2] = i_mask_color; \
- if( i_mask & 0x10 ) /* 0001 */ \
- { \
- p_pic[3] = i_mask_color; \
- } \
- } \
- else /* not 0010 means 0001 */ \
- { \
- p_pic[3] = i_mask_color; \
- } \
- } \
-} \
-if( i_mask & 0x0f ) \
-{ \
- if( i_mask & 0x0c ) /* one from 1100 */ \
- { \
- if( i_mask & 0x08 ) /* 1000 */ \
- { \
- p_pic[4] = i_mask_color; \
- if( i_mask & 0x04 ) /* 0100 */ \
- { \
- p_pic[5] = i_mask_color; \
- } \
- } \
- else /* not 1000 means 0100 */ \
- { \
- p_pic[5] = i_mask_color; \
- } \
- if( i_mask & 0x03 ) /* one from 0011 */ \
- { \
- if( i_mask & 0x02 ) /* 0010 */ \
- { \
- p_pic[6] = i_mask_color; \
- if( i_mask & 0x01 ) /* 0001 */ \
- { \
- p_pic[7] = i_mask_color; \
- } \
- } \
- else /* not 0010 means 0001 */ \
- { \
- p_pic[7] = i_mask_color; \
- } \
- } \
- } \
- else /* not 1100 means 0011 */ \
- { \
- if( i_mask & 0x02 ) /* 0010 */ \
- { \
- p_pic[6] = i_mask_color; \
- if( i_mask & 0x01 ) /* 0001 */ \
- { \
- p_pic[7] = i_mask_color; \
- } \
- } \
- else /* not 0010 means 0001 */ \
- { \
- p_pic[7] = i_mask_color; \
- } \
- } \
-}
-