Ocean
Ocean::CV::FrameShrinkerAlpha Class Reference

This class implements functions downsizing frames that hold alpha channels. More...

Data Structures

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

template<unsigned int tChannels, bool tAlphaAtFront, bool tTransparentIs0xFF>
static void divideByTwo8BitPerChannel (const uint8_t *source, uint8_t *target, const unsigned int sourceWidth, const unsigned int sourceHeight, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
 Divides a given 8 bit per channel frame by two, taking four pixel values into account:
| 1 1 |
| 1 1 |
If the given source image has an odd frame dimension the last pixel row or the last pixel column is filtered together with the two valid rows or columns respectively. More...
 

Static Private Member Functions

template<unsigned int tChannels, bool tAlphaAtFront, bool tTransparentIs0xFF>
static void divideByTwo8BitPerChannelSubset (const uint8_t *source, uint8_t *target, const unsigned int sourceWidth, const unsigned int sourceHeight, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, const unsigned int firstTargetRow, const unsigned int numberTargetRows)
 Divides a subset of a given 8 bit per channel frame by two, taking the average of four pixel values. More...
 

Detailed Description

This class implements functions downsizing frames that hold alpha channels.

Member Function Documentation

◆ divideByTwo8BitPerChannel()

template<unsigned int tChannels, bool tAlphaAtFront, bool tTransparentIs0xFF>
void Ocean::CV::FrameShrinkerAlpha::divideByTwo8BitPerChannel ( const uint8_t *  source,
uint8_t *  target,
const unsigned int  sourceWidth,
const unsigned int  sourceHeight,
const unsigned int  sourcePaddingElements,
const unsigned int  targetPaddingElements,
Worker worker = nullptr 
)
static

Divides a given 8 bit per channel frame by two, taking four pixel values into account:
| 1 1 |
| 1 1 |
If the given source image has an odd frame dimension the last pixel row or the last pixel column is filtered together with the two valid rows or columns respectively.


Parameters
sourceThe source frame buffer to resize
targetThe target frame buffer
sourceWidthWidth of the source frame in pixel, with range [2, infinity)
sourceHeightHeight of the source frame in pixel, with range [2, infinity)
sourcePaddingElementsThe number of padding elements at the end of each source row, in elements, with range [0, infinity)
targetPaddingElementsThe number of padding elements at the end of each target row, in elements, with range [0, infinity)
workerOptional worker object to distribute the computational load to several CPU cores
Template Parameters
tChannelsNumber of channels of the frame (including the alpha channel), with range [1, infinity)
tAlphaAtFrontTrue, if the alpha channel is in the front of the data channels
tTransparentIs0xFFTrue, if 0xFF is interpreted as fully transparent

◆ divideByTwo8BitPerChannelSubset()

template<unsigned int tChannels, bool tAlphaAtFront, bool tTransparentIs0xFF>
void Ocean::CV::FrameShrinkerAlpha::divideByTwo8BitPerChannelSubset ( const uint8_t *  source,
uint8_t *  target,
const unsigned int  sourceWidth,
const unsigned int  sourceHeight,
const unsigned int  sourcePaddingElements,
const unsigned int  targetPaddingElements,
const unsigned int  firstTargetRow,
const unsigned int  numberTargetRows 
)
staticprivate

Divides a subset of a given 8 bit per channel frame by two, taking the average of four pixel values.

If the given source image has an odd frame dimension the last pixel row or the last pixel column is filtered together with the two valid rows or columns respectively.

Parameters
sourceThe source frame buffer to resize
targetThe target frame buffer
sourceWidthWidth of the source frame in pixel, with range [2, infinity)
sourceHeightHeight of the source frame in pixel, with range [2, infinity)
sourcePaddingElementsThe number of padding elements at the end of each source row, in elements, with range [0, infinity)
targetPaddingElementsThe number of padding elements at the end of each target row, in elements, with range [0, infinity)
firstTargetRowFirst (including) row to halve
numberTargetRowsNumber of rows to halve
Template Parameters
tChannelsNumber of channels of the frame (including the alpha channel), with range [1, infinity)
tAlphaAtFrontTrue, if the alpha channel is in the front of the data channels
tTransparentIs0xFFTrue, if 0xFF is interpreted as fully transparent

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