AJA NTV2 SDK  17.5.0.1242
NTV2 SDK 17.5.0.1242
NTV2TestPatternGen Class Reference

The NTV2 test pattern generator. More...

#include <ntv2testpatterngen.h>

Public Member Functions

Constructors & Destructors
 NTV2TestPatternGen ()
 
virtual ~NTV2TestPatternGen ()
 
Drawing Methods
virtual bool DrawTestPattern (const std::string &inTPName, const NTV2FormatDescriptor &inFormatDesc, NTV2Buffer &inBuffer)
 Renders the given test pattern or color into a host raster buffer. More...
 
virtual bool DrawTestPattern (const NTV2TestPatternSelect inPattern, const NTV2FormatDescriptor &inFormatDesc, NTV2Buffer &inBuffer)
 Renders the given test pattern into a host raster buffer. More...
 
virtual bool DrawTestPattern (const NTV2TestPatternID tp, const NTV2FormatDesc &fd, NTV2TestPatBuffer &buf)
 
virtual bool DrawTestPattern (const NTV2TestPatternID tp, const uint32_t w, const uint32_t h, const NTV2PixelFormat pf, NTV2TestPatBuffer &buf)
 
Getters
bool getUseRGBSmpteRange (void) const
 
NTV2SignalMask getSignalMask (void) const
 
const double & getSliderValue (void) const
 
bool getAlphaFromLuma (void) const
 
Setters
NTV2TestPatternGensetUseRGBSmpteRange (const bool useRGBSmpteRange)
 
NTV2TestPatternGensetSignalMask (const NTV2SignalMask signalMask)
 
NTV2TestPatternGensetSliderValue (const double &sliderValue)
 
NTV2TestPatternGensetAlphaFromLuma (const bool alphaFromLuma)
 
NTV2TestPatternGensetVANCToLegalBlack (const bool inClearVANC)
 Changes my "clear VANC lines to legal black" setting. More...
 

Static Public Member Functions

Class Methods
static bool canDrawTestPattern (const NTV2TestPatternSelect inPattern, const NTV2FormatDescriptor &inDesc)
 
static NTV2TestPatternNames getTestPatternNames (void)
 
static NTV2StringList getColorNames (void)
 
static NTV2TestPatternSelect findTestPatternByName (const std::string &inName)
 
static ULWord findRGBColorByName (const std::string &inName)
 

Protected Member Functions

virtual bool DrawSegmentedTestPattern ()
 
virtual bool DrawYCbCrFrame (uint16_t Y, uint16_t Cb, uint16_t Cr)
 
virtual bool DrawBorderFrame ()
 
virtual bool DrawLinearRampFrame ()
 
virtual bool DrawSlantRampFrame ()
 
virtual bool DrawZonePlateFrame ()
 
virtual bool DrawQuadrantBorderFrame ()
 
virtual bool DrawColorQuadrantFrame ()
 
virtual bool DrawColorQuadrantFrameTsi ()
 
virtual bool DrawColorQuadrantFrameTsi2 ()
 
virtual bool DrawTestPatternNarrowHLG ()
 
virtual bool DrawTestPatternNarrowPQ ()
 
virtual bool DrawTestPatternWidePQ ()
 
virtual bool Draw12BitRamp ()
 
virtual bool Draw12BitZonePlate ()
 
virtual void PrepareForOutput ()
 
bool IsSDStandard (void) const
 
bool GetStandard (int &outStandard, bool &outIs4K, bool &outIs8K) const
 
virtual bool drawIt (void)
 

Protected Attributes

NTV2TestPatternID mPatternID
 Pattern number. More...
 
NTV2PixelFormat mDstPixelFormat
 Dest pixel format. More...
 
uint32_t mDstFrameWidth
 Dest width (pixels) More...
 
uint32_t mDstFrameHeight
 Dest height (lines) More...
 
uint32_t mDstLinePitch
 Dest bytes per row. More...
 
uint32_t mSrcLinePitch
 Src bytes per row. More...
 
uint32_t mDstBufferSize
 Dest visible buffer size (bytes) More...
 
uint8_t * mpDstBuffer
 Dest buffer (start of active video) More...
 
uint32_t * mpPackedLineBuffer
 
uint16_t * mpUnpackedLineBuffer
 
bool mSetRGBSmpteRange
 
bool mSetAlphaFromLuma
 
bool mSetDstVancBlack
 Set destination VANC lines to legal black? More...
 
double mSliderValue
 Used for Zone Plate. More...
 
NTV2SignalMask mSignalMask
 Component mask for MultiBurst, LineSweep. More...
 
uint32_t mNumPixels
 
uint32_t mNumLines
 
uint32_t mBitsPerComponent
 
uint32_t mSamplesPerPixel
 
uint16_t mCompressionType
 
uint32_t mDataOffset
 
uint32_t mDataSize
 
std::vector< char > mData
 
std::vector< uint16_t > mUnPackedRAWBuffer
 
std::vector< uint16_t > mRGBBuffer
 

Detailed Description

The NTV2 test pattern generator.

Bug:
NTV2TestPatternGen doesn't work for planar formats.

Definition at line 69 of file ntv2testpatterngen.h.

Constructor & Destructor Documentation

◆ NTV2TestPatternGen()

NTV2TestPatternGen::NTV2TestPatternGen ( )

Definition at line 2588 of file ntv2testpatterngen.cpp.

◆ ~NTV2TestPatternGen()

virtual NTV2TestPatternGen::~NTV2TestPatternGen ( )
inlinevirtual

Definition at line 124 of file ntv2testpatterngen.h.

Member Function Documentation

◆ canDrawTestPattern()

bool NTV2TestPatternGen::canDrawTestPattern ( const NTV2TestPatternSelect  inPattern,
const NTV2FormatDescriptor inDesc 
)
static
Parameters
[in]inPatternSpecifies the test pattern of interest.
[in]inDescSpecifies a description of the raster being used.
Returns
True, if the given test pattern can be drawn for the given raster description.

Definition at line 2286 of file ntv2testpatterngen.cpp.

◆ Draw12BitRamp()

bool NTV2TestPatternGen::Draw12BitRamp ( )
protectedvirtual

Definition at line 4060 of file ntv2testpatterngen.cpp.

◆ Draw12BitZonePlate()

bool NTV2TestPatternGen::Draw12BitZonePlate ( )
protectedvirtual

Definition at line 4093 of file ntv2testpatterngen.cpp.

◆ DrawBorderFrame()

bool NTV2TestPatternGen::DrawBorderFrame ( )
protectedvirtual

Definition at line 3051 of file ntv2testpatterngen.cpp.

◆ DrawColorQuadrantFrame()

bool NTV2TestPatternGen::DrawColorQuadrantFrame ( )
protectedvirtual

Definition at line 3143 of file ntv2testpatterngen.cpp.

◆ DrawColorQuadrantFrameTsi()

bool NTV2TestPatternGen::DrawColorQuadrantFrameTsi ( )
protectedvirtual

Definition at line 3300 of file ntv2testpatterngen.cpp.

◆ DrawColorQuadrantFrameTsi2()

bool NTV2TestPatternGen::DrawColorQuadrantFrameTsi2 ( )
protectedvirtual

Definition at line 3387 of file ntv2testpatterngen.cpp.

◆ drawIt()

bool NTV2TestPatternGen::drawIt ( void  )
protectedvirtual

Definition at line 2617 of file ntv2testpatterngen.cpp.

◆ DrawLinearRampFrame()

bool NTV2TestPatternGen::DrawLinearRampFrame ( )
protectedvirtual

Definition at line 3005 of file ntv2testpatterngen.cpp.

◆ DrawQuadrantBorderFrame()

bool NTV2TestPatternGen::DrawQuadrantBorderFrame ( )
protectedvirtual

Definition at line 3204 of file ntv2testpatterngen.cpp.

◆ DrawSegmentedTestPattern()

bool NTV2TestPatternGen::DrawSegmentedTestPattern ( )
protectedvirtual

Definition at line 2872 of file ntv2testpatterngen.cpp.

◆ DrawSlantRampFrame()

bool NTV2TestPatternGen::DrawSlantRampFrame ( )
protectedvirtual

Definition at line 3029 of file ntv2testpatterngen.cpp.

◆ DrawTestPattern() [1/4]

