libclosedcaption 1.0.3
ISDB-Tb/SBTVD (Brazilian DTV) closed caption extraction from MPEG-TS
Loading...
Searching...
No Matches
caption-closed.h File Reference

Interpreting the caption (closed caption) text and its state: colors, character size, position and display format. More...

#include "caption-common.h"
#include "caption-data.h"
#include "caption-management.h"
Include dependency graph for caption-closed.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  CC_Dimension_t
 
struct  CC_Color_t
 
struct  CaptionClosed_t
 
struct  CaptionClosed_t::APS
 

Macros

#define CC_Dimension_is_equal(dimen1, dimen2)    ((dimen1).width == (dimen2).width && (dimen1).height == (dimen2).height)
 
#define CC_Color_is_equal(color1, color2)
 

Enumerations

enum  CC_CharacterSize_t {
  CC_CharacterSize_Small = 0x01 , CC_CharacterSize_Middle = 0x02 , CC_CharacterSize_Standard = 0x03 , CC_CharacterSize_t_eMax = 0x04 ,
  CC_CharacterSize_Custom = 0x05 , CC_CharacterSize_UNKNOWN = 0xff
}
 
enum  CC_Format_t {
  CC_Format_HOR_STAN_DENSITY = 0x00 , CC_Format_VER_STAN_DENSITY = 0x01 , CC_Format_HOR_HIGH_DENSITY = 0x02 , CC_Format_VER_HIGH_DENSITY = 0x03 ,
  CC_Format_HOR_WEST_LANG = 0x04 , CC_Format_HOR_1920x1080 = 0x05 , CC_Format_VER_1920x1080 = 0x06 , CC_Format_HOR_960x540 = 0x07 ,
  CC_Format_VER_960x540 = 0x08 , CC_Format_HOR_720x480 = 0x09 , CC_Format_VER_720x480 = 0x0a , CC_Format_HOR_1280x720 = 0x0b ,
  CC_Format_VER_1280x720 = 0x0c , CC_Format_t_eMax = 0x0d
}
 
enum  CC_Rcs_t {
  CC_Rcs_BLACK = 0 , CC_Rcs_FULL_INTENSITY_RED = 1 , CC_Rcs_FULL_INTENSITY_GREEN = 2 , CC_Rcs_FULL_INTENSITY_YELLOW = 3 ,
  CC_Rcs_FULL_INTENSITY_BLUE = 4 , CC_Rcs_FULL_INTENSITY_MAGNETA = 5 , CC_Rcs_FULL_INTENSITY_CYAN = 6 , CC_Rcs_FULL_INTENSITY_WHITE = 7 ,
  CC_Rcs_TRANSPARENT = 8 , Cc_Rcs_HALF_INTENSITY_RED = 9 , Cc_Rcs_HALF_INTENSITY_GREEN = 10 , Cc_Rcs_HALF_INTENSITY_YELLOW = 11 ,
  Cc_Rcs_HALF_INTENSITY_BLUE = 12 , Cc_Rcs_HALF_INTENSITY_MAGNETA = 13 , Cc_Rcs_HALF_INTENSITY_CYAN = 14 , Cc_Rcs_HALF_INTENSITY_WHITE = 15 ,
  CC_Rcs_t_eMax = 16
}
 

Functions

bool caption_closed_run (const CaptionManagement_t *m, CaptionClosed_t *cc)
 
uint8_t char_latin9_to_utf8 (const char *const from, char *const to, uint8_t to_len)
 

Detailed Description

Interpreting the caption (closed caption) text and its state: colors, character size, position and display format.

Author
Jorge Pereira jpere.nosp@m.iran.nosp@m.@gmai.nosp@m.l.co.nosp@m.m
Date
Thu Aug 12 13:49:21 BRT 2010

caption_closed_run() walks the statement body (text + control commands) and:

Definition in file caption-closed.h.

Macro Definition Documentation

◆ CC_Dimension_is_equal

#define CC_Dimension_is_equal (   dimen1,
  dimen2 
)     ((dimen1).width == (dimen2).width && (dimen1).height == (dimen2).height)

Compares two CC_Dimension_t.

Definition at line 65 of file caption-closed.h.

◆ CC_Color_is_equal

#define CC_Color_is_equal (   color1,
  color2 
)
Value:
((color1).r == (color2).r && (color1).g == (color2).g && \
(color1).b == (color2).b && (color1).a == (color2).a)

Compares two CC_Color_t.

Definition at line 79 of file caption-closed.h.

Enumeration Type Documentation

◆ CC_CharacterSize_t

Character size (SSZ, MSZ, NSZ and SZX commands).

Enumerator
CC_CharacterSize_Small 

Small (SSZ).

CC_CharacterSize_Middle 

Medium (MSZ).

CC_CharacterSize_Standard 

Normal (NSZ).

CC_CharacterSize_t_eMax 

Limit of the values above.

CC_CharacterSize_Custom 

Size given by SZX; the value is in CaptionClosed_t::char_size_custom.

CC_CharacterSize_UNKNOWN 

Unknown.

Definition at line 26 of file caption-closed.h.

◆ CC_Format_t

Display format (ARIB STD-B24, Table 9-7; CSI SWF command).

Enumerator
CC_Format_HOR_STAN_DENSITY 

Horizontal, standard density.

CC_Format_VER_STAN_DENSITY 

Vertical, standard density.

CC_Format_HOR_HIGH_DENSITY 

Horizontal, high density.

CC_Format_VER_HIGH_DENSITY 

Vertical, high density.

CC_Format_HOR_WEST_LANG 

Horizontal, western languages.

CC_Format_HOR_1920x1080 

Horizontal, 1920x1080.

CC_Format_VER_1920x1080 

Vertical, 1920x1080.

CC_Format_HOR_960x540 

Horizontal, 960x540.

CC_Format_VER_960x540 

Vertical, 960x540.

CC_Format_HOR_720x480 

Horizontal, 720x480.

CC_Format_VER_720x480 

Vertical, 720x480.

CC_Format_HOR_1280x720 

Horizontal, 1280x720.

CC_Format_VER_1280x720 

Vertical, 1280x720.

CC_Format_t_eMax 

Number of formats.

Definition at line 39 of file caption-closed.h.

◆ CC_Rcs_t

enum CC_Rcs_t

Raster color (CSI RCS command, Raster Colour Command).

Enumerator
CC_Rcs_BLACK 

Black.

CC_Rcs_FULL_INTENSITY_RED 

Red.

CC_Rcs_FULL_INTENSITY_GREEN 

Green.

CC_Rcs_FULL_INTENSITY_YELLOW 

Yellow.

CC_Rcs_FULL_INTENSITY_BLUE 

Blue.

CC_Rcs_FULL_INTENSITY_MAGNETA 

Magenta.

CC_Rcs_FULL_INTENSITY_CYAN 

Cyan.

CC_Rcs_FULL_INTENSITY_WHITE 

White.

CC_Rcs_TRANSPARENT 

Transparent.

Cc_Rcs_HALF_INTENSITY_RED 

Red, half intensity.

Cc_Rcs_HALF_INTENSITY_GREEN 

Green, half intensity.

Cc_Rcs_HALF_INTENSITY_YELLOW 

Yellow, half intensity.

Cc_Rcs_HALF_INTENSITY_BLUE 

Blue, half intensity.

Cc_Rcs_HALF_INTENSITY_MAGNETA 

Magenta, half intensity.

Cc_Rcs_HALF_INTENSITY_CYAN 

Cyan, half intensity.

Cc_Rcs_HALF_INTENSITY_WHITE 

White, half intensity.

CC_Rcs_t_eMax 

Number of colors.

Definition at line 86 of file caption-closed.h.

Function Documentation

◆ caption_closed_run()

bool caption_closed_run ( const CaptionManagement_t *  m,
CaptionClosed_t *  cc 
)

Processes the caption text.

Walks the statement body of m, handing each character (in UTF-8) to the text hook and running each control command (which updates cc and calls the controls hook). See caption-hooking.h.

Characters outside ISO-8859-15 and commands not supported in closed caption are ignored, along with their parameters.

Parameters
mContent of type CAPTION_HANDLER_TYPE_STATEMENT_BODY, read by caption_management_load().
ccCaption state, kept between calls.
Returns
TRUE.

◆ char_latin9_to_utf8()

uint8_t char_latin9_to_utf8 ( const char *const  from,
char *const  to,
uint8_t  to_len 
)

Converts an ISO-8859-15 (Latin-9) character to UTF-8.

Parameters
fromSource character (1 byte).
toReceives the UTF-8 character, '\0' terminated.
to_lenSize of to; must be 4 or more.
Returns
Number of bytes written in to, without the '\0' (1 to 3).