AJA NTV2 SDK
17.1.3.1410
NTV2 SDK 17.1.3.1410
|
This is the font used when rendering CEA-608 captions into a frame buffer. I define a "dot" map having a fixed width and height, plus a fixed set of glyphs, each with a particular dot pattern. Each glyph corresponds to an NTV2_CC608_CodePoint. More...
#include <ccfont.h>
Public Member Functions | |
virtual bool | HasGlyphFor608CodePoint (const NTV2_CC608_CodePoint in608CodePoint) const |
Returns true if there is a glyph available for the given CEA-608 code point. More... | |
virtual UWord * | GetGlyphFor608CodePoint (const NTV2_CC608_CodePoint in608CodePoint) const |
Returns a pointer to the "dot" bitmap of the glyph that represents the given CEA-608 code point. More... | |
virtual UWord | GetGlyphRowDots (const NTV2GlyphIndex inGlyphIndex, const unsigned inRow) const |
Returns the 16-bit "dot" bitmap of the row of the character glyph having the given offset. More... | |
virtual UByte | GetCCFontCharCode (const NTV2_CC608_CodePoint in608CodePoint) const |
Returns the "ASCII-like" character code that best represents the given CEA-608 code point. More... | |
virtual NTV2CodePointSet | GetCodePointsForCCFontCharCode (const UByte inCharCode) const |
Returns the set of codepoints that map to a given CCFont character code. More... | |
virtual bool | IsValidGlyphIndex (const NTV2GlyphIndex inGlyphIndex) const |
Returns true if the given glyph index is valid. More... | |
virtual UWord | GetGlyphCount (void) const |
Returns the number of glyphs available in this caption font. More... | |
virtual std::string | GetName (void) const |
Returns the name of this caption font. More... | |
virtual NTV2GlyphIndex | GetUnderlineGlyphIndex (void) const |
Returns the underline character's zero-based glyph index number. More... | |
virtual NTV2GlyphIndex | GetNoUnderlineSpaceGlyphIndex (void) const |
Returns the "no underline space" character's zero-based glyph index number. More... | |
virtual UByte | GetUnderlineCharacterCode (void) const |
Returns the character code of the special underline glyph. More... | |
virtual UByte | GetNoUnderlineSpaceCharacterCode (void) const |
Returns the character code of the special "underline space" glyph. More... | |
virtual UWord | GetUnderlineStartingDotRow (void) const |
Returns the starting row position of the underline, which is below the dot map. Also takes into account the top margin, if any. More... | |
virtual UWord | GetDotMapWidth (void) const |
Returns the width of the dot map, in dots. More... | |
virtual UWord | GetLeftMarginDotCount (void) const |
Returns the number of dots of space to appear to the left of each blitted glyph. More... | |
virtual UWord | GetRightMarginDotCount (void) const |
Returns the number of dots of space to appear to the right of each blitted glyph. More... | |
virtual UWord | GetTotalWidthInDots (void) const |
Returns the total width, in dots, a blitted glyph will consume, including any left and/or right margin space. More... | |
virtual UWord | GetDotMapRowCount (void) const |
Returns the height of the dot map, in dot rows. More... | |
virtual UWord | GetDotMapHeight (void) const |
Returns the height of the dot map, in dots. More... | |
virtual UWord | GetTopMarginDotCount (void) const |
Returns the number of dots of space to appear above each blitted glyph. More... | |
virtual UWord | GetBottomMarginDotCount (void) const |
Returns the number of dots of space to appear below each blitted glyph. More... | |
virtual UWord | GetTotalHeightInDots (void) const |
Returns the total height, in dots, a blitted glyph will consume, including any top and/or bottom margin space. More... | |
virtual std::string | GetGlyphRowDotsAsString (const NTV2GlyphIndex inGlyphIndex, const unsigned inRow) const |
Returns a UTF-8 encoded string that contains the dot pattern for the given zero-based row number and zero-based glyph index. Each opaque (black) dot is rendered as a "full block" character (u2588), whereas each transparent (white) dot is rendered as a simple space character. More... | |
virtual std::ostream & | PrintGlyphs (std::ostream &inOutStream, const NTV2GlyphIndex inFirstGlyph, const NTV2GlyphIndex inLastGlyph) const |
Renders all glyphs in the given range (inclusive) into the specified output stream as multiple rows of UTF-8 encoded strings. When displayed in a terminal using a monospaced font, it shows what the glyphs actually look like. Each black dot is rendered as a "full block" character (u2588), while white dots are rendered as spaces. More... | |
virtual bool | RenderGlyph8BitYCbCr (UByte *pDestBuffer, const ULWord inBytesPerRow, const NTV2GlyphIndex inGlyphIndex, const NTV2Line21Attrs &inAttribs, const ULWord inScaledDotWidth=1, const ULWord inScaledDotHeight=1) const |
Renders the given glyph with the given display attributes into the specified 8-bit YCbCr '2vuy' destination buffer. More... | |
virtual bool | RenderGlyph8BitRGB (const NTV2PixelFormat inPixelFormat, UByte *pDestBuffer, const ULWord inBytesPerRow, const NTV2GlyphIndex inGlyphIndex, const NTV2Line21Attrs &inAttribs, const ULWord inScaledDotWidth, const ULWord inScaledDotHeight, const bool inIsHD=false) const |
Renders the given glyph with the given display attributes into the specified 8-bit NTV2_FBF_ARGB destination buffer. More... | |
NTV2CCFont () | |
virtual | ~NTV2CCFont () |
Static Public Member Functions | |
static const NTV2CCFont & | GetInstance (void) |
Returns a constant reference to the NTV2CCFont singleton. More... | |
static UByte | GlyphIndexToCharacterCode (const NTV2GlyphIndex inGlyphIndex) |
Returns the character code that corresponds to the given glyph. More... | |
static NTV2GlyphIndex | CharacterCodeToGlyphIndex (const UByte inCharacterCode) |
Returns the zero-based glyph index number that corresponds to the given character code. More... | |
static UByte | UnicodeCodePointToCharacterCode (const ULWord inCodePoint) |
Returns the character code that corresponds to the given unicode codepoint. More... | |
static std::string | Utf8ToCCFontByteArray (const std::string &inUtf8Str) |
Converts the given UTF-8 encoded string into a string of CCFont character codes. More... | |
This is the font used when rendering CEA-608 captions into a frame buffer. I define a "dot" map having a fixed width and height, plus a fixed set of glyphs, each with a particular dot pattern. Each glyph corresponds to an NTV2_CC608_CodePoint.
|
explicit |
|
virtual |
|
static |
Returns the zero-based glyph index number that corresponds to the given character code.
[in] | inCharacterCode | Specifies the character code of interest. |
|
inlinevirtual |
|
virtual |
Returns the "ASCII-like" character code that best represents the given CEA-608 code point.
[in] | in608CodePoint | Specifies the CEA-608 code point for which a CCFont character code is being requested. |
|
virtual |
Returns the set of codepoints that map to a given CCFont character code.
[in] | inCharCode | Specifies the CCFont character code of interest. Valid values are from 0x20 and less than NTV2_CCFont_NumChars+0x20. |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
virtual |
Returns a pointer to the "dot" bitmap of the glyph that represents the given CEA-608 code point.
[in] | in608CodePoint | Specifies the CEA-608 code point for which a glyph is being requested. |
|
virtual |
Returns the 16-bit "dot" bitmap of the row of the character glyph having the given offset.
[in] | inGlyphIndex | Specifies the glyph index, which must be less than the value returned from GetGlyphCount(). |
[in] | inRow | Specifies the row of interest in the "dot" bitmap, which must be less than the value returned from GetDotMapHeight(). |
|
virtual |
Returns a UTF-8 encoded string that contains the dot pattern for the given zero-based row number and zero-based glyph index. Each opaque (black) dot is rendered as a "full block" character (u2588), whereas each transparent (white) dot is rendered as a simple space character.
[in] | inGlyphIndex | Specifies the glyph of interest, expressed as a zero-based index number. This must be less than the value returned from GetGlyphCount. |
[in] | inRow | Specifies the zero-based row of interest in the glyph's dot map. This must be less than the value returned from GetDotMapHeight. |
|
static |
Returns a constant reference to the NTV2CCFont singleton.
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
static |
Returns the character code that corresponds to the given glyph.
[in] | inGlyphIndex | Specifies the zero-based index number of the glyph of interest. |
|
virtual |
Returns true if there is a glyph available for the given CEA-608 code point.
[in] | in608CodePoint | Specifies the CEA-608 code point of interest. |
|
inlinevirtual |
|
virtual |
Renders all glyphs in the given range (inclusive) into the specified output stream as multiple rows of UTF-8 encoded strings. When displayed in a terminal using a monospaced font, it shows what the glyphs actually look like. Each black dot is rendered as a "full block" character (u2588), while white dots are rendered as spaces.
inOutStream | Specifies the output stream to use. | |
[in] | inFirstGlyph | Specifies the zero-based index of the first glyph to be printed into the output stream. This must be less than the value returned from GetGlyphCount, and also must be less than the value used in "inLastGlyph". |
[in] | inLastGlyph | Specifies the zero-based index of the last glyph to be printed into the output stream. This must be less than the value returned from GetGlyphCount. |
|
virtual |
Renders the given glyph with the given display attributes into the specified 8-bit NTV2_FBF_ARGB destination buffer.
[in] | inPixelFormat | Specifies which 8-bit RGB pixel format the destination buffer has. Must be one of NTV2_FBF_ARGB, NTV2_FBF_RGBA or NTV2_FBF_ABGR. |
pDestBuffer | Specifies the destination buffer that is to receive the "blitted" glyph. | |
[in] | inBytesPerRow | Specifies the number of bytes per row in the destination buffer. |
[in] | inGlyphIndex | Specifies the glyph to be blitted. Must be less than the given font's glyph count. |
[in] | inAttribs | Specifies the attributes the blitted glyph should be rendered with (color, italic, underline, etc.). |
[in] | inScaledDotWidth | Specifies the number of horizontal pixels per glyph "dot". |
[in] | inScaledDotHeight | Specifies the number of vertical pixels (lines) per glyph "dot". |
[in] | inIsHD | Use true for Rec709 color translation; otherwise false for Rec601. Defaults to false (Rec601). |
|
virtual |
Renders the given glyph with the given display attributes into the specified 8-bit YCbCr '2vuy' destination buffer.
pDestBuffer | Specifies the destination buffer that is to receive the "blitted" glyph. | |
[in] | inBytesPerRow | Specifies the number of bytes per row in the destination buffer. |
[in] | inGlyphIndex | Specifies the glyph to be blitted. Must be less than the given font's glyph count. |
[in] | inAttribs | Specifies the attributes the blitted glyph should be rendered with (color, italic, underline, etc.). |
[in] | inScaledDotWidth | Specifies the number of horizontal pixels per glyph "dot". |
[in] | inScaledDotHeight | Specifies the number of vertical pixels (lines) per glyph "dot". |
Returns the character code that corresponds to the given unicode codepoint.
[in] | inCodePoint | Specifies the unicode code point to be converted. |
|
static |
Converts the given UTF-8 encoded string into a string of CCFont character codes.
[in] | inUtf8Str | Specifies the UTF-8 encoded string to be converted. |