bool NTV2TestPatternGen::DrawTestPattern ( const NTV2TestPatternID  tp,
const NTV2FormatDesc fd,
NTV2TestPatBuffer buf 
)
virtual
Deprecated:
Use the DrawTestPattern method that requires an NTV2Buffer to specify the buffer to fill.

Definition at line 2669 of file ntv2testpatterngen.cpp.

◆ DrawTestPattern() [2/4]

bool NTV2TestPatternGen::DrawTestPattern ( const NTV2TestPatternID  tp,
const uint32_t  w,
const uint32_t  h,
const NTV2PixelFormat  pf,
NTV2TestPatBuffer buf 
)
virtual
Deprecated:
Use the DrawTestPattern method that requires an NTV2Buffer to specify the buffer to fill.

Definition at line 2679 of file ntv2testpatterngen.cpp.

◆ DrawTestPattern() [3/4]

bool NTV2TestPatternGen::DrawTestPattern ( const NTV2TestPatternSelect  inPattern,
const NTV2FormatDescriptor inFormatDesc,
NTV2Buffer inBuffer 
)
virtual

Renders the given test pattern into a host raster buffer.

Parameters
[in]inPatternSpecifies the test pattern to be drawn.
[in]inFormatDescDescribes the raster memory.
inBufferSpecifies the host memory buffer to be written.
Note
If the format descriptor describes a "tall" or "taller" (VANC) geometry, the first byte in the specified buffer is presumed to be the start of the VANC region.
If my mSetDstVancBlack member is true, the buffer's VANC region will also be cleared to legal black.
Returns
True if successful; otherwise false.
Bug:
Needs planar pixel format implementations.

Definition at line 2726 of file ntv2testpatterngen.cpp.

◆ DrawTestPattern() [4/4]

virtual bool NTV2TestPatternGen::DrawTestPattern ( const std::string &  inTPName,
const NTV2FormatDescriptor inFormatDesc,
NTV2Buffer inBuffer 
)
virtual

Renders the given test pattern or color into a host raster buffer.

Parameters
[in]inTPNameSpecifies the name of the test pattern or web color to be drawn.
[in]inFormatDescDescribes the raster memory.
inBufferSpecifies the host memory buffer to be written.
Note
If the format descriptor describes a "tall" or "taller" (VANC) raster geometry, the first byte in the specified buffer is presumed to be the start of the VANC region.
If my mSetDstVancBlack member is true, the buffer's VANC region will also be cleared to legal black.
Returns
True if successful; otherwise false.
Bug:
Needs planar pixel format implementations.

◆ DrawTestPatternNarrowHLG()

bool NTV2TestPatternGen::DrawTestPatternNarrowHLG ( )
protectedvirtual

Definition at line 3723 of file ntv2testpatterngen.cpp.

◆ DrawTestPatternNarrowPQ()

bool NTV2TestPatternGen::DrawTestPatternNarrowPQ ( )
protectedvirtual

Definition at line 3835 of file ntv2testpatterngen.cpp.

◆ DrawTestPatternWidePQ()

bool NTV2TestPatternGen::DrawTestPatternWidePQ ( )
protectedvirtual

Definition at line 3946 of file ntv2testpatterngen.cpp.

◆ DrawYCbCrFrame()

bool NTV2TestPatternGen::DrawYCbCrFrame ( uint16_t  Y,
uint16_t  Cb,
uint16_t  Cr 
)
protectedvirtual

Definition at line 2990 of file ntv2testpatterngen.cpp.

◆ DrawZonePlateFrame()

bool NTV2TestPatternGen::DrawZonePlateFrame ( )
protectedvirtual

Definition at line 3119 of file ntv2testpatterngen.cpp.

◆ findRGBColorByName()

ULWord NTV2TestPatternGen::findRGBColorByName ( const std::string &  inName)
static
Returns
The flat-field RGB "web color" value that corresponds to the given name. The highest-order byte in the 32-bit result is 0x00; the next-lower byte is the Red value (0-255); the next-lower byte is the Green value (0-255); the lowest-order byte is the Blue value (0-255). A zero return value means "not found".
Parameters
[in]inNameSpecifies the "web color" name. The search is done case-insensitively.
Note
"Black" and "White" are not returned, as these are available as ordinary test patterns NTV2_TestPatt_Black and NTV2_TestPatt_White, respectively.
Bug:
As currently implemented and documented, this function only returns 8-bit deep color values.

