Ocean
Ocean::CV::FrameTransposer Class Reference

This class implements a frame transposer. More...

Data Structures

class  BlockTransposer
 Helper class for functions transposing blocks. More...
 
class  Comfort
 The following comfort class provides comfortable functions simplifying prototyping applications but also increasing binary size of the resulting applications. More...
 

Static Public Member Functions

static bool transpose (const Frame &source, Frame &target, Worker *worker=nullptr)
 Transposes a given frame. More...
 
static bool transpose (Frame &frame, Worker *worker=nullptr)
 Transposes a given frame. More...
 
template<typename T , unsigned int tChannels>
static void transpose (const T *source, T *target, const unsigned int sourceWidth, const unsigned int sourceHeight, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
 Transposes a given image buffer. More...
 
template<typename T , unsigned int tChannels>
static void rotate90 (const T *source, T *target, const unsigned int sourceWidth, const unsigned int sourceHeight, const bool clockwise, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
 Rotates a given image buffer 90 degrees clockwise or counter clockwise. More...
 
template<typename T , unsigned int tChannels>
static void rotate180 (const T *source, T *target, const unsigned int sourceWidth, const unsigned int sourceHeight, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
 Rotates a given image buffer 180 degrees. More...
 
template<typename T , unsigned int tChannels>
static bool rotate (const T *source, T *target, const unsigned int sourceWidth, const unsigned int sourceHeight, const int angle, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
 Rotates a given image with 90 degree steps. More...
 

Protected Types

enum  FlipDirection { FD_NONE , FD_LEFT_RIGHT , FD_TOP_BOTTOM }
 Definition of individual flip directions which can be applied to a transposed frame. More...
 

Static Protected Member Functions

template<typename T , unsigned int tChannels, FlipDirection tFlipDirection>
static void transposeSubset (const T *source, T *target, const unsigned int sourceWidth, const unsigned int sourceHeight, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, const unsigned int firstSourceRow, const unsigned int numberSourceRows)
 Transposes the subset of a given image buffer. More...
 
template<typename TElementType , unsigned int tChannels>
static void rotate90Subset (const TElementType *source, TElementType *target, const unsigned int sourceWidth, const unsigned int sourceHeight, const bool clockwise, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, const unsigned int firstTargetRow, const unsigned int numberTargetRows)
 Rotates a subset of a given frame either clockwise or counter-clockwise by 90 degree. More...
 

Detailed Description

This class implements a frame transposer.

Member Enumeration Documentation

◆ FlipDirection

Definition of individual flip directions which can be applied to a transposed frame.

Flipping the transposed result allows to rotate the image by 90 degree (clockwise and counter clockwise).

Enumerator
FD_NONE 

Applying no flip.

FD_LEFT_RIGHT 

Applying a left-right flip like a mirror, combined with a transpose operation an image can be rotated clockwise.

FD_TOP_BOTTOM 

Applying a top-bottom flip, combined with a transpose operation an image can be rotated counter clockwise.

Member Function Documentation

◆ rotate()

template<typename T , unsigned int tChannels>
bool Ocean::CV::FrameTransposer::rotate ( const T *  source,
T *  target,
const unsigned int  sourceWidth,
const unsigned int  sourceHeight,
const int  angle,
const unsigned int  sourcePaddingElements,
const unsigned int  targetPaddingElements,
Worker worker = nullptr 
)
static

Rotates a given image with 90 degree steps.

Parameters
sourceThe source buffer to rotated, must be valid
targetThe target buffer receiving the rotated image, must not be 'source', must be valid
sourceWidthWidth of the source frame in pixel, with range [1, infinity)
sourceHeightHeight of the source frame in pixel, with range [1, infinity)
angleThe clockwise rotation angle to be used, must be a multiple of +/- 90, with range (-infinity, infinity)
workerOptional worker to distribute the computation
sourcePaddingElementsThe optional number of padding elements at the end of each row of the source frame, in elements, with range [0, infinity)
targetPaddingElementsThe optional number of padding elements at the end of each row of the target frame, in elements, with range [0, infinity)
Returns
True, if succeeded
Template Parameters
TThe data type of each channel
tChannelsThe number of frame channels, with range [1, infinity)

◆ rotate180()

template<typename T , unsigned int tChannels>
void Ocean::CV::FrameTransposer::rotate180 ( const T *  source,
T *  target,
const unsigned int  sourceWidth,
const unsigned int  sourceHeight,
const unsigned int  sourcePaddingElements,
const unsigned int  targetPaddingElements,
Worker worker = nullptr 
)
static

Rotates a given image buffer 180 degrees.

Parameters
sourceThe source buffer to transpose, must be valid
targetThe target buffer receiving the rotated image, must not be 'source', must be valid
sourceWidthWidth of the source frame in pixel, with range [1, infinity)
sourceHeightHeight of the source frame in pixel, with range [1, infinity)
workerOptional worker to distribute the computation
sourcePaddingElementsThe optional number of padding elements at the end of each row of the source frame, in elements, with range [0, infinity)
targetPaddingElementsThe optional number of padding elements at the end of each row of the target frame, in elements, with range [0, infinity)
Template Parameters
TThe data type of each channel
tChannelsThe number of frame channels, with range [1, infinity)

◆ rotate90()

template<typename T , unsigned int tChannels>
void Ocean::CV::FrameTransposer::rotate90 ( const T *  source,
T *  target,
const unsigned int  sourceWidth,
const unsigned int  sourceHeight,
const bool  clockwise,
const unsigned int  sourcePaddingElements,
const unsigned int  targetPaddingElements,
Worker worker = nullptr 
)
static

Rotates a given image buffer 90 degrees clockwise or counter clockwise.

Parameters
sourceThe source buffer to transpose, must be valid
targetThe target buffer receiving the rotated image, must not be 'source', must be valid
sourceWidthWidth of the source frame in pixel, with range [1, infinity)
sourceHeightHeight of the source frame in pixel, with range [1, infinity)
clockwiseTrue, to rotate the source image clockwise; False, to rotate the image counter clockwise
workerOptional worker to distribute the computation
sourcePaddingElementsThe optional number of padding elements at the end of each row of the source frame, in elements, with range [0, infinity)
targetPaddingElementsThe optional number of padding elements at the end of each row of the target frame, in elements, with range [0, infinity)
Template Parameters
TThe data type of each channel
tChannelsThe number of frame channels, with range [1, infinity)

◆ rotate90Subset()

template<typename TElementType , unsigned int tChannels>
void Ocean::CV::FrameTransposer::rotate90Subset ( const TElementType *  source,
TElementType *  target,
const unsigned int  sourceWidth,
const unsigned int  sourceHeight,
const bool  clockwise,
const unsigned int  sourcePaddingElements,
const unsigned int  targetPaddingElements,
const unsigned int  firstTargetRow,
const unsigned int  numberTargetRows 
)
inlinestaticprotected

Rotates a subset of a given frame either clockwise or counter-clockwise by 90 degree.

Parameters
sourceThe source frame which will be rotated, must be valid
targetThe resulting rotated target frame, must be valid and must have the same buffer size as the source frame
sourceWidthThe width of the source frame in pixel, with range [1, infinity)
sourceHeightThe height of the source frame in pixel, with range [1, infinity)
clockwiseTrue, to rotate the frame clockwise; False, to rotate the frame counter-clockwise
sourcePaddingElementsNumber of padding elements in the source frame, range: [0, infinity)
targetPaddingElementsNumber of padding elements in the target frame, range: [0, infinity)
firstTargetRowThe first target row to be handled, with range [0, sourceWidth)
numberTargetRowsThe number of target rows to be handled, with range [1, sourceWidth - firstTargetRow]
Template Parameters
TElementTypeData type of the elements of the image pixels
tChannelsNumber of data channels, with range [1, infinity)

◆ transpose() [1/3]

static bool Ocean::CV::FrameTransposer::transpose ( const Frame source,
Frame target,
Worker worker = nullptr 
)
static

Transposes a given frame.

Beware: This function has a significantly bigger binary size impact than the corresponding template-based function.

Parameters
sourceThe source frame to transpose, must be valid
targetThe target frame receiving the transposed image, if the frame type of the target frame does not match the transposed source frame, the target frame will be adjusted accordingly, must not be 'source'
workerOptional worker to distribute the computation
Returns
True, if succeeded

◆ transpose() [2/3]

template<typename T , unsigned int tChannels>
void Ocean::CV::FrameTransposer::transpose ( const T *  source,
T *  target,
const unsigned int  sourceWidth,
const unsigned int  sourceHeight,
const unsigned int  sourcePaddingElements,
const unsigned int  targetPaddingElements,
Worker worker = nullptr 
)
static

Transposes a given image buffer.

Parameters
sourceThe source buffer to transpose, must be valid
targetThe target buffer receiving the transposed image, must not be 'source', must be valid
sourceWidthWidth of the source frame in pixel, with range [1, infinity)
sourceHeightHeight of the source frame in pixel, with range [1, infinity)
sourcePaddingElementsThe number of padding elements at the end of each row of the source frame, in elements, with range [0, infinity)
targetPaddingElementsThe number of padding elements at the end of each row of the target frame, in elements, with range [0, infinity)
workerOptional worker to distribute the computation
Template Parameters
TThe data type of each channel
tChannelsThe number of frame channels, with range [1, infinity)

◆ transpose() [3/3]

bool Ocean::CV::FrameTransposer::transpose ( Frame frame,
Worker worker = nullptr 
)
inlinestatic

Transposes a given frame.

Beware: This function has a significantly bigger binary size impact than the corresponding template-based function.

Parameters
frameThe frame to transpose, must be valid
workerOptional worker to distribute the computation
Returns
True, if succeeded

◆ transposeSubset()

template<typename T , unsigned int tChannels, FrameTransposer::FlipDirection tFlipDirection>
void Ocean::CV::FrameTransposer::transposeSubset ( const T *  source,
T *  target,
const unsigned int  sourceWidth,
const unsigned int  sourceHeight,
const unsigned int  sourcePaddingElements,
const unsigned int  targetPaddingElements,
const unsigned int  firstSourceRow,
const unsigned int  numberSourceRows 
)
staticprotected

Transposes the subset of a given image buffer.

Parameters
sourceThe source buffer to transpose
targetThe target buffer receiving the transposed image
sourceWidthWidth of the source frame in pixel, with range [1, infinity)
sourceHeightHeight of the source frame in pixel, with range [1, infinity)
sourcePaddingElementsThe optional number of padding elements at the end of each row of the source frame, in elements, with range [0, infinity)
targetPaddingElementsThe optional number of padding elements at the end of each row of the target frame, in elements, with range [0, infinity)
firstSourceRowFirst source row to be handled
numberSourceRowsThe number of source rows to be handled
Template Parameters
TThe data type of each channel
tChannelsThe number of frame channels, with range [1, infinity)
tFlipDirectionThe flip direction to be applied after transposing
See also
transposeBlock8x8(), transposeBlock().

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