ZVBI Library  0.2.33
Functions
Teletext and Closed Caption page render functions
Exporting formatted Teletext and Closed Caption pages

Functions

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)
_vbi_inline void vbi_draw_vt_page (vbi_page *pg, vbi_pixfmt fmt, void *canvas, int reveal, int flash_on)
void vbi_draw_cc_page_region (vbi_page *pg, vbi_pixfmt fmt, void *canvas, int rowstride, int column, int row, int width, int height)
_vbi_inline void vbi_draw_cc_page (vbi_page *pg, vbi_pixfmt fmt, void *canvas)
void vbi_get_max_rendered_size (int *w, int *h)
void vbi_get_vt_cell_size (int *w, int *h)
int vbi_print_page_region (vbi_page *pg, char *buf, int size, const char *format, vbi_bool table, vbi_bool ltr, int column, int row, int width, int height)
_vbi_inline int vbi_print_page (vbi_page *pg, char *buf, int size, const char *format, vbi_bool table, vbi_bool ltr)
void vbi_set_brightness (vbi_decoder *vbi, int brightness)
void vbi_set_contrast (vbi_decoder *vbi, int contrast)

Detailed Description

These are functions to render Teletext and Closed Caption pages directly into memory, essentially a more direct interface to the functions of some important export modules.


Function Documentation

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 
)
Parameters:
pgSource page.
fmtTarget format. For now only VBI_PIXFMT_RGBA32_LE (vbi_rgba) and VBI_PIXFMT_PAL8 (1-byte palette indices) are permitted.
canvasPointer to destination image (depending on the format, either an array of vbi_rgba or uint8_t), this must be at least rowstride * height * 10 bytes large.
rowstridecanvas byte distance from line to line. If this is -1, pg->columns * 12 * sizeof(vbi_rgba) bytes will be assumed.
columnFirst source column, 0 ... pg->columns - 1.
rowFirst source row, 0 ... pg->rows - 1.
widthNumber of columns to draw, 1 ... pg->columns.
heightNumber of rows to draw, 1 ... pg->rows.
revealIf FALSE, draw characters flagged 'concealed' (see vbi_char) as space (U+0020).
flash_onIf FALSE, draw characters flagged 'blink' (see vbi_char) as space (U+0020).

Draw a subsection of a Teletext vbi_page. In this mode one character occupies 12 x 10 pixels. Note this function does not consider transparency (e.g. on boxed pages)

_vbi_inline void vbi_draw_vt_page ( vbi_page pg,
vbi_pixfmt  fmt,
void *  canvas,
int  reveal,
int  flash_on 
)
Parameters:
pgSource page.
fmtTarget format. For now only VBI_PIXFMT_RGBA32_LE (vbi_rgba) permitted.
canvasPointer to destination image (currently an array of vbi_rgba). This must be at least pg->columns * pg->rows * 12 * 10 * pixels large, without padding between lines.
revealIf FALSE, draw characters flagged 'concealed' (see vbi_char) as space (U+0020).
flash_onIf FALSE, draw characters flagged 'blink' (see vbi_char) as space (U+0020).

Draw a Teletext vbi_page. In this mode one character occupies 12 x 10 pixels.

void vbi_draw_cc_page_region ( vbi_page pg,
vbi_pixfmt  fmt,
void *  canvas,
int  rowstride,
int  column,
int  row,
int  width,
int  height 
)
Parameters:
pgSource vbi_page, see vbi_fetch_cc_page().
fmtTarget format. For now only VBI_PIXFMT_RGBA32_LE (vbi_rgba) permitted.
canvasPointer to destination image (currently an array of vbi_rgba), this must be at least rowstride * height * 26 bytes large.
rowstridecanvas byte distance from line to line. If this is -1, pg->columns * 16 * sizeof(vbi_rgba) bytes will be assumed.
columnFirst source column, 0 ... pg->columns - 1.
rowFirst source row, 0 ... pg->rows - 1.
widthNumber of columns to draw, 1 ... pg->columns.
heightNumber of rows to draw, 1 ... pg->rows.

Draw a subsection of a Closed Caption vbi_page. In this mode one character occupies 16 x 26 pixels.

_vbi_inline void vbi_draw_cc_page ( vbi_page pg,
vbi_pixfmt  fmt,
void *  canvas 
)
Parameters:
pgSource page.
fmtTarget format. For now only VBI_PIXFMT_RGBA32_LE (vbi_rgba) permitted.
canvasPointer to destination image (currently an array of vbi_rgba). This must be at least pg->columns * pg->rows * 16 * 26 * pixels large, without padding between lines.

Draw a Closed Caption vbi_page. In this mode one character occupies 16 x 26 pixels.

void vbi_get_max_rendered_size ( int *  w,
int *  h 
)
Parameters:
w
h
Deprecated:
Character cells are 12 x 10 for Teletext and 16 x 26 for Caption. Page size is in vbi_page.
void vbi_get_vt_cell_size ( int *  w,
int *  h 
)
Parameters:
w
h
Deprecated:
Character cells are 12 x 10 for Teletext and 16 x 26 for Caption.
int vbi_print_page_region ( vbi_page pg,
char *  buf,
int  size,
const char *  format,
vbi_bool  table,
vbi_bool  rtl,
int  column,
int  row,
int  width,
int  height 
)
Parameters:
pgSource page.
bufMemory location to hold the output.
sizeSize of the buffer in bytes. The function fails when the data exceeds the buffer capacity.
formatCharacter set name for iconv() conversion, for example "ISO-8859-1".
tableScan page in table mode, printing all characters within the source rectangle including runs of spaces at the start and end of rows. When FALSE, scan all characters from column, row to column + width - 1, row + height - 1 and all intermediate rows to their full pg->columns width. In this mode runs of spaces at the start and end of rows are collapsed into single spaces, blank lines are suppressed.
rtlCurrently ignored.
columnFirst source column, 0 ... pg->columns - 1.
rowFirst source row, 0 ... pg->rows - 1.
widthNumber of columns to print, 1 ... pg->columns.
heightNumber of rows to print, 1 ... pg->rows.

Print a subsection of a Teletext or Closed Caption vbi_page, rows separated by linefeeds "\n", in the desired format. All character attributes and colors will be lost. Graphics characters, DRCS and all characters not representable in the target format will be replaced by spaces.

Returns:
Number of bytes written into buf, a value of zero when some error occurred. In this case buf may contain incomplete data. Note this function does not append a terminating null character.
_vbi_inline int vbi_print_page ( vbi_page pg,
char *  buf,
int  size,
const char *  format,
vbi_bool  table,
vbi_bool  ltr 
)
Parameters:
pgSource page.
bufMemory location to hold the output.
sizeSize of the buffer in bytes. The function fails when the data exceeds the buffer capacity.
formatCharacter set name for iconv() conversion, for example "ISO-8859-1".
tableWhen FALSE, runs of spaces at the start and end of rows will be collapsed into single spaces, blank lines are suppressed.
ltrCurrently ignored, please set to TRUE.

Print a Teletext or Closed Caption vbi_page, rows separated by linefeeds "\n", in the desired format. All character attributes and colors will be lost. Graphics characters, DRCS and all characters not representable in the target format will be replaced by spaces.

Returns:
Number of bytes written into buf, a value of zero when some error occurred. In this case buf may contain incomplete data. Note this function does not append a terminating null character.
void vbi_set_brightness ( vbi_decoder vbi,
int  brightness 
)
Parameters:
vbiInitialized vbi decoding context.
brightness0 dark ... 255 bright, default 128.

Change brightness of text pages, this affects the color palette of pages fetched with vbi_fetch_vt_page() and vbi_fetch_cc_page().

void vbi_set_contrast ( vbi_decoder vbi,
int  contrast 
)
Parameters:
vbiInitialized vbi decoding context.
contrast-128 inverse ... 0 none ... 127 maximum, default 64.

Change contrast of text pages, this affects the color palette of pages fetched with vbi_fetch_vt_page() and vbi_fetch_cc_page().