AJA NTV2 SDK  18.1.0.2145
NTV2 SDK 18.1.0.2145
ntv2caption608types.h
Go to the documentation of this file.
1 
7 #ifndef __NTV2_CAPTION608TYPES_
8 #define __NTV2_CAPTION608TYPES_
9 
10 #include "ajatypes.h"
11 #include "ajaexport.h"
12 #include "ntv2utils.h"
13 #include <ostream>
14 #include <string>
15 #include <set>
16 #include <map>
17 
18 #if !defined(NULL)
19  #define NULL 0
20 #endif
21 
22 
23 
28 const UWord NTV2_CC608_MinRow (1);
29 
34 const UWord NTV2_CC608_MaxRow (15);
35 
40 const UWord NTV2_CC608_MinCol (1);
41 
46 const UWord NTV2_CC608_MaxCol (32);
47 
48 
49 #define IsValidLine21Row(__row__) ((__row__) >= NTV2_CC608_MinRow && (__row__) <= NTV2_CC608_MaxRow)
50 #define IsValidLine21Column(__col__) ((__col__) >= NTV2_CC608_MinCol && (__col__) <= NTV2_CC608_MaxCol)
51 
52 
56 typedef enum NTV2Line21Field
57 {
62 
64 
65 
66 #define IsValidLine21Field(_field_) ((_field_) == NTV2_CC608_Field1 || (_field_) == NTV2_CC608_Field2)
67 #define IsLine21Field1(_field_) ((_field_) == NTV2_CC608_Field1)
68 #define IsLine21Field2(_field_) ((_field_) == NTV2_CC608_Field2)
69 
70 
76 AJAExport const std::string & NTV2Line21FieldToStr (const NTV2Line21Field inLine21Field);
77 
78 
82 typedef enum NTV2Line21Channel
83 {
88 
94 
96 
100 
101 
102 #define IsValidLine21Channel(_chan_) ((_chan_) >= NTV2_CC608_CC1 && (_chan_) < NTV2_CC608_ChannelMax)
103 #define IsLine21CaptionChannel(_chan_) ((_chan_) >= NTV2_CC608_CC1 && (_chan_) <= NTV2_CC608_CC4)
104 #define IsLine21TextChannel(_chan_) ((_chan_) >= NTV2_CC608_Text1 && (_chan_) <= NTV2_CC608_Text4)
105 #define IsLine21XDSChannel(_chan_) ((_chan_) == NTV2_CC608_XDS)
106 #define IsField1Line21CaptionChannel(_chan_) ((_chan_) == NTV2_CC608_CC1 || (_chan_) == NTV2_CC608_CC2 || (_chan_) == NTV2_CC608_Text1 || (_chan_) == NTV2_CC608_Text2)
107 #define IsField2Line21CaptionChannel(_chan_) ((_chan_) == NTV2_CC608_CC3 || (_chan_) == NTV2_CC608_CC4 || (_chan_) == NTV2_CC608_Text3 || (_chan_) == NTV2_CC608_Text4)
108 
109 
117 AJAExport const std::string & NTV2Line21ChannelToStr (const NTV2Line21Channel inLine21Channel, const bool inCompact = true);
118 
119 
123 typedef enum NTV2Line21Mode
124 {
134 
135 
136 #define IsValidLine21Mode(_mode_) ((_mode_) >= NTV2_CC608_CapModePopOn && (_mode_) < NTV2_CC608_CapModeMax)
137 #define IsLine21PopOnMode(_mode_) ((_mode_) == NTV2_CC608_CapModePopOn)
138 #define IsLine21PaintOnMode(_mode_) ((_mode_) == NTV2_CC608_CapModePaintOn)
139 #define IsLine21RollUpMode(_mode_) ((_mode_) >= NTV2_CC608_CapModeRollUp2 && (_mode_) <= NTV2_CC608_CapModeRollUp4)
140 
141 
147 AJAExport const std::string & NTV2Line21ModeToStr (const NTV2Line21Mode inLine21Mode);
148 
149 
153 typedef enum NTV2Line21Color
154 {
163 
166 
168 
169 
170 #define IsValidLine21Color(_color_) ((_color_) >= NTV2_CC608_White && (_color_) < NTV2_CC608_NumColors)
171 #define IsLine21WhiteColor(_color_) ((_color_) == NTV2_CC608_White)
172 #define IsLine21BlackColor(_color_) ((_color_) == NTV2_CC608_Black)
173 
174 
182 AJAExport const std::string & NTV2Line21ColorToStr (const NTV2Line21Color inLine21Color, const bool inCompact = true);
183 
184 
193 AJAExport bool NTV2Line21ColorToYUV8 (const NTV2Line21Color inLine21Color, UByte & outY, UByte & outCb, UByte & outCr);
194 
195 
207 AJAExport bool NTV2Line21ColorToRGB8 (const NTV2Line21Color inLine21Color, UByte & outR, UByte & outG, UByte & outB, const bool inIsHD = false);
208 
209 
213 typedef enum NTV2Line21Opacity
214 {
218 
220 
222 
223 
224 #define IsValidLine21Opacity(_opacity_) ((_opacity_) >= NTV2_CC608_Opaque && (_opacity_) < NTV2_CC608_NumOpacities)
225 #define IsLine21Transparent(_opacity_) ((_opacity_) == NTV2_CC608_Transparent)
226 #define IsLine21SemiTransparent(_opacity_) ((_opacity_) == NTV2_CC608_SemiTransparent)
227 #define IsLine21Opaque(_opacity_) ((_opacity_) == NTV2_CC608_Opaque)
228 
229 
237 AJAExport const std::string & NTV2Line21OpacityToStr (const NTV2Line21Opacity inLine21Opacity, const bool inCompact = true);
238 
239 
244 {
245  NTV2_CC608_DefaultCharacterSet, // Plain ol' normal U.S./Latin characters
252 
254 
256 
257 
258 #define IsValidLine21CharacterSet(_charset_) ((_charset_) >= NTV2_CC608_DefaultCharacterSet && (_charset_) < NTV2_CC608_NumCharacterSets)
259 
260 
266 AJAExport const std::string & NTV2Line21CharacterSetToStr (const NTV2Line21CharacterSet inLine21CharSet);
267 
268 
277 
278 
282 typedef std::set <NTV2_CC608_CodePoint> NTV2CodePointSet;
283 typedef NTV2CodePointSet::const_iterator NTV2CodePointSetConstIter;
284 
285 AJAExport std::string NTV2CodePointSetToString (const NTV2CodePointSet & inSet); // conflicts with classes lib --- std::ostream & operator << (std::ostream & inOutStream, const NTV2CodePointSet & inSet);
286 
287 
295 inline NTV2_CC608_CodePoint Make608CodePoint (const UByte in608Byte1, const UByte in608Byte2, const NTV2Line21CharacterSet inCharSet = NTV2_CC608_DefaultCharacterSet)
296 {
297  return NTV2_CC608_CodePoint (ULWord (inCharSet << 24) | ULWord (in608Byte1 << 8) | ULWord (in608Byte2));
298 }
299 
307 AJAExport std::string NTV2CC608CodePointToUtf8String (const NTV2_CC608_CodePoint in608CodePoint);
308 
315 
316 
323 {
324  return NTV2Line21CharacterSet ((inCodePoint & 0xFF000000) >> 24);
325 }
326 
327 
333 inline UByte Get608Byte1 (const NTV2_CC608_CodePoint inCodePoint)
334 {
335  return UByte ((inCodePoint & 0x00FF00) >> 8);
336 }
337 
338 
344 inline UByte Get608Byte2 (const NTV2_CC608_CodePoint inCodePoint)
345 {
346  return UByte (inCodePoint & 0x000000FF);
347 }
348 
349 
358 {
359  public:
364  explicit NTV2Line21Attributes ();
365 
375  explicit NTV2Line21Attributes ( const NTV2Line21Color inFGColor,
376  const NTV2Line21Color inBGColor = NTV2_CC608_Black,
377  const NTV2Line21Opacity inOpacity = NTV2_CC608_Opaque,
378  const bool inItalics = false,
379  const bool inUnderline = false,
380  const bool inFlash = false);
381  inline NTV2Line21Attributes ( const NTV2Line21Attributes & inRHS) { bFlash = inRHS.bFlash;
382  bItalic = inRHS.bItalic;
383  bUnderline = inRHS.bUnderline;
384  fgColor = inRHS.fgColor;
385  bgColor = inRHS.bgColor;
386  bgOpacity = inRHS.bgOpacity; }
387  inline NTV2Line21Attributes & operator = (const NTV2Line21Attributes & inRHS) { bFlash = inRHS.bFlash;
388  bItalic = inRHS.bItalic;
389  bUnderline = inRHS.bUnderline;
390  fgColor = inRHS.fgColor;
391  bgColor = inRHS.bgColor;
392  bgOpacity = inRHS.bgOpacity; return *this;}
393 
399  inline bool IsSet (void) const { return bFlash || bItalic || bUnderline
400  || fgColor != NTV2_CC608_White
401  || bgColor != NTV2_CC608_Black
402  || bgOpacity != NTV2_CC608_Opaque; }
403 
407  inline NTV2Line21Color GetColor (void) const { return NTV2Line21Color(fgColor); }
408 
412  inline NTV2Line21Color GetBGColor (void) const { return NTV2Line21Color(bgColor); }
413 
417  inline NTV2Line21Opacity GetOpacity (void) const { return NTV2Line21Opacity(bgOpacity); }
418 
422  inline bool IsItalicized (void) const { return bItalic; }
423 
427  inline bool IsUnderlined (void) const { return bUnderline; }
428 
432  inline bool IsFlashing (void) const { return bFlash; }
433 
438  inline NTV2Line21Attributes & AddItalics (void) { bItalic = true; return *this; }
439 
444  inline NTV2Line21Attributes & RemoveItalics (void) { bItalic = false; return *this; }
445 
451  inline NTV2Line21Attributes & SetItalics (const bool inItalics) { bItalic = inItalics; return *this; }
452 
453 
458  inline NTV2Line21Attributes & AddUnderline (void) { bUnderline = true; return *this; }
459 
464  inline NTV2Line21Attributes & RemoveUnderline (void) { bUnderline = false; return *this; }
465 
471  inline NTV2Line21Attributes & SetUnderline (const bool inUnderline) { bUnderline = inUnderline; return *this; }
472 
473 
478  inline NTV2Line21Attributes & AddFlash (void) { bFlash = true; return *this; }
479 
484  inline NTV2Line21Attributes & RemoveFlash (void) { bFlash = false; return *this; }
485 
491  inline NTV2Line21Attributes & SetFlash (const bool inFlash) { bFlash = inFlash; return *this; }
492 
493 
499  inline NTV2Line21Attributes & SetColor (const NTV2Line21Color inFGColor) { fgColor = inFGColor; return *this; }
500 
506  inline NTV2Line21Attributes & SetBGColor (const NTV2Line21Color inBGColor) { bgColor = inBGColor; return *this; }
507 
513  inline NTV2Line21Attributes & SetOpacity (const NTV2Line21Opacity inOpacity) { bgOpacity = inOpacity; return *this; }
514 
515 
520  inline void Clear (void) { bFlash = bItalic = bUnderline = false;
521  fgColor = NTV2_CC608_White;
522  bgColor = NTV2_CC608_Black;
523  bgOpacity = NTV2_CC608_Opaque; }
524 
530  inline bool operator < (const NTV2Line21Attributes & inRHS) const { return GetHashKey () < inRHS.GetHashKey (); }
531 
537  inline bool operator == (const NTV2Line21Attributes & inRHS) const { return GetHashKey () == inRHS.GetHashKey (); }
538 
544  inline bool operator != (const NTV2Line21Attributes & inRHS) const { return !(*this == inRHS);}
545 
549  std::string GetHexString (void) const;
550 
554  uint16_t GetHashKey (void) const;
555 
556 
557  // Instance Data
558  private:
559  bool bFlash :1;
560  bool bItalic :1;
561  bool bUnderline :1;
562  unsigned fgColor :3;
563  unsigned bgColor :3;
564  unsigned bgOpacity :2;
565 
567 
570 
571 
578 AJAExport std::ostream & operator << (std::ostream & inOutStream, const NTV2Line21Attrs & inData);
579 
580 
581 
582 // CONVERSION TO/FROM STRINGS
583 
584 
590 AJAExport std::string NTV2Line21AttributesToStr (const NTV2Line21Attributes inLine21Attributes);
591 
592 
598 AJAExport NTV2Line21Field StrToNTV2Line21Field (const std::string & inStr);
599 
600 
606 AJAExport NTV2Line21Channel StrToNTV2Line21Channel (const std::string & inStr);
607 
608 
614 AJAExport NTV2Line21Mode StrToNTV2Line21Mode (const std::string & inStr);
615 
616 
622 AJAExport NTV2Line21Color StrToNTV2Line21Color (const std::string & inStr);
623 
624 
630 AJAExport NTV2Line21Opacity StrToNTV2Line21Opacity (const std::string & inStr);
631 
632 
639 
640 
646 AJAExport NTV2Line21Attributes StrToNTV2Line21Attributes (const std::string & inStr);
647 
648 
649 
655 typedef struct AJAExport CaptionData
656 {
660 
664 
668 
669  public:
673  explicit inline CaptionData () { bGotField1Data = bGotField2Data = bGotField3Data = false; f1_char1 = f1_char2 = f2_char1 = f2_char2 = f3_char1 = f3_char2 = 0xFF; }
674 
678  explicit CaptionData (const UByte inF1Char1, const UByte inF1Char2);
679 
683  explicit CaptionData (const UByte inF1Char1, const UByte inF1Char2, const UByte inF2Char1, const UByte inF2Char2);
684 
688  inline bool HasF1Data (void) const {return (bGotField1Data && (f1_char1 != 0x80 || f1_char2 != 0x80));}
689 
693  inline bool HasF2Data (void) const {return (bGotField2Data && (f2_char1 != 0x80 || f2_char2 != 0x80));}
694 
698  inline bool HasData (void) const {return HasF1Data() || HasF2Data();}
699 
703  inline bool IsF1Invalid (void) const {return f1_char1 == 0xFF && f1_char2 == 0xFF;}
704 
708  inline bool IsF2Invalid (void) const {return f2_char1 == 0xFF && f2_char2 == 0xFF;}
709 
713  inline bool IsError (void) const {return IsF1Invalid() && IsF2Invalid();}
714 
720  inline CaptionData & SetF1Data (const CaptionData & inRHS) {f1_char1 = inRHS.f1_char1; f1_char2 = inRHS.f1_char2; bGotField1Data = inRHS.bGotField1Data; return *this;}
721 
728  inline CaptionData & SetF1Data (const UByte inF1Char1, const UByte inF1Char2) {f1_char1 = inF1Char1; f1_char2 = inF1Char2; bGotField1Data = inF1Char1 != 0xFF && inF1Char2 != 0xFF; return *this;}
729 
735  inline CaptionData & SetF2Data (const CaptionData & inRHS) {f2_char1 = inRHS.f2_char1; f2_char2 = inRHS.f2_char2; bGotField2Data = inRHS.bGotField2Data; return *this;}
736 
743  inline CaptionData & SetF2Data (const UByte inF2Char1, const UByte inF2Char2) {f2_char1 = inF2Char1; f2_char2 = inF2Char2; bGotField2Data = inF2Char1 != 0xFF && inF2Char2 != 0xFF; return *this;}
744 
748  inline void Clear (void) {bGotField1Data = bGotField2Data = bGotField3Data = false; f1_char1 = f1_char2 = f2_char1 = f2_char2 = f3_char1 = f3_char2 = 0x80;}
749 
753  inline void Zero (void) {bGotField1Data = bGotField2Data = bGotField3Data = false; f1_char1 = f1_char2 = f2_char1 = f2_char2 = f3_char1 = f3_char2 = 0x00;}
754 
761  bool operator == (const CaptionData & inRHS) const;
762  bool operator < (const CaptionData & inRHS) const;
763  inline bool operator != (const CaptionData & inRHS) const {return !(*this == inRHS);}
764 } CaptionData;
765 
766 
773 AJAExport std::ostream & operator << (std::ostream & inOutStream, const CaptionData & inData);
774 
775 
780 {
781  public:
785  typedef enum NTV2Caption608Change
786  {
787  NTV2DecoderChange_None = 0,
788  NTV2DecoderChange_CurrentChannel = 1,
789  NTV2DecoderChange_CurrentRow = 2,
790  NTV2DecoderChange_CurrentColumn = 4,
791  NTV2DecoderChange_CurrentScreen = 8,
792  NTV2DecoderChange_CaptionMode = 16,
793  NTV2DecoderChange_ScreenCharacter = 32,
794  NTV2DecoderChange_ScreenAttribute = 64,
795  NTV2DecoderChange_DrawScreen = 128,
796  NTV2DecoderChange_All = 0xFFFF
797  } NTV2Caption608Change;
798 
799  public:
800  explicit NTV2Caption608ChangeInfo (const NTV2Line21Channel inChannel);
801  explicit NTV2Caption608ChangeInfo (const NTV2Line21Channel inOldChannel, const NTV2Line21Channel inNewChannel);
802  explicit NTV2Caption608ChangeInfo (const NTV2Line21Channel inChannel, const UWord inWhatChanged, const UWord inOldValue, const UWord inNewValue);
803  explicit NTV2Caption608ChangeInfo (const NTV2Line21Channel inChannel, const UWord inScreen, const UWord inRow, const UWord inColumn, const NTV2_CC608_CodePoint inOldValue, const NTV2_CC608_CodePoint inNewValue);
804  explicit NTV2Caption608ChangeInfo (const NTV2Line21Channel inChannel, const UWord inScreen, const UWord inRow, const UWord inColumn, const NTV2Line21Attributes & inOldValue, const NTV2Line21Attributes & inNewValue);
805  std::ostream & Print (std::ostream & inOutStrm) const;
806 
807  public:
808  union _u
809  {
811  {
813  } currentChannel;
814  struct _currentRow
815  {
818  } currentRow;
820  {
823  } currentColumn;
825  {
828  } currentScreen;
830  {
833  } captionMode;
834  struct _screenChar
835  {
841  } screenChar;
842  struct _screenAttr
843  {
847  uint16_t mOld;
848  uint16_t mNew;
849  } screenAttr;
850  } u;
851 
854 
855 }; // NTV2Caption608ChangeInfo
856 
857 
864 inline std::ostream & operator << (std::ostream & oss, const NTV2Caption608ChangeInfo & inInfo) {return inInfo.Print(oss);}
865 
866 
872 typedef void (NTV2Caption608Changed) (void * pInstance, const NTV2Caption608ChangeInfo & inChangeInfo);
873 
874 
883 {
884  public:
889 
895  const NTV2Line21Attrs & GetPermutation (const size_t inIndex) const;
896 
901  inline ULWord size (void) const {return 3 * 2 * 8 * 2 * 8;}
902 
908  size_t GetIndexFromAttribute (const NTV2Line21Attributes & inAttribute) const;
909 
915  inline const NTV2Line21Attrs & operator [] (const size_t inIndex) const {return GetPermutation(inIndex);}
916 
917  private:
918  NTV2Line21Attrs mAttribs [3 * 2 * 8 * 2 * 8]; // 3 opacities x w/wo underline x 8 BG colors x w/wo italics x 8 FG colors
919 
920 }; // NTV2Line21AttributePermutations
921 
922 #endif // __NTV2_CAPTION608TYPES_
UByte f3_char2
Caption Byte 2 of Field 3.
std::ostream & operator<<(std::ostream &inOutStream, const NTV2Line21Attrs &inData)
Writes a human-readable rendition of the given NTV2Line21Attributes into the given output stream...
ULWord size(void) const
Returns my size (the total number of attribute permutations that I have).
UWord NTV2CC608CodePointToUtf16Char(const NTV2_CC608_CodePoint in608CodePoint)
Returns the UTF-16 character that best represents the given CEA-608 code point.
const UWord NTV2_CC608_MinCol(1)
The minimum column index number (located at the left edge of the screen).
UByte f2_char1
Caption Byte 1 of Field 2.
uint16_t mNew
The new character NTV2Line21Attributes.
std::set< NTV2_CC608_CodePoint > NTV2CodePointSet
A set of unique CEA-608 caption character code points.
This class is used to respond to dynamic events that occur during CEA-608 caption decoding...
NTV2Line21Attributes & RemoveFlash(void)
Disables my flashing attribute setting.
UByte f1_char2
Caption Byte 2 of Field 1.
NTV2Line21CharacterSet
The available CEA-608 character sets.
bool HasData(void) const
NTV2Line21Attributes StrToNTV2Line21Attributes(const std::string &inStr)
Converts the given string into the equivalent NTV2Line21Attributes value.
UWord mOld
Current column change. This is the old column number.
UWord mNew
Current NTV2Line21Mode change. This is the new NTV2Line21Mode value.
NTV2Line21Attributes & SetFlash(const bool inFlash)
Sets my flashing attribute setting.
UByte f1_char1
Caption Byte 1 of Field 1.
NTV2Line21Opacity
The CEA-608 character opacity values: opaque, semi-transparent, and transparent.
2-row roll-up from bottom
NTV2CodePointSet::const_iterator NTV2CodePointSetConstIter
NTV2Line21Attributes & RemoveUnderline(void)
Disables my underline attribute setting.
NTV2Line21Attributes & SetUnderline(const bool inUnderline)
Sets my underline attribute setting.
UWord mOld
Caption channel change. This is the old NTV2Line21Channel value. (The new, current value is in my mCh...
Pop-on caption mode.
UByte f2_char2
Caption Byte 2 of Field 2.
NTV2Caption608Change
Used to determine what changed. Also can be used to choose which changes to pay attention to...
NTV2Line21Color GetColor(void) const
Returns my foreground color.
UWord mColumn
Display character change. The column number that contains the character that&#39;s being changed...
bool IsFlashing(void) const
Returns true if I&#39;m flashing; otherwise returns false.
bool bGotField3Data
True if Field 3 bytes have been set. This is used only when translating 30fps video to 24fps and remo...
void Zero(void)
Sets all of my "got data" fields to "false" and all my character values to zero.
bool operator!=(const json_pointer< RefStringTypeLhs > &lhs, const json_pointer< RefStringTypeRhs > &rhs) noexcept
Definition: json.hpp:14762
NTV2_CC608_CodePoint mNew
Display character change. The new character NTV2_CC608_CodePoint value.
CaptionData & SetF2Data(const CaptionData &inRHS)
Copies my F2 data bytes from the given CaptionData instance.
NTV2Line21Color
The CEA-608 color values: white, green, blue, cyan, red, yellow, magenta, and black.
uint32_t ULWord
Definition: ajatypes.h:236
CaptionData & SetF1Data(const CaptionData &inRHS)
Copies my F1 data bytes from the given CaptionData instance.
bool IsSet(void) const
Returns true if I&#39;m any different from the default, i.e., if IsFlashing(), IsItalicized(), IsUnderlined() return true, or if my foreground color is anything but white, or if my background color is anything but black, or if my opacity is anything but opaque.
Unknown or invalid caption mode.
UByte Get608Byte2(const NTV2_CC608_CodePoint inCodePoint)
Extracts the second CEA-608 byte from the given NTV2_CC608_CodePoint.
NTV2Line21Opacity StrToNTV2Line21Opacity(const std::string &inStr)
Converts the given string into the equivalent NTV2Line21Opacity value.
NTV2Line21Attributes & SetItalics(const bool inItalics)
Sets my italics setting.
NTV2Line21AttrsPtr NTV2Line21AttributesPtr
const std::string & NTV2Line21ModeToStr(const NTV2Line21Mode inLine21Mode)
Converts the given NTV2Line21Mode value into a human-readable string.
NTV2Line21Attributes & SetBGColor(const NTV2Line21Color inBGColor)
Sets my background color attribute.
bool IsError(void) const
UWord mNew
Current column change. This is the new column number.
NTV2_CC608_CodePoint mOld
Display character change. The old character NTV2_CC608_CodePoint value.
NTV2Line21Attributes & SetColor(const NTV2Line21Color inFGColor)
Sets my foreground color attribute.
bool IsItalicized(void) const
Returns true if I&#39;m italicized; otherwise returns false.
bool bGotField2Data
True if Field 2 bytes have been set; otherwise false.
UWord mScreenNum
Display character change. This is the number of the screen backbuffer that&#39;s changing.
UByte Get608Byte1(const NTV2_CC608_CodePoint inCodePoint)
Extracts the first CEA-608 byte from the given NTV2_CC608_CodePoint.
CEA-608 Character Attributes.
Defines the import/export macros for producing DLLs or LIBs.
NTV2Line21Field StrToNTV2Line21Field(const std::string &inStr)
Converts the given string into the equivalent NTV2Line21Field value.
bool NTV2Line21ColorToRGB8(const NTV2Line21Color inLine21Color, UByte &outR, UByte &outG, UByte &outB, const bool inIsHD=false)
Converts a given CEA-608 color value into three 8-bit RGB component values.
Declares the most fundamental data types used by NTV2. Since Windows NT was the first principal devel...
bool HasF2Data(void) const
const std::string & NTV2Line21OpacityToStr(const NTV2Line21Opacity inLine21Opacity, const bool inCompact=true)
Converts the given NTV2Line21Opacity value into a human-readable string.
NTV2Line21Attributes & RemoveItalics(void)
Removes italics.
void Clear(void)
Sets all of my "got data" fields to "false" and all my character values to 0x80.
const UWord NTV2_CC608_MaxCol(32)
The maximum column index number (located at the right edge of the screen).
bool bGotField1Data
True if Field 1 bytes have been set; otherwise false.
Caption channel 1, the primary caption channel.
NTV2Line21Attributes & SetOpacity(const NTV2Line21Opacity inOpacity)
Sets my background opacity attribute.
UWord mColumn
The column number that contains the character whose attributes are changing.
NTV2Line21Attributes(const NTV2Line21Attributes &inRHS)
NTV2Line21Attributes & AddFlash(void)
Enables my flashing attribute setting.
bool IsUnderlined(void) const
Returns true if I&#39;m underlined; otherwise returns false.
NTV2Line21Opacity GetOpacity(void) const
Returns my background opacity.
NTV2_CC608_CodePoint Make608CodePoint(const UByte in608Byte1, const UByte in608Byte2, const NTV2Line21CharacterSet inCharSet=NTV2_CC608_DefaultCharacterSet)
Constructs a unique CEA-608 caption character code point from its three components.
const std::string & NTV2Line21CharacterSetToStr(const NTV2Line21CharacterSet inLine21CharSet)
Converts the given NTV2Line21CharacterSet value into a human-readable string.
enum NTV2Line21CharacterSet NTV2Line21CharSet
ULWord NTV2_CC608_CodePoint
Describes a unique CEA-608 caption character code point in 32 bits: 0xSS00XXYY, where... SS == NTV2Line21CharacterSet XX == CEA608 byte 1 (parity stripped) YY == CEA608 byte 2 (parity stripped)
UWord mNew
Current row change. This is the new row number.
NTV2Line21Color StrToNTV2Line21Color(const std::string &inStr)
Converts the given string into the equivalent NTV2Line21Color value.
uint8_t UByte
Definition: ajatypes.h:231
3-row roll-up from bottom
const std::string & NTV2Line21FieldToStr(const NTV2Line21Field inLine21Field)
Converts the given NTV2Line21Field value into a human-readable string.
const UWord NTV2_CC608_MinRow(1)
The minimum row index number (located at the top of the screen).
bool IsF1Invalid(void) const
UByte f3_char1
Caption Byte 1 of Field 3.
UWord mOld
Current row change. This is the old row number.
void() NTV2Caption608Changed(void *pInstance, const NTV2Caption608ChangeInfo &inChangeInfo)
This callback is used to respond to dynamic events that occur during CEA-608 caption decoding...
bool operator==(const json_pointer< RefStringTypeLhs > &lhs, const json_pointer< RefStringTypeRhs > &rhs) noexcept
Definition: json.hpp:14737
#define AJAExport
Definition: export.h:33
NTV2Line21CharacterSet GetLine21CharacterSet(const NTV2_CC608_CodePoint inCodePoint)
Extracts the NTV2Line21CharacterSet from the given NTV2_CC608_CodePoint.
Declares numerous NTV2 utility functions.
NTV2Line21Mode StrToNTV2Line21Mode(const std::string &inStr)
Converts the given string into the equivalent NTV2Line21Mode value.
NTV2Line21Channel StrToNTV2Line21Channel(const std::string &inStr)
Converts the given string into the equivalent NTV2Line21Channel value.
NTV2Line21Color GetBGColor(void) const
Returns my background color.
NTV2Line21Attrs * NTV2Line21AttrsPtr
uint16_t mOld
The old character NTV2Line21Attributes.
std::string NTV2CC608CodePointToUtf8String(const NTV2_CC608_CodePoint in608CodePoint)
Returns a string containing the UTF-8 character sequence that best represents the given CEA-608 code ...
UWord mOld
Current NTV2Line21Mode change. This is the old NTV2Line21Mode value.
This structure encapsulates all possible CEA-608 caption data bytes that may be associated with a giv...
CaptionData()
Default constructor. Sets my caption bytes to 0xFF, and "gotFieldData" values to false.
uint16_t UWord
Definition: ajatypes.h:234
UWord mRow
The row number that contains the character whose attributes are changing.
UWord mNew
Current screen change. This is the new screen number.
CaptionData & SetF1Data(const UByte inF1Char1, const UByte inF1Char2)
Sets my F1 data bytes.
Caption channel 2, the secondary caption channel.
4-row roll-up from bottom
const std::string & NTV2Line21ChannelToStr(const NTV2Line21Channel inLine21Channel, const bool inCompact=true)
Converts the given NTV2Line21Channel value into a human-readable string.
NTV2Line21Channel mChannel
Caption channel being changed.
bool operator<(const value_t lhs, const value_t rhs) noexcept
comparison operator for JSON types
Definition: json.hpp:2902
bool NTV2Line21ColorToYUV8(const NTV2Line21Color inLine21Color, UByte &outY, UByte &outCb, UByte &outCr)
Converts a given CEA-608 color value into three 8-bit Y, Cb, Cr component values. ...
uint16_t GetHashKey(void) const
Returns my magnitude used to implement operator < for sorting or using a Line21 attribute as an index...
struct CaptionData CaptionData
This structure encapsulates all possible CEA-608 caption data bytes that may be associated with a giv...
struct NTV2Line21Attributes NTV2Line21Attrs
void Clear(void)
Clears all of my attributes, returning me to a default state, i.e., no flashing, no italics...
NTV2Line21Mode
The CEA-608 modes: pop-on, roll-up (2, 3 and 4-line), and paint-on.
NTV2Line21Attributes & AddItalics(void)
Enables italics.
std::ostream & Print(std::ostream &inOutStrm) const
const UWord NTV2_CC608_MaxRow(15)
The maximum permissible row index number (located at the bottom of the screen).
NTV2Line21Attributes & AddUnderline(void)
Enables my underline attribute setting.
NTV2Line21CharacterSet StrToNTV2Line21CharacterSet(const std::string &inStr)
Converts the given string into the equivalent NTV2Line21CharacterSet value.
UWord mRow
Display character change. The row number that contains the character that&#39;s being changed...
struct NTV2Line21Attributes NTV2Line21Attributes
CEA-608 Character Attributes.
NTV2Line21Channel
The CEA-608 caption channels: CC1 thru CC4, TX1 thru TX4, plus XDS.
bool HasF1Data(void) const
UWord mScreenNum
The number of the screen backbuffer that&#39;s changing.
Paint-on caption mode.
std::string NTV2CodePointSetToString(const NTV2CodePointSet &inSet)
NTV2Line21Field
The two CEA-608 interlace fields.
An ordered set of all possible NTV2Line21Attributes permutations (excluding the "flashing" attribute...
bool IsF2Invalid(void) const
const std::string & NTV2Line21ColorToStr(const NTV2Line21Color inLine21Color, const bool inCompact=true)
Converts the given NTV2Line21Color value into a human-readable string.
UWord mWhatChanged
Bit mask that indicates what changed.
CaptionData & SetF2Data(const UByte inF2Char1, const UByte inF2Char2)
Sets my F2 data bytes.
UWord mOld
Current screen change. This is the old screen number.
std::string NTV2Line21AttributesToStr(const NTV2Line21Attributes inLine21Attributes)
Converts the given NTV2Line21Attributes value into a human-readable string.