AJA NTV2 SDK
17.5.0.1492
NTV2 SDK 17.5.0.1492
|
Describes a video frame for a given video standard or format and pixel format, including the total number of lines, number of pixels per line, line pitch, and which line contains the start of active video. More...
#include <ntv2formatdescriptor.h>
Public Member Functions | |
void | MakeInvalid (void) |
Resets me into an invalid (NULL) state. More... | |
Constructors | |
NTV2FormatDescriptor () | |
My default constructor initializes me in an "invalid" state. More... | |
NTV2FormatDescriptor (const ULWord inNumLines, const ULWord inNumPixels, const ULWord inLinePitch, const ULWord in1stActiveLine=0, const UByte inNumLumaBits=0, const UByte inNumChromaBits=0, const UByte inNumAlphaBits=0) | |
Construct from line and pixel count, plus line pitch. More... | |
NTV2FormatDescriptor (const NTV2Standard inStandard, const NTV2FrameBufferFormat inFrameBufferFormat, const NTV2VANCMode inVancMode=NTV2_VANCMODE_OFF) | |
Constructs me from the given video standard, pixel format, and VANC settings. More... | |
NTV2FormatDescriptor (const NTV2VideoFormat inVideoFormat, const NTV2FrameBufferFormat inFrameBufferFormat, const NTV2VANCMode inVancMode=NTV2_VANCMODE_OFF) | |
Constructs me from the given video format, pixel format and VANC settings. More... | |
NTV2FormatDescriptor (const NTV2FrameSize &inRasterSize, const NTV2PixelFormat inPixelFormat, const NTV2VANCMode inVancMode=NTV2_VANCMODE_OFF) | |
Constructs me from the given video format, pixel format and VANC settings. More... | |
Inquiry | |
bool | IsValid (void) const |
ULWord | GetVerticalSampleRatio (const UWord inPlaneIndex0=0) const |
ULWord | GetTotalRasterBytes (const UWord inPlaneIndex0=0) const |
ULWord | GetTotalBytes (void) const |
ULWord | GetVideoWriteSize (ULWord inPageSize=4096UL) const |
ULWord | GetVisibleRasterBytes (const UWord inPlaneIndex0=0) const |
ULWord | GetBytesPerRow (const UWord inPlaneIndex0=0) const |
std::string | PlaneToString (const UWord inPlaneIndex0) const |
UWord | ByteOffsetToPlane (const ULWord inByteOffset) const |
UWord | ByteOffsetToRasterLine (const ULWord inByteOffset) const |
bool | IsAtLineStart (ULWord inByteOffset) const |
ULWord | GetRasterHeight (const bool inVisibleOnly=false) const |
ULWord | GetFullRasterHeight (void) const |
ULWord | GetFirstActiveLine (void) const |
ULWord | GetVisibleRasterHeight (void) const |
bool | GetRowBuffer (const NTV2Buffer &inFrameBuffer, NTV2Buffer &inOutRowBuffer, const ULWord inRowIndex0, const UWord inPlaneIndex0=0) const |
Answers with an NTV2Buffer that describes the given row (and plane) given the NTV2Buffer that describes the frame buffer. More... | |
const void * | GetRowAddress (const void *pInStartAddress, const ULWord inRowIndex0, const UWord inPlaneIndex0=0) const |
void * | GetWriteableRowAddress (void *pInStartAddress, const ULWord inRowIndex0, const UWord inPlaneIndex0=0) const |
ULWord | RasterLineToByteOffset (const ULWord inRowIndex0, const UWord inPlaneIndex0=0) const |
UByte * | GetTopVisibleRowAddress (UByte *pInStartAddress) const |
bool | GetFirstChangedRow (const void *pInStartAddress1, const void *pInStartAddress2, ULWord &outFirstChangedRowNum) const |
Compares two buffers line-by-line (using my description of the buffer contents). More... | |
bool | GetChangedLines (NTV2RasterLineOffsets &outDiffs, const void *pInBuffer1, const void *pInBuffer2, const ULWord inMaxLines=0) const |
Compares two buffers line-by-line (using my description of the buffer contents). More... | |
NTV2FrameDimensions | GetFullRasterDimensions (void) const |
NTV2FrameDimensions | GetVisibleRasterDimensions (void) const |
bool | GetSMPTELineNumber (const ULWord inLineOffset, ULWord &outSMPTELine, bool &outIsField2) const |
Answers with the equivalent SMPTE line number for the given line offset into the frame buffer I describe. More... | |
bool | GetLineOffsetFromSMPTELine (const ULWord inSMPTELine, ULWord &outLineOffset) const |
Answers with the equivalent line offset into the raster I describe for the given SMPTE line number. More... | |
NTV2SegmentedXferInfo & | GetSegmentedXferInfo (NTV2SegmentedXferInfo &inSegmentInfo, const bool inIsSource=true) const |
Sets the given NTV2SegmentedXferInfo to match my raster, as a source or destination. More... | |
bool | operator== (const NTV2FormatDescriptor &inRHS) const |
std::ostream & | Print (std::ostream &inOutStream, const bool inDetailed=true) const |
Writes a human-readable description of me into the given output stream. More... | |
std::ostream & | PrintSMPTELineNumber (std::ostream &inOutStream, const ULWord inLineOffset, const bool inForTextMode=false) const |
Writes the given frame buffer line offset as a formatted SMPTE line number into the given output stream. More... | |
bool | Is2KFormat (void) const |
Public Attributes | |
ULWord | numLines |
Height – total number of lines. More... | |
ULWord | numPixels |
Width – total number of pixels per line. More... | |
ULWord | linePitch |
Number of 32-bit words per line – shadows mLinePitch[0] / sizeof(ULWord) More... | |
ULWord | firstActiveLine |
First active line of video (0 if NTV2_VANCMODE_OFF) More... | |
Friends | |
class | CNTV2CaptionRenderer |
Describes a video frame for a given video standard or format and pixel format, including the total number of lines, number of pixels per line, line pitch, and which line contains the start of active video.
Definition at line 41 of file ntv2formatdescriptor.h.
|
explicit |
My default constructor initializes me in an "invalid" state.
My default constructor
Definition at line 903 of file ntv2formatdescriptor.cpp.
|
explicit |
Construct from line and pixel count, plus line pitch.
[in] | inNumLines | Specifies the total number of lines. |
[in] | inNumPixels | Specifies the total number of pixels. |
[in] | inLinePitch | Specifies the line pitch as the number of 32-bit words per line. |
[in] | in1stActiveLine | Optionally specifies the first active line of video, where zero is the first (top) line. Defaults to zero. |
[in] | inNumLumaBits | Optionally specifies the number of luma bits. Defaults to zero. |
[in] | inNumChromaBits | Optionally specifies the number of chroma bits. Defaults to zero. |
[in] | inNumAlphaBits | Optionally specifies the number of alpha bits. Defaults to zero. |
Definition at line 909 of file ntv2formatdescriptor.cpp.
|
explicit |
Constructs me from the given video standard, pixel format, and VANC settings.
[in] | inStandard | Specifies the video standard being used. |
[in] | inFrameBufferFormat | Specifies the pixel format of the frame buffer. |
[in] | inVancMode | Specifies the VANC mode. Defaults to OFF. |
Definition at line 651 of file ntv2formatdescriptor.cpp.
|
explicit |
Constructs me from the given video format, pixel format and VANC settings.
[in] | inVideoFormat | Specifies the video format being used. |
[in] | inFrameBufferFormat | Specifies the pixel format of the frame buffer. |
[in] | inVancMode | Specifies the VANC mode. |
Definition at line 756 of file ntv2formatdescriptor.cpp.
|
explicit |
Constructs me from the given video format, pixel format and VANC settings.
[in] | inRasterSize | Specifies the raster dimensions. |
[in] | inPixelFormat | Specifies the pixel format of the frame buffer. |
[in] | inVancMode | Specifies the VANC mode. If NTV2_VANCMODE_TALL or NTV2_VANCMODE_TALLER, "inRasterSize" must match a "tall" or "taller" NTV2FrameGeometry. |
Definition at line 811 of file ntv2formatdescriptor.cpp.
[in] | inByteOffset | The offset, in bytes, to the byte of interest in the frame. |
Definition at line 1020 of file ntv2formatdescriptor.cpp.
[in] | inByteOffset | The offset, in bytes, to the byte of interest in the raster buffer. |
Definition at line 1037 of file ntv2formatdescriptor.cpp.
[in] | inPlaneIndex0 | Specifies the plane of interest. Defaults to zero. |
Definition at line 158 of file ntv2formatdescriptor.h.
bool NTV2FormatDescriptor::GetChangedLines | ( | NTV2RasterLineOffsets & | outDiffs, |
const void * | pInBuffer1, | ||
const void * | pInBuffer2, | ||
const ULWord | inMaxLines = 0 |
||
) | const |
Compares two buffers line-by-line (using my description of the buffer contents).
[out] | outDiffs | Receives the ordered sequence of line offsets of the lines that differed. This will be empty if the two buffers are identical (or if an error occurs). |
[in] | pInBuffer1 | Specifies the non-NULL address of the first memory buffer whose contents are to be compared. |
[in] | pInBuffer2 | Specifies the non-NULL address of the second memory buffer whose contents are to be compared. |
[in] | inMaxLines | Optionally specifies the maximum number of lines to compare. If zero, all lines are compared. Defaults to zero (all lines). |
Definition at line 1173 of file ntv2formatdescriptor.cpp.
|
inline |
Definition at line 198 of file ntv2formatdescriptor.h.
bool NTV2FormatDescriptor::GetFirstChangedRow | ( | const void * | pInStartAddress1, |
const void * | pInStartAddress2, | ||
ULWord & | outFirstChangedRowNum | ||
) | const |
Compares two buffers line-by-line (using my description of the buffer contents).
[in] | pInStartAddress1 | A valid, non-NULL pointer to the start of the first raster buffer. |
[in] | pInStartAddress2 | A valid, non-NULL pointer to the start of the second raster buffer. |
[out] | outFirstChangedRowNum | Receives the zero-based row number of the first row that's different, or 0xFFFFFFFF if identical. |
Definition at line 1149 of file ntv2formatdescriptor.cpp.
NTV2FrameDimensions NTV2FormatDescriptor::GetFullRasterDimensions | ( | void | ) | const |
Definition at line 1353 of file ntv2formatdescriptor.cpp.
|
inline |
Definition at line 193 of file ntv2formatdescriptor.h.
bool NTV2FormatDescriptor::GetLineOffsetFromSMPTELine | ( | const ULWord | inSMPTELine, |
ULWord & | outLineOffset | ||
) | const |
Answers with the equivalent line offset into the raster I describe for the given SMPTE line number.
[in] | inSMPTELine | Specifies the SMPTE line number. |
[out] | outLineOffset | Receives the zero-based line offset into the raster I describe. |
Definition at line 1295 of file ntv2formatdescriptor.cpp.
[in] | inVisibleOnly | Specify true to return just the visible height; otherwise false (the default) to return the full height. |
Definition at line 188 of file ntv2formatdescriptor.h.
const void * NTV2FormatDescriptor::GetRowAddress | ( | const void * | pInStartAddress, |
const ULWord | inRowIndex0, | ||
const UWord | inPlaneIndex0 = 0 |
||
) | const |
[in] | pInStartAddress | A pointer to the raster buffer. |
[in] | inRowIndex0 | Specifies the row of interest in the buffer, where zero is the topmost row. |
[in] | inPlaneIndex0 | Specifies the plane of interest. Defaults to zero. |
Definition at line 1092 of file ntv2formatdescriptor.cpp.
bool NTV2FormatDescriptor::GetRowBuffer | ( | const NTV2Buffer & | inFrameBuffer, |
NTV2Buffer & | inOutRowBuffer, | ||
const ULWord | inRowIndex0, | ||
const UWord | inPlaneIndex0 = 0 |
||
) | const |
Answers with an NTV2Buffer that describes the given row (and plane) given the NTV2Buffer that describes the frame buffer.
[in] | inFrameBuffer | Specifies the frame buffer (that includes all planes, if planar). |
inOutRowBuffer | Receives the NTV2Buffer that references the row (and plane) in the frame buffer. | |
[in] | inRowIndex0 | Specifies the row of interest in the buffer, where zero is the topmost row. |
[in] | inPlaneIndex0 | Optionally specifies the plane of interest. Defaults to zero. |
Definition at line 1066 of file ntv2formatdescriptor.cpp.
NTV2SegmentedXferInfo & NTV2FormatDescriptor::GetSegmentedXferInfo | ( | NTV2SegmentedXferInfo & | inSegmentInfo, |
const bool | inIsSource = true |
||
) | const |
Sets the given NTV2SegmentedXferInfo to match my raster, as a source or destination.
inSegmentInfo | Specifies the segmented transfer object to modify. | |
[in] | inIsSource | Specify 'true' (the default) to set the "source" aspect of the transfer info object; otherwise 'false' to set the "destination" aspect of it. |
Definition at line 1364 of file ntv2formatdescriptor.cpp.
bool NTV2FormatDescriptor::GetSMPTELineNumber | ( | const ULWord | inLineOffset, |
ULWord & | outSMPTELine, | ||
bool & | outIsField2 | ||
) | const |
Answers with the equivalent SMPTE line number for the given line offset into the frame buffer I describe.
[in] | inLineOffset | Specifies the zero-based line offset into the frame buffer that I describe. |
[out] | outSMPTELine | Receives the equivalent SMPTE line number. |
[out] | outIsField2 | Receives true if the line number is associated with Field 2 (interlaced only); otherwise false. |
Definition at line 1263 of file ntv2formatdescriptor.cpp.
[in] | pInStartAddress | A pointer to the raster buffer. |
Definition at line 248 of file ntv2formatdescriptor.h.
ULWord NTV2FormatDescriptor::GetTotalBytes | ( | void | ) | const |
Definition at line 946 of file ntv2formatdescriptor.cpp.
[in] | inPlaneIndex0 | Specifies the plane of interest. Defaults to zero. |
Definition at line 132 of file ntv2formatdescriptor.h.
[in] | inPlaneIndex0 | Specifies the plane of interest. Defaults to zero. |
Definition at line 976 of file ntv2formatdescriptor.cpp.
[in] | inPageSize | Optionally specifies the page size to use. Defaults to 4096 (4K) bytes. |
Definition at line 957 of file ntv2formatdescriptor.cpp.
[in] | inPlaneIndex0 | Specifies the plane of interest. Defaults to zero, the first plane. |
Definition at line 152 of file ntv2formatdescriptor.h.
NTV2FrameDimensions NTV2FormatDescriptor::GetVisibleRasterDimensions | ( | void | ) | const |
Definition at line 1358 of file ntv2formatdescriptor.cpp.
|
inline |
Definition at line 203 of file ntv2formatdescriptor.h.
void * NTV2FormatDescriptor::GetWriteableRowAddress | ( | void * | pInStartAddress, |
const ULWord | inRowIndex0, | ||
const UWord | inPlaneIndex0 = 0 |
||
) | const |
[in] | pInStartAddress | A non-const pointer to the raster buffer. |
[in] | inRowIndex0 | Specifies the row of interest in the buffer, where zero is the topmost row. |
[in] | inPlaneIndex0 | Specifies the plane of interest. Defaults to zero. |
Definition at line 1113 of file ntv2formatdescriptor.cpp.
bool NTV2FormatDescriptor::Is2KFormat | ( | void | ) | const |
Definition at line 993 of file ntv2formatdescriptor.cpp.
bool NTV2FormatDescriptor::IsAtLineStart | ( | ULWord | inByteOffset | ) | const |
[in] | inByteOffset | The offset, in bytes, to the byte of interest in the frame. |
Definition at line 1052 of file ntv2formatdescriptor.cpp.
|
inline |
Definition at line 112 of file ntv2formatdescriptor.h.
void NTV2FormatDescriptor::MakeInvalid | ( | void | ) |
Resets me into an invalid (NULL) state.
Definition at line 930 of file ntv2formatdescriptor.cpp.
bool NTV2FormatDescriptor::operator== | ( | const NTV2FormatDescriptor & | inRHS | ) | const |
[in] | inRHS | The right-hand-side operand that I'll be compared with. |
Definition at line 1003 of file ntv2formatdescriptor.cpp.
string NTV2FormatDescriptor::PlaneToString | ( | const UWord | inPlaneIndex0 | ) | const |
Definition at line 1011 of file ntv2formatdescriptor.cpp.
ostream & NTV2FormatDescriptor::Print | ( | std::ostream & | inOutStream, |
const bool | inDetailed = true |
||
) | const |
Writes a human-readable description of me into the given output stream.
inOutStream | The output stream to be written into. | |
[in] | inDetailed | If true (the default), writes a detailed description; otherwise writes a brief one. |
Definition at line 1203 of file ntv2formatdescriptor.cpp.
ostream & NTV2FormatDescriptor::PrintSMPTELineNumber | ( | std::ostream & | inOutStream, |
const ULWord | inLineOffset, | ||
const bool | inForTextMode = false |
||
) | const |
Writes the given frame buffer line offset as a formatted SMPTE line number into the given output stream.
inOutStream | The output stream to be written into. | |
[in] | inLineOffset | Specifies the zero-based line offset in the frame buffer. |
[in] | inForTextMode | Defaults to false. If true, omits the space between the field indicator and the line number, and adds leading zeroes to line number. |
Definition at line 1337 of file ntv2formatdescriptor.cpp.
ULWord NTV2FormatDescriptor::RasterLineToByteOffset | ( | const ULWord | inRowIndex0, |
const UWord | inPlaneIndex0 = 0 |
||
) | const |
[in] | inRowIndex0 | Specifies the row of interest in the buffer, where zero is the topmost row. |
[in] | inPlaneIndex0 | Specifies the plane of interest. Defaults to zero. |
Definition at line 1131 of file ntv2formatdescriptor.cpp.
|
friend |
Definition at line 359 of file ntv2formatdescriptor.h.
ULWord NTV2FormatDescriptor::firstActiveLine |
First active line of video (0 if NTV2_VANCMODE_OFF)
Definition at line 369 of file ntv2formatdescriptor.h.
ULWord NTV2FormatDescriptor::linePitch |
Number of 32-bit words per line – shadows mLinePitch[0] / sizeof(ULWord)
Definition at line 368 of file ntv2formatdescriptor.h.
ULWord NTV2FormatDescriptor::numLines |
Height – total number of lines.
Definition at line 366 of file ntv2formatdescriptor.h.
ULWord NTV2FormatDescriptor::numPixels |
Width – total number of pixels per line.
Definition at line 367 of file ntv2formatdescriptor.h.