AJA NTV2 SDK  18.1.0.2439
NTV2 SDK 18.1.0.2439
NTV2ACFrameRange Class Reference

A helper class used in CNTV2Card::AutoCirculateInitForInput and CNTV2Card::AutoCirculateInitForOutput that makes it easier to specify an AutoCirculate Frame Range, either as a simple frame count (to lazily allow CNTV2Card::FindUnallocatedFrames to determine the actual frame range to use), or an explicit frame range. More...

#include <ntv2utils.h>

Public Member Functions

 NTV2ACFrameRange (const UWord inFrameCount=0)
 Constructs me from a simple frame count. More...
 
 NTV2ACFrameRange (const UWord inFirstFrame, const UWord inLastFrame)
 Constructs me from an explicit frame range. More...
 
bool isCountOnly (void) const
 
bool isFrameRange (void) const
 
UWord count (void) const
 
UWord firstFrame (void) const
 
UWord lastFrame (void) const
 
 operator bool () const
 
bool valid (void) const
 
NTV2ACFrameRange & makeInvalid (void)
 Invalidates me. More...
 
bool setExactRange (const UWord inFirstFrame, const UWord inLastFrame)
 Sets me to the given explicit frame range values. More...
 
bool setRangeWithCount (const UWord inCount, const UWord inFirstFrame)
 Sets me to an explicit frame range specified by a frame count and a starting frame index. More...
 
bool setCountOnly (const UWord inCount)
 Sets me to a simple frame count. More...
 
std::string setFromString (const std::string &inStr)
 Resets me from the given character string that should contain a human-readable frame range. More...
 
std::string toString (const bool inNormalized=false) const
 Converts me into a character string. More...
 

Detailed Description

A helper class used in CNTV2Card::AutoCirculateInitForInput and CNTV2Card::AutoCirculateInitForOutput that makes it easier to specify an AutoCirculate Frame Range, either as a simple frame count (to lazily allow CNTV2Card::FindUnallocatedFrames to determine the actual frame range to use), or an explicit frame range.

Definition at line 972 of file ntv2utils.h.

Constructor & Destructor Documentation

◆ NTV2ACFrameRange() [1/2]

NTV2ACFrameRange::NTV2ACFrameRange ( const UWord  inFrameCount = 0)
inlineexplicit

Constructs me from a simple frame count.

Parameters
[in]inFrameCountSpecifies a frame count. This value should be at least 1.
Warning
AJA generally does not recommended using "lazy" AutoCirculate buffer allocation/specification in production code.

Definition at line 980 of file ntv2utils.h.

◆ NTV2ACFrameRange() [2/2]

NTV2ACFrameRange::NTV2ACFrameRange ( const UWord  inFirstFrame,
const UWord  inLastFrame 
)
inlineexplicit

Constructs me from an explicit frame range.

Parameters
[in]inFirstFrameSpecifies the starting frame index number. This value should be less than inLastFrame.
[in]inLastFrameSpecifies the ending frame index number. This value should be greater than inFirstFrame.

Definition at line 990 of file ntv2utils.h.

Member Function Documentation

◆ count()

UWord NTV2ACFrameRange::count ( void  ) const
inline
Returns
my frame count (valid only if I'm a simple frame count); otherwise zero

Definition at line 997 of file ntv2utils.h.

◆ firstFrame()

UWord NTV2ACFrameRange::firstFrame ( void  ) const
inline
Returns
my first frame index number (if explicit frame range); otherwise zero

Definition at line 998 of file ntv2utils.h.

◆ isCountOnly()

bool NTV2ACFrameRange::isCountOnly ( void  ) const
inline
Returns
true if I'm a simple frame count; otherwise I'm an explicit frame range.

Definition at line 995 of file ntv2utils.h.

◆ isFrameRange()

bool NTV2ACFrameRange::isFrameRange ( void  ) const
inline
Returns
true if I'm a specific frame range; otherwise I'm a simple frame count.

Definition at line 996 of file ntv2utils.h.

◆ lastFrame()

UWord NTV2ACFrameRange::lastFrame ( void  ) const
inline
Returns
my last frame index number (if explicit frame range); otherwise zero

Definition at line 999 of file ntv2utils.h.

◆ makeInvalid()

NTV2ACFrameRange& NTV2ACFrameRange::makeInvalid ( void  )
inline

Invalidates me.

Definition at line 1015 of file ntv2utils.h.

◆ operator bool()

NTV2ACFrameRange::operator bool ( ) const
inline
Returns
true if valid; otherwise false

Definition at line 1000 of file ntv2utils.h.

◆ setCountOnly()

bool NTV2ACFrameRange::setCountOnly ( const UWord  inCount)
inline

Sets me to a simple frame count.

Parameters
[in]inCountSpecifies my frame count. This value should be at least 1.
Returns
true if I'm valid; otherwise false

Definition at line 1057 of file ntv2utils.h.

◆ setExactRange()

bool NTV2ACFrameRange::setExactRange ( const UWord  inFirstFrame,
const UWord  inLastFrame 
)
inline

Sets me to the given explicit frame range values.

Parameters
[in]inFirstFrameSpecifies my starting frame index number. This value should be less than inLastFrame.
[in]inLastFrameSpecifies my ending frame index number. This value should be greater than inFirstFrame.
Returns
true if I'm valid; otherwise false

Definition at line 1028 of file ntv2utils.h.

◆ setFromString()

string NTV2ACFrameRange::setFromString ( const std::string &  inStr)

Resets me from the given character string that should contain a human-readable frame range.

Parameters
[in]inStrSpecifies the character string to be interpreted as a frame range.
Returns
an empty string if successful; otherwise a non-empty string containing a human-readable error message.

Definition at line 4256 of file ntv2utils.cpp.

◆ setRangeWithCount()

bool NTV2ACFrameRange::setRangeWithCount ( const UWord  inCount,
const UWord  inFirstFrame 
)
inline

Sets me to an explicit frame range specified by a frame count and a starting frame index.

Parameters
[in]inCountSpecifies my frame count. This value should be at least 1.
[in]inFirstFrameSpecifies my starting frame index number.
Returns
true if I'm valid; otherwise false

Definition at line 1043 of file ntv2utils.h.

◆ toString()

string NTV2ACFrameRange::toString ( const bool  inNormalized = false) const

Converts me into a character string.

Parameters
[in]inNormalizedIf true, the returned string will contain something like "X-Y" or "N@M", suitable for use in NTV2ACFrameRange::setFromString; otherwise, it will contain a more human-readable description of my frame range.
Returns
a character string that contains a readable representation of my frame range.

Definition at line 4306 of file ntv2utils.cpp.

◆ valid()

bool NTV2ACFrameRange::valid ( void  ) const
inline
Returns
true if I'm valid; otherwise false

Definition at line 1005 of file ntv2utils.h.


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