Formatted text page
High Level Decoding

## Data Structures

struct | vbi_char
| Attributed character. More...
struct | vbi_page
| Formatted Teletext or Closed Caption page. More...

## Typedefs

typedef uint32_t | vbi_rgba
| Colormap entry: 0xAABBGGRR. libzvbi sets the alpha channel always to 0xFF.
typedef struct vbi_char | vbi_char
| Attributed character.
typedef struct vbi_page | vbi_page
| Formatted Teletext or Closed Caption page.
typedef struct vbi_font_descr | vbi_font_descr
| Opaque font descriptor.

## Enumerations

enum | vbi_color { VBI_BLACK , VBI_RED , VBI_GREEN , VBI_YELLOW , VBI_BLUE , VBI_MAGENTA , VBI_CYAN , VBI_WHITE }
| Index into the vbi_page->color_map. More...
enum | vbi_opacity { VBI_TRANSPARENT_SPACE , VBI_TRANSPARENT_FULL , VBI_SEMI_TRANSPARENT , VBI_OPAQUE }
| Defines the opacity of a vbi_char and vbi_page border. More...
enum | vbi_size { VBI_NORMAL_SIZE , VBI_DOUBLE_WIDTH , VBI_DOUBLE_HEIGHT , VBI_DOUBLE_SIZE , VBI_OVER_TOP , VBI_OVER_BOTTOM , VBI_DOUBLE_HEIGHT2 , VBI_DOUBLE_SIZE2 }
| Defines the size of a vbi_char in a vbi_page. More...

## Functions

_vbi_inline vbi_bool | vbi_is_print (unsigned int unicode)
_vbi_inline vbi_bool | vbi_is_gfx (unsigned int unicode)
_vbi_inline vbi_bool | vbi_is_drcs (unsigned int unicode)

## Detailed Description

## Typedef Documentation

## vbi_page

typedef struct vbi_page vbi_page

Formatted Teletext or Closed Caption page.

Clients can fetch pages from the respective cache using vbi_fetch_vt_page() or vbi_fetch_cc_page() for evaluation, display or output. Since the page may reference other objects in cache which are locked by the fetch functions, vbi_unref_page() must be called when done. Note this structure is large, some 10 KB.

## Enumeration Type Documentation

## vbi_color

enum vbi_color

Index into the vbi_page->color_map.

The enumerated color names refer to the Teletext and Closed Caption base palette of eight colors. Note however the color_map really has 40 entries for Teletext Level 2.5+, 32 of which are redefinable, the remaining eight are private colors of libzvbi e. g. for navigational information. So these symbols may not necessarily correspond to the respective color.

## vbi_opacity

enum vbi_opacity

Defines the opacity of a vbi_char and vbi_page border.

Teletext Level 2.5 defines a special transparent color which permits unusual characters with transparent foreground, opaque background. For simplicity this type of opacity has been omitted. Also renderers shall rely on the opacity attribute and not attempt to interpret the color value as transparency indicator.

Enumerator

VBI_TRANSPARENT_SPACE

This page is supposed to be overlayed onto video, with video displayed in place of this character (or the page border). In other words the character is a space (vbi_char->unicode = U+0020) and the glyph background is transparent. If desired the renderer may also fall back to VBI_SEMI_TRANSPARENT or VBI_OPAQUE mode. For this case vbi_char->background names the color to use as the semi-transparent or opaque background.

VBI_TRANSPARENT_SPACE is the opacity of subtitle pages (both border and characters, while the 'boxed' words are marked as VBI_SEMI_TRANSPARENT), but can also occur on a mainly VBI_OPAQUE page to create a 'window' effect.

VBI_TRANSPARENT_FULL | Display video instead of the background color. Here the character is not a space and shall be displayed in vbi_char->foreground color. Only in the background of the character video shall look through. Again the renderer may fall back to VBI_SEMI_TRANSPARENT or VBI_OPAQUE.
VBI_SEMI_TRANSPARENT | Alpha blend video into background color, the character background becomes translucent. This is the opacity used for 'boxed' text on an otherwise VBI_TRANSPARENT_SPACE page, typically a subtitle or Teletext newsflash page. The renderer may fall back to VBI_OPAQUE.
VBI_OPAQUE | Display foreground and background color. Showing foreground or background transparent instead is not recommended because the editor may have swapped foreground and background color, then replaced a glyph by its inverse image, so one cannot really know if the character foreground or background will appear transparent.

## vbi_size

enum vbi_size

Defines the size of a vbi_char in a vbi_page.

Double width or height characters expand into the next column right and/or next row below.

Scanning two rows left to right, you will find

    VBI_NORMAL_SIZE | VBI_DOUBLE_WIDTH VBI_OVER_TOP | VBI_DOUBLE_HEIGHT  | VBI_DOUBLE_SIZE  VBI_OVER_TOP
          x         |         x             x       | VBI_DOUBLE_HEIGHT2 | VBI_DOUBLE_SIZE2 VBI_OVER_BOTTOM

A VBI_DOUBLE_HEIGHT2, VBI_DOUBLE_SIZE2, VBI_OVER_TOP, VBI_OVER_BOTTOM vbi_char has the same character unicode and attributes as the top/left anchor. Partial characters (like a single VBI_DOUBLE_HEIGHT2) will not appear, so VBI_DOUBLE_HEIGHT2, VBI_DOUBLE_SIZE2, VBI_OVER_TOP, VBI_OVER_BOTTOM can be safely ignored when scanning the page.

## Function Documentation

## vbi_is_print()

_vbi_inline vbi_bool vbi_is_print | ( | unsigned int | unicode | ) |

Parameters

  unicode | Unicode as in vbi_char.

Returns
  `TRUE` if unicode represents a Teletext or Closed Caption printable character. This excludes Teletext Arabic characters (which are represented by private codes U+E600 ... U+E7FF until the conversion table is ready), the Teletext Turkish currency sign U+E800 which is not representable in Unicode, the Teletext G1 Block Mosaic and G3 Smooth Mosaics and Line Drawing Set, with codes U+EE00 ... U+EFFF, and Teletext DRCS coded U+F000 ... U+F7FF.

Referenced by vbi_print_page_region().

## vbi_is_gfx()

_vbi_inline vbi_bool vbi_is_gfx | ( | unsigned int | unicode | ) |

Parameters

  unicode | Unicode as in vbi_char.

Returns
  `TRUE` if unicode represents a Teletext G1 Block Mosaic or G3 Smooth Mosaics and Line Drawing Set, that is a code in range U+EE00 ... U+EFFF.

## vbi_is_drcs()

_vbi_inline vbi_bool vbi_is_drcs | ( | unsigned int | unicode | ) |

Parameters

  unicode | Unicode as in vbi_char.

Returns
  `TRUE` if unicode represents a Teletext DRCS (Dynamically Redefinable Character), that is a code in range U+F000 ... U+F7FF.

Referenced by vbi_draw_vt_page_region().