author | ke.gong <ke.gong@amlogic.com> | 2012-08-10 03:22:00 (GMT) |
---|---|---|
committer | ke.gong <ke.gong@amlogic.com> | 2012-08-10 03:22:00 (GMT) |
commit | 7b7d97b6d4d82c141b1a1942e1aed193d07bf258 (patch) | |
tree | 0c632fd881a2477e89e7c63d9bd916e76e86090a | |
parent | cd562751bc6f2b5dbb2a869d72e9334d2f3d7b44 (diff) | |
download | libzvbi-7b7d97b6d4d82c141b1a1942e1aed193d07bf258.zip libzvbi-7b7d97b6d4d82c141b1a1942e1aed193d07bf258.tar.gz libzvbi-7b7d97b6d4d82c141b1a1942e1aed193d07bf258.tar.bz2 |
add subtitle parameter in vt_draw function
-rw-r--r-- | src/exp-gfx.c | 18 | ||||
-rw-r--r-- | src/exp-gfx.h | 7 | ||||
-rw-r--r-- | src/libzvbi.h | 6 |
3 files changed, 23 insertions, 8 deletions
diff --git a/src/exp-gfx.c b/src/exp-gfx.c index 87eebee..b91278c 100644 --- a/src/exp-gfx.c +++ b/src/exp-gfx.c @@ -592,6 +592,7 @@ vbi_draw_cc_page_region(vbi_page *pg, * space (U+0020). * @param flash_on If FALSE, draw characters flagged 'blink' (see vbi_char) as * space (U+0020). + * @param subtitle If TRUE, draw subtitle mode teletext. * * Draw a subsection of a Teletext vbi_page. In this mode one * character occupies 12 x 10 pixels. Note this function does @@ -601,7 +602,7 @@ void vbi_draw_vt_page_region(vbi_page *pg, vbi_pixfmt fmt, void *canvas, int rowstride, int column, int row, int width, int height, - int reveal, int flash_on) + int reveal, int flash_on, int subtitle) { union { vbi_rgba rgba[64]; @@ -657,12 +658,25 @@ vbi_draw_vt_page_region(vbi_page *pg, else unicode = ac->unicode; + if (subtitle && (row == 0)) + unicode = 0x0020; + if (canvas_type == 1) { pen.pal8[0] = ac->background; pen.pal8[1] = ac->foreground; } else { pen.rgba[0] = pg->color_map[ac->background]; pen.rgba[1] = pg->color_map[ac->foreground]; + + if(subtitle){ + if(vbi_is_drcs(unicode) || unicode==0x0020) { + pen.rgba[0] &= 0x00FFFFFF; + pen.rgba[1] &= 0x00FFFFFF; + }else{ + pen.rgba[0] &= 0x00FFFFFF; + //pen.rgba[0] |= 0x80000000; + } + } } switch (ac->size) { @@ -1032,7 +1046,7 @@ ppm_export (vbi_export * e, /* column */ 0, row, pg->columns, /* rows */ 1, /* reveal */ !e->reveal, - /* flash_on */ TRUE); + /* flash_on */ TRUE, FALSE); } d = (uint8_t *) e->buffer.data + e->buffer.offset; diff --git a/src/exp-gfx.h b/src/exp-gfx.h index 2da32fb..3f3b4a2 100644 --- a/src/exp-gfx.h +++ b/src/exp-gfx.h @@ -37,7 +37,7 @@ extern void vbi_draw_vt_page_region(vbi_page *pg, vbi_pixfmt fmt, void *canvas, int rowstride, int column, int row, int width, int height, - int reveal, int flash_on); + int reveal, int flash_on, int subtitle); /** * @param pg Source page. * @param fmt Target format. For now only VBI_PIXFMT_RGBA32_LE (vbi_rgba) permitted. @@ -48,15 +48,16 @@ extern void vbi_draw_vt_page_region(vbi_page *pg, vbi_pixfmt fmt, * space (U+0020). * @param flash_on If FALSE, draw characters flagged 'blink' (see vbi_char) as * space (U+0020). + * @param subtitle If TRUE, draw subtitle mode teletext. * * Draw a Teletext vbi_page. In this mode one character occupies 12 x 10 pixels. */ _vbi_inline void vbi_draw_vt_page(vbi_page *pg, vbi_pixfmt fmt, void *canvas, - int reveal, int flash_on) + int reveal, int flash_on, int subtitle) { vbi_draw_vt_page_region(pg, fmt, canvas, -1, 0, 0, - pg->columns, pg->rows, reveal, flash_on); + pg->columns, pg->rows, reveal, flash_on, subtitle); } extern void vbi_draw_cc_page_region(vbi_page *pg, vbi_pixfmt fmt, diff --git a/src/libzvbi.h b/src/libzvbi.h index 042d657..fa422db 100644 --- a/src/libzvbi.h +++ b/src/libzvbi.h @@ -1669,13 +1669,13 @@ extern void vbi_draw_vt_page_region(vbi_page *pg, vbi_pixfmt fmt, void *canvas, int rowstride, int column, int row, int width, int height, - int reveal, int flash_on); + int reveal, int flash_on, int subtitle); _vbi_inline void vbi_draw_vt_page(vbi_page *pg, vbi_pixfmt fmt, void *canvas, - int reveal, int flash_on) + int reveal, int flash_on, int subtitle) { vbi_draw_vt_page_region(pg, fmt, canvas, -1, 0, 0, - pg->columns, pg->rows, reveal, flash_on); + pg->columns, pg->rows, reveal, flash_on, subtitle); } extern void vbi_draw_cc_page_region(vbi_page *pg, vbi_pixfmt fmt, |