AJA NTV2 SDK  18.0.0.2122
NTV2 SDK 18.0.0.2122
NTV2SegmentedXferInfo Class Reference

Describes a segmented data transfer (copy or move) from a source memory location to a destination location, with independent pitch and direction attributes for source and destination. The simplest transfer, of course, has a single segment. More...

#include <ntv2publicinterface.h>

Public Member Functions

 NTV2SegmentedXferInfo ()
 Constructs me as empty/invalid. More...
 
Inquiry -- Essentials
bool isValid (void) const
 
ULWord getSegmentCount (void) const
 
ULWord getSegmentLength (void) const
 
ULWord getSourceOffset (void) const
 
ULWord getDestOffset (void) const
 
ULWord getSourcePitch (void) const
 
ULWord getDestPitch (void) const
 
Inquiry
ULWord getElementLength (void) const
 
bool isSourceBottomUp (void) const
 
bool isSourceTopDown (void) const
 
bool isDestBottomUp (void) const
 
bool isDestTopDown (void) const
 
ULWord getTotalElements (void) const
 
ULWord getTotalBytes (void) const
 
ULWord getSourceEndOffset (void) const
 
ULWord getDestEndOffset (void) const
 
std::ostream & Print (std::ostream &inStrm, const bool inDumpSegments=false) const
 Writes a human-readable description of me into a given output stream. More...
 
std::string getSourceCode (const bool inInclDecl=true) const
 
bool containsElementAtOffset (const ULWord inElementOffset) const
 
bool operator!= (const NTV2SegmentedXferInfo &inRHS) const
 
bool operator== (const NTV2SegmentedXferInfo &inRHS) const
 
Changing
NTV2SegmentedXferInforeset (void)
 Resets me to an invalid (all zero) state. More...
 
NTV2SegmentedXferInfosetSegmentInfo (const ULWord inNumSegs, const ULWord inSegLength)
 Sets both my segment count and length. More...
 
NTV2SegmentedXferInfosetSegmentCount (const ULWord inNumSegments)
 Sets my segment count. More...
 
NTV2SegmentedXferInfosetSegmentLength (const ULWord inNumElements)
 Sets my segment length. More...
 
NTV2SegmentedXferInfosetSourceInfo (const ULWord inOffset, const ULWord inPitch)
 A convenience function that sets both my source offset and pitch. More...
 
NTV2SegmentedXferInfosetSourceOffset (const ULWord inOffset)
 Sets my source offset. More...
 
NTV2SegmentedXferInfosetSourcePitch (const ULWord inPitch)
 Sets my source pitch. More...
 
NTV2SegmentedXferInfosetSourceDirection (const bool inTopDown)
 Sets the scan direction for the source. More...
 
NTV2SegmentedXferInfosetSourceFlipped (const bool inFlipped=Direction_Flipped)
 Sets the scan direction for the source. More...
 
NTV2SegmentedXferInfosetDestInfo (const ULWord inOffset, const ULWord inPitch)
 A convenience function that sets both my destination offset and pitch. More...
 
NTV2SegmentedXferInfosetDestOffset (const ULWord inOffset)
 Sets my destination offset. More...
 
NTV2SegmentedXferInfosetDestPitch (const ULWord inPitch)
 Sets my destination pitch. More...
 
NTV2SegmentedXferInfosetDestDirection (const bool inTopDown)
 Sets the scan direction for the destination. More...
 
NTV2SegmentedXferInfosetDestFlipped (const bool inFlipped=Direction_Flipped)
 Sets the scan direction for the destination. More...
 
NTV2SegmentedXferInfosetElementLength (const ULWord inBytesPerElement)
 Sets my element length. More...
 
NTV2SegmentedXferInfoswapSourceAndDestination (void)
 Swaps my source and destination offsets, pitches and scan directions. More...
 

Static Public Attributes

Scan Direction Constants
static const bool Direction_TopToBottom = true
 Use this in setDestDirection or setSourceDirection for top-to-bottom scanning. More...
 
static const bool Direction_TopDown = true
 Use this in setDestDirection or setSourceDirection for top-to-bottom scanning. More...
 
static const bool Direction_Normal = true
 Use this in setDestDirection or setSourceDirection for top-to-bottom scanning. More...
 
static const bool Direction_BottomToTop = false
 Use this in setDestDirection or setSourceDirection for bottom-to-top scanning. More...
 
static const bool Direction_BottomUp = false
 Use this in setDestDirection or setSourceDirection for bottom-to-top scanning. More...
 
static const bool Direction_Flipped = false
 Use this in setDestDirection or setSourceDirection for bottom-to-top scanning. More...
 

Detailed Description

Describes a segmented data transfer (copy or move) from a source memory location to a destination location, with independent pitch and direction attributes for source and destination. The simplest transfer, of course, has a single segment.

A segmented transfer is described by these attributes:

  • A starting source and destination offset, in elements;
  • A source and destination pitch (span between segments, in elements);
  • A segment length, in elements;
  • A segment count.

The element size defaults to 1 byte per element, must be a power-of-2, and cannot be larger than 8 bytes.

There are also some optional attributes:

  • Optional "source vertical flip" flag that if set indicates that during the transfer, the source is read bottom-to-top. Defaults to normal "top-to-bottom" operation.
  • Optional "destination vertical flip" flag that if set indicates that during the transfer, the destination is written bottom-to-top. Defaults to normal operation.

Definition at line 5926 of file ntv2publicinterface.h.

Constructor & Destructor Documentation

◆ NTV2SegmentedXferInfo()

NTV2SegmentedXferInfo::NTV2SegmentedXferInfo ( )
inline

Constructs me as empty/invalid.

Definition at line 5931 of file ntv2publicinterface.h.

Member Function Documentation

◆ containsElementAtOffset()

bool NTV2SegmentedXferInfo::containsElementAtOffset ( const ULWord  inElementOffset) const
Parameters
[in]inElementOffsetSpecifies the element offset of interest.
Returns
True if the element is contained within me.

Definition at line 1609 of file ntv2publicinterface.cpp.

◆ getDestEndOffset()

ULWord NTV2SegmentedXferInfo::getDestEndOffset ( void  ) const
inline
Returns
The offset to the first element immediately past the last destination segment.

Definition at line 5974 of file ntv2publicinterface.h.

◆ getDestOffset()

ULWord NTV2SegmentedXferInfo::getDestOffset ( void  ) const
inline
Returns
The offset, in elements, to the start of the first destination segment.

Definition at line 5948 of file ntv2publicinterface.h.

◆ getDestPitch()

ULWord NTV2SegmentedXferInfo::getDestPitch ( void  ) const
inline
Returns
The number of elements between each destination row.

Definition at line 5950 of file ntv2publicinterface.h.

◆ getElementLength()

ULWord NTV2SegmentedXferInfo::getElementLength ( void  ) const
inline
Returns
The size of each element, in bytes.

Definition at line 5957 of file ntv2publicinterface.h.

◆ getSegmentCount()

ULWord NTV2SegmentedXferInfo::getSegmentCount ( void  ) const
inline
Returns
The number of segments.

Definition at line 5945 of file ntv2publicinterface.h.

◆ getSegmentLength()

ULWord NTV2SegmentedXferInfo::getSegmentLength ( void  ) const
inline
Returns
The segment length, in elements.

Definition at line 5946 of file ntv2publicinterface.h.

◆ getSourceCode()

string NTV2SegmentedXferInfo::getSourceCode ( const bool  inInclDecl = true) const
Parameters
[in]inInclDeclIf true, the default, include a declaration statement in the source code.
Returns
A string containing C++ source code that, when compiled, will result in a NTV2SegmentedXferInfo instance that will perfectly match me.

Definition at line 1579 of file ntv2publicinterface.cpp.

◆ getSourceEndOffset()

ULWord NTV2SegmentedXferInfo::getSourceEndOffset ( void  ) const
inline
Returns
The offset to the first element immediately past the last source segment.

Definition at line 5968 of file ntv2publicinterface.h.

◆ getSourceOffset()

ULWord NTV2SegmentedXferInfo::getSourceOffset ( void  ) const
inline
Returns
The offset, in elements, to the start of the first source segment.

Definition at line 5947 of file ntv2publicinterface.h.

◆ getSourcePitch()

ULWord NTV2SegmentedXferInfo::getSourcePitch ( void  ) const
inline
Returns
The number of elements between each source row.

Definition at line 5949 of file ntv2publicinterface.h.

◆ getTotalBytes()

ULWord NTV2SegmentedXferInfo::getTotalBytes ( void  ) const
inline
Returns
The total number of bytes.

Definition at line 5963 of file ntv2publicinterface.h.

◆ getTotalElements()

ULWord NTV2SegmentedXferInfo::getTotalElements ( void  ) const
inline
Returns
The total number of elements (i.e. the product of the segment count and length).

Definition at line 5962 of file ntv2publicinterface.h.

◆ isDestBottomUp()

bool NTV2SegmentedXferInfo::isDestBottomUp ( void  ) const
inline
Returns
True if destination rows should be traversed bottom-to-top; otherwise false.

Definition at line 5960 of file ntv2publicinterface.h.

◆ isDestTopDown()

bool NTV2SegmentedXferInfo::isDestTopDown ( void  ) const
inline
Returns
True if destination rows should be traversed top-to-bottom; otherwise false.

Definition at line 5961 of file ntv2publicinterface.h.

◆ isSourceBottomUp()

bool NTV2SegmentedXferInfo::isSourceBottomUp ( void  ) const
inline
Returns
True if source rows should be traversed bottom-to-top; otherwise false.

Definition at line 5958 of file ntv2publicinterface.h.

◆ isSourceTopDown()

bool NTV2SegmentedXferInfo::isSourceTopDown ( void  ) const
inline
Returns
True if source rows should be traversed top-to-bottom; otherwise false.

Definition at line 5959 of file ntv2publicinterface.h.

◆ isValid()

bool NTV2SegmentedXferInfo::isValid ( void  ) const
inline
Returns
True if valid (i.e. a non-zero segment count and segment length); otherwise false.

Definition at line 5944 of file ntv2publicinterface.h.

◆ operator!=()

bool NTV2SegmentedXferInfo::operator!= ( const NTV2SegmentedXferInfo inRHS) const
Parameters
[in]inRHSSpecifies the NTV2SegmentedXferInfo to compare with me.
Returns
True if not equal.
Note
The element sizes must match (though this ought to be compensated for in the comparison).

Definition at line 1632 of file ntv2publicinterface.cpp.

◆ operator==()

bool NTV2SegmentedXferInfo::operator== ( const NTV2SegmentedXferInfo inRHS) const
inline
Parameters
[in]inRHSSpecifies the NTV2SegmentedXferInfo to compare with me.
Returns
True if equal.
Note
The element sizes must match (though this ought to be compensated for in the comparison).

Definition at line 6010 of file ntv2publicinterface.h.

◆ Print()

ostream & NTV2SegmentedXferInfo::Print ( std::ostream &  inStrm,
const bool  inDumpSegments = false 
) const

Writes a human-readable description of me into a given output stream.

Parameters
inStrmA non-constant reference to the output stream that will receive the description.
[in]inDumpSegmentsIf true, also dumps a description of each segment. Defaults to false.
Returns
A reference to the output stream.

Definition at line 1554 of file ntv2publicinterface.cpp.

◆ reset()

NTV2SegmentedXferInfo & NTV2SegmentedXferInfo::reset ( void  )

Resets me to an invalid (all zero) state.

Definition at line 1652 of file ntv2publicinterface.cpp.

◆ setDestDirection()

NTV2SegmentedXferInfo& NTV2SegmentedXferInfo::setDestDirection ( const bool  inTopDown)
inline

Sets the scan direction for the destination.

Parameters
[in]inTopDownSpecify Direction_TopToBottom, Direction_TopDown or Direction_Normal to traverse the destination segments top-to-bottom; otherwise specify Direction_BottomToTop, Direction_BottomUp or Direction_Flipped for bottom-to-top.
Returns
A reference to me.

Definition at line 6119 of file ntv2publicinterface.h.

◆ setDestFlipped()

NTV2SegmentedXferInfo& NTV2SegmentedXferInfo::setDestFlipped ( const bool  inFlipped = Direction_Flipped)
inline

Sets the scan direction for the destination.

Parameters
[in]inFlippedOptionally specifies if my scan direction is flipped (i.e. bottom-to-top) instead of top-to-bottom. Defaults to Direction_Flipped (i.e. bottom-to-top).
Returns
A reference to me.

Definition at line 6131 of file ntv2publicinterface.h.

◆ setDestInfo()

NTV2SegmentedXferInfo& NTV2SegmentedXferInfo::setDestInfo ( const ULWord  inOffset,
const ULWord  inPitch 
)
inline

A convenience function that sets both my destination offset and pitch.

Parameters
[in]inOffsetThe new offset, in elements, to the start of the first destination segment.
[in]inPitchThe new number of elements between each destination row.
Returns
A reference to me.

Definition at line 6096 of file ntv2publicinterface.h.

◆ setDestOffset()

NTV2SegmentedXferInfo& NTV2SegmentedXferInfo::setDestOffset ( const ULWord  inOffset)
inline

Sets my destination offset.

Parameters
[in]inOffsetThe new offset, in elements, to the start of the first destination segment.
Returns
A reference to me.

Definition at line 6104 of file ntv2publicinterface.h.

◆ setDestPitch()

NTV2SegmentedXferInfo& NTV2SegmentedXferInfo::setDestPitch ( const ULWord  inPitch)
inline

Sets my destination pitch.

Parameters
[in]inPitchThe new number of elements between each destination row.
Returns
A reference to me.

Definition at line 6111 of file ntv2publicinterface.h.

◆ setElementLength()

NTV2SegmentedXferInfo& NTV2SegmentedXferInfo::setElementLength ( const ULWord  inBytesPerElement)
inline

Sets my element length.

Parameters
[in]inBytesPerElementThe new element size, in bytes. Must be a power of two (1, 2, 4, or 8).
Note
This function does not transform any of my offsets, pitches or lengths.
Returns
A reference to me.

Definition at line 6139 of file ntv2publicinterface.h.

◆ setSegmentCount()

NTV2SegmentedXferInfo& NTV2SegmentedXferInfo::setSegmentCount ( const ULWord  inNumSegments)
inline

Sets my segment count.

Parameters
[in]inNumSegmentsMy new segment count.
Returns
A reference to me.

Definition at line 6034 of file ntv2publicinterface.h.

◆ setSegmentInfo()

NTV2SegmentedXferInfo& NTV2SegmentedXferInfo::setSegmentInfo ( const ULWord  inNumSegs,
const ULWord  inSegLength 
)
inline

Sets both my segment count and length.

Parameters
[in]inNumSegsMy new segment count.
[in]inSegLengthMy new segment length, in elements.
Returns
A reference to me.

Definition at line 6026 of file ntv2publicinterface.h.

◆ setSegmentLength()

NTV2SegmentedXferInfo& NTV2SegmentedXferInfo::setSegmentLength ( const ULWord  inNumElements)
inline

Sets my segment length.

Parameters
[in]inNumElementsMy new segment length, in elements.
Returns
A reference to me.

Definition at line 6042 of file ntv2publicinterface.h.

◆ setSourceDirection()

NTV2SegmentedXferInfo& NTV2SegmentedXferInfo::setSourceDirection ( const bool  inTopDown)
inline

Sets the scan direction for the source.

Parameters
[in]inTopDownSpecify Direction_TopToBottom, Direction_TopDown or Direction_Normal to traverse the source segments top-to-bottom; otherwise specify Direction_BottomToTop, Direction_BottomUp or Direction_Flipped for bottom-to-top.
Returns
A reference to me.

Definition at line 6076 of file ntv2publicinterface.h.

◆ setSourceFlipped()

NTV2SegmentedXferInfo& NTV2SegmentedXferInfo::setSourceFlipped ( const bool  inFlipped = Direction_Flipped)
inline

Sets the scan direction for the source.

Parameters
[in]inFlippedOptionally specifies if my scan direction is flipped (i.e. bottom-to-top) instead of top-to-bottom. Defaults to Direction_Flipped (i.e. bottom-to-top).
Returns
A reference to me.

Definition at line 6088 of file ntv2publicinterface.h.

◆ setSourceInfo()

NTV2SegmentedXferInfo& NTV2SegmentedXferInfo::setSourceInfo ( const ULWord  inOffset,
const ULWord  inPitch 
)
inline

A convenience function that sets both my source offset and pitch.

Parameters
[in]inOffsetThe new offset, in elements, to the start of the first source segment.
[in]inPitchThe new number of elements between each source row.
Returns
A reference to me.

Definition at line 6051 of file ntv2publicinterface.h.

◆ setSourceOffset()

NTV2SegmentedXferInfo& NTV2SegmentedXferInfo::setSourceOffset ( const ULWord  inOffset)
inline

Sets my source offset.

Parameters
[in]inOffsetThe new offset, in elements, to the start of the first source segment.
Returns
A reference to me.

Definition at line 6059 of file ntv2publicinterface.h.

◆ setSourcePitch()

NTV2SegmentedXferInfo& NTV2SegmentedXferInfo::setSourcePitch ( const ULWord  inPitch)
inline

Sets my source pitch.

Parameters
[in]inPitchThe new number of elements between each source row.
Returns
A reference to me.

Definition at line 6067 of file ntv2publicinterface.h.

◆ swapSourceAndDestination()

NTV2SegmentedXferInfo & NTV2SegmentedXferInfo::swapSourceAndDestination ( void  )

Swaps my source and destination offsets, pitches and scan directions.

Returns
A reference to me.

Definition at line 1665 of file ntv2publicinterface.cpp.

Member Data Documentation

◆ Direction_BottomToTop

const bool NTV2SegmentedXferInfo::Direction_BottomToTop = false
static

Use this in setDestDirection or setSourceDirection for bottom-to-top scanning.

Definition at line 6165 of file ntv2publicinterface.h.

◆ Direction_BottomUp

const bool NTV2SegmentedXferInfo::Direction_BottomUp = false
static

Use this in setDestDirection or setSourceDirection for bottom-to-top scanning.

Definition at line 6166 of file ntv2publicinterface.h.

◆ Direction_Flipped

const bool NTV2SegmentedXferInfo::Direction_Flipped = false
static

Use this in setDestDirection or setSourceDirection for bottom-to-top scanning.

Definition at line 6167 of file ntv2publicinterface.h.

◆ Direction_Normal

const bool NTV2SegmentedXferInfo::Direction_Normal = true
static

Use this in setDestDirection or setSourceDirection for top-to-bottom scanning.

Definition at line 6164 of file ntv2publicinterface.h.

◆ Direction_TopDown

const bool NTV2SegmentedXferInfo::Direction_TopDown = true
static

Use this in setDestDirection or setSourceDirection for top-to-bottom scanning.

Definition at line 6163 of file ntv2publicinterface.h.

◆ Direction_TopToBottom

const bool NTV2SegmentedXferInfo::Direction_TopToBottom = true
static

Use this in setDestDirection or setSourceDirection for top-to-bottom scanning.

Definition at line 6162 of file ntv2publicinterface.h.


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