Mercurial > libavcodec.hg
comparison ansi.c @ 12283:a08f20066719 libavcodec
Fix doxy that refers to the wrong variable.
author | michael |
---|---|
date | Tue, 27 Jul 2010 15:54:26 +0000 |
parents | fb2f04f70afe |
children | 601fbb943758 |
comparison
equal
deleted
inserted
replaced
12282:f31ba4ca1397 | 12283:a08f20066719 |
---|---|
26 | 26 |
27 #include "avcodec.h" | 27 #include "avcodec.h" |
28 #include "cga_data.h" | 28 #include "cga_data.h" |
29 #include <libavutil/lfg.h> | 29 #include <libavutil/lfg.h> |
30 | 30 |
31 #define ATTR_BOLD 0x01 /** Bold/Bright-foreground (mode 1) */ | 31 #define ATTR_BOLD 0x01 /**< Bold/Bright-foreground (mode 1) */ |
32 #define ATTR_FAINT 0x02 /** Faint (mode 2) */ | 32 #define ATTR_FAINT 0x02 /**< Faint (mode 2) */ |
33 #define ATTR_UNDERLINE 0x08 /** Underline (mode 4) */ | 33 #define ATTR_UNDERLINE 0x08 /**< Underline (mode 4) */ |
34 #define ATTR_BLINK 0x10 /** Blink/Bright-background (mode 5) */ | 34 #define ATTR_BLINK 0x10 /**< Blink/Bright-background (mode 5) */ |
35 #define ATTR_REVERSE 0x40 /** Reverse (mode 7) */ | 35 #define ATTR_REVERSE 0x40 /**< Reverse (mode 7) */ |
36 #define ATTR_CONCEALED 0x80 /** Concealed (mode 8) */ | 36 #define ATTR_CONCEALED 0x80 /**< Concealed (mode 8) */ |
37 | 37 |
38 #define DEFAULT_FG_COLOR 7 /** CGA color index */ | 38 #define DEFAULT_FG_COLOR 7 /**< CGA color index */ |
39 #define DEFAULT_BG_COLOR 0 | 39 #define DEFAULT_BG_COLOR 0 |
40 #define DEFAULT_SCREEN_MODE 3 /** 80x25 */ | 40 #define DEFAULT_SCREEN_MODE 3 /**< 80x25 */ |
41 | 41 |
42 #define FONT_WIDTH 8 /** Font width */ | 42 #define FONT_WIDTH 8 /**< Font width */ |
43 | 43 |
44 /** map ansi color index to cga palette index */ | 44 /** map ansi color index to cga palette index */ |
45 static const uint8_t ansi_to_cga[16] = { | 45 static const uint8_t ansi_to_cga[16] = { |
46 0, 4, 2, 6, 1, 5, 3, 7, 8, 12, 10, 14, 9, 13, 11, 15 | 46 0, 4, 2, 6, 1, 5, 3, 7, 8, 12, 10, 14, 9, 13, 11, 15 |
47 }; | 47 }; |
48 | 48 |
49 typedef struct { | 49 typedef struct { |
50 AVFrame frame; | 50 AVFrame frame; |
51 int x, y; /** cursor position (pixels) */ | 51 int x; /**< x cursor position (pixels) */ |
52 int sx, sy; /** saved cursor position (pixels) */ | 52 int y; /**< y cursor position (pixels) */ |
53 const uint8_t* font; /** font */ | 53 int sx; /**< saved x cursor position (pixels) */ |
54 int font_height; /** font height */ | 54 int sy; /**< saved y cursor position (pixels) */ |
55 int attributes; /** attribute flags */ | 55 const uint8_t* font; /**< font */ |
56 int fg, bg; /** foreground and background color */ | 56 int font_height; /**< font height */ |
57 int attributes; /**< attribute flags */ | |
58 int fg; /**< foreground color */ | |
59 int bg; /**< background color */ | |
57 | 60 |
58 /* ansi parser state machine */ | 61 /* ansi parser state machine */ |
59 enum { | 62 enum { |
60 STATE_NORMAL = 0, | 63 STATE_NORMAL = 0, |
61 STATE_ESCAPE, | 64 STATE_ESCAPE, |
62 STATE_CODE, | 65 STATE_CODE, |
63 STATE_MUSIC_PREAMBLE | 66 STATE_MUSIC_PREAMBLE |
64 } state; | 67 } state; |
65 #define MAX_NB_ARGS 4 | 68 #define MAX_NB_ARGS 4 |
66 int args[MAX_NB_ARGS]; | 69 int args[MAX_NB_ARGS]; |
67 int nb_args; /** number of arguments (may exceed MAX_NB_ARGS) */ | 70 int nb_args; /**< number of arguments (may exceed MAX_NB_ARGS) */ |
68 } AnsiContext; | 71 } AnsiContext; |
69 | 72 |
70 static av_cold int decode_init(AVCodecContext *avctx) | 73 static av_cold int decode_init(AVCodecContext *avctx) |
71 { | 74 { |
72 AnsiContext *s = avctx->priv_data; | 75 AnsiContext *s = avctx->priv_data; |