Mercurial > libavcodec.hg
comparison cga_data.c @ 12183:4fccdee316ea libavcodec
Add ff_draw_pc_font()
| author | pross |
|---|---|
| date | Sun, 18 Jul 2010 07:44:38 +0000 |
| parents | a5c136008851 |
| children | a5ebc95870a2 |
comparison
equal
deleted
inserted
replaced
| 12182:a5c136008851 | 12183:4fccdee316ea |
|---|---|
| 17 * License along with FFmpeg; if not, write to the Free Software | 17 * License along with FFmpeg; if not, write to the Free Software |
| 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 19 */ | 19 */ |
| 20 | 20 |
| 21 #include <stdint.h> | 21 #include <stdint.h> |
| 22 #include "cga_data.h" | |
| 22 | 23 |
| 23 const uint8_t ff_cga_font[2048] = { | 24 const uint8_t ff_cga_font[2048] = { |
| 24 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x81, 0xa5, 0x81, 0xbd, 0x99, 0x81, 0x7e, | 25 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x81, 0xa5, 0x81, 0xbd, 0x99, 0x81, 0x7e, |
| 25 0x7e, 0xff, 0xdb, 0xff, 0xc3, 0xe7, 0xff, 0x7e, 0x6c, 0xfe, 0xfe, 0xfe, 0x7c, 0x38, 0x10, 0x00, | 26 0x7e, 0xff, 0xdb, 0xff, 0xc3, 0xe7, 0xff, 0x7e, 0x6c, 0xfe, 0xfe, 0xfe, 0x7c, 0x38, 0x10, 0x00, |
| 26 0x10, 0x38, 0x7c, 0xfe, 0x7c, 0x38, 0x10, 0x00, 0x38, 0x7c, 0x38, 0xfe, 0xfe, 0x7c, 0x38, 0x7c, | 27 0x10, 0x38, 0x7c, 0xfe, 0x7c, 0x38, 0x10, 0x00, 0x38, 0x7c, 0x38, 0xfe, 0xfe, 0x7c, 0x38, 0x7c, |
| 423 0x550000, 0x5500AA, 0x55AA00, 0x55AAAA, 0xFF0000, 0xFF00AA, 0xFFAA00, 0xFFAAAA, | 424 0x550000, 0x5500AA, 0x55AA00, 0x55AAAA, 0xFF0000, 0xFF00AA, 0xFFAA00, 0xFFAAAA, |
| 424 0x550055, 0x5500FF, 0x55AA55, 0x55AAFF, 0xFF0055, 0xFF00FF, 0xFFAA55, 0xFFAAFF, | 425 0x550055, 0x5500FF, 0x55AA55, 0x55AAFF, 0xFF0055, 0xFF00FF, 0xFFAA55, 0xFFAAFF, |
| 425 0x555500, 0x5555AA, 0x55FF00, 0x55FFAA, 0xFF5500, 0xFF55AA, 0xFFFF00, 0xFFFFAA, | 426 0x555500, 0x5555AA, 0x55FF00, 0x55FFAA, 0xFF5500, 0xFF55AA, 0xFFFF00, 0xFFFFAA, |
| 426 0x555555, 0x5555FF, 0x55FF55, 0x55FFFF, 0xFF5555, 0xFF55FF, 0xFFFF55, 0xFFFFFF | 427 0x555555, 0x5555FF, 0x55FF55, 0x55FFFF, 0xFF5555, 0xFF55FF, 0xFFFF55, 0xFFFFFF |
| 427 }; | 428 }; |
| 429 | |
| 430 void ff_draw_pc_font(uint8_t *dst, int linesize, const uint8_t *font, int font_height, int ch, int fg, int bg) | |
| 431 { | |
| 432 int char_y, mask; | |
| 433 for (char_y = 0; char_y < font_height; char_y++) { | |
| 434 for (mask = 0x80; mask; mask >>= 1) { | |
| 435 *dst++ = font[ch * font_height + char_y] & mask ? fg : bg; | |
| 436 } | |
| 437 dst += linesize - 8; | |
| 438 } | |
| 439 } |