Definition at line 2577 of file ntv2testpatterngen.cpp.

◆ findTestPatternByName()

NTV2TestPatternSelect NTV2TestPatternGen::findTestPatternByName ( const std::string &  inName)
static
Returns
The test pattern that corresponds to the given name.
Parameters
[in]inNameSpecifies the test pattern name. The search is done case-insensitively.

Definition at line 2568 of file ntv2testpatterngen.cpp.

◆ getAlphaFromLuma()

bool NTV2TestPatternGen::getAlphaFromLuma ( void  ) const
inline

Definition at line 181 of file ntv2testpatterngen.h.

◆ getColorNames()

NTV2StringList NTV2TestPatternGen::getColorNames ( void  )
static
Returns
An ordered collection of strings containing the names of all available flat-field "web colors".

Definition at line 2552 of file ntv2testpatterngen.cpp.

◆ getSignalMask()

NTV2SignalMask NTV2TestPatternGen::getSignalMask ( void  ) const
inline

Definition at line 179 of file ntv2testpatterngen.h.

◆ getSliderValue()

const double& NTV2TestPatternGen::getSliderValue ( void  ) const
inline

Definition at line 180 of file ntv2testpatterngen.h.

◆ GetStandard()

bool NTV2TestPatternGen::GetStandard ( int &  outStandard,
bool &  outIs4K,
bool &  outIs8K 
) const
protected

Definition at line 3554 of file ntv2testpatterngen.cpp.

◆ getTestPatternNames()

NTV2TestPatternNames NTV2TestPatternGen::getTestPatternNames ( void  )
static
Returns
An ordered collection of strings containing the names of all available test patterns.

Definition at line 2542 of file ntv2testpatterngen.cpp.

◆ getUseRGBSmpteRange()

bool NTV2TestPatternGen::getUseRGBSmpteRange ( void  ) const
inline

Definition at line 178 of file ntv2testpatterngen.h.

◆ IsSDStandard()

bool NTV2TestPatternGen::IsSDStandard ( void  ) const
protected

Definition at line 3595 of file ntv2testpatterngen.cpp.

◆ PrepareForOutput()

void NTV2TestPatternGen::PrepareForOutput ( )
protectedvirtual

Definition at line 3668 of file ntv2testpatterngen.cpp.

◆ setAlphaFromLuma()

NTV2TestPatternGen& NTV2TestPatternGen::setAlphaFromLuma ( const bool  alphaFromLuma)
inline

Definition at line 192 of file ntv2testpatterngen.h.

◆ setSignalMask()

NTV2TestPatternGen& NTV2TestPatternGen::setSignalMask ( const NTV2SignalMask  signalMask)
inline

Definition at line 190 of file ntv2testpatterngen.h.

◆ setSliderValue()

NTV2TestPatternGen& NTV2TestPatternGen::setSliderValue ( const double &  sliderValue)
inline

Definition at line 191 of file ntv2testpatterngen.h.

◆ setUseRGBSmpteRange()

NTV2TestPatternGen& NTV2TestPatternGen::setUseRGBSmpteRange ( const bool  useRGBSmpteRange)
inline

Definition at line 189 of file ntv2testpatterngen.h.

◆ setVANCToLegalBlack()

NTV2TestPatternGen& NTV2TestPatternGen::setVANCToLegalBlack ( const bool  inClearVANC)
inline

Changes my "clear VANC lines to legal black" setting.

Parameters
[in]inClearVANCSpecify true to have my DrawTestPattern method automatically clear the VANC region (if any) to legal black.
Returns
A non-constant reference to me.

Definition at line 198 of file ntv2testpatterngen.h.

Member Data Documentation

◆ mBitsPerComponent

uint32_t NTV2TestPatternGen::mBitsPerComponent
protected

Definition at line 247 of file ntv2testpatterngen.h.

◆ mCompressionType

uint16_t NTV2TestPatternGen::mCompressionType
protected

Definition at line 249 of file ntv2testpatterngen.h.

◆ mData

std::vector<char> NTV2TestPatternGen::mData
protected

Definition at line 252 of file ntv2testpatterngen.h.

◆ mDataOffset

uint32_t NTV2TestPatternGen::mDataOffset
protected

Definition at line 250 of file ntv2testpatterngen.h.

◆ mDataSize

uint32_t NTV2TestPatternGen::mDataSize
protected

Definition at line 251 of file ntv2testpatterngen.h.

◆ mDstBufferSize

uint32_t NTV2TestPatternGen::mDstBufferSize
protected

Dest visible buffer size (bytes)

Definition at line 235 of file ntv2testpatterngen.h.

◆ mDstFrameHeight

uint32_t NTV2TestPatternGen::mDstFrameHeight
protected

Dest height (lines)

Definition at line 232 of file ntv2testpatterngen.h.

◆ mDstFrameWidth

uint32_t NTV2TestPatternGen::mDstFrameWidth
protected

Dest width (pixels)

Definition at line 231 of file ntv2testpatterngen.h.

◆ mDstLinePitch

uint32_t NTV2TestPatternGen::mDstLinePitch
protected

Dest bytes per row.

Definition at line 233 of file ntv2testpatterngen.h.

◆ mDstPixelFormat

NTV2PixelFormat NTV2TestPatternGen::mDstPixelFormat
protected

Dest pixel format.

Definition at line 230 of file ntv2testpatterngen.h.

◆ mNumLines

uint32_t NTV2TestPatternGen::mNumLines
protected

Definition at line 246 of file ntv2testpatterngen.h.

◆ mNumPixels

uint32_t NTV2TestPatternGen::mNumPixels
protected

Definition at line 245 of file ntv2testpatterngen.h.

◆ mPatternID

NTV2TestPatternID NTV2TestPatternGen::mPatternID
protected

Pattern number.

Definition at line 228 of file ntv2testpatterngen.h.

◆ mpDstBuffer

uint8_t* NTV2TestPatternGen::mpDstBuffer
protected

Dest buffer (start of active video)

Definition at line 236 of file ntv2testpatterngen.h.

◆ mpPackedLineBuffer

uint32_t* NTV2TestPatternGen::mpPackedLineBuffer
protected

Definition at line 237 of file ntv2testpatterngen.h.

◆ mpUnpackedLineBuffer

uint16_t* NTV2TestPatternGen::mpUnpackedLineBuffer
protected

Definition at line 238 of file ntv2testpatterngen.h.

◆ mRGBBuffer

std::vector<uint16_t> NTV2TestPatternGen::mRGBBuffer
protected

Definition at line 254 of file ntv2testpatterngen.h.

◆ mSamplesPerPixel

uint32_t NTV2TestPatternGen::mSamplesPerPixel
protected

Definition at line 248 of file ntv2testpatterngen.h.

◆ mSetAlphaFromLuma

bool NTV2TestPatternGen::mSetAlphaFromLuma
protected

Definition at line 240 of file ntv2testpatterngen.h.

◆ mSetDstVancBlack

bool NTV2TestPatternGen::mSetDstVancBlack
protected

Set destination VANC lines to legal black?

Definition at line 241 of file ntv2testpatterngen.h.

◆ mSetRGBSmpteRange

bool NTV2TestPatternGen::mSetRGBSmpteRange
protected

Definition at line 239 of file ntv2testpatterngen.h.

◆ mSignalMask

NTV2SignalMask NTV2TestPatternGen::mSignalMask
protected

Component mask for MultiBurst, LineSweep.

Definition at line 243 of file ntv2testpatterngen.h.

◆ mSliderValue

double NTV2TestPatternGen::mSliderValue
protected

Used for Zone Plate.

Definition at line 242 of file ntv2testpatterngen.h.

◆ mSrcLinePitch

uint32_t NTV2TestPatternGen::mSrcLinePitch
protected

Src bytes per row.

Definition at line 234 of file ntv2testpatterngen.h.

◆ mUnPackedRAWBuffer

std::vector<uint16_t> NTV2TestPatternGen::mUnPackedRAWBuffer
protected

Definition at line 253 of file ntv2testpatterngen.h.


The documentation for this class was generated from the following files: