This class implements a frame transposer.
More...
#include <FrameTransposer.h>
|
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 bool | transpose (const Frame &source, Frame &target, Worker *worker=nullptr) |
| Transposes a given frame.
|
|
static bool | transpose (Frame &frame, Worker *worker=nullptr) |
| Transposes a given frame.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
|
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.
|
|
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.
|
|
This class implements a frame transposer.
◆ 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.
|
◆ 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
-
source | The source buffer to rotated, must be valid |
target | The target buffer receiving the rotated image, must not be 'source', must be valid |
sourceWidth | Width of the source frame in pixel, with range [1, infinity) |
sourceHeight | Height of the source frame in pixel, with range [1, infinity) |
angle | The clockwise rotation angle to be used, must be a multiple of +/- 90, with range (-infinity, infinity) |
worker | Optional worker to distribute the computation |
sourcePaddingElements | The optional number of padding elements at the end of each row of the source frame, in elements, with range [0, infinity) |
targetPaddingElements | The 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
-
T | The data type of each channel |
tChannels | The 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
-
source | The source buffer to transpose, must be valid |
target | The target buffer receiving the rotated image, must not be 'source', must be valid |
sourceWidth | Width of the source frame in pixel, with range [1, infinity) |
sourceHeight | Height of the source frame in pixel, with range [1, infinity) |
worker | Optional worker to distribute the computation |
sourcePaddingElements | The optional number of padding elements at the end of each row of the source frame, in elements, with range [0, infinity) |
targetPaddingElements | The optional number of padding elements at the end of each row of the target frame, in elements, with range [0, infinity) |
- Template Parameters
-
T | The data type of each channel |
tChannels | The 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
-
source | The source buffer to transpose, must be valid |
target | The target buffer receiving the rotated image, must not be 'source', must be valid |
sourceWidth | Width of the source frame in pixel, with range [1, infinity) |
sourceHeight | Height of the source frame in pixel, with range [1, infinity) |
clockwise | True, to rotate the source image clockwise; False, to rotate the image counter clockwise |
worker | Optional worker to distribute the computation |
sourcePaddingElements | The optional number of padding elements at the end of each row of the source frame, in elements, with range [0, infinity) |
targetPaddingElements | The optional number of padding elements at the end of each row of the target frame, in elements, with range [0, infinity) |
- Template Parameters
-
T | The data type of each channel |
tChannels | The 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
-
source | The source frame which will be rotated, must be valid |
target | The resulting rotated target frame, must be valid and must have the same buffer size as the source frame |
sourceWidth | The width of the source frame in pixel, with range [1, infinity) |
sourceHeight | The height of the source frame in pixel, with range [1, infinity) |
clockwise | True, to rotate the frame clockwise; False, to rotate the frame counter-clockwise |
sourcePaddingElements | Number of padding elements in the source frame, range: [0, infinity) |
targetPaddingElements | Number of padding elements in the target frame, range: [0, infinity) |
firstTargetRow | The first target row to be handled, with range [0, sourceWidth) |
numberTargetRows | The number of target rows to be handled, with range [1, sourceWidth - firstTargetRow] |
- Template Parameters
-
TElementType | Data type of the elements of the image pixels |
tChannels | Number 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
-
source | The source frame to transpose, must be valid |
target | The 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' |
worker | Optional 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
-
source | The source buffer to transpose, must be valid |
target | The target buffer receiving the transposed image, must not be 'source', must be valid |
sourceWidth | Width of the source frame in pixel, with range [1, infinity) |
sourceHeight | Height of the source frame in pixel, with range [1, infinity) |
sourcePaddingElements | The number of padding elements at the end of each row of the source frame, in elements, with range [0, infinity) |
targetPaddingElements | The number of padding elements at the end of each row of the target frame, in elements, with range [0, infinity) |
worker | Optional worker to distribute the computation |
- Template Parameters
-
T | The data type of each channel |
tChannels | The 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
-
frame | The frame to transpose, must be valid |
worker | Optional worker to distribute the computation |
- Returns
- True, if succeeded
◆ transposeSubset()
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
-
source | The source buffer to transpose |
target | The target buffer receiving the transposed image |
sourceWidth | Width of the source frame in pixel, with range [1, infinity) |
sourceHeight | Height of the source frame in pixel, with range [1, infinity) |
sourcePaddingElements | The optional number of padding elements at the end of each row of the source frame, in elements, with range [0, infinity) |
targetPaddingElements | The optional number of padding elements at the end of each row of the target frame, in elements, with range [0, infinity) |
firstSourceRow | First source row to be handled |
numberSourceRows | The number of source rows to be handled |
- Template Parameters
-
T | The data type of each channel |
tChannels | The number of frame channels, with range [1, infinity) |
tFlipDirection | The flip direction to be applied after transposing |
- See also
- transposeBlock8x8(), transposeBlock().
The documentation for this class was generated from the following file: