Ocean
Ocean::CV::FrameChannels Class Reference

This class implements frame channel conversion, transformation and extraction functions. More...

Inheritance diagram for Ocean::CV::FrameChannels:

Data Structures

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

Public Types

template<typename TSource , typename TTarget , unsigned int tSourceChannels, unsigned int tTargetChannels>
using RowOperatorFunction = void(*)(const TSource *sourceRow, TTarget *targetRow, const unsigned int width, const unsigned int height, unsigned int rowIndex, const unsigned int sourceStrideElements, const unsigned int targetStrideElements)
 Definition of a function pointer to a function able to operate on an entire image row. More...
 
- Public Types inherited from Ocean::CV::FrameConverter
enum  ConversionFlag : uint32_t { CONVERT_NORMAL , CONVERT_FLIPPED , CONVERT_MIRRORED , CONVERT_FLIPPED_AND_MIRRORED }
 Definition of individual conversion flags. More...
 
enum  CopyPreference : bool { CP_AVOID_COPY_IF_POSSIBLE = false , CP_ALWAYS_COPY = true }
 Definition of a boolean enum for copy preferences (to improve code readability). More...
 
using ConversionFlags = std::vector< ConversionFlag >
 Definition of a vector holding conversion flags. More...
 

Public Member Functions

template<bool tUseFactorChannel0, bool tUseFactorChannel1, bool tUseFactorChannel2>
void convert3ChannelsTo1Channel8Pixels8BitPerChannel7BitPrecisionNEON (const uint8_t *const source, uint8_t *const target, const uint8x8_t &factorChannel0_128_u_8x8, const uint8x8_t &factorChannel1_128_u_8x8, const uint8x8_t &factorChannel2_128_u_8x8)
 
template<bool tUseFactorChannel0, bool tUseFactorChannel1, bool tUseFactorChannel2, bool tUseFactorChannel3>
void convert4ChannelsTo1Channel8Pixels8BitPerChannel7BitPrecisionNEON (const uint8_t *const source, uint8_t *const target, const uint8x8_t &factorChannel0_128_u_8x8, const uint8x8_t &factorChannel1_128_u_8x8, const uint8x8_t &factorChannel2_128_u_8x8, const uint8x8_t &factorChannel3_128_u_8x8)
 
- Public Member Functions inherited from Ocean::CV::FrameConverter
template<typename TSource , typename TTarget >
OCEAN_RE_ENABLE_DOCUMENTATION_DIAGNOSTIC void cast (const TSource *__restrict source, TTarget *__restrict target, const unsigned int width, const unsigned int height, const unsigned int channels, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements)
 
template<typename TSource , typename TTarget >
OCEAN_FORCE_INLINE void cast16Elements (const TSource *const source, TTarget *const target)
 

Static Public Member Functions

template<typename TSource , typename TTarget , unsigned int tChannels = CHANNELS_NOT_KNOWN_AT_COMPILE_TIME>
static void separateTo1Channel (const TSource *const sourceFrame, TTarget *const *const targetFrames, const unsigned int width, const unsigned int height, const unsigned int channels, const unsigned int sourceFramePaddingElements, const unsigned int *targetFramesPaddingElements)
 Separates a given frame with zipped pixel format e.g., FORMAT_RGB24, FORMAT_YUV24, FORMAT_BGRA32 into individual frames with one channel only. More...
 
template<typename TSource , typename TTarget >
static void separateTo1Channel (const TSource *const sourceFrame, const std::initializer_list< TTarget * > &targetFrames, const unsigned int width, const unsigned int height, const unsigned int sourceFramePaddingElements, const std::initializer_list< const unsigned int > &targetFramesPaddingElements)
 Separates a given frame with zipped pixel format e.g., FORMAT_RGB24, FORMAT_YUV24, FORMAT_BGRA32 into individual frames with one channel only. More...
 
template<typename TSource , typename TTarget , unsigned int tChannels = CHANNELS_NOT_KNOWN_AT_COMPILE_TIME>
static void zipChannels (const TSource *const *const sourceFrames, TTarget *const targetFrame, const unsigned int width, const unsigned int height, const unsigned int channels, const unsigned int *sourceFramesPaddingElements, const unsigned int targetFramePaddingElements)
 Zips/interleaves 1-channel images into one image with n-channels. More...
 
template<typename TSource , typename TTarget >
static void zipChannels (const std::initializer_list< const TSource * > &sourceFrames, TTarget *const targetFrame, const unsigned int width, const unsigned int height, const std::initializer_list< unsigned int > &sourceFramesPaddingElements, const unsigned int targetFramePaddingElements)
 Zips/interleaves 1-channel images into one image with n-channels. More...
 
template<typename T , unsigned int tSourceChannels>
static void addFirstChannel (const T *source, const T *sourceNewChannel, T *target, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const unsigned int sourcePaddingElements, const unsigned int sourceNewChannelPaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
 Adds a new channel to a given frame with zipped pixel format, the new channel will be added to the front of all existing channels. More...
 
template<typename T , unsigned int tSourceChannels>
static void addFirstChannelValue (const T *source, const T newChannelValue, T *target, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
 Adds a new channel to a given frame with zipped pixel format, the value of the new channel will be the same for each pixel. More...
 
template<typename T , unsigned int tSourceChannels>
static void addLastChannel (const T *source, const T *sourceNewChannel, T *target, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const unsigned int sourcePaddingElements, const unsigned int sourceNewChannelPaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
 Adds a new channel to a given frame with zipped pixel format, the new channel will be added to the back of all existing channels. More...
 
template<typename T , unsigned int tSourceChannels>
static void addLastChannelValue (const T *source, const T newChannelValue, T *target, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
 Adds a new channel to a given frame with zipped pixel format, the value of the new channel will be the same for each pixel. More...
 
template<typename T , unsigned int tSourceChannels>
static void removeFirstChannel (const T *source, T *target, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
 Removes the first channel from a given frame with zipped (generic) pixel format. More...
 
template<typename T , unsigned int tSourceChannels>
static void removeLastChannel (const T *source, T *target, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
 Removes the last channel from a given frame with zipped (generic) pixel format. More...
 
template<typename T , unsigned int tSourceChannels, unsigned int tTargetChannels, unsigned int tSourceChannelIndex, unsigned int tTargetChannelIndex>
static void copyChannel (const T *source, T *target, const unsigned int width, const unsigned int height, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
 Copies one channel from a given frame with zipped pixel format to another frame with zipped pixel format. More...
 
template<typename T , unsigned int tChannel, unsigned int tChannels>
static void setChannel (T *frame, const unsigned int width, const unsigned int height, const T value, const unsigned int framePaddingElements, Worker *worker=nullptr)
 Sets one channel of a frame with a specific unique value. More...
 
template<typename T , unsigned int tChannels>
static void reverseChannelOrder (const T *source, T *target, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
 Reverses the order of the channels of a frame with zipped pixel format. More...
 
template<typename T , unsigned int tSourceChannels, unsigned int tTargetChannels, unsigned int tShufflePattern>
static void shuffleChannels (const T *source, T *target, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
 Shuffles the channels of a frame by an arbitrary pattern. More...
 
template<typename T , unsigned int tSourceChannels, unsigned int tTargetChannels, unsigned int tShufflePattern>
static void shuffleChannelsAndSetLastChannelValue (const T *source, const T newChannelValue, T *target, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
 Shuffles the channels of source frame and sets the last channel with constant value in the target frame. More...
 
template<unsigned int tChannels>
static void narrow16BitPerChannelTo8BitPerChannel (const uint16_t *source, uint8_t *target, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
 Narrows 16 bit channels of a frame to 8 bit channels. More...
 
template<typename T , unsigned int tChannels, void(*)(const T *, T *) tPixelFunction>
static void applyPixelModifier (const T *source, T *target, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, Worker *worker=nullptr)
 Applies a specific modifier function on each pixel. More...
 
template<typename TSource , typename TTarget , unsigned int tSourceChannels, unsigned int tTargetChannels, void(*)(const TSource *, TTarget *) tPixelFunction>
static void applyAdvancedPixelModifier (const TSource *source, TTarget *target, const unsigned int width, const unsigned int height, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, const ConversionFlag conversionFlag, Worker *worker=nullptr)
 Applies a specific modifier function on each pixel. More...
 
template<typename TSource0 , typename TSource1 , typename TTarget , typename TIntermediate , unsigned int tSourceChannels, unsigned int tTargetChannels, void(*)(const TSource0 *, const TSource1 *, TTarget *) tOperator>
static void applyBivariateOperator (const TSource0 *source0, const TSource1 *source1, TTarget *target, const unsigned int width, const unsigned int height, const unsigned int source0PaddingElements, const unsigned int source1PaddingElements, const unsigned int targetPaddingElements, const ConversionFlag conversionFlag, Worker *worker=nullptr)
 Generic bivariate pixel operations Applies bivariate per-pixel operators: C(y, x) = op(A(y, x), B(y, x)). More...
 
template<typename TSource , typename TTarget , unsigned int tSourceChannels, unsigned int tTargetChannels>
static void applyRowOperator (const TSource *source, TTarget *target, const unsigned int width, const unsigned int height, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, const RowOperatorFunction< TSource, TTarget, tSourceChannels, tTargetChannels > &rowOperatorFunction, Worker *worker=nullptr)
 Applies a row operator to all rows of a source image. More...
 
template<typename T , unsigned int tChannels>
static void transformGeneric (const T *source, T *target, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker)
 Transforms a frame with generic pixel format (with zipped pixel information) like RGB24 or YUV24, to a frame with same pixel format and channel number. More...
 
template<unsigned int tChannels, unsigned int tAlphaChannelIndex>
static void premultipliedAlphaToStraightAlpha8BitPerChannel (uint8_t *const frame, const unsigned int width, const unsigned int height, const unsigned int framePaddingElements, Worker *worker=nullptr)
 Converts an image with premultiplied alpha to a straight image (without premultiplied alpha). More...
 
template<unsigned int tChannels, unsigned int tAlphaChannelIndex>
static void premultipliedAlphaToStraightAlpha8BitPerChannel (const uint8_t *const source, uint8_t *const target, const unsigned int width, const unsigned int height, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
 Converts an image with premultiplied alpha to a straight image (without premultiplied alpha). More...
 
template<unsigned int tChannels, unsigned int tAlphaChannelIndex>
static void straightAlphaToPremultipliedAlpha8BitPerChannel (uint8_t *const frame, const unsigned int width, const unsigned int height, const unsigned int framePaddingElements, Worker *worker=nullptr)
 Converts an image with straight alpha (without premultiplied alpha) to an image with premultiplied alpha. More...
 
template<unsigned int tChannels, unsigned int tAlphaChannelIndex>
static void straightAlphaToPremultipliedAlpha8BitPerChannel (const uint8_t *const source, uint8_t *const target, const unsigned int width, const unsigned int height, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
 Converts an image with straight alpha (without premultiplied alpha) to an image with premultiplied alpha. More...
 
template<typename T , unsigned int tChannels>
static void reverseRowPixelOrder (const T *source, T *target, const size_t size)
 Reverses/mirrors the order of pixels in a given row (or a memory block in general). More...
 
template<typename T , unsigned int tChannels>
static void reverseRowPixelOrderInPlace (T *data, const size_t size)
 Reverses/mirrors the order of pixels in a given row (or a memory block in general) in place. More...
 
template<typename T , unsigned int tChannels>
static void reverseRowChannelOrder (const T *source, T *target, const size_t size, const void *unusedOptions=nullptr)
 Reverses/mirrors the order of channels in a given row (or a memory block in general). More...
 
template<typename T , unsigned int tSourceChannels, unsigned int tTargetChannels, unsigned int tShufflePattern>
static void shuffleRowChannels (const T *source, T *target, const size_t size, const void *unusedOptions=nullptr)
 Shuffles the channels of row pixels by application of a specified shuffle pattern. More...
 
template<typename T , unsigned int tSourceChannels, unsigned int tTargetChannels, unsigned int tShufflePattern>
static void shuffleRowChannelsAndSetLastChannelValue (const T *source, T *target, const size_t size, const void *options=nullptr)
 Shuffles the channels of row pixels by application of a specified shuffle pattern and sets the last channel with constant value in the target row. More...
 
template<bool tUseFactorChannel0, bool tUseFactorChannel1, bool tUseFactorChannel2>
static void convertRow3ChannelsTo1Channel8BitPerChannel7BitPrecision (const uint8_t *source, uint8_t *target, const size_t size, const void *channelMultiplicationFactors_128)
 Converts a row of pixels with 3 channels to pixels with one channel by a linear combination of the four channels. More...
 
static void convertRow3ChannelsTo3Channels8BitPerChannel6BitPrecision (const uint8_t *source, uint8_t *target, const size_t size, const void *parameters)
 Converts a row of pixels with 3 channels to pixels with 3 channels by a linear combination of the three channels plus an translational part applied to the source data before applying the linear transformation. More...
 
static void convertRow3ChannelsTo3Channels8BitPerChannel7BitPrecision (const uint8_t *source, uint8_t *target, const size_t size, const void *parameters)
 Converts a row of pixels with 3 channels to pixels with 3 channels by a linear combination of the three channels plus a bias (translation) part. More...
 
static void convertRow3ChannelsTo3Channels8BitPerChannel10BitPrecision (const uint8_t *source, uint8_t *target, const size_t size, const void *parameters)
 Converts a row of pixels with 3 channels to pixels with 3 channels by a linear combination of the three channels plus a bias (translation) part. More...
 
static void convertRow3ChannelsTo4Channels8BitPerChannel6BitPrecision (const uint8_t *source, uint8_t *target, const size_t size, const void *parameters)
 Converts a row of pixels with 3 channels to pixels with 4 channels by a linear combination of the three channels plus an translational part applied to the source data before applying the linear transformation (for the first three channels). More...
 
template<bool tUseFactorChannel0, bool tUseFactorChannel1, bool tUseFactorChannel2, bool tUseFactorChannel3>
static void convertRow4ChannelsTo1Channel8BitPerChannel7BitPrecision (const uint8_t *source, uint8_t *target, const size_t size, const void *channelMultiplicationFactors_128)
 Converts a row of pixels with 4 channels to pixels with one channel by a linear combination of the four channels. More...
 
static void convertRow4ChannelsTo2Channels8BitPerChannel7BitPrecision (const uint8_t *source, uint8_t *target, const size_t size, const void *multiplicationFactors_128)
 Converts a row of pixels with 4 channels to pixels with two channel by a linear combination of the four channels. More...
 
static void convertRow4ChannelsTo3Channels8BitPerChannel7BitPrecision (const uint8_t *source, uint8_t *target, const size_t size, const void *parameters)
 Converts a row of pixels with 3 channels to pixels with 3 channels by a linear combination of the three channels plus a bias (translation) part. More...
 
template<unsigned int tChannels>
static void narrowRow16BitPerChannelTo8BitPerChannel (const uint16_t *source, uint8_t *target, const size_t size, const void *unusedParameters=nullptr)
 Narrows a row of pixels with 16 bit channels to pixels with 8 bit channels. More...
 
template<typename T , unsigned int tSourceChannels, bool tAddToFront>
static void addChannelRow (const void **sources, void **targets, const unsigned int multipleRowIndex, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const void *options)
 Adds a channel to a given row with generic (zipped) pixel format and copies the information of the new channel from a one-channel image. More...
 
template<typename T , unsigned int tSourceChannels, bool tAddToFront>
static void addChannelValueRow (const T *source, T *target, const size_t size, const void *channelValueParameter)
 Adds a channel to a given row with generic (zipped) pixel format and sets all values to a specified value. More...
 
template<typename T , unsigned int tSourceChannels, unsigned int tTargetChannels, unsigned int tSourceChannelIndex, unsigned int tTargetChannelIndex>
static void copyChannelRow (const T *source, T *target, const size_t size, const void *unusedParameters=nullptr)
 Copies one channel from a source row to a target row with generic (zipped) pixel format. More...
 
template<>
void separateTo1Channel (const uint8_t *const sourceFrame, uint8_t *const *const targetFrames, const unsigned int width, const unsigned int height, const unsigned int channels, const unsigned int sourceFramePaddingElements, const unsigned int *targetFramesPaddingElements)
 
template<>
void separateTo1Channel (const uint8_t *const sourceFrame, uint8_t *const *const targetFrames, const unsigned int width, const unsigned int height, const unsigned int channels, const unsigned int sourceFramePaddingElements, const unsigned int *targetFramesPaddingElements)
 
template<>
void separateTo1Channel (const uint8_t *const sourceFrame, uint8_t *const *const targetFrames, const unsigned int width, const unsigned int height, const unsigned int channels, const unsigned int sourceFramePaddingElements, const unsigned int *targetFramesPaddingElements)
 
template<>
void zipChannels (const uint8_t *const *sourceFrames, uint8_t *const targetFrame, const unsigned int width, const unsigned int height, const unsigned int channels, const unsigned int *sourceFramesPaddingElements, const unsigned int targetFramePaddingElements)
 
template<>
void zipChannels (const uint8_t *const *sourceFrames, uint8_t *const targetFrame, const unsigned int width, const unsigned int height, const unsigned int channels, const unsigned int *sourceFramesPaddingElements, const unsigned int targetFramePaddingElements)
 
template<>
void zipChannels (const uint8_t *const *sourceFrames, uint8_t *const targetFrame, const unsigned int width, const unsigned int height, const unsigned int channels, const unsigned int *sourceFramesPaddingElements, const unsigned int targetFramePaddingElements)
 
template<>
void zipChannels (const float *const *sourceFrames, uint8_t *const targetFrame, const unsigned int width, const unsigned int height, const unsigned int channels, const unsigned int *sourceFramesPaddingElements, const unsigned int targetFramePaddingElements)
 
template<>
void zipChannels (const float *const *sourceFrames, uint8_t *const targetFrame, const unsigned int width, const unsigned int height, const unsigned int channels, const unsigned int *sourceFramesPaddingElements, const unsigned int targetFramePaddingElements)
 
template<>
void zipChannels (const float *const *sourceFrames, uint8_t *const targetFrame, const unsigned int width, const unsigned int height, const unsigned int channels, const unsigned int *sourceFramesPaddingElements, const unsigned int targetFramePaddingElements)
 
- Static Public Member Functions inherited from Ocean::CV::FrameConverter
template<typename TSource , typename TTarget >
static void cast (const TSource *__restrict source, TTarget *__restrict target, const unsigned int width, const unsigned int height, const unsigned int channels, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements)
 Casts the pixel values from one frame type to another frame type. More...
 
template<typename TSource , typename TTarget >
static void normalizedCast (const TSource *__restrict source, TTarget *__restrict target, const unsigned int width, const unsigned int height, const unsigned int channels, const TTarget multiplicationFactor, const TTarget offset, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements)
 Casts the pixel values from one frame type to another frame type but also normalizes the casted source values before assigning them (by scaling and offsetting). More...
 
template<typename T >
static bool subFrame (const T *source, T *target, const unsigned int sourceWidth, const unsigned int sourceHeight, const unsigned int targetWidth, const unsigned int targetHeight, const unsigned int channels, const unsigned int sourceLeft, const unsigned int sourceTop, const unsigned int targetLeft, const unsigned int targetTop, const unsigned int width, const unsigned int height, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements)
 Copies a sub-frame of a given frame into a second frame while both frames might have an individual number of padding elements at the end of each row. More...
 
template<typename T >
static bool subFrameMask (const Frame &sourceFrame, Frame &targetFrame, const Frame &maskFrame, const uint32_t sourceLeft, const uint32_t sourceTop, const uint32_t targetLeft, const uint32_t targetTop, const uint32_t subFrameWidth, const uint32_t subFrameHeight, const uint8_t maskValue=0u)
 Copies pixels from one sub-frame to another if the pixels are part of a mask; input may use padding. More...
 
template<typename T >
static bool subFrameMask (const T *source, T *target, const uint8_t *mask, const unsigned int sourceWidth, const unsigned int sourceHeight, const unsigned int targetWidth, const unsigned int targetHeight, const unsigned int channels, const unsigned int sourceLeft, const unsigned int sourceTop, const unsigned int targetLeft, const unsigned int targetTop, const unsigned int subFrameWidth, const unsigned int subFrameHeight, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, const unsigned int maskPaddingElements, const uint8_t maskValue=0u)
 Copies pixels from one sub-frame to another if the pixels are part of a mask; input may use padding. More...
 
template<typename T >
static void patchFrame (const T *source, T *buffer, const unsigned int width, const unsigned int channels, const unsigned int x, const unsigned int y, const unsigned int patchSize, const unsigned int sourcePaddingElements, const unsigned int bufferPaddingElements)
 Copies a small patch area of a given frame into a buffer holding only the entire patch. More...
 
template<typename T , unsigned int tChannels>
static void patchFrameMirroredBorder (const T *source, T *buffer, const unsigned int width, const unsigned int height, const unsigned int x, const unsigned int y, const unsigned int patchSize, const unsigned int sourcePaddingElements, const unsigned int bufferPaddingElements)
 Copies a small patch area of a frame into a buffer holding only the entire patch. More...
 
static MatrixD transformationMatrix_FullRangeRGB24_To_FullRangeYUV24_BT601 ()
 Returns the 3x4 color space transformation matrix from full range RGB24 to full range YUV24 using BT.601, analog RGB to (analog) YPbPr. More...
 
static MatrixD transformationMatrix_FullRangeRGB24_To_FullRangeYVU24_BT601 ()
 Returns the 3x4 color space transformation matrix from full range RGB24 to full range YVU24 using BT.601, analog RGB to (analog) YPbPr. More...
 
static MatrixD transformationMatrix_FullRangeRGB24_To_LimitedRangeYUV24_BT601 ()
 Returns the 3x4 color space transformation matrix from full range RGB24 to limited range YUV24 using BT.601, analog RGB to (digital) YCbCr. More...
 
static MatrixD transformationMatrix_FullRangeRGB24_To_LimitedRangeYVU24_BT601 ()
 Returns the 3x4 color space transformation matrix from full range RGB24 to limited range YVU24 using BT.601, analog RGB to (digital) YCbCr. More...
 
static MatrixD transformationMatrix_FullRangeYUV24_To_FullRangeBGR24_BT601 ()
 Returns the color space transformation matrix from full range YUV24 to full range BGR24 using BT.601, (analog) YPbPr to analog BGR. More...
 
static MatrixD transformationMatrix_FullRangeYUV24_To_FullRangeRGB24_BT601 ()
 Returns the color space transformation matrix from full range YUV24 to full range RGB24 using BT.601, (analog) YPbPr to analog RGB. More...
 
static MatrixD transformationMatrix_FullRangeYUV24_To_FullRangeBGR24_Android ()
 Returns the color space transformation matrix from full range YUV24 to full range BGR24 similar to BT.601, (analog) YPbPr to analog BGR. More...
 
static MatrixD transformationMatrix_FullRangeYUV24_To_FullRangeRGB24_Android ()
 Returns the color space transformation matrix from full range YUV24 to full range RGB24 similar to BT.601, (analog) YPbPr to analog RGB. More...
 
static MatrixD transformationMatrix_FullRangeYVU24_To_FullRangeBGR24_Android ()
 Returns the color space transformation matrix from full range YVU24 to full range BGR24 similar to BT.601, (analog) YPbPr to analog BGR. More...
 
static MatrixD transformationMatrix_FullRangeYVU24_To_FullRangeRGB24_Android ()
 Returns the color space transformation matrix from full range YVU24 to full range RGB24 similar to BT.601, (analog) YPbPr to analog RGB. More...
 
static MatrixD transformationMatrix_LimitedRangeYUV24_To_FullRangeRGB24_BT601 ()
 Returns the color space transformation matrix from limited range YUV24 to full range RGB24 using BT.601, (digital) YCbCr to analog RGB. More...
 
static MatrixD transformationMatrix_FullRangeBGR24_To_LimitedRangeYUV24_BT601 ()
 Returns the color space transformation matrix from full range BGR24 to limited range YUV24 using BT.601, analog RGB to (digital) YCbCr. More...
 
static MatrixD transformationMatrix_FullRangeBGR24_To_FullRangeYUV24_BT601 ()
 Returns the 3x4 color space transformation matrix from full range BGR24 to full range YUV24 using BT.601, analog BGR to (analog) YPbPr. More...
 
static MatrixD transformationMatrix_FullRangeBGR24_To_FullRangeYVU24_BT601 ()
 Returns the 3x4 color space transformation matrix from full range BGR24 to full range YVU24 using BT.601, analog BGR to (analog) YPbPr. More...
 
static MatrixD transformationMatrix_LimitedRangeYUV24_To_FullRangeBGR24_BT601 ()
 Returns the color space transformation matrix from limited range YUV24 to full range BGR24 using BT.601, (digital) YCbCr to analog BGR. More...
 
static MatrixD transformationMatrix_LimitedRangeYVU24_To_FullRangeBGR24_BT601 ()
 Returns the color space transformation matrix from limited range YVU24 to full range BGR24 using BT.601, (digital) YCrCb to analog BGR. More...
 
static MatrixD transformationMatrix_LimitedRangeYVU24_To_FullRangeRGB24_BT601 ()
 Returns the color space transformation matrix from limited range YVU24 to full range RGB24 using BT.601, (digital) YCrCb to analog RGB. More...
 
static MatrixD transformationMatrix_FullRangeYVU24_To_FullRangeRGB24_BT601 ()
 Returns the color space transformation matrix from full range YVU24 to full range RGB24 using BT.601, (digital) YCrCb to analog RGB. More...
 
static MatrixD transformationMatrix_FullRangeYVU24_To_FullRangeBGR24_BT601 ()
 Returns the color space transformation matrix from full range YVU24 to full range BGR24 using BT.601, (digital) YCrCb to analog BGR. More...
 
static const ConversionFlagsconversionFlags ()
 Returns a vector holding all possible conversion flags. More...
 
static std::string translateConversionFlag (const ConversionFlag conversionFlag)
 Translates a given conversion flag to a string. More...
 

Static Public Attributes

static constexpr unsigned int CHANNELS_NOT_KNOWN_AT_COMPILE_TIME = 0u
 Definition of a constant to specify that the number of channels are not known at compile time but at runtime only. More...
 

Static Protected Member Functions

template<typename TSource , typename TTarget >
static void separateTo1ChannelRuntime (const TSource *const sourceFrame, TTarget *const *const targetFrames, const unsigned int width, const unsigned int height, const unsigned int channels, const unsigned int sourceFramePaddingElements, const unsigned int *targetFramesPaddingElements)
 Separates a given frame with zipped pixel format e.g., FORMAT_RGB24, FORMAT_YUV24, FORMAT_BGRA32 into individual frames with one channel only. More...
 
template<typename TSource , typename TTarget >
static void zipChannelsRuntime (const TSource *const *const sourceFrames, TTarget *const targetFrame, const unsigned int width, const unsigned int height, const unsigned int channels, const unsigned int *sourceFramesPaddingElements, const unsigned int targetFramePaddingElements)
 Zips/interleaves 1-channel images into one image with n-channels. More...
 
template<typename T , unsigned int tChannel, unsigned int tChannels>
static void setChannelSubset (T *frame, const unsigned int width, const T value, const unsigned int framePaddingElements, const unsigned int firstRow, const unsigned int numberRows)
 Sets one channel of a frame with one unique value. More...
 
template<typename T , unsigned int tChannels, void(*)(const T *, T *) tPixelFunction>
static void applyPixelModifierSubset (const T *source, T *target, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const unsigned int firstRow, const unsigned int numberRows)
 Applies a specific modifier function on each pixel. More...
 
template<typename TSource , typename TTarget , unsigned int tSourceChannels, unsigned int tTargetChannels, void(*)(const TSource *, TTarget *) tPixelFunction>
static void applyAdvancedPixelModifierSubset (const TSource *source, TTarget *target, const unsigned int width, const unsigned int height, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, const ConversionFlag conversionFlag, const unsigned int firstRow, const unsigned int numberRows)
 Applies a specific modifier function on each pixel. More...
 
template<typename TSource0 , typename TSource1 , typename TTarget , typename TIntermediate , unsigned int tSourceChannels, unsigned int tTargetChannels, void(*)(const TSource0 *, const TSource1 *, TTarget *) tOperator>
static void applyBivariateOperatorSubset (const TSource0 *source0, const TSource1 *source1, TTarget *target, const unsigned int width, const unsigned int height, const unsigned int source0PaddingElements, const unsigned int source1PaddingElements, const unsigned int targetPaddingElements, const ConversionFlag conversionFlag, const unsigned int firstRow, const unsigned int numberRows)
 Generic bivariate pixel operations. More...
 
template<typename TSource , typename TTarget , unsigned int tSourceChannels, unsigned int tTargetChannels>
static void applyRowOperatorSubset (const TSource *source, TTarget *target, const unsigned int width, const unsigned int height, const unsigned int sourceStrideElements, const unsigned int targetStrideElements, const RowOperatorFunction< TSource, TTarget, tSourceChannels, tTargetChannels > rowOperatorFunction, const unsigned int firstRow, const unsigned int numberRows)
 Applies a row operator to a subset of all rows of a source image. More...
 
static void transformGenericSubset (const uint8_t *source, uint8_t *target, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const RowReversePixelOrderFunction< void > rowReversePixelOrderFunction, const unsigned int bytesPerRow, const unsigned int sourceStrideBytes, const unsigned int targetStrideBytes, const unsigned int firstRow, const unsigned int numberRows)
 Transforms a subset of a frame with generic pixel format (with zipped pixel information) like RGB24 or YUV24, to a frame with same pixel format and channel number. More...
 
template<unsigned int tChannels, unsigned int tAlphaChannelIndex>
static void premultipliedAlphaToStraightAlpha8BitPerChannelSubset (uint8_t *const frame, const unsigned int width, const unsigned int framePaddingElements, const unsigned int firstRow, const unsigned int numberRows)
 Converts an image with premultiplied alpha to a straight image (without premultiplied alpha). More...
 
template<unsigned int tChannels, unsigned int tAlphaChannelIndex>
static void premultipliedAlphaToStraightAlpha8BitPerChannelSubset (const uint8_t *const source, uint8_t *const target, const unsigned int width, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, const unsigned int firstRow, const unsigned int numberRows)
 Converts an image with premultiplied alpha to a straight image (without premultiplied alpha). More...
 
template<unsigned int tChannels, unsigned int tAlphaChannelIndex>
static void straightAlphaToPremultipliedAlpha8BitPerChannelSubset (uint8_t *const frame, const unsigned int width, const unsigned int framePaddingElements, const unsigned int firstRow, const unsigned int numberRows)
 Converts an image with straight alpha (without premultiplied alpha) to an image with premultiplied alpha. More...
 
template<unsigned int tChannels, unsigned int tAlphaChannelIndex>
static void straightAlphaToPremultipliedAlpha8BitPerChannelSubset (const uint8_t *const source, uint8_t *const target, const unsigned int width, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, const unsigned int firstRow, const unsigned int numberRows)
 Converts an image with straight alpha (without premultiplied alpha) to an image with premultiplied alpha. More...
 
static OCEAN_FORCE_INLINE void convert3ChannelsTo1Channel16Pixels8BitPerChannel7BitPrecisionSSE (const uint8_t *const source, uint8_t *const target, const __m128i &multiplicationFactors0_128_u_16x8, const __m128i &multiplicationFactors1_128_u_16x8, const __m128i &multiplicationFactors2_128_u_16x8)
 Converts 16 pixels with 3 channels per pixel to 16 pixels with one channel per pixel by a linear combination of the three channels. More...
 
static OCEAN_FORCE_INLINE void convert3ChannelsTo3Channels16Pixels8BitPerChannel7BitPrecisionSSE (const uint8_t *const source, uint8_t *const target, const __m128i &factorChannel00_128_s_16x8, const __m128i &factorChannel10_128_s_16x8, const __m128i &factorChannel20_128_s_16x8, const __m128i &factorChannel01_128_s_16x8, const __m128i &factorChannel11_128_s_16x8, const __m128i &factorChannel21_128_s_16x8, const __m128i &factorChannel02_128_s_16x8, const __m128i &factorChannel12_128_s_16x8, const __m128i &factorChannel22_128_s_16x8, const __m128i &biasChannel0_s_16x8, const __m128i &biasChannel1_s_16x8, const __m128i &biasChannel2_s_16x8)
 Converts 16 pixels with 3 channels per pixel to 16 pixels with three channel per pixel by a linear combination of the three channels plus a bias (translation) parameter. More...
 
static OCEAN_FORCE_INLINE void convert3ChannelsTo3Channels16Pixels8BitPerChannel10BitPrecisionSSE (const uint8_t *const source, uint8_t *const target, const __m128i &factorChannel00_1024_s_16x8, const __m128i &factorChannel10_1024_s_16x8, const __m128i &factorChannel20_1024_s_16x8, const __m128i &factorChannel01_1024_s_16x8, const __m128i &factorChannel11_1024_s_16x8, const __m128i &factorChannel21_1024_s_16x8, const __m128i &factorChannel02_1024_s_16x8, const __m128i &factorChannel12_1024_s_16x8, const __m128i &factorChannel22_1024_s_16x8, const __m128i &biasChannel0_1024_s_32x4, const __m128i &biasChannel1_1024_s_32x4, const __m128i &biasChannel2_1024_s_32x4)
 Converts 16 pixels with 3 channels per pixel to 16 pixels with three channel per pixel by a linear combination of the three channels plus a bias (translation) parameter. More...
 
static OCEAN_FORCE_INLINE void convert4ChannelsTo1Channel16Pixels8BitPerChannel7BitPrecisionSSE (const uint8_t *const source, uint8_t *const target, const __m128i &multiplicationFactors0123_128_s_32x)
 Converts 16 pixels with 4 channels per pixel to 16 pixels with one channel per pixel by a linear combination of the four channels. More...
 
static OCEAN_FORCE_INLINE void convert4ChannelsTo2Channels16Pixels8BitPerChannel7BitPrecisionSSE (const uint8_t *const source, uint8_t *const target, const __m128i &multiplicationFactorsChannel0_0123_128_s_16x8, const __m128i &multiplicationFactorsChannel1_0123_128_s_16x8)
 Converts 16 pixels with 4 channels per pixel to 16 pixels with two channel per pixel by a linear combination of the four channels. More...
 
template<bool tUseFactorChannel0, bool tUseFactorChannel1, bool tUseFactorChannel2>
static OCEAN_FORCE_INLINE void convert3ChannelsTo1Channel8Pixels8BitPerChannel7BitPrecisionNEON (const uint8_t *const source, uint8_t *const target, const uint8x8_t &factorChannel0_128_u_8x8, const uint8x8_t &factorChannel1_128_u_8x8, const uint8x8_t &factorChannel2_128_u_8x8)
 Converts 8 pixels with 3 channels per pixel to 8 pixels with one channel per pixel by a linear combination of the three channels. More...
 
static OCEAN_FORCE_INLINE void convert3ChannelsTo3Channels8Pixels8BitPerChannel6BitPrecisionNEON (const uint8_t *const source, uint8_t *const target, const int16x8_t &factorChannel00_64_s_16x8, const int16x8_t &factorChannel10_64_s_16x8, const int16x8_t &factorChannel20_64_s_16x8, const int16x8_t &factorChannel01_64_s_16x8, const int16x8_t &factorChannel11_64_s_16x8, const int16x8_t &factorChannel21_64_s_16x8, const int16x8_t &factorChannel02_64_s_16x8, const int16x8_t &factorChannel12_64_s_16x8, const int16x8_t &factorChannel22_64_s_16x8, const uint8x8_t &biasChannel0_u_8x8, const uint8x8_t &biasChannel1_u_8x8, const uint8x8_t &biasChannel2_u_8x8)
 Converts 8 pixels with 3 channels per pixel to 8 pixels with three channel per pixel by a linear combination of the three channels plus an in advance bias (translation) parameter. More...
 
static OCEAN_FORCE_INLINE void convert3ChannelsTo3Channels16Pixels8BitPerChannel6BitPrecisionNEON (const uint8_t *const source, uint8_t *const target, const int16x8_t &factorChannel00_64_s_16x8, const int16x8_t &factorChannel10_64_s_16x8, const int16x8_t &factorChannel20_64_s_16x8, const int16x8_t &factorChannel01_64_s_16x8, const int16x8_t &factorChannel11_64_s_16x8, const int16x8_t &factorChannel21_64_s_16x8, const int16x8_t &factorChannel02_64_s_16x8, const int16x8_t &factorChannel12_64_s_16x8, const int16x8_t &factorChannel22_64_s_16x8, const uint8x8_t &biasChannel0_u_8x8, const uint8x8_t &biasChannel1_u_8x8, const uint8x8_t &biasChannel2_u_8x8)
 Converts 16 pixels with 3 channels per pixel to 16 pixels with three channel per pixel by a linear combination of the three channels plus an in advance bias (translation) parameter. More...
 
static OCEAN_FORCE_INLINE void convert3ChannelsTo3Channels8Pixels8BitPerChannel7BitPrecisionNEON (const uint8_t *const source, uint8_t *const target, const int16x8_t &factorChannel00_128_s_16x8, const int16x8_t &factorChannel10_128_s_16x8, const int16x8_t &factorChannel20_128_s_16x8, const int16x8_t &factorChannel01_128_s_16x8, const int16x8_t &factorChannel11_128_s_16x8, const int16x8_t &factorChannel21_128_s_16x8, const int16x8_t &factorChannel02_128_s_16x8, const int16x8_t &factorChannel12_128_s_16x8, const int16x8_t &factorChannel22_128_s_16x8, const int16x8_t &biasChannel0_128_s_16x8, const int16x8_t &biasChannel1_128_s_16x8, const int16x8_t &biasChannel2_128_s_16x8)
 Converts 8 pixels with 3 channels per pixel to 8 pixels with three channel per pixel by a linear combination of the three channels plus a bias (translation) parameter. More...
 
static OCEAN_FORCE_INLINE void convert3ChannelsTo3Channels8Pixels8BitPerChannel10BitPrecisionNEON (const uint8_t *const source, uint8_t *const target, const int16x4_t &factorChannel00_1024_s_16x4, const int16x4_t &factorChannel10_1024_s_16x4, const int16x4_t &factorChannel20_1024_s_16x4, const int16x4_t &factorChannel01_1024_s_16x4, const int16x4_t &factorChannel11_1024_s_16x4, const int16x4_t &factorChannel21_1024_s_16x4, const int16x4_t &factorChannel02_1024_s_16x4, const int16x4_t &factorChannel12_1024_s_16x4, const int16x4_t &factorChannel22_1024_s_16x4, const int32x4_t &biasChannel0_1024_s_32x4, const int32x4_t &biasChannel1_1024_s_32x4, const int32x4_t &biasChannel2_1024_s_32x4)
 Converts 8 pixels with 3 channels per pixel to 8 pixels with three channel per pixel by a linear combination of the three channels plus a bias (translation) parameter. More...
 
static OCEAN_FORCE_INLINE void convert3ChannelsTo3Channels16Pixels8BitPerChannel10BitPrecisionNEON (const uint8_t *const source, uint8_t *const target, const int16x4_t &factorChannel00_1024_s_16x4, const int16x4_t &factorChannel10_1024_s_16x4, const int16x4_t &factorChannel20_1024_s_16x4, const int16x4_t &factorChannel01_1024_s_16x4, const int16x4_t &factorChannel11_1024_s_16x4, const int16x4_t &factorChannel21_1024_s_16x4, const int16x4_t &factorChannel02_1024_s_16x4, const int16x4_t &factorChannel12_1024_s_16x4, const int16x4_t &factorChannel22_1024_s_16x4, const int32x4_t &biasChannel0_1024_s_32x4, const int32x4_t &biasChannel1_1024_s_32x4, const int32x4_t &biasChannel2_1024_s_32x4)
 Converts 8 pixels with 3 channels per pixel to 16 pixels with three channel per pixel by a linear combination of the three channels plus a bias (translation) parameter. More...
 
static OCEAN_FORCE_INLINE void convert3ChannelsTo3Channels16Pixels8BitPerChannel7BitPrecisionNEON (const uint8_t *const source, uint8_t *const target, const int16x8_t &factorChannel00_128_s_16x8, const int16x8_t &factorChannel10_128_s_16x8, const int16x8_t &factorChannel20_128_s_16x8, const int16x8_t &factorChannel01_128_s_16x8, const int16x8_t &factorChannel11_128_s_16x8, const int16x8_t &factorChannel21_128_s_16x8, const int16x8_t &factorChannel02_128_s_16x8, const int16x8_t &factorChannel12_128_s_16x8, const int16x8_t &factorChannel22_128_s_16x8, const int16x8_t &biasChannel0_128_s_16x8, const int16x8_t &biasChannel1_128_s_16x8, const int16x8_t &biasChannel2_128_s_16x8)
 Converts 16 pixels with 3 channels per pixel to 16 pixels with 3 channels per pixel by a linear combination of the three channels plus a bias (translation) parameter. More...
 
static OCEAN_FORCE_INLINE void convert3ChannelsTo4Channels16Pixels8BitPerChannel6BitPrecisionNEON (const uint8_t *const source, uint8_t *const target, const int16x8_t &factorChannel00_64_s_16x8, const int16x8_t &factorChannel10_64_s_16x8, const int16x8_t &factorChannel20_64_s_16x8, const int16x8_t &factorChannel01_64_s_16x8, const int16x8_t &factorChannel11_64_s_16x8, const int16x8_t &factorChannel21_64_s_16x8, const int16x8_t &factorChannel02_64_s_16x8, const int16x8_t &factorChannel12_64_s_16x8, const int16x8_t &factorChannel22_64_s_16x8, const uint8x8_t &biasChannel0_u_8x8, const uint8x8_t &biasChannel1_u_8x8, const uint8x8_t &biasChannel2_u_8x8, const uint8x16_t &channelValue3_u_8x16)
 Converts 16 pixels with 3 channels per pixel to 16 pixels with 4 channels per pixel by a linear combination of the three channels plus a bias (translation) parameter. More...
 
template<bool tUseFactorChannel0, bool tUseFactorChannel1, bool tUseFactorChannel2, bool tUseFactorChannel3>
static OCEAN_FORCE_INLINE void convert4ChannelsTo1Channel8Pixels8BitPerChannel7BitPrecisionNEON (const uint8_t *const source, uint8_t *const target, const uint8x8_t &factorChannel0_128_u_8x8, const uint8x8_t &factorChannel1_128_u_8x8, const uint8x8_t &factorChannel2_128_u_8x8, const uint8x8_t &factorChannel3_128_u_8x8)
 Converts 8 pixels with 4 channels per pixel to 8 pixels with one channel per pixel by a linear combination of the four channels. More...
 
static OCEAN_FORCE_INLINE void convert4ChannelsTo2Channels8Pixels8BitPerChannel7BitPrecisionNEON (const uint8_t *const source, uint8_t *const target, const uint8x8_t &factorChannel00_128_u_8x8, const uint8x8_t &factorChannel10_128_u_8x8, const uint8x8_t &factorChannel01_128_u_8x8, const uint8x8_t &factorChannel11_128_u_8x8, const uint8x8_t &factorChannel02_128_u_8x8, const uint8x8_t &factorChannel12_128_u_8x8, const uint8x8_t &factorChannel03_128_u_8x8, const uint8x8_t &factorChannel13_128_u_8x8)
 Converts 8 pixels with 4 channels per pixel to 8 pixels with two channels per pixel by a linear combination of the four channels. More...
 
- Static Protected Member Functions inherited from Ocean::CV::FrameConverter
template<typename TSource , typename TTarget >
static void cast16Elements (const TSource *const source, TTarget *const target)
 Casts 16 successive elements from one data type to another data type. More...
 
template<typename TSource , typename TTarget >
static void convertGenericPixelFormat (const TSource *source, TTarget *target, const unsigned int width, const unsigned int height, const unsigned int sourceStrideElements, const unsigned int targetStrideElements, const ConversionFlag flag, const RowConversionFunction< TSource, TTarget > rowConversionFunction, const RowReversePixelOrderInPlaceFunction< TTarget > targetReversePixelOrderInPlaceFunction, const bool areContinuous, const void *options, Worker *worker)
 Converts a frame with generic pixel format (e.g., RGBA32, BGR24, YUV24, ...) to a frame with generic pixel format (e.g., RGB24, Y8). More...
 
static void convertArbitraryPixelFormat (const void **sources, void **targets, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int multipleRowsPerIteration, const MultipleRowsConversionFunction multipleRowsConversionFunction, const void *options, Worker *worker)
 Converts a frame with arbitrary pixel format (e.g., Y_UV12, Y_VU12, YUYV16, ...) to a frame with arbitrary pixel format. More...
 
static void convertGenericPixelFormatSubset (const uint8_t *source, uint8_t *target, const unsigned int width, const unsigned int height, const unsigned int sourceStrideBytes, const unsigned int targetStrideBytes, const ConversionFlag flag, const RowConversionFunction< uint8_t, uint8_t > rowConversionFunction, const RowReversePixelOrderInPlaceFunction< uint8_t > targetReversePixelOrderInPlaceFunction, const bool areContinuous, const void *options, const unsigned int firstRow, const unsigned int numberRows)
 Converts a subset of a frame with generic pixel format (e.g., RGBA32, BGR24, YUV24, ...) to a frame with generic pixel format (e.g., Y8). More...
 
static void convertArbitraryPixelFormatSubset (const void **sources, void **targets, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int multipleRowsPerIteration, const MultipleRowsConversionFunction multipleRowsConversionFunction, const void *options, const unsigned int firstMultipleRow, const unsigned int numberMultipleRows)
 Converts a subset of a frame with arbitrary pixel format (e.g., Y_UV12, Y_VU12, YUYV16, ...) to a frame with arbitrary pixel format. More...
 
static void convertOneRow_1Plane1ChannelAnd1Plane2ChannelsDownsampled2x2_To_1Plane3Channels_8BitPerChannel_Precision6Bit (const void **sources, void **targets, const unsigned int multipleRowIndex, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const void *options)
 This function is not used anymore due to the corresponding 2-row function. More...
 
static void convertOneRow_1Plane1ChannelAnd1Plane2ChannelsDownsampled2x2_To_1Plane3Channels_8BitPerChannel_Precision10Bit (const void **sources, void **targets, const unsigned int multipleRowIndex, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const void *options)
 This function is not used anymore due to the corresponding 2-row function. More...
 
static void convertTwoRows_1Plane1ChannelAnd1Plane2ChannelsDownsampled2x2_To_1Plane3Channels_8BitPerChannel_Precision6Bit (const void **sources, void **targets, const unsigned int multipleRowIndex, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const void *options)
 Converts two rows of an image with e.g., a Y_UV12 pixel format to two rows of an image with e.g., an RGB24 pixel format with 6 bit precision. More...
 
static void convertTwoRows_1Plane1ChannelAnd1Plane2ChannelsDownsampled2x2_To_1Plane3Channels_8BitPerChannel_Precision10Bit (const void **sources, void **targets, const unsigned int multipleRowIndex, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const void *options)
 Converts two rows of an image with e.g., a Y_UV12 pixel format to two rows of an image with e.g., an RGB24 pixel format with 10 bit precision. More...
 
static void convertTwoRows_1Plane3Channels_To_1Plane1ChannelAnd1Plane2ChannelsDownsampled2x2_8BitPerChannel_Precision7Bit (const void **sources, void **targets, const unsigned int multipleRowIndex, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const void *options)
 Converts two rows of an image with e.g., a RGB pixel format to two rows of an image with e.g., an Y_UV12 pixel format with 7 bit precision. More...
 
static void convertTwoRows_1Plane3Channels_To_1Plane1ChannelAnd2Planes1ChannelsDownsampled2x2_8BitPerChannel_Precision7Bit (const void **sources, void **targets, const unsigned int multipleRowIndex, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const void *options)
 Converts two rows of an image with e.g., a RGB pixel format to two rows of an image with e.g., an Y_U_V12 pixel format with 7 bit precision. More...
 
template<unsigned int tSourceChannelIndex0, unsigned int tSourceChannelIndex1, unsigned int tSourceChannelIndex2>
static void mapOneRow_3Plane1Channel_To_1Plane3Channels_8BitPerChannel (const void **sources, void **targets, const unsigned int multipleRowIndex, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const void *options)
 Converts (maps) one row of an image with e.g., a Y_U_V24 pixel format to one row of an image with e.g., an YUV24 or YVU24 pixel format. More...
 
template<unsigned int tSourceChannelIndex0, unsigned int tSourceChannelIndex1, unsigned int tSourceChannelIndex2>
static void mapOneRow_1Plane1ChannelAnd1Plane2ChannelsDownsampled2x2_To_1Plane3Channels_8BitPerChannel (const void **sources, void **targets, const unsigned int multipleRowIndex, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const void *options)
 Converts (matches) one row of an image with e.g., a Y_UV12 pixel format to one row of an image with e.g., an YUV24 or YVU24 pixel format. More...
 
template<unsigned int tSourceChannelIndex0, unsigned int tSourceChannelIndex1, unsigned int tSourceChannelIndex2>
static void mapTwoRows_1Plane1ChannelAnd1Plane2ChannelsDownsampled2x2_To_1Plane3Channels_8BitPerChannel (const void **sources, void **targets, const unsigned int multipleRowIndex, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const void *options)
 Converts (matches) two rows of an image with e.g., a Y_UV12 pixel format to two rows of an image with e.g., an YUV24 or YVU24 pixel format. More...
 
static void convertOneRow_1Plane1ChannelAnd2Planes1ChannelDownsampled2x2_To_1Plane3Channels_8BitPerChannel_Precision10Bit (const void **sources, void **targets, const unsigned int multipleRowIndex, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const void *options)
 Converts one row of an image with e.g., a Y_U_V12 pixel format to one row of an image with e.g., an RGB24 pixel format with 10 bit precision. More...
 
static void convertTwoRows_1Plane1ChannelAnd2Planes1ChannelDownsampled2x2_To_1Plane3Channels_8BitPerChannel_Precision10Bit (const void **sources, void **targets, const unsigned int multipleRowIndex, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const void *options)
 Converts two rows of an image with e.g., a Y_U_V12 pixel format to two rows of an image with e.g., an RGB24 pixel format with 10 bit precision. More...
 
template<unsigned int tSourceChannelIndex0, unsigned int tSourceChannelIndex1, unsigned int tSourceChannelIndex2>
static void mapOneRow_1Plane1ChannelAnd2Planes1ChannelDownsampled2x2_To_1Plane3Channels_8BitPerChannel (const void **sources, void **targets, const unsigned int multipleRowIndex, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const void *options)
 Converts one row of an image with e.g., a Y_U_V12 pixel format to one row of an image with e.g., an YUV24 or YVU24 pixel format. More...
 
template<unsigned int tSourceChannelIndex0, unsigned int tSourceChannelIndex1, unsigned int tSourceChannelIndex2>
static void mapTwoRows_1Plane1ChannelAnd2Planes1ChannelDownsampled2x2_To_1Plane3Channels_8BitPerChannel (const void **sources, void **targets, const unsigned int multipleRowIndex, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const void *options)
 Converts two rows of an image with e.g., a Y_U_V12 pixel format to two rows of an image with e.g., an YUV24 or YVU24 pixel format. More...
 
template<unsigned int tSourceChannelIndex0, unsigned int tSourceChannelIndex1, unsigned int tSourceChannelIndex2>
static void mapTwoRows_1Plane3Channels_To_1Plane1ChannelAnd2Planes1ChannelDownsampled2x2_8BitPerChannel (const void **sources, void **targets, const unsigned int multipleRowIndex, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const void *options)
 Converts two rows of an image with e.g., a YUV24 pixel format to two rows of an image with e.g., an Y_U_V12 or Y_V_U12 pixel format. More...
 
static void convertOneRow_3Planes1Channel_To_1Plane3Channels_8BitPerChannel_Precision6Bit (const void **sources, void **targets, const unsigned int multipleRowIndex, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const void *options)
 Converts one row of an image with e.g., a Y_U_V24 pixel format to one rows of an image with e.g., an RGB24 pixel format. More...
 
static void convertOneRow_3Planes1Channel_To_1Plane4Channels_8BitPerChannel_Precision6Bit (const void **sources, void **targets, const unsigned int multipleRowIndex, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const void *options)
 Converts one row of an image with e.g., a Y_U_V24 pixel format to one rows of an image with e.g., an RGBA32 pixel format. More...
 
static void convertOneRow_1Plane1ChannelAnd2Planes1ChannelDownsampled2x2_To_1Plane4Channels_8BitPerChannel_Precision6Bit (const void **sources, void **targets, const unsigned int multipleRowIndex, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const void *options)
 Converts one row of an image with e.g., a Y_U_V12 pixel format to one row of an image with e.g., an RGBA32 pixel format. More...
 
static void convertTwoRows_1Plane1ChannelAnd2Planes1ChannelDownsampled2x2_To_1Plane3Channels_8BitPerChannel_Precision6Bit (const void **sources, void **targets, const unsigned int multipleRowIndex, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const void *options)
 Converts two rows of an image with e.g., a Y_U_V12 pixel format to two rows of an image with e.g., an RGB24 pixel format. More...
 
static void convertTwoRows_1Plane1ChannelAnd2Planes1ChannelDownsampled2x2_To_1Plane4Channels_8BitPerChannel_Precision6Bit (const void **sources, void **targets, const unsigned int multipleRowIndex, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const void *options)
 Converts two rows of an image with e.g., a Y_U_V12 pixel format to two rows of an image with e.g., an RGBA32 pixel format. More...
 
static void convertOneRow_1Plane3ChannelsWith2ChannelsDownsampled2x1BackIsDownsampled_To_1Plane3Channels_8BitPerChannel_Precision10Bit (const void **sources, void **targets, const unsigned int multipleRowIndex, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const void *options)
 Converts one row of an image with e.g., a YUYV16 pixel format to one row of an image with e.g., an RGB24 or BGR2424 pixel format. More...
 
static void convertOneRow_1Plane3ChannelsWith2ChannelsDownsampled2x1FrontIsDownsampled_To_1Plane3Channels_8BitPerChannel_Precision10Bit (const void **sources, void **targets, const unsigned int multipleRowIndex, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const void *options)
 Converts one row of an image with e.g., a UYVY16 pixel format to one row of an image with e.g., an RGB24 or BGR2424 pixel format. More...
 
template<unsigned int tSourceChannelIndex0, unsigned int tSourceChannelIndex1, unsigned int tSourceChannelIndex2>
static void mapOneRow_1Plane3ChannelsWith2ChannelsDownsampled2x1BackIsDownsampled_To_1Plane3Channels_8BitPerChannel (const void **sources, void **targets, const unsigned int multipleRowIndex, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const void *options)
 Converts one row of an image with e.g., a YUYV16 pixel format to one row of an image with e.g., an YUV24 or YVU24 pixel format. More...
 
template<unsigned int tSourceChannelIndex0, unsigned int tSourceChannelIndex1, unsigned int tSourceChannelIndex2>
static void mapOneRow_1Plane3ChannelsWith2ChannelsDownsampled2x1FrontIsDownsampled_To_1Plane3Channels_8BitPerChannel (const void **sources, void **targets, const unsigned int multipleRowIndex, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const void *options)
 Converts one row of an image with e.g., a UYVY16 pixel format to one row of an image with e.g., an YUV24 or YVU24 pixel format. More...
 
template<unsigned int tIndexRed, unsigned int tIndexGreen, unsigned int tIndexBlue>
static void convertTwoRows_1PlaneMosaicPacked10Bit_To_1PlaneUnpacked3Channels8Bit (const void **sources, void **targets, const unsigned int multipleRowIndex, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const void *options)
 Converts two rows of an image with 3-channel Bayer mosaic pixel format with packed 10-bit pixel values to an image with 3-channel un-packed 8-bit pixel format. More...
 
template<unsigned int tIndexRed, unsigned int tIndexGreen, unsigned int tIndexBlue>
static void convertTwoRows_1PlaneMosaicPacked10Bit_To_1PlaneUnpacked3Channels16Bit (const void **sources, void **targets, const unsigned int multipleRowIndex, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const void *options)
 Converts two rows of an image with 3-channel Bayer mosaic pixel format with packed 10-bit pixel values to an image with 3-channel un-packed 16-bit pixel format. More...
 
template<unsigned int tIndexRed, unsigned int tIndexGreen, unsigned int tIndexBlue>
static void convertTwoRows_1PlaneMosaicPacked10Bit_To_1PlaneUnpacked3Channels8BitAdvanced (const void **sources, void **targets, const unsigned int multipleRowIndex, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const void *options)
 Converts two rows of an image with 3-channel Bayer mosaic pixel format with packed 10-bit pixel values to an image with 3-channel un-packed 8-bit pixel format and applies black level subtraction, white balance, and gamma encoding The layout of the parameters, options, is defined in the struct RGGB10ToRGB24AdvancedOptions. More...
 
static void mapOneRow_1Plane2Channels_To_2Planes1Channel_8BitPerChannel (const void **sources, void **targets, const unsigned int multipleRowIndex, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const void *options)
 Maps one row of a 1-plane, 2-channel image to two planes with 1 channels. More...
 
static OCEAN_FORCE_INLINE void unpack5ElementsBayerMosaicPacked10Bit (const uint8_t *const packed, uint16_t *unpacked)
 Unpacks 5 elements from a row in a packed Bayer mosaic to 4 pixels values The required memory layout of the input: A B C D X ... Bytes marked as X store two bits for each of the previous four elements: X = AABB CCDD. More...
 
template<bool tAllowLastOverlappingElement>
static OCEAN_FORCE_INLINE void unpack15ElementsBayerMosaicPacked10BitNEON (const uint8_t *const packed, uint16x8_t &unpackedAB_u_16x8, uint16x4_t &unpackedC_u_16x4)
 Unpacks 15 elements from a row in a packed Bayer mosaic to 12 pixels values The required memory layout of the input: A B C D X A B C D X A B C D X A ... Bytes marked as X store two bits for each of the previous four elements: X = AABB CCDD. More...
 
template<>
OCEAN_FORCE_INLINE void cast16Elements (const uint8_t *const source, float *const target)
 
template<>
OCEAN_FORCE_INLINE void cast16Elements (const uint8_t *const source, uint16_t *const target)
 
template<>
OCEAN_FORCE_INLINE void cast16Elements (const uint8_t *const source, int16_t *const target)
 
template<>
OCEAN_FORCE_INLINE void cast16Elements (const uint8_t *const source, uint32_t *const target)
 
template<>
OCEAN_FORCE_INLINE void cast16Elements (const uint8_t *const source, int32_t *const target)
 
template<>
OCEAN_FORCE_INLINE void cast16Elements (const float *const source, uint8_t *const target)
 

Additional Inherited Members

- Protected Types inherited from Ocean::CV::FrameConverter
template<typename TSource , typename TTarget >
using RowConversionFunction = void(*)(const TSource *sourceRow, TTarget *targetRow, const size_t width, const void *options)
 Definition of a function pointer to a function able to convert one image row from one generic pixel format to another generic pixel format. More...
 
using MultipleRowsConversionFunction = void(*)(const void **sources, void **targets, const unsigned int multipleRowIndex, const unsigned int width, const unsigned int height, const ConversionFlag conversionFlag, const void *options)
 Definition of a function pointer to a function able to convert multiple image row from an arbitrary pixel format to another arbitrary pixel format. More...
 
template<typename T >
using RowReversePixelOrderFunction = void(*)(const T *inputRow, T *targetRow, const size_t width)
 Definition of a function pointer to a function able to reverse the order of pixels in an image row with a generic pixel format. More...
 
template<typename T >
using RowReversePixelOrderInPlaceFunction = void(*)(T *row, const size_t width)
 Definition of a function pointer to a function able to reverse the order of pixels in an image row with a generic pixel format in-place. More...
 

Detailed Description

This class implements frame channel conversion, transformation and extraction functions.

Member Typedef Documentation

◆ RowOperatorFunction

template<typename TSource , typename TTarget , unsigned int tSourceChannels, unsigned int tTargetChannels>
using Ocean::CV::FrameChannels::RowOperatorFunction = void(*)(const TSource* sourceRow, TTarget* targetRow, const unsigned int width, const unsigned int height, unsigned int rowIndex, const unsigned int sourceStrideElements, const unsigned int targetStrideElements)

Definition of a function pointer to a function able to operate on an entire image row.

Member Function Documentation

◆ addChannelRow()

template<typename T , unsigned int tSourceChannels, bool tAddToFront>
void Ocean::CV::FrameChannels::addChannelRow ( const void **  sources,
void **  targets,
const unsigned int  multipleRowIndex,
const unsigned int  width,
const unsigned int  height,
const ConversionFlag  conversionFlag,
const void *  options 
)
static

Adds a channel to a given row with generic (zipped) pixel format and copies the information of the new channel from a one-channel image.

The channel can be added at new first channel or as new last channel.

Parameters
sourcesThe pointer to the multi-channel source frame and to the single-channel source frame, must be valid
targetsThe one pointer to the target image, must be valid
multipleRowIndexThe index of the multiple-row to be handled, with range [0, height - 1]
widthThe width of the frame in pixel, with range [1, infinity), must be even
heightThe height of the frame in pixel, with range [1, infinity), must be even
conversionFlagThe conversion to be applied
optionsThe 1 options parameters: padding parameters of 1-channel source frame, must be valid
Template Parameters
TData type of each channel pixel value, e.g, 'uint8_t' or 'float'
tSourceChannelsNumber of channels of the source frame (without the new channel), with range [1, infinity)
tAddToFrontTrue, to add the channel to the front (as new first channel); False, to add the channel to the back (as new last channel).

◆ addChannelValueRow()

template<typename T , unsigned int tSourceChannels, bool tAddToFront>
void Ocean::CV::FrameChannels::addChannelValueRow ( const T *  source,
T *  target,
const size_t  size,
const void *  channelValueParameter 
)
static

Adds a channel to a given row with generic (zipped) pixel format and sets all values to a specified value.

The channel can be added at new first channel or as new last channel.

Parameters
sourceThe pointer to the source pixels, must be valid
targetThe pointer to the target pixels, receiving the additional channels, must be valid
sizeThe number of source (and target pixels) to convert, with range [1, infinity)
channelValueParameterThe pointer to the value of the channel to be set (with data type 'T'), must be valid
Template Parameters
TData type of each channel pixel value, e.g, 'uint8_t' or 'float'
tSourceChannelsNumber of channels of the source frame (without the new channel), with range [1, infinity)
tAddToFrontTrue, to add the channel to the front (as new first channel); False, to add the channel to the back (as new last channel).

◆ addFirstChannel()

template<typename T , unsigned int tSourceChannels>
void Ocean::CV::FrameChannels::addFirstChannel ( const T *  source,
const T *  sourceNewChannel,
T *  target,
const unsigned int  width,
const unsigned int  height,
const ConversionFlag  conversionFlag,
const unsigned int  sourcePaddingElements,
const unsigned int  sourceNewChannelPaddingElements,
const unsigned int  targetPaddingElements,
Worker worker = nullptr 
)
inlinestatic

Adds a new channel to a given frame with zipped pixel format, the new channel will be added to the front of all existing channels.

Parameters
sourceThe source frame to which the new channel will be added, must be valid
sourceNewChannelThe 1-channel frame providing the new channel information, must be valid
targetThe target frame receiving the joined channels, must be valid
widthThe width of the frames in pixel, with range [1, infinity)
heightThe height of the frames in pixel, with range [1, infinity)
conversionFlagThe conversion to be applied
sourcePaddingElementsThe number of padding elements at the end of each source row, in elements, with range [0, infinity)
sourceNewChannelPaddingElementsThe number of padding elements at the end of each new-channel-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
Template Parameters
TData type of each channel pixel value
tSourceChannelsNumber of channels of the source frame (without the new channel), with range [1, infinity)

◆ addFirstChannelValue()

template<typename T , unsigned int tSourceChannels>
void Ocean::CV::FrameChannels::addFirstChannelValue ( const T *  source,
const T  newChannelValue,
T *  target,
const unsigned int  width,
const unsigned int  height,
const ConversionFlag  conversionFlag,
const unsigned int  sourcePaddingElements,
const unsigned int  targetPaddingElements,
Worker worker = nullptr 
)
inlinestatic

Adds a new channel to a given frame with zipped pixel format, the value of the new channel will be the same for each pixel.

Parameters
sourceThe source frame that provided the existing channels
newChannelValueValue that will be assigned to the new channel for each pixel
targetThe target frame to that the existing channels and the new channel will be added (as new first channel)
widthThe width of the frames in pixel, with range [1, infinity)
heightThe height of the frames in pixel, with range [1, infinity)
conversionFlagThe conversion to be applied
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
Template Parameters
TData type of each channel pixel value
tSourceChannelsNumber of channels of the source frame (without the new channel)

◆ addLastChannel()

template<typename T , unsigned int tSourceChannels>
void Ocean::CV::FrameChannels::addLastChannel ( const T *  source,
const T *  sourceNewChannel,
T *  target,
const unsigned int  width,
const unsigned int  height,
const ConversionFlag  conversionFlag,
const unsigned int  sourcePaddingElements,
const unsigned int  sourceNewChannelPaddingElements,
const unsigned int  targetPaddingElements,
Worker worker = nullptr 
)
inlinestatic

Adds a new channel to a given frame with zipped pixel format, the new channel will be added to the back of all existing channels.

Parameters
sourceThe source frame to which the new channel will be added, must be valid
sourceNewChannelThe 1-channel frame providing the new channel information, must be valid
targetThe target frame receiving the joined channels, must be valid
widthThe width of the frames in pixel, with range [1, infinity)
heightThe height of the frames in pixel, with range [1, infinity)
conversionFlagThe conversion to be applied
sourcePaddingElementsThe number of padding elements at the end of each source row, in elements, with range [0, infinity)
sourceNewChannelPaddingElementsThe number of padding elements at the end of each new-channel-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
Template Parameters
TData type of each channel pixel value
tSourceChannelsNumber of channels of the source frame (without the new channel), with range [1, infinity)

◆ addLastChannelValue()

template<typename T , unsigned int tSourceChannels>
void Ocean::CV::FrameChannels::addLastChannelValue ( const T *  source,
const T  newChannelValue,
T *  target,
const unsigned int  width,
const unsigned int  height,
const ConversionFlag  conversionFlag,
const unsigned int  sourcePaddingElements,
const unsigned int  targetPaddingElements,
Worker worker = nullptr 
)
inlinestatic

Adds a new channel to a given frame with zipped pixel format, the value of the new channel will be the same for each pixel.

Parameters
sourceThe source frame that provided the existing channels
newChannelValueValue that will be assigned to the new channel for each pixel
targetThe target frame to that the existing channels and the new channel will be added (as new last channel)
widthThe width of the frames in pixel, with range [1, infinity)
heightThe height of the frames in pixel, with range [1, infinity)
conversionFlagThe conversion to be applied
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
Template Parameters
TData type of each channel pixel value
tSourceChannelsNumber of channels of the source frame (without the new channel)

◆ applyAdvancedPixelModifier()

template<typename TSource , typename TTarget , unsigned int tSourceChannels, unsigned int tTargetChannels, void(*)(const TSource *, TTarget *) tPixelFunction>
void Ocean::CV::FrameChannels::applyAdvancedPixelModifier ( const TSource *  source,
TTarget *  target,
const unsigned int  width,
const unsigned int  height,
const unsigned int  sourcePaddingElements,
const unsigned int  targetPaddingElements,
const ConversionFlag  conversionFlag,
Worker worker = nullptr 
)
static

Applies a specific modifier function on each pixel.

Parameters
sourceThe source frame providing the pixel information, must be valid
targetThe target frame receiving the pixel information, must be valid
widthThe width of the source frame in pixel, with range [1, infinity)
heightThe height 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)
conversionFlagThe conversion to be applied
workerOptional worker object to distribute the computation
Template Parameters
TSourceData type of each source channel pixel value
TTargetData type of each target channel pixel value
tSourceChannelsNumber of source data channels, with range [1, infinity)
tTargetChannelsNumber of target data channels, with range [1, infinity)
tPixelFunctionPixel modification function

◆ applyAdvancedPixelModifierSubset()

template<typename TSource , typename TTarget , unsigned int tSourceChannels, unsigned int tTargetChannels, void(*)(const TSource *, TTarget *) tPixelFunction>
void Ocean::CV::FrameChannels::applyAdvancedPixelModifierSubset ( const TSource *  source,
TTarget *  target,
const unsigned int  width,
const unsigned int  height,
const unsigned int  sourcePaddingElements,
const unsigned int  targetPaddingElements,
const ConversionFlag  conversionFlag,
const unsigned int  firstRow,
const unsigned int  numberRows 
)
staticprotected

Applies a specific modifier function on each pixel.

Parameters
sourceThe source frame providing the pixel information, must be valid
targetThe target frame receiving the pixel information, must be valid
widthThe width of the source frame in pixel, with range [1, infinity)
heightThe height 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)
conversionFlagThe conversion to be applied
firstRowFirst row to be handled
numberRowsNumber of rows to be handled
Template Parameters
TSourceData type of each source channel pixel value
TTargetData type of each target channel pixel value
tSourceChannelsNumber of source data channels, with range [1, infinity)
tTargetChannelsNumber of target data channels, with range [1, infinity)
tPixelFunctionPixel modification function

◆ applyBivariateOperator()

template<typename TSource0 , typename TSource1 , typename TTarget , typename TIntermediate , unsigned int tSourceChannels, unsigned int tTargetChannels, void(*)(const TSource0 *, const TSource1 *, TTarget *) tOperator>
void Ocean::CV::FrameChannels::applyBivariateOperator ( const TSource0 *  source0,
const TSource1 *  source1,
TTarget *  target,
const unsigned int  width,
const unsigned int  height,
const unsigned int  source0PaddingElements,
const unsigned int  source1PaddingElements,
const unsigned int  targetPaddingElements,
const ConversionFlag  conversionFlag,
Worker worker = nullptr 
)
static

Generic bivariate pixel operations Applies bivariate per-pixel operators: C(y, x) = op(A(y, x), B(y, x)).

Input and output must have the same frame type and have a single plane.

Parameters
source0First source frame
source1Second source frame
targetThe target frame
widthThe width of the source frame in pixel, with range [1, infinity)
heightThe height of the source frame in pixel, with range [1, infinity)
source0PaddingElementsThe number of padding elements at the end of each row of the first source, in elements, with range [0, infinity)
source1PaddingElementsThe number of padding elements at the end of each row of the second source, in elements, with range [0, infinity)
targetPaddingElementsThe number of padding elements at the end of each target row, in elements, with range [0, infinity)
conversionFlagThe conversion to be applied
workerOptional worker object to distribute the computation
Template Parameters
TSource0Type of the first data source
TSource1Type of the second data source
TTargetType of the target
TIntermediateData type that is used for the computation of intermediate results, e.g. if TSource0 and TSource1 are different
tSourceChannelsNumber of channels of the two sources, range: [1, infinity)
tTargetChannelsNumber of channels of the target, range: [1, infinity)
tOperatorThe operation (function) that is applied on both sources to yield the value for the target (called per pixel)

◆ applyBivariateOperatorSubset()

template<typename TSource0 , typename TSource1 , typename TTarget , typename TIntermediate , unsigned int tSourceChannels, unsigned int tTargetChannels, void(*)(const TSource0 *, const TSource1 *, TTarget *) tOperator>
void Ocean::CV::FrameChannels::applyBivariateOperatorSubset ( const TSource0 *  source0,
const TSource1 *  source1,
TTarget *  target,
const unsigned int  width,
const unsigned int  height,
const unsigned int  source0PaddingElements,
const unsigned int  source1PaddingElements,
const unsigned int  targetPaddingElements,
const ConversionFlag  conversionFlag,
const unsigned int  firstRow,
const unsigned int  numberRows 
)
staticprotected

Generic bivariate pixel operations.

Parameters
source0First source frame
source1Second source frame
targetThe target frame
widthThe width of the source frame in pixel, with range [1, infinity)
heightThe height of the source frame in pixel, with range [1, infinity)
source0PaddingElementsThe number of padding elements at the end of each row of the first source, in elements, with range [0, infinity)
source1PaddingElementsThe number of padding elements at the end of each row of the second source, in elements, with range [0, infinity)
targetPaddingElementsThe number of padding elements at the end of each target row, in elements, with range [0, infinity)
conversionFlagThe conversion to be applied
firstRowFirst row to be handled
numberRowsNumber of rows to be handled
Template Parameters
TSource0Type of the first data source
TSource1Type of the second data source
TTargetType of the target
TIntermediateType for the computation of intermediate result, e.g. if TSource0 and TSource1 are different
tSourceChannelsNumber of channels of the two sources, range: [1, infinity)
tTargetChannelsNumber of channels of the target, range: [1, infinity)
tOperatorThe operation (function) that is applied on both sources to yield the value for the target (called per pixel)

◆ applyPixelModifier()

template<typename T , unsigned int tChannels, void(*)(const T *, T *) tPixelFunction>
void Ocean::CV::FrameChannels::applyPixelModifier ( const T *  source,
T *  target,
const unsigned int  width,
const unsigned int  height,
const ConversionFlag  conversionFlag,
Worker worker = nullptr 
)
static

Applies a specific modifier function on each pixel.

Parameters
sourceThe source frame providing the pixel information, must be valid
targetThe target frame receiving the pixel information, must be valid
widthThe width of the source frame in pixel, with range (0, infinity)
heightThe height of the source frame in pixel, with range (0, infinity)
conversionFlagThe conversion to be applied
workerOptional worker object to distribute the computation
Template Parameters
TData type of each channel pixel value
tChannelsNumber of data channels, with range [1, infinity)
tPixelFunctionPixel modification function

◆ applyPixelModifierSubset()

template<typename T , unsigned int tChannels, void(*)(const T *, T *) tPixelFunction>
void Ocean::CV::FrameChannels::applyPixelModifierSubset ( const T *  source,
T *  target,
const unsigned int  width,
const unsigned int  height,
const ConversionFlag  conversionFlag,
const unsigned int  firstRow,
const unsigned int  numberRows 
)
staticprotected

Applies a specific modifier function on each pixel.

Parameters
sourceThe source frame providing the pixel information, must be valid
targetThe target frame receiving the pixel information, must be valid
widthThe width of the source frame in pixel
heightThe height of the source frame in pixel
conversionFlagThe conversion to be applied
firstRowFirst row to be handled
numberRowsNumber of rows to be handled
Template Parameters
TData type of each channel pixel value
tChannelsNumber of data channels, with range [1, infinity)
tPixelFunctionPixel modification function

◆ applyRowOperator()

template<typename TSource , typename TTarget , unsigned int tSourceChannels, unsigned int tTargetChannels>
void Ocean::CV::FrameChannels::applyRowOperator ( const TSource *  source,
TTarget *  target,
const unsigned int  width,
const unsigned int  height,
const unsigned int  sourcePaddingElements,
const unsigned int  targetPaddingElements,
const RowOperatorFunction< TSource, TTarget, tSourceChannels, tTargetChannels > &  rowOperatorFunction,
Worker worker = nullptr 
)
static

Applies a row operator to all rows of a source image.

The row operator is given as function pointer and is intended to transform a source row to a target row.
The function allows to implement e.g., frame filters with few lines of code, source and target frame must have the same size.

Parameters
sourceThe source frame to which the row operator is applied, must be valid
targetThe target frame receiving the result of the row operator, must be valid
widthThe width of the source frame and target frame in pixel, with range [1, infinity)
heightThe height of the source frame and target frame in pixel, with range [1, 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)
rowOperatorFunctionThe pointer to the row operator function, must be valid
workerOptional worker object to distribute the computation
Template Parameters
TSourceThe data type of the source elements
TTargetThe data type of the target elements
tSourceChannelsThe number of channels the source frame has, with range [1, infinity)
tTargetChannelsThe number of channels the target frame has, with range [1, infinity)

◆ applyRowOperatorSubset()

template<typename TSource , typename TTarget , unsigned int tSourceChannels, unsigned int tTargetChannels>
void Ocean::CV::FrameChannels::applyRowOperatorSubset ( const TSource *  source,
TTarget *  target,
const unsigned int  width,
const unsigned int  height,
const unsigned int  sourceStrideElements,
const unsigned int  targetStrideElements,
const RowOperatorFunction< TSource, TTarget, tSourceChannels, tTargetChannels >  rowOperatorFunction,
const unsigned int  firstRow,
const unsigned int  numberRows 
)
staticprotected

Applies a row operator to a subset of all rows of a source image.

The row operator is given as function pointer and is intended to transform a source row to a target row.
The function allows to implement e.g., frame filters with few lines of code, source and target frame must have the same size.

Parameters
sourceThe source frame to which the row operator is applied, must be valid
targetThe target frame receiving the result of the row operator, must be valid
widthThe width of the source frame and target frame in pixel, with range [1, infinity)
heightThe height of the source frame and target frame in pixel, with range [1, infinity)
sourceStrideElementsThe number of stride elements at the end of each source row, in elements, with range [width * tSourceChannels, infinity)
targetStrideElementsThe number of padding elements at the end of each target row, in elements, with range [width * tTargetChannels, infinity)
rowOperatorFunctionThe pointer to the row operator function, must be valid
firstRowThe first row to be handled, with range [0, height - 1]
numberRowsThe number of rows to be handled, with range [1, height - firstRow]
Template Parameters
TSourceThe data type of the source elements
TTargetThe data type of the target elements
tSourceChannelsThe number of channels the source frame has, with range [1, infinity)
tTargetChannelsThe number of channels the target frame has, with range [1, infinity)

◆ convert3ChannelsTo1Channel16Pixels8BitPerChannel7BitPrecisionSSE()

OCEAN_FORCE_INLINE void Ocean::CV::FrameChannels::convert3ChannelsTo1Channel16Pixels8BitPerChannel7BitPrecisionSSE ( const uint8_t *const  source,
uint8_t *const  target,
const __m128i &  multiplicationFactors0_128_u_16x8,
const __m128i &  multiplicationFactors1_128_u_16x8,
const __m128i &  multiplicationFactors2_128_u_16x8 
)
staticprotected

Converts 16 pixels with 3 channels per pixel to 16 pixels with one channel per pixel by a linear combination of the three channels.

This function can be used to e.g., convert RGB24 to Y8, or RGB24 to Y8. The linear combination is defined by one integer multiplication factor for each channel with 128 as denominator.
Beware: As this function applies integer multiplication factors (with 7 bits precision) the conversion result has an accuracy of +/- 2 color intensities.

Parameters
sourceThe pointer to the 16 source pixels (with 3 channels = 64 bytes) to convert, must be valid
targetThe pointer to the 16 target pixels (with 1 channel = 16 bytes) receiving the converted pixel data, must be valid
multiplicationFactors0_128_u_16x8The multiplication factor for the first channel (8 identical 16 bit values), with ranges [0, 128], while the sum of all three factors must be 128
multiplicationFactors1_128_u_16x8The multiplication factor for the second channel (8 identical 16 bit values), with ranges [0, 128], while the sum of all three factors must be 128
multiplicationFactors2_128_u_16x8The multiplication factor for the third channel (8 identical 16 bit values), with ranges [0, 128], while the sum of all three factors must be 128

◆ convert3ChannelsTo1Channel8Pixels8BitPerChannel7BitPrecisionNEON() [1/2]

template<bool tUseFactorChannel0, bool tUseFactorChannel1, bool tUseFactorChannel2>
static OCEAN_FORCE_INLINE void Ocean::CV::FrameChannels::convert3ChannelsTo1Channel8Pixels8BitPerChannel7BitPrecisionNEON ( const uint8_t *const  source,
uint8_t *const  target,
const uint8x8_t &  factorChannel0_128_u_8x8,
const uint8x8_t &  factorChannel1_128_u_8x8,
const uint8x8_t &  factorChannel2_128_u_8x8 
)
staticprotected

Converts 8 pixels with 3 channels per pixel to 8 pixels with one channel per pixel by a linear combination of the three channels.

Thus, this function can be used to e.g., convert RGB24 to Y8, or BGR24 to Y8. The linear combination is defined by one integer multiplication factor for each channel with 128 as denominator.
Beware: As this function applies integer multiplication factors (with 7 bits precision) the conversion result has an accuracy of +/- 2 color intensities.

Parameters
sourceThe pointer to the 8 source pixels (with 3 channels = 24 bytes) to convert, must be valid
targetThe pointer to the 8 target pixels (with 1 channel = 8 bytes) receiving the converted pixel data, must be valid
factorChannel0_128_u_8x8The multiplication factor (8 identical factors) for the first channel, with range [0, 128]
factorChannel1_128_u_8x8The multiplication factor (8 identical factors) for the second channel, with range [0, 128 - factorChannel0 - factorChannel2]
factorChannel2_128_u_8x8The multiplication factor (8 identical factors) for the third channel, with range [0, 128 - factorChannel0 - factorChannel1]
Template Parameters
tUseFactorChannel0True, if the value(s) of factorChannel0 is not zero; False, if the value(s) of factorChannel0 is zero
tUseFactorChannel1True, if the value(s) of factorChannel1 is not zero; False, if the value(s) of factorChannel1 is zero
tUseFactorChannel2True, if the value(s) of factorChannel2 is not zero; False, if the value(s) of factorChannel2 is zero

◆ convert3ChannelsTo1Channel8Pixels8BitPerChannel7BitPrecisionNEON() [2/2]

template<bool tUseFactorChannel0, bool tUseFactorChannel1, bool tUseFactorChannel2>
void Ocean::CV::FrameChannels::convert3ChannelsTo1Channel8Pixels8BitPerChannel7BitPrecisionNEON ( const uint8_t *const  source,
uint8_t *const  target,
const uint8x8_t &  factorChannel0_128_u_8x8,
const uint8x8_t &  factorChannel1_128_u_8x8,
const uint8x8_t &  factorChannel2_128_u_8x8 
)

◆ convert3ChannelsTo3Channels16Pixels8BitPerChannel10BitPrecisionNEON()

OCEAN_FORCE_INLINE void Ocean::CV::FrameChannels::convert3ChannelsTo3Channels16Pixels8BitPerChannel10BitPrecisionNEON ( const uint8_t *const  source,
uint8_t *const  target,
const int16x4_t &  factorChannel00_1024_s_16x4,
const int16x4_t &  factorChannel10_1024_s_16x4,
const int16x4_t &  factorChannel20_1024_s_16x4,
const int16x4_t &  factorChannel01_1024_s_16x4,
const int16x4_t &  factorChannel11_1024_s_16x4,
const int16x4_t &  factorChannel21_1024_s_16x4,
const int16x4_t &  factorChannel02_1024_s_16x4,
const int16x4_t &  factorChannel12_1024_s_16x4,
const int16x4_t &  factorChannel22_1024_s_16x4,
const int32x4_t &  biasChannel0_1024_s_32x4,
const int32x4_t &  biasChannel1_1024_s_32x4,
const int32x4_t &  biasChannel2_1024_s_32x4 
)
staticprotected

Converts 8 pixels with 3 channels per pixel to 16 pixels with three channel per pixel by a linear combination of the three channels plus a bias (translation) parameter.

Thus, this function can be used to e.g., convert YUV24 to RGB24, or YVU24 to BGR24. The linear combination is defined by three integer multiplication factor for each source channel with 1024 as denominator. plus one bias (translation) parameter for each source channel (also with 1024 as denominator).
Beware: As this function applies integer multiplication factors (with 10 bits precision) the conversion result has an accuracy of +/- 1 color intensities.
The transformation is based on the following pattern:

t0 = f00 * s0 + f01 * s1 + f02 * s2 + b0
t1 = f10 * s0 + f11 * s1 + f12 * s2 + b1
t2 = f20 * s0 + f21 * s1 + f22 * s2 + b2

With t target, s source, f factor, and b bias.

Parameters
sourceThe pointer to the 16 source pixels (with 3 channels = 24 bytes) to convert, must be valid
targetThe pointer to the 16 target pixels (with 3 channels = 24 bytes) receiving the converted pixel data, must be valid
factorChannel00_1024_s_16x4The multiplication factor (4 identical factors) for the first source channel and for the first target channel, with range [-32767, 32767]
factorChannel10_1024_s_16x4The multiplication factor (4 identical factors) for the first source channel and for the second target channel, with range [-32767, 32767]
factorChannel20_1024_s_16x4The multiplication factor (4 identical factors) for the first source channel and for the third target channel, with range [-32767, 32767]
factorChannel01_1024_s_16x4The multiplication factor (4 identical factors) for the second source channel and for the first target channel, with range [-32767, 32767]
factorChannel11_1024_s_16x4The multiplication factor (4 identical factors) for the second source channel and for the second target channel, with range [-32767, 32767]
factorChannel21_1024_s_16x4The multiplication factor (4 identical factors) for the second source channel and for the third target channel, with range [-32767, 32767]
factorChannel02_1024_s_16x4The multiplication factor (4 identical factors) for the third source channel and for the first target channel, with range [-32767, 32767]
factorChannel12_1024_s_16x4The multiplication factor (4 identical factors) for the third source channel and for the second target channel, with range [-32767, 32767
factorChannel22_1024_s_16x4The multiplication factor (4 identical factors) for the third source channel and for the third target channel, with range [-32767, 32767]
biasChannel0_1024_s_32x4The bias (translation) value for the first target channel, with range [-32767, 32767]
biasChannel1_1024_s_32x4The bias (translation) value for the second target channel, with range [-32767, 32767]
biasChannel2_1024_s_32x4The bias (translation) value for the third target channel, with range [-32767, 32767]

◆ convert3ChannelsTo3Channels16Pixels8BitPerChannel10BitPrecisionSSE()

OCEAN_FORCE_INLINE void Ocean::CV::FrameChannels::convert3ChannelsTo3Channels16Pixels8BitPerChannel10BitPrecisionSSE ( const uint8_t *const  source,
uint8_t *const  target,
const __m128i &  factorChannel00_1024_s_16x8,
const __m128i &  factorChannel10_1024_s_16x8,
const __m128i &  factorChannel20_1024_s_16x8,
const __m128i &  factorChannel01_1024_s_16x8,
const __m128i &  factorChannel11_1024_s_16x8,
const __m128i &  factorChannel21_1024_s_16x8,
const __m128i &  factorChannel02_1024_s_16x8,
const __m128i &  factorChannel12_1024_s_16x8,
const __m128i &  factorChannel22_1024_s_16x8,
const __m128i &  biasChannel0_1024_s_32x4,
const __m128i &  biasChannel1_1024_s_32x4,
const __m128i &  biasChannel2_1024_s_32x4 
)
staticprotected

Converts 16 pixels with 3 channels per pixel to 16 pixels with three channel per pixel by a linear combination of the three channels plus a bias (translation) parameter.

Thus, this function can be used to e.g., convert RGB24 to YUV24, or YUV24 to RGB24. The linear combination is defined by three integer multiplication factor for each source channel with 1024 as denominator. plus one bias (translation) parameter for each source channel (with 1 as denominator).
Beware: As this function applies integer multiplication factors (with 10 bits precision) the conversion result has an accuracy of +/- 1 color intensities.
The transformation is based on the following pattern:

t0 = f00 * s0 + f01 * s1 + f02 * s2 + b0
t1 = f10 * s0 + f11 * s1 + f12 * s2 + b1
t2 = f20 * s0 + f21 * s1 + f22 * s2 + b2

With t target, s source, f factor, and b bias.

Parameters
sourceThe pointer to the 16 source pixels (with 3 channels = 48 bytes) to convert, must be valid
targetThe pointer to the 16 target pixels (with 3 channels = 48 bytes) receiving the converted pixel data, must be valid
factorChannel00_1024_s_16x8The multiplication factor (8 identical factors) for the first source channel and for the first target channel, with range [-1024 * 16, 1024 * 16]
factorChannel10_1024_s_16x8The multiplication factor (8 identical factors) for the first source channel and for the second target channel, with range [-1024 * 16, 1024 * 16]
factorChannel20_1024_s_16x8The multiplication factor (8 identical factors) for the first source channel and for the third target channel, with range [-1024 * 16, 1024 * 16]
factorChannel01_1024_s_16x8The multiplication factor (8 identical factors) for the second source channel and for the first target channel, with range [-1024 * 16, 1024 * 16]
factorChannel11_1024_s_16x8The multiplication factor (8 identical factors) for the second source channel and for the second target channel, with range [-1024 * 16, 1024 * 16]
factorChannel21_1024_s_16x8The multiplication factor (8 identical factors) for the second source channel and for the third target channel, with range [-1024 * 16, 1024 * 16]
factorChannel02_1024_s_16x8The multiplication factor (8 identical factors) for the third source channel and for the first target channel, with range [-1024 * 16, 1024 * 16]
factorChannel12_1024_s_16x8The multiplication factor (8 identical factors) for the third source channel and for the second target channel, with range [-1024 * 16, 1024 * 16]
factorChannel22_1024_s_16x8The multiplication factor (8 identical factors) for the third source channel and for the third target channel, with range [-1024 * 16, 1024 * 16]
biasChannel0_1024_s_32x4The bias (translation) value for the first target channel, with range [-1024 * 16, 1024 * 16]
biasChannel1_1024_s_32x4The bias (translation) value for the second target channel, with range [-1024 * 16, 1024 * 16]
biasChannel2_1024_s_32x4The bias (translation) value for the third target channel, with range [-1024 * 16, 1024 * 16]

precise color space conversion:

◆ convert3ChannelsTo3Channels16Pixels8BitPerChannel6BitPrecisionNEON()

OCEAN_FORCE_INLINE void Ocean::CV::FrameChannels::convert3ChannelsTo3Channels16Pixels8BitPerChannel6BitPrecisionNEON ( const uint8_t *const  source,
uint8_t *const  target,
const int16x8_t &  factorChannel00_64_s_16x8,
const int16x8_t &  factorChannel10_64_s_16x8,
const int16x8_t &  factorChannel20_64_s_16x8,
const int16x8_t &  factorChannel01_64_s_16x8,
const int16x8_t &  factorChannel11_64_s_16x8,
const int16x8_t &  factorChannel21_64_s_16x8,
const int16x8_t &  factorChannel02_64_s_16x8,
const int16x8_t &  factorChannel12_64_s_16x8,
const int16x8_t &  factorChannel22_64_s_16x8,
const uint8x8_t &  biasChannel0_u_8x8,
const uint8x8_t &  biasChannel1_u_8x8,
const uint8x8_t &  biasChannel2_u_8x8 
)
staticprotected

Converts 16 pixels with 3 channels per pixel to 16 pixels with three channel per pixel by a linear combination of the three channels plus an in advance bias (translation) parameter.

Thus, this function can be used to e.g., convert RGB24 to YUV24, or RGB24 to YUV24. The linear combination is defined by three integer multiplication factor for each source channel with 64 as denominator. plus one bias (translation) parameter for each source channel (with 1 as denominator).
Beware: As this function applies integer multiplication factors (with 6 bits precision) the conversion result has an accuracy of +/- 4 color intensities.
The transformation is based on the following pattern:

t0 = clamp(0, f00 * (s0 - b0) + f01 * (s1 - b1) + f02 * (s2 - b2), 255)
t1 = clamp(0, f10 * (s0 - b0) + f11 * (s1 - b1) + f12 * (s2 - b2), 255)
t2 = clamp(0, f20 * (s0 - b0) + f21 * (s1 - b1) + f22 * (s2 - b2), 255)

With t target, s source, f factor, and b bias/translation.

Parameters
sourceThe pointer to the 16 source pixels (with 3 channels = 48 bytes) to convert, must be valid
targetThe pointer to the 16 target pixels (with 3 channels = 48 bytes) receiving the converted pixel data, must be valid
factorChannel00_64_s_16x8The multiplication factor (8 identical factors) for the first source channel and for the first target channel, with range [-127, 127]
factorChannel10_64_s_16x8The multiplication factor (8 identical factors) for the first source channel and for the second target channel, with range [-127, 127]
factorChannel20_64_s_16x8The multiplication factor (8 identical factors) for the first source channel and for the third target channel, with range [-127, 127]
factorChannel01_64_s_16x8The multiplication factor (8 identical factors) for the second source channel and for the first target channel, with range [-127, 127]
factorChannel11_64_s_16x8The multiplication factor (8 identical factors) for the second source channel and for the second target channel, with range [-127, 127]
factorChannel21_64_s_16x8The multiplication factor (8 identical factors) for the second source channel and for the third target channel, with range [-127, 127]
factorChannel02_64_s_16x8The multiplication factor (8 identical factors) for the third source channel and for the first target channel, with range [-127, 127]
factorChannel12_64_s_16x8The multiplication factor (8 identical factors) for the third source channel and for the second target channel, with range [-127, 127]
factorChannel22_64_s_16x8The multiplication factor (8 identical factors) for the third source channel and for the third target channel, with range [-127, 127]
biasChannel0_u_8x8The bias (translation) value for the first target channel, with range [0, 128]
biasChannel1_u_8x8The bias (translation) value for the second target channel, with range [0, 128]
biasChannel2_u_8x8The bias (translation) value for the third target channel, with range [0, 128]

◆ convert3ChannelsTo3Channels16Pixels8BitPerChannel7BitPrecisionNEON()

OCEAN_FORCE_INLINE void Ocean::CV::FrameChannels::convert3ChannelsTo3Channels16Pixels8BitPerChannel7BitPrecisionNEON ( const uint8_t *const  source,
uint8_t *const  target,
const int16x8_t &  factorChannel00_128_s_16x8,
const int16x8_t &  factorChannel10_128_s_16x8,
const int16x8_t &  factorChannel20_128_s_16x8,
const int16x8_t &  factorChannel01_128_s_16x8,
const int16x8_t &  factorChannel11_128_s_16x8,
const int16x8_t &  factorChannel21_128_s_16x8,
const int16x8_t &  factorChannel02_128_s_16x8,
const int16x8_t &  factorChannel12_128_s_16x8,
const int16x8_t &  factorChannel22_128_s_16x8,
const int16x8_t &  biasChannel0_128_s_16x8,
const int16x8_t &  biasChannel1_128_s_16x8,
const int16x8_t &  biasChannel2_128_s_16x8 
)
staticprotected

Converts 16 pixels with 3 channels per pixel to 16 pixels with 3 channels per pixel by a linear combination of the three channels plus a bias (translation) parameter.

Thus, this function can be used to e.g., convert RGB24 to YUV24, or YUV24 to RGB24. The linear combination is defined by three integer multiplication factor for each source channel with 128 as denominator. plus one bias (translation) parameter for each source channel (with 128 as denominator).
Beware: As this function applies integer multiplication factors (with 7 bits precision) the conversion result has an accuracy of +/- 2 color intensities.
The transformation is based on the following pattern:

t0 = f00 * s0 + f01 * s1 + f02 * s2 + b0
t1 = f10 * s0 + f11 * s1 + f12 * s2 + b1
t2 = f20 * s0 + f21 * s1 + f22 * s2 + b2

With t target, s source, f factor, and b bias.

Parameters
sourceThe pointer to the 16 source pixels (with 3 channels = 48 bytes) to convert, must be valid
targetThe pointer to the 16 target pixels (with 3 channels = 48 bytes) receiving the converted pixel data, must be valid
factorChannel00_128_s_16x8The multiplication factor (8 identical factors) for the first source channel and for the first target channel, with range [-127, 127]
factorChannel10_128_s_16x8The multiplication factor (8 identical factors) for the first source channel and for the second target channel, with range [-127, 127]
factorChannel20_128_s_16x8The multiplication factor (8 identical factors) for the first source channel and for the third target channel, with range [-127, 127]
factorChannel01_128_s_16x8The multiplication factor (8 identical factors) for the second source channel and for the first target channel, with range [-127, 127]
factorChannel11_128_s_16x8The multiplication factor (8 identical factors) for the second source channel and for the second target channel, with range [-127, 127]
factorChannel21_128_s_16x8The multiplication factor (8 identical factors) for the second source channel and for the third target channel, with range [-127, 127]
factorChannel02_128_s_16x8The multiplication factor (8 identical factors) for the third source channel and for the first target channel, with range [-127, 127]
factorChannel12_128_s_16x8The multiplication factor (8 identical factors) for the third source channel and for the second target channel, with range [-127, 127
factorChannel22_128_s_16x8The multiplication factor (8 identical factors) for the third source channel and for the third target channel, with range [-127, 127]
biasChannel0_128_s_16x8The bias (translation) value for the first target channel, with range [-128 * 128, 128 * 128]
biasChannel1_128_s_16x8The bias (translation) value for the second target channel, with range [-128 * 128, 128 * 128]
biasChannel2_128_s_16x8The bias (translation) value for the third target channel, with range [-128 * 128, 128 * 128]

◆ convert3ChannelsTo3Channels16Pixels8BitPerChannel7BitPrecisionSSE()

OCEAN_FORCE_INLINE void Ocean::CV::FrameChannels::convert3ChannelsTo3Channels16Pixels8BitPerChannel7BitPrecisionSSE ( const uint8_t *const  source,
uint8_t *const  target,
const __m128i &  factorChannel00_128_s_16x8,
const __m128i &  factorChannel10_128_s_16x8,
const __m128i &  factorChannel20_128_s_16x8,
const __m128i &  factorChannel01_128_s_16x8,
const __m128i &  factorChannel11_128_s_16x8,
const __m128i &  factorChannel21_128_s_16x8,
const __m128i &  factorChannel02_128_s_16x8,
const __m128i &  factorChannel12_128_s_16x8,
const __m128i &  factorChannel22_128_s_16x8,
const __m128i &  biasChannel0_s_16x8,
const __m128i &  biasChannel1_s_16x8,
const __m128i &  biasChannel2_s_16x8 
)
staticprotected

Converts 16 pixels with 3 channels per pixel to 16 pixels with three channel per pixel by a linear combination of the three channels plus a bias (translation) parameter.

Thus, this function can be used to e.g., convert RGB24 to YUV24, or YUV24 to RGB24. The linear combination is defined by three integer multiplication factor for each source channel with 128 as denominator. plus one bias (translation) parameter for each source channel (with 1 as denominator).
Beware: As this function applies integer multiplication factors (with 7 bits precision) the conversion result has an accuracy of +/- 2 color intensities.
The transformation is based on the following pattern:

t0 = f00 * s0 + f01 * s1 + f02 * s2 + b0
t1 = f10 * s0 + f11 * s1 + f12 * s2 + b1
t2 = f20 * s0 + f21 * s1 + f22 * s2 + b2

With t target, s source, f factor, and b bias.

Parameters
sourceThe pointer to the 16 source pixels (with 3 channels = 48 bytes) to convert, must be valid
targetThe pointer to the 16 target pixels (with 3 channels = 48 bytes) receiving the converted pixel data, must be valid
factorChannel00_128_s_16x8The multiplication factor (8 identical factors) for the first source channel and for the first target channel, with range [-127, 127]
factorChannel10_128_s_16x8The multiplication factor (8 identical factors) for the first source channel and for the second target channel, with range [-127, 127]
factorChannel20_128_s_16x8The multiplication factor (8 identical factors) for the first source channel and for the third target channel, with range [-127, 127]
factorChannel01_128_s_16x8The multiplication factor (8 identical factors) for the second source channel and for the first target channel, with range [-127, 127]
factorChannel11_128_s_16x8The multiplication factor (8 identical factors) for the second source channel and for the second target channel, with range [-127, 127]
factorChannel21_128_s_16x8The multiplication factor (8 identical factors) for the second source channel and for the third target channel, with range [-127, 127]
factorChannel02_128_s_16x8The multiplication factor (8 identical factors) for the third source channel and for the first target channel, with range [-127, 127]
factorChannel12_128_s_16x8The multiplication factor (8 identical factors) for the third source channel and for the second target channel, with range [-127, 127
factorChannel22_128_s_16x8The multiplication factor (8 identical factors) for the third source channel and for the third target channel, with range [-127, 127]
biasChannel0_s_16x8The bias (translation) value for the first target channel, with range [-127, 127]
biasChannel1_s_16x8The bias (translation) value for the second target channel, with range [-127, 127]
biasChannel2_s_16x8The bias (translation) value for the third target channel, with range [-127, 127]

◆ convert3ChannelsTo3Channels8Pixels8BitPerChannel10BitPrecisionNEON()

OCEAN_FORCE_INLINE void Ocean::CV::FrameChannels::convert3ChannelsTo3Channels8Pixels8BitPerChannel10BitPrecisionNEON ( const uint8_t *const  source,
uint8_t *const  target,
const int16x4_t &  factorChannel00_1024_s_16x4,
const int16x4_t &  factorChannel10_1024_s_16x4,
const int16x4_t &  factorChannel20_1024_s_16x4,
const int16x4_t &  factorChannel01_1024_s_16x4,
const int16x4_t &  factorChannel11_1024_s_16x4,
const int16x4_t &  factorChannel21_1024_s_16x4,
const int16x4_t &  factorChannel02_1024_s_16x4,
const int16x4_t &  factorChannel12_1024_s_16x4,
const int16x4_t &  factorChannel22_1024_s_16x4,
const int32x4_t &  biasChannel0_1024_s_32x4,
const int32x4_t &  biasChannel1_1024_s_32x4,
const int32x4_t &  biasChannel2_1024_s_32x4 
)
staticprotected

Converts 8 pixels with 3 channels per pixel to 8 pixels with three channel per pixel by a linear combination of the three channels plus a bias (translation) parameter.

Thus, this function can be used to e.g., convert YUV24 to RGB24, or YVU24 to BGR24. The linear combination is defined by three integer multiplication factor for each source channel with 1024 as denominator. plus one bias (translation) parameter for each source channel (also with 1024 as denominator).
Beware: As this function applies integer multiplication factors (with 10 bits precision) the conversion result has an accuracy of +/- 1 color intensities.
The transformation is based on the following pattern:

t0 = f00 * s0 + f01 * s1 + f02 * s2 + b0
t1 = f10 * s0 + f11 * s1 + f12 * s2 + b1
t2 = f20 * s0 + f21 * s1 + f22 * s2 + b2

With t target, s source, f factor, and b bias.

Parameters
sourceThe pointer to the 8 source pixels (with 3 channels = 24 bytes) to convert, must be valid
targetThe pointer to the 8 target pixels (with 3 channels = 24 bytes) receiving the converted pixel data, must be valid
factorChannel00_1024_s_16x4The multiplication factor (4 identical factors) for the first source channel and for the first target channel, with range [-32767, 32767]
factorChannel10_1024_s_16x4The multiplication factor (4 identical factors) for the first source channel and for the second target channel, with range [-32767, 32767]
factorChannel20_1024_s_16x4The multiplication factor (4 identical factors) for the first source channel and for the third target channel, with range [-32767, 32767]
factorChannel01_1024_s_16x4The multiplication factor (4 identical factors) for the second source channel and for the first target channel, with range [-32767, 32767]
factorChannel11_1024_s_16x4The multiplication factor (4 identical factors) for the second source channel and for the second target channel, with range [-32767, 32767]
factorChannel21_1024_s_16x4The multiplication factor (4 identical factors) for the second source channel and for the third target channel, with range [-32767, 32767]
factorChannel02_1024_s_16x4The multiplication factor (4 identical factors) for the third source channel and for the first target channel, with range [-32767, 32767]
factorChannel12_1024_s_16x4The multiplication factor (4 identical factors) for the third source channel and for the second target channel, with range [-32767, 32767
factorChannel22_1024_s_16x4The multiplication factor (4 identical factors) for the third source channel and for the third target channel, with range [-32767, 32767]
biasChannel0_1024_s_32x4The bias (translation) value for the first target channel, with range [-32767, 32767]
biasChannel1_1024_s_32x4The bias (translation) value for the second target channel, with range [-32767, 32767]
biasChannel2_1024_s_32x4The bias (translation) value for the third target channel, with range [-32767, 32767]

◆ convert3ChannelsTo3Channels8Pixels8BitPerChannel6BitPrecisionNEON()

OCEAN_FORCE_INLINE void Ocean::CV::FrameChannels::convert3ChannelsTo3Channels8Pixels8BitPerChannel6BitPrecisionNEON ( const uint8_t *const  source,
uint8_t *const  target,
const int16x8_t &  factorChannel00_64_s_16x8,
const int16x8_t &  factorChannel10_64_s_16x8,
const int16x8_t &  factorChannel20_64_s_16x8,
const int16x8_t &  factorChannel01_64_s_16x8,
const int16x8_t &  factorChannel11_64_s_16x8,
const int16x8_t &  factorChannel21_64_s_16x8,
const int16x8_t &  factorChannel02_64_s_16x8,
const int16x8_t &  factorChannel12_64_s_16x8,
const int16x8_t &  factorChannel22_64_s_16x8,
const uint8x8_t &  biasChannel0_u_8x8,
const uint8x8_t &  biasChannel1_u_8x8,
const uint8x8_t &  biasChannel2_u_8x8 
)
staticprotected

Converts 8 pixels with 3 channels per pixel to 8 pixels with three channel per pixel by a linear combination of the three channels plus an in advance bias (translation) parameter.

Thus, this function can be used to e.g., convert RGB24 to YUV24, or RGB24 to YUV24. The linear combination is defined by three integer multiplication factor for each source channel with 64 as denominator. plus one bias (translation) parameter for each source channel (with 1 as denominator).
Beware: As this function applies integer multiplication factors (with 6 bits precision) the conversion result has an accuracy of +/- 4 color intensities.
The transformation is based on the following pattern:

t0 = clamp(0, f00 * (s0 - b0) + f01 * (s1 - b1) + f02 * (s2 - b2), 255)
t1 = clamp(0, f10 * (s0 - b0) + f11 * (s1 - b1) + f12 * (s2 - b2), 255)
t2 = clamp(0, f20 * (s0 - b0) + f21 * (s1 - b1) + f22 * (s2 - b2), 255)

With t target, s source, f factor, and b bias/translation.

Parameters
sourceThe pointer to the 8 source pixels (with 3 channels = 24 bytes) to convert, must be valid
targetThe pointer to the 8 target pixels (with 3 channels = 24 bytes) receiving the converted pixel data, must be valid
factorChannel00_64_s_16x8The multiplication factor (8 identical factors) for the first source channel and for the first target channel, with range [-127, 127]
factorChannel10_64_s_16x8The multiplication factor (8 identical factors) for the first source channel and for the second target channel, with range [-127, 127]
factorChannel20_64_s_16x8The multiplication factor (8 identical factors) for the first source channel and for the third target channel, with range [-127, 127]
factorChannel01_64_s_16x8The multiplication factor (8 identical factors) for the second source channel and for the first target channel, with range [-127, 127]
factorChannel11_64_s_16x8The multiplication factor (8 identical factors) for the second source channel and for the second target channel, with range [-127, 127]
factorChannel21_64_s_16x8The multiplication factor (8 identical factors) for the second source channel and for the third target channel, with range [-127, 127]
factorChannel02_64_s_16x8The multiplication factor (8 identical factors) for the third source channel and for the first target channel, with range [-127, 127]
factorChannel12_64_s_16x8The multiplication factor (8 identical factors) for the third source channel and for the second target channel, with range [-127, 127]
factorChannel22_64_s_16x8The multiplication factor (8 identical factors) for the third source channel and for the third target channel, with range [-127, 127]
biasChannel0_u_8x8The bias (translation) value for the first target channel, with range [0, 128]
biasChannel1_u_8x8The bias (translation) value for the second target channel, with range [0, 128]
biasChannel2_u_8x8The bias (translation) value for the third target channel, with range [0, 128]

◆ convert3ChannelsTo3Channels8Pixels8BitPerChannel7BitPrecisionNEON()

OCEAN_FORCE_INLINE void Ocean::CV::FrameChannels::convert3ChannelsTo3Channels8Pixels8BitPerChannel7BitPrecisionNEON ( const uint8_t *const  source,
uint8_t *const  target,
const int16x8_t &  factorChannel00_128_s_16x8,
const int16x8_t &  factorChannel10_128_s_16x8,
const int16x8_t &  factorChannel20_128_s_16x8,
const int16x8_t &  factorChannel01_128_s_16x8,
const int16x8_t &  factorChannel11_128_s_16x8,
const int16x8_t &  factorChannel21_128_s_16x8,
const int16x8_t &  factorChannel02_128_s_16x8,
const int16x8_t &  factorChannel12_128_s_16x8,
const int16x8_t &  factorChannel22_128_s_16x8,
const int16x8_t &  biasChannel0_128_s_16x8,
const int16x8_t &  biasChannel1_128_s_16x8,
const int16x8_t &  biasChannel2_128_s_16x8 
)
staticprotected

Converts 8 pixels with 3 channels per pixel to 8 pixels with three channel per pixel by a linear combination of the three channels plus a bias (translation) parameter.

Thus, this function can be used to e.g., convert RGB24 to YUV24, or YUV24 to RGB24. The linear combination is defined by three integer multiplication factor for each source channel with 128 as denominator. plus one bias (translation) parameter for each source channel (also with 128 as denominator).
Beware: As this function applies integer multiplication factors (with 7 bits precision) the conversion result has an accuracy of +/- 2 color intensities.
The transformation is based on the following pattern:

t0 = f00 * s0 + f01 * s1 + f02 * s2 + b0
t1 = f10 * s0 + f11 * s1 + f12 * s2 + b1
t2 = f20 * s0 + f21 * s1 + f22 * s2 + b2

With t target, s source, f factor, and b bias.

Parameters
sourceThe pointer to the 8 source pixels (with 3 channels = 24 bytes) to convert, must be valid
targetThe pointer to the 8 target pixels (with 3 channels = 24 bytes) receiving the converted pixel data, must be valid
factorChannel00_128_s_16x8The multiplication factor (8 identical factors) for the first source channel and for the first target channel, with range [-127, 127]
factorChannel10_128_s_16x8The multiplication factor (8 identical factors) for the first source channel and for the second target channel, with range [-127, 127]
factorChannel20_128_s_16x8The multiplication factor (8 identical factors) for the first source channel and for the third target channel, with range [-127, 127]
factorChannel01_128_s_16x8The multiplication factor (8 identical factors) for the second source channel and for the first target channel, with range [-127, 127]
factorChannel11_128_s_16x8The multiplication factor (8 identical factors) for the second source channel and for the second target channel, with range [-127, 127]
factorChannel21_128_s_16x8The multiplication factor (8 identical factors) for the second source channel and for the third target channel, with range [-127, 127]
factorChannel02_128_s_16x8The multiplication factor (8 identical factors) for the third source channel and for the first target channel, with range [-127, 127]
factorChannel12_128_s_16x8The multiplication factor (8 identical factors) for the third source channel and for the second target channel, with range [-127, 127]
factorChannel22_128_s_16x8The multiplication factor (8 identical factors) for the third source channel and for the third target channel, with range [-127, 127]
biasChannel0_128_s_16x8The bias (translation) value for the first target channel, with range [-128 * 128, 128 * 128]
biasChannel1_128_s_16x8The bias (translation) value for the second target channel, with range [-128 * 128, 128 * 128]
biasChannel2_128_s_16x8The bias (translation) value for the third target channel, with range [-128 * 128, 128 * 128]

◆ convert3ChannelsTo4Channels16Pixels8BitPerChannel6BitPrecisionNEON()

OCEAN_FORCE_INLINE void Ocean::CV::FrameChannels::convert3ChannelsTo4Channels16Pixels8BitPerChannel6BitPrecisionNEON ( const uint8_t *const  source,
uint8_t *const  target,
const int16x8_t &  factorChannel00_64_s_16x8,
const int16x8_t &  factorChannel10_64_s_16x8,
const int16x8_t &  factorChannel20_64_s_16x8,
const int16x8_t &  factorChannel01_64_s_16x8,
const int16x8_t &  factorChannel11_64_s_16x8,
const int16x8_t &  factorChannel21_64_s_16x8,
const int16x8_t &  factorChannel02_64_s_16x8,
const int16x8_t &  factorChannel12_64_s_16x8,
const int16x8_t &  factorChannel22_64_s_16x8,
const uint8x8_t &  biasChannel0_u_8x8,
const uint8x8_t &  biasChannel1_u_8x8,
const uint8x8_t &  biasChannel2_u_8x8,
const uint8x16_t &  channelValue3_u_8x16 
)
staticprotected

Converts 16 pixels with 3 channels per pixel to 16 pixels with 4 channels per pixel by a linear combination of the three channels plus a bias (translation) parameter.

The fourth channel is set to a constant value, e.g., for an alpha channel.
Thus, this function can be used to e.g., convert YUV24 to RGBA32, or YVU24 to BGRA32.
The linear combination is defined by three integer multiplication factor for each source channel with 128 as denominator. plus one bias (translation) parameter for each source channel (with 128 as denominator).
Beware: As this function applies integer multiplication factors (with 7 bits precision) the conversion result has an accuracy of +/- 2 color intensities.
The transformation is based on the following pattern:

t0 = f00 * s0 + f01 * s1 + f02 * s2 + b0
t1 = f10 * s0 + f11 * s1 + f12 * s2 + b1
t2 = f20 * s0 + f21 * s1 + f22 * s2 + b2
t3 = valueChannel3

With t target, s source, f factor, and b bias.

Parameters
sourceThe pointer to the 16 source pixels (with 3 channels = 48 bytes) to convert, must be valid
targetThe pointer to the 16 target pixels (with 3 channels = 48 bytes) receiving the converted pixel data, must be valid
factorChannel00_64_s_16x8The multiplication factor (8 identical factors) for the first source channel and for the first target channel, with range [-127, 127]
factorChannel10_64_s_16x8The multiplication factor (8 identical factors) for the first source channel and for the second target channel, with range [-127, 127]
factorChannel20_64_s_16x8The multiplication factor (8 identical factors) for the first source channel and for the third target channel, with range [-127, 127]
factorChannel01_64_s_16x8The multiplication factor (8 identical factors) for the second source channel and for the first target channel, with range [-127, 127]
factorChannel11_64_s_16x8The multiplication factor (8 identical factors) for the second source channel and for the second target channel, with range [-127, 127]
factorChannel21_64_s_16x8The multiplication factor (8 identical factors) for the second source channel and for the third target channel, with range [-127, 127]
factorChannel02_64_s_16x8The multiplication factor (8 identical factors) for the third source channel and for the first target channel, with range [-127, 127]
factorChannel12_64_s_16x8The multiplication factor (8 identical factors) for the third source channel and for the second target channel, with range [-127, 127
factorChannel22_64_s_16x8The multiplication factor (8 identical factors) for the third source channel and for the third target channel, with range [-127, 127]
biasChannel0_u_8x8The bias (translation) value for the first target channel, with range [0, 128]
biasChannel1_u_8x8The bias (translation) value for the second target channel, with range [0, 128]
biasChannel2_u_8x8The bias (translation) value for the third target channel, with range [0, 138]
channelValue3_u_8x16The constant value for the fourth target channel, with range [0, 255]

◆ convert4ChannelsTo1Channel16Pixels8BitPerChannel7BitPrecisionSSE()

OCEAN_FORCE_INLINE void Ocean::CV::FrameChannels::convert4ChannelsTo1Channel16Pixels8BitPerChannel7BitPrecisionSSE ( const uint8_t *const  source,
uint8_t *const  target,
const __m128i &  multiplicationFactors0123_128_s_32x 
)
staticprotected

Converts 16 pixels with 4 channels per pixel to 16 pixels with one channel per pixel by a linear combination of the four channels.

This function can be used to e.g., convert RGBA32 to Y8, or ARGB32 to Y8, or RGB32 to Y8. The linear combination is defined by one integer multiplication factor for each channel with 128 as denominator.
Beware: As this function applies integer multiplication factors (with 7 bits precision) the conversion result has an accuracy of +/- 2 color intensities.

Parameters
sourceThe pointer to the 16 source pixels (with 4 channels = 64 bytes) to convert, must be valid
targetThe pointer to the 16 target pixels (with 1 channel = 16 bytes) receiving the converted pixel data, must be valid
multiplicationFactors0123_128_s_32xThe four individual multiplication factors, one for each channel, with ranges [0, 127], while the sum of all four factors must be 128

◆ convert4ChannelsTo1Channel8Pixels8BitPerChannel7BitPrecisionNEON() [1/2]

template<bool tUseFactorChannel0, bool tUseFactorChannel1, bool tUseFactorChannel2, bool tUseFactorChannel3>
static OCEAN_FORCE_INLINE void Ocean::CV::FrameChannels::convert4ChannelsTo1Channel8Pixels8BitPerChannel7BitPrecisionNEON ( const uint8_t *const  source,
uint8_t *const  target,
const uint8x8_t &  factorChannel0_128_u_8x8,
const uint8x8_t &  factorChannel1_128_u_8x8,
const uint8x8_t &  factorChannel2_128_u_8x8,
const uint8x8_t &  factorChannel3_128_u_8x8 
)
staticprotected

Converts 8 pixels with 4 channels per pixel to 8 pixels with one channel per pixel by a linear combination of the four channels.

Thus, this function can be used to e.g., convert RGBA32 to Y8, or ARGB32 to Y8, or RGB32 to Y8. The linear combination is defined by one integer multiplication factor for each channel with 128 as denominator.
Beware: As this function applies integer multiplication factors (with 7 bits precision) the conversion result has an accuracy of +/- 2 color intensities.

Parameters
sourceThe pointer to the 8 source pixels (with 4 channels = 32 bytes) to convert, must be valid
targetThe pointer to the 8 target pixels (with 1 channel = 8 bytes) receiving the converted pixel data, must be valid
factorChannel0_128_u_8x8The multiplication factor (8 identical factors) for the first channel, with range [0, 127]
factorChannel1_128_u_8x8The multiplication factor (8 identical factors) for the second channel, with range [0, 127 - factorChannel0 - factorChannel2 - factorChannel3]
factorChannel2_128_u_8x8The multiplication factor (8 identical factors) for the third channel, with range [0, 127 - factorChannel0 - factorChannel1 - factorChannel3]
factorChannel3_128_u_8x8The multiplication factor (8 identical factors) for the fourth channel, with range [0, 127 - factorChannel0 - factorChannel1 - factorChannel2]
Template Parameters
tUseFactorChannel0True, if the value(s) of factorChannel0 is not zero; False, if the value(s) of factorChannel0 is zero
tUseFactorChannel1True, if the value(s) of factorChannel1 is not zero; False, if the value(s) of factorChannel1 is zero
tUseFactorChannel2True, if the value(s) of factorChannel2 is not zero; False, if the value(s) of factorChannel2 is zero
tUseFactorChannel3True, if the value(s) of factorChannel3 is not zero; False, if the value(s) of factorChannel3 is zero

◆ convert4ChannelsTo1Channel8Pixels8BitPerChannel7BitPrecisionNEON() [2/2]

template<bool tUseFactorChannel0, bool tUseFactorChannel1, bool tUseFactorChannel2, bool tUseFactorChannel3>
void Ocean::CV::FrameChannels::convert4ChannelsTo1Channel8Pixels8BitPerChannel7BitPrecisionNEON ( const uint8_t *const  source,
uint8_t *const  target,
const uint8x8_t &  factorChannel0_128_u_8x8,
const uint8x8_t &  factorChannel1_128_u_8x8,
const uint8x8_t &  factorChannel2_128_u_8x8,
const uint8x8_t &  factorChannel3_128_u_8x8 
)

◆ convert4ChannelsTo2Channels16Pixels8BitPerChannel7BitPrecisionSSE()

void Ocean::CV::FrameChannels::convert4ChannelsTo2Channels16Pixels8BitPerChannel7BitPrecisionSSE ( const uint8_t *const  source,
uint8_t *const  target,
const __m128i &  multiplicationFactorsChannel0_0123_128_s_16x8,
const __m128i &  multiplicationFactorsChannel1_0123_128_s_16x8 
)
staticprotected

Converts 16 pixels with 4 channels per pixel to 16 pixels with two channel per pixel by a linear combination of the four channels.

This function can be used to e.g., convert RGBA32 to YA16, or ARGB32 to AY16. The linear combination is defined by one integer multiplication factor for each channel with 128 as denominator.
Beware: As this function applies integer multiplication factors (with 7 bits precision) the conversion result has an accuracy of +/- 2 color intensities.

Parameters
sourceThe pointer to the 16 source pixels (with 4 channels = 64 bytes) to convert, must be valid
targetThe pointer to the 16 target pixels (with 2 channel = 32 bytes) receiving the converted pixel data, must be valid
multiplicationFactorsChannel0_0123_128_s_16x8The four individual multiplication factors for the first target channel (two sets), one for each source channel, with ranges [0, 128], while the sum of all four factors must be 128
multiplicationFactorsChannel1_0123_128_s_16x8The four individual multiplication factors for the second target channel (two sets), one for each source channel, with ranges [0, 128], while the sum of all four factors must be 128

◆ convert4ChannelsTo2Channels8Pixels8BitPerChannel7BitPrecisionNEON()

OCEAN_FORCE_INLINE void Ocean::CV::FrameChannels::convert4ChannelsTo2Channels8Pixels8BitPerChannel7BitPrecisionNEON ( const uint8_t *const  source,
uint8_t *const  target,
const uint8x8_t &  factorChannel00_128_u_8x8,
const uint8x8_t &  factorChannel10_128_u_8x8,
const uint8x8_t &  factorChannel01_128_u_8x8,
const uint8x8_t &  factorChannel11_128_u_8x8,
const uint8x8_t &  factorChannel02_128_u_8x8,
const uint8x8_t &  factorChannel12_128_u_8x8,
const uint8x8_t &  factorChannel03_128_u_8x8,
const uint8x8_t &  factorChannel13_128_u_8x8 
)
staticprotected

Converts 8 pixels with 4 channels per pixel to 8 pixels with two channels per pixel by a linear combination of the four channels.

Thus, this function can be used to e.g., convert RGBA32 to YA16, or ARGB32 to AY16. The linear combination is defined by one integer multiplication factor for each channel with 128 as denominator.
Beware: As this function applies integer multiplication factors (with 7 bits precision) the conversion result has an accuracy of +/- 2 color intensities.

Parameters
sourceThe pointer to the 8 source pixels (with 4 channels = 32 bytes) to convert, must be valid
targetThe pointer to the 8 target pixels (with 1 channel = 8 bytes) receiving the converted pixel data, must be valid
factorChannel00_128_u_8x8The multiplication factor (8 identical factors) for the first target and first source channel, with range [0, 127]
factorChannel10_128_u_8x8The multiplication factor (8 identical factors) for the second target and first source channel, with range [0, 127]
factorChannel01_128_u_8x8The multiplication factor (8 identical factors) for the first target and second source channel, with range [0, 127 - factorChannel00 - factorChannel02 - factorChannel03]
factorChannel11_128_u_8x8The multiplication factor (8 identical factors) for the second target and second source channel, with range [0, 127 - factorChannel10 - factorChannel12 - factorChannel13]
factorChannel02_128_u_8x8The multiplication factor (8 identical factors) for the first target and third source channel, with range [0, 127 - factorChannel00 - factorChannel01 - factorChannel03]
factorChannel12_128_u_8x8The multiplication factor (8 identical factors) for the second target and third source channel, with range [0, 127 - factorChannel10 - factorChannel11 - factorChannel13]
factorChannel03_128_u_8x8The multiplication factor (8 identical factors) for the first target and fourth source channel, with range [0, 127 - factorChannel00 - factorChannel01 - factorChannel02]
factorChannel13_128_u_8x8The multiplication factor (8 identical factors) for the second target and fourth source channel, with range [0, 127 - factorChannel10 - factorChannel11 - factorChannel12]

◆ convertRow3ChannelsTo1Channel8BitPerChannel7BitPrecision()

template<bool tUseFactorChannel0, bool tUseFactorChannel1, bool tUseFactorChannel2>
void Ocean::CV::FrameChannels::convertRow3ChannelsTo1Channel8BitPerChannel7BitPrecision ( const uint8_t *  source,
uint8_t *  target,
const size_t  size,
const void *  channelMultiplicationFactors_128 
)
static

Converts a row of pixels with 3 channels to pixels with one channel by a linear combination of the four channels.

This function can be used to e.g., convert RGB24 to Y8, or BGR24 to Y8. The linear combination is defined by one integer multiplication factor for each channel with 128 as denominator.
Beware: As this function applies integer multiplication factors (with 7 bits precision) the conversion result has an accuracy of +/- 2 color intensities.

Parameters
sourceThe pointer to the source pixels, must be valid
targetThe pointer to the target pixels receiving the converted pixel data, must be valid
sizeThe number of source (and target pixels) to convert, with range [1, infinity)
channelMultiplicationFactors_128The three uint32_t multiplication factors, one for each channel, with range [0, 128], while the sum of all four factors must be 128, must be valid
Template Parameters
tUseFactorChannel0True, if the value(s) of factorChannel0 is not zero; False, if the value(s) of factorChannel0 is zero
tUseFactorChannel1True, if the value(s) of factorChannel1 is not zero; False, if the value(s) of factorChannel1 is zero
tUseFactorChannel2True, if the value(s) of factorChannel2 is not zero; False, if the value(s) of factorChannel2 is zero

◆ convertRow3ChannelsTo3Channels8BitPerChannel10BitPrecision()

static void Ocean::CV::FrameChannels::convertRow3ChannelsTo3Channels8BitPerChannel10BitPrecision ( const uint8_t *  source,
uint8_t *  target,
const size_t  size,
const void *  parameters 
)
static

Converts a row of pixels with 3 channels to pixels with 3 channels by a linear combination of the three channels plus a bias (translation) part.

This function can be used to e.g., convert YUV24 to RGB24, or YVU24 to BGR24. The linear combination is defined by three integer multiplication factor for each source channel with 1024 as denominator. plus one bias (translation) parameter for each source channel (with 1 as denominator).
Beware: As this function applies integer multiplication factors (with 10 bits precision) the conversion result has an accuracy of +/- 1 color intensities.
The transformation is based on the following pattern:

t0 = clamp(0, f00 * s0 + f01 * s1 + f02 * s2 + b0, 255)
t1 = clamp(0, f10 * s0 + f11 * s1 + f12 * s2 + b1, 255)
t2 = clamp(0, f20 * s0 + f21 * s1 + f22 * s2 + b2, 255)

With t target, s source, f factor, and b bias.
Factors must be specified in relation to a denominator of 1024, bias values must be specified with a denominator of 1.

Parameters
sourceThe pointer to the source pixels, must be valid
targetThe pointer to the target pixels receiving the converted pixel data, must be valid
sizeThe number of source (and target pixels) to convert, with range [1, infinity)
parametersThe 12 int32_t parameters of the column-aligned 3x4 transformation matrix: f00_1024, f10_1024, f20_1024, f01_1024, f02_1024, ..., f22_1024, b0, b1, b2, with ranges [-1024 * 16, 1024 * 16]

◆ convertRow3ChannelsTo3Channels8BitPerChannel6BitPrecision()

static void Ocean::CV::FrameChannels::convertRow3ChannelsTo3Channels8BitPerChannel6BitPrecision ( const uint8_t *  source,
uint8_t *  target,
const size_t  size,
const void *  parameters 
)
static

Converts a row of pixels with 3 channels to pixels with 3 channels by a linear combination of the three channels plus an translational part applied to the source data before applying the linear transformation.

This function can be used to e.g., convert RGB24 to YUV24, or YUV24 to RGB24. The linear combination is defined by three integer multiplication factor for each source channel with 64 as denominator, plus one translation parameter for each source channel (with 1 as denominator).
Beware: As this function applies integer multiplication factors (with 6 bits precision) the conversion result has an accuracy of +/- 4 color intensities.
The transformation is based on the following pattern:

t0 = clamp(0, f00 * (s0 - b0) + f01 * (s1 - b1) + f02 * (s2 - b2), 255)
t1 = clamp(0, f10 * (s0 - b0) + f11 * (s1 - b1) + f12 * (s2 - b2), 255)
t2 = clamp(0, f20 * (s0 - b0) + f21 * (s1 - b1) + f22 * (s2 - b2), 255)

With t target, s source, f factor, and b bias/translation.
Factors must be specified in relation to a denominator of 64, bias values must be specified with a denominator of 1.

Parameters
sourceThe pointer to the source pixels, must be valid
targetThe pointer to the target pixels receiving the converted pixel data, must be valid
sizeThe number of source (and target pixels) to convert, with range [1, infinity)
parametersThe 12 int32_t parameters of the column-aligned 3x3 transformation matrix, plus 3 translation parameters: f00_64, f10_64, f20_64, f01_64, f02_64, ..., f22_64, with ranges [-128, 128], b0, b1, b2, with ranges [0, 128]

◆ convertRow3ChannelsTo3Channels8BitPerChannel7BitPrecision()

static void Ocean::CV::FrameChannels::convertRow3ChannelsTo3Channels8BitPerChannel7BitPrecision ( const uint8_t *  source,
uint8_t *  target,
const size_t  size,
const void *  parameters 
)
static

Converts a row of pixels with 3 channels to pixels with 3 channels by a linear combination of the three channels plus a bias (translation) part.

This function can be used to e.g., convert RGB24 to YUV24, or BGR24 to YVU24. The linear combination is defined by three integer multiplication factor for each source channel with 128 as denominator, plus one bias (translation) parameter for each source channel (with 1 as denominator).
Beware: As this function applies integer multiplication factors (with 7 bits precision) the conversion result has an accuracy of +/- 2 color intensities.
The transformation is based on the following pattern:

t0 = clamp(0, f00 * s0 + f01 * s1 + f02 * s2 + b0, 255)
t1 = clamp(0, f10 * s0 + f11 * s1 + f12 * s2 + b1, 255)
t2 = clamp(0, f20 * s0 + f21 * s1 + f22 * s2 + b2, 255)

With t target, s source, f factor, and b bias.
Factors must be specified in relation to a denominator of 128, bias values must be specified with a denominator of 1.

Parameters
sourceThe pointer to the source pixels, must be valid
targetThe pointer to the target pixels receiving the converted pixel data, must be valid
sizeThe number of source (and target pixels) to convert, with range [1, infinity)
parametersThe 12 int32_t parameters of the column-aligned 3x4 transformation matrix: f00_128, f10_128, f20_128, f01_128, f02_128, ..., f22_128, b0, b1, b2, with ranges [-127, 127]

◆ convertRow3ChannelsTo4Channels8BitPerChannel6BitPrecision()

static void Ocean::CV::FrameChannels::convertRow3ChannelsTo4Channels8BitPerChannel6BitPrecision ( const uint8_t *  source,
uint8_t *  target,
const size_t  size,
const void *  parameters 
)
static

Converts a row of pixels with 3 channels to pixels with 4 channels by a linear combination of the three channels plus an translational part applied to the source data before applying the linear transformation (for the first three channels).

The fourth channel is set to a constant value, e.g., for an alpha channel.
This function can be used to e.g., convert YUV24 to RGBA32, or YVU24 to BGRA32.
The linear combination is defined by three integer multiplication factor for each source channel with 64 as denominator, plus one translation parameter for each source channel (with 1 as denominator).
Beware: As this function applies integer multiplication factors (with 6 bits precision) the conversion result has an accuracy of +/- 4 color intensities.
The transformation is based on the following pattern:

t0 = clamp(0, f00 * (s0 - b0) + f01 * (s1 - b1) + f02 * (s2 - b2), 255)
t1 = clamp(0, f10 * (s0 - b0) + f11 * (s1 - b1) + f12 * (s2 - b2), 255)
t2 = clamp(0, f20 * (s0 - b0) + f21 * (s1 - b1) + f22 * (s2 - b2), 255)
t3 = valueChannel3

With t target, s source, f factor, and b bias/translation.
Factors must be specified in relation to a denominator of 64, bias values must be specified with a denominator of 1.

Parameters
sourceThe pointer to the source pixels, must be valid
targetThe pointer to the target pixels receiving the converted pixel data, must be valid
sizeThe number of source (and target pixels) to convert, with range [1, infinity)
parametersThe 13 int32_t parameters of the column-aligned 3x3 transformation matrix, plus 3 translation parameters: f00_64, f10_64, f20_64, f01_64, f02_64, ..., f22_64, with ranges [-128, 128], b0, b1, b2, with ranges [0, 128], valueChannel3, with range [0, 255]

◆ convertRow4ChannelsTo1Channel8BitPerChannel7BitPrecision()

template<bool tUseFactorChannel0, bool tUseFactorChannel1, bool tUseFactorChannel2, bool tUseFactorChannel3>
void Ocean::CV::FrameChannels::convertRow4ChannelsTo1Channel8BitPerChannel7BitPrecision ( const uint8_t *  source,
uint8_t *  target,
const size_t  size,
const void *  channelMultiplicationFactors_128 
)
static

Converts a row of pixels with 4 channels to pixels with one channel by a linear combination of the four channels.

This function can be used to e.g., convert RGBA32 to Y8, or ARGB32 to Y8, or RGB32 to Y8. The linear combination is defined by one integer multiplication factor for each channel with 128 as denominator.
Beware: As this function applies integer multiplication factors (with 7 bits precision) the conversion result has an accuracy of +/- 2 color intensities.

t0 = f0 * s0 + f1 * s1 + f2 * s2 + f3 * s3
Parameters
sourceThe pointer to the source pixels, must be valid
targetThe pointer to the target pixels receiving the converted pixel data, must be valid
sizeThe number of source (and target pixels) to convert, with range [1, infinity)
channelMultiplicationFactors_128The four uint32_t multiplication factors, one for each channel, with range [0, 127], while the sum of all four factors must be 128, must be valid
Template Parameters
tUseFactorChannel0True, if the value(s) of factorChannel0 is not zero; False, if the value(s) of factorChannel0 is zero
tUseFactorChannel1True, if the value(s) of factorChannel1 is not zero; False, if the value(s) of factorChannel1 is zero
tUseFactorChannel2True, if the value(s) of factorChannel2 is not zero; False, if the value(s) of factorChannel2 is zero
tUseFactorChannel3True, if the value(s) of factorChannel3 is not zero; False, if the value(s) of factorChannel3 is zero

◆ convertRow4ChannelsTo2Channels8BitPerChannel7BitPrecision()

static void Ocean::CV::FrameChannels::convertRow4ChannelsTo2Channels8BitPerChannel7BitPrecision ( const uint8_t *  source,
uint8_t *  target,
const size_t  size,
const void *  multiplicationFactors_128 
)
static

Converts a row of pixels with 4 channels to pixels with two channel by a linear combination of the four channels.

This function can be used to e.g., convert RGBA32 to YA16, or ARGB32 to AY16. The linear combination is defined by one integer multiplication factor for each channel with 128 as denominator.
Beware: As this function applies integer multiplication factors (with 7 bits precision) the conversion result has an accuracy of +/- 2 color intensities. The transformation is based on the following pattern:

t0 = f00 * s0 + f01 * s1 + f02 * s2 + f03 * s3
t1 = f10 * s0 + f11 * s1 + f12 * s2 + f13 * s3
Parameters
sourceThe pointer to the source pixels, must be valid
targetThe pointer to the target pixels receiving the converted pixel data, must be valid
sizeThe number of source (and target pixels) to convert, with range [1, infinity)
multiplicationFactors_128The 8 int32_t parameters of the column-aligned 2x4 transformation matrix: f00_128, f10_128, f01_128, ..., f13_128, with range [0, 127], while the sum of all four row factors must be 128, must be valid

◆ convertRow4ChannelsTo3Channels8BitPerChannel7BitPrecision()

static void Ocean::CV::FrameChannels::convertRow4ChannelsTo3Channels8BitPerChannel7BitPrecision ( const uint8_t *  source,
uint8_t *  target,
const size_t  size,
const void *  parameters 
)
static

Converts a row of pixels with 3 channels to pixels with 3 channels by a linear combination of the three channels plus a bias (translation) part.

This function can be used to e.g., convert RGBA32 to YUV24, or BGRA24 to YVU24. The linear combination is defined by three integer multiplication factor for each source channel with 128 as denominator, plus one bias (translation) parameter for each source channel (with 1 as denominator).
Beware: As this function applies integer multiplication factors (with 7 bits precision) the conversion result has an accuracy of +/- 2 color intensities.
The transformation is based on the following pattern:

t0 = clamp(0, f00 * s0 + f01 * s1 + f02 * s2 + f03 * s3 + b0, 255)
t1 = clamp(0, f10 * s0 + f11 * s1 + f12 * s2 + f13 * s3 + b1, 255)
t2 = clamp(0, f20 * s0 + f21 * s1 + f22 * s2 + f23 * s3 + b2, 255)

With t target, s source, f factor, and b bias.
Factors must be specified in relation to a denominator of 128, bias values must be specified with a denominator of 1.

Parameters
sourceThe pointer to the source pixels, must be valid
targetThe pointer to the target pixels receiving the converted pixel data, must be valid
sizeThe number of source (and target pixels) to convert, with range [1, infinity)
parametersThe 12 int32_t parameters of the column-aligned 3x4 transformation matrix: f00_128, f10_128, f20_128, f01_128, f02_128, ..., f23_128, b0, b1, b2, with ranges [-127, 127]

◆ copyChannel()

template<typename T , unsigned int tSourceChannels, unsigned int tTargetChannels, unsigned int tSourceChannelIndex, unsigned int tTargetChannelIndex>
void Ocean::CV::FrameChannels::copyChannel ( const T *  source,
T *  target,
const unsigned int  width,
const unsigned int  height,
const unsigned int  sourcePaddingElements,
const unsigned int  targetPaddingElements,
Worker worker = nullptr 
)
inlinestatic

Copies one channel from a given frame with zipped pixel format to another frame with zipped pixel format.

Parameters
sourceThe source frame from that the channel will be copied, must be valid
targetThe target frame to which the channel will be copied, must be valid
widthThe width of both frames in pixel, with range [1, infinity)
heightThe height of both frames in pixel, with range [1, 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
Template Parameters
TData type of each channel pixel value
tSourceChannelsNumber of channels in the source frame, with range [1, infinity)
tTargetChannelsNumber of channels in the target frame, with range [1, infinity)
tSourceChannelIndexThe index of the source channel that will be copied, with range [0, tSourceChannels - 1]
tTargetChannelIndexThe index of the target channel that will be copied, with range [0, tTargetChannels - 1]

◆ copyChannelRow()

template<typename T , unsigned int tSourceChannels, unsigned int tTargetChannels, unsigned int tSourceChannelIndex, unsigned int tTargetChannelIndex>
void Ocean::CV::FrameChannels::copyChannelRow ( const T *  source,
T *  target,
const size_t  size,
const void *  unusedParameters = nullptr 
)
static

Copies one channel from a source row to a target row with generic (zipped) pixel format.

Parameters
sourceThe pointer to the source pixels, must be valid
targetThe pointer to the target pixels, receiving the additional channels, must be valid
sizeThe number of source (and target pixels) to convert, with range [1, infinity)
Template Parameters
TData type of each channel pixel value, e.g, 'uint8_t' or 'float'
Parameters
unusedParametersUnused parameters, must be nullptr
Template Parameters
tSourceChannelsNumber of channels of the source frame, with range [1, infinity)
tTargetChannelsNumber of channels of the target frame, with range [1, infinity)
tSourceChannelIndexThe index of the source channel to be copied, with range [0, tSourceChannels - 1]
tTargetChannelIndexThe index of the target channel to be copied, with range [0, tTargetChannels - 1]

◆ narrow16BitPerChannelTo8BitPerChannel()

template<unsigned int tChannels>
void Ocean::CV::FrameChannels::narrow16BitPerChannelTo8BitPerChannel ( const uint16_t *  source,
uint8_t *  target,
const unsigned int  width,
const unsigned int  height,
const ConversionFlag  conversionFlag,
const unsigned int  sourcePaddingElements,
const unsigned int  targetPaddingElements,
Worker worker = nullptr 
)
inlinestatic

Narrows 16 bit channels of a frame to 8 bit channels.

Parameters
sourceThe source frame for which the channels will be narrowed, must be valid
targetThe target frame that receives the narrowed channels, must be valid
widthThe width of the source frame in pixel, with range [1, infinity)
heightThe height of the source frame in pixel, with range [1, infinity)
conversionFlagThe conversion to be applied
sourcePaddingElementsOptional padding at the end of each source row in elements, with range [0, infinity)
targetPaddingElementsOptional padding at the end of each target row in elements, with range [0, infinity)
workerOptional worker object to distribute the computation
Template Parameters
tChannelsNumber of source data channels, with range [1, infinity)

◆ narrowRow16BitPerChannelTo8BitPerChannel()

template<unsigned int tChannels>
void Ocean::CV::FrameChannels::narrowRow16BitPerChannelTo8BitPerChannel ( const uint16_t *  source,
uint8_t *  target,
const size_t  size,
const void *  unusedParameters = nullptr 
)
static

Narrows a row of pixels with 16 bit channels to pixels with 8 bit channels.

Parameters
sourceThe pointer to the source pixels, must be valid
targetThe pointer to the target pixels receiving the converted pixel data, must be valid
sizeThe number of source (and target pixels) to convert, with range [1, infinity)
unusedParametersUnused parameter, must be nullptr
Template Parameters
tChannelsThe number of channels the source (and target) frame have, with range [1, infinity)

◆ premultipliedAlphaToStraightAlpha8BitPerChannel() [1/2]

template<unsigned int tChannels, unsigned int tAlphaChannelIndex>
void Ocean::CV::FrameChannels::premultipliedAlphaToStraightAlpha8BitPerChannel ( const uint8_t *const  source,
uint8_t *const  target,
const unsigned int  width,
const unsigned int  height,
const unsigned int  sourcePaddingElements,
const unsigned int  targetPaddingElements,
Worker worker = nullptr 
)
inlinestatic

Converts an image with premultiplied alpha to a straight image (without premultiplied alpha).

Parameters
sourceThe source image to convert, must be valid
targetThe resulting converted target image, must be valid
widthThe width of the image in pixel, with range [1, infinity)
heightThe height of the image in pixel, with range [1, 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 computation
Template Parameters
tChannelsThe number of frame channels, with range [2, infinity)
tAlphaChannelIndexThe index of the alpha channel, with range [0, tChannels - 1]
See also
straightAlphaToPremultipliedAlpha8BitPerChannel().

◆ premultipliedAlphaToStraightAlpha8BitPerChannel() [2/2]

template<unsigned int tChannels, unsigned int tAlphaChannelIndex>
void Ocean::CV::FrameChannels::premultipliedAlphaToStraightAlpha8BitPerChannel ( uint8_t *const  frame,
const unsigned int  width,
const unsigned int  height,
const unsigned int  framePaddingElements,
Worker worker = nullptr 
)
inlinestatic

Converts an image with premultiplied alpha to a straight image (without premultiplied alpha).

Parameters
frameThe image to convert, must be valid
widthThe width of the image in pixel, with range [1, infinity)
heightThe height of the image in pixel, with range [1, infinity)
framePaddingElementsThe number of padding elements at the end of each frame row, in elements, with range [0, infinity)
workerOptional worker object to distribute the computation
Template Parameters
tChannelsThe number of frame channels, with range [2, infinity)
tAlphaChannelIndexThe index of the alpha channel, with range [0, tChannels - 1]
See also
straightAlphaToPremultipliedAlpha8BitPerChannel().

◆ premultipliedAlphaToStraightAlpha8BitPerChannelSubset() [1/2]

template<unsigned int tChannels, unsigned int tAlphaChannelIndex>
void Ocean::CV::FrameChannels::premultipliedAlphaToStraightAlpha8BitPerChannelSubset ( const uint8_t *const  source,
uint8_t *const  target,
const unsigned int  width,
const unsigned int  sourcePaddingElements,
const unsigned int  targetPaddingElements,
const unsigned int  firstRow,
const unsigned int  numberRows 
)
staticprotected

Converts an image with premultiplied alpha to a straight image (without premultiplied alpha).

Parameters
sourceThe source image to convert, must be valid
targetThe resulting converted target image, must be valid
widthThe width of the image in pixel, with range [1, 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)
firstRowThe first row to be handled, with range [0, height - 1]
numberRowsThe number of rows to be handled, with range [1, height - firstRow]
Template Parameters
tChannelsThe number of frame channels, with range [2, infinity)
tAlphaChannelIndexThe index of the alpha channel, with range [0, tChannels - 1]

◆ premultipliedAlphaToStraightAlpha8BitPerChannelSubset() [2/2]

template<unsigned int tChannels, unsigned int tAlphaChannelIndex>
void Ocean::CV::FrameChannels::premultipliedAlphaToStraightAlpha8BitPerChannelSubset ( uint8_t *const  frame,
const unsigned int  width,
const unsigned int  framePaddingElements,
const unsigned int  firstRow,
const unsigned int  numberRows 
)
staticprotected

Converts an image with premultiplied alpha to a straight image (without premultiplied alpha).

Parameters
frameThe image to convert, must be valid
widthThe width of the image in pixel, with range [1, infinity)
framePaddingElementsThe number of padding elements at the end of each frame row, in elements, with range [0, infinity)
firstRowThe first row to be handled, with range [0, height - 1]
numberRowsThe number of rows to be handled, with range [1, height - firstRow]
Template Parameters
tChannelsThe number of frame channels, with range [2, infinity)
tAlphaChannelIndexThe index of the alpha channel, with range [0, tChannels - 1]

◆ removeFirstChannel()

template<typename T , unsigned int tSourceChannels>
void Ocean::CV::FrameChannels::removeFirstChannel ( const T *  source,
T *  target,
const unsigned int  width,
const unsigned int  height,
const ConversionFlag  conversionFlag,
const unsigned int  sourcePaddingElements,
const unsigned int  targetPaddingElements,
Worker worker = nullptr 
)
inlinestatic

Removes the first channel from a given frame with zipped (generic) pixel format.

This function is mainly a wrapper around FrameChannels::shuffleChannels().

Parameters
sourceThe source frame from that the first channel will be removed, must be valid
targetThe target frame without the first channel, must be valid
widthThe width of the frames in pixel, with range [1, infinity)
heightThe height of the frames in pixel, with range [1, infinity)
conversionFlagThe conversion to be applied
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
Template Parameters
TData type of each channel pixel value
tSourceChannelsNumber of channels of the source frame (including the channel that will be removed), with range [2, infinity)
See also
FrameChannels::shuffleChannels<T, tSourceChannels, tTargetChannels, tShufflePattern>(), removeLastChannel().

◆ removeLastChannel()

template<typename T , unsigned int tSourceChannels>
void Ocean::CV::FrameChannels::removeLastChannel ( const T *  source,
T *  target,
const unsigned int  width,
const unsigned int  height,
const ConversionFlag  conversionFlag,
const unsigned int  sourcePaddingElements,
const unsigned int  targetPaddingElements,
Worker worker = nullptr 
)
inlinestatic

Removes the last channel from a given frame with zipped (generic) pixel format.

This function is mainly a wrapper around FrameChannels::shuffleChannels().

Parameters
sourceThe source frame from that the first channel will be removed, must be valid
targetThe target frame without the first channel, must be valid
widthThe width of the frames in pixel, with range [1, infinity)
heightThe height of the frames in pixel, with range [1, infinity)
conversionFlagThe conversion to be applied
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
Template Parameters
TData type of each channel pixel value
tSourceChannelsNumber of channels of the frame (including the channel that will be removed), with range [2, infinity)
See also
FrameChannels::shuffleChannels<T, tSourceChannels, tTargetChannels, tShufflePattern>(), removeFirstChannel().

◆ reverseChannelOrder()

template<typename T , unsigned int tChannels>
void Ocean::CV::FrameChannels::reverseChannelOrder ( const T *  source,
T *  target,
const unsigned int  width,
const unsigned int  height,
const ConversionFlag  conversionFlag,
const unsigned int  sourcePaddingElements,
const unsigned int  targetPaddingElements,
Worker worker = nullptr 
)
inlinestatic

Reverses the order of the channels of a frame with zipped pixel format.

The first channel will be exchanged with the last channel, the second channel will be exchanged with the second last channel and so on.

Parameters
sourceThe source frame from that the channels will be swapped, must be valid
targetThe target frame that receives the swapped channels, must be valid
widthThe width of the source frame in pixel, with range (0, infinity)
heightThe height of the source frame in pixel, with range (0, infinity)
conversionFlagThe conversion to be applied
sourcePaddingElementsOptional padding at the end of each source row in elements, with range [0, infinity)
targetPaddingElementsOptional padding at the end of each target row in elements, with range [0, infinity)
workerOptional worker object to distribute the computation
Template Parameters
TData type of each channel pixel value
tChannelsNumber of data channels, with range [1, infinity)

◆ reverseRowChannelOrder()

template<typename T , unsigned int tChannels>
void Ocean::CV::FrameChannels::reverseRowChannelOrder ( const T *  source,
T *  target,
const size_t  size,
const void *  unusedOptions = nullptr 
)
static

Reverses/mirrors the order of channels in a given row (or a memory block in general).

Parameters
sourceThe pointer to the source pixels, must be valid
targetThe pointer to the target pixels receiving the reversed/mirrored channels, must be valid
sizeThe number of source (and target pixels) to convert, with range [1, infinity)
unusedOptionsAn unused options parameters, must be nullptr
Template Parameters
TThe data type of the pixel elements, e.g, 'uint8_t', 'int'
tChannelsThe number of channels (the number of elements) each pixel has, with range [1, infinity)

◆ reverseRowPixelOrder()

template<typename T , unsigned int tChannels>
void Ocean::CV::FrameChannels::reverseRowPixelOrder ( const T *  source,
T *  target,
const size_t  size 
)
static

Reverses/mirrors the order of pixels in a given row (or a memory block in general).

Parameters
sourceThe pointer to the source pixels, must be valid
targetThe pointer to the target pixels receiving the reversed/mirrored pixel data, must be valid
sizeThe number of source (and target pixels) to convert, with range [1, infinity)
Template Parameters
TThe data type of the pixel elements, e.g, 'uint8_t', 'int'
tChannelsThe number of channels (the number of elements) each pixel has, with range [1, infinity)

◆ reverseRowPixelOrderInPlace()

template<typename T , unsigned int tChannels>
void Ocean::CV::FrameChannels::reverseRowPixelOrderInPlace ( T *  data,
const size_t  size 
)
static

Reverses/mirrors the order of pixels in a given row (or a memory block in general) in place.

Parameters
dataThe pointer to the pixels, must be valid
sizeThe number of source (and target pixels) to convert, with range [1, infinity)
Template Parameters
TThe data type of the pixel elements, e.g, 'uint8_t', 'int'
tChannelsThe number of channels (the number of elements) each pixel has, with range [1, infinity)

◆ separateTo1Channel() [1/5]

template<typename TSource , typename TTarget >
void Ocean::CV::FrameChannels::separateTo1Channel ( const TSource *const  sourceFrame,
const std::initializer_list< TTarget * > &  targetFrames,
const unsigned int  width,
const unsigned int  height,
const unsigned int  sourceFramePaddingElements,
const std::initializer_list< const unsigned int > &  targetFramesPaddingElements 
)
static

Separates a given frame with zipped pixel format e.g., FORMAT_RGB24, FORMAT_YUV24, FORMAT_BGRA32 into individual frames with one channel only.

Usage:

const unsigned int width = ...;
const unsigned int height = ...;
const uint8_t* sourceFrame = ...;
const unsigned int sourceFramePaddingElements = ...;
uint8_t* targetFrame0 = ...;
uint8_t* targetFrame1 = ...;
const unsigned int targetFramePaddingElements0 = ...;
const unsigned int targetFramePaddingElements1 = ...;
separateTo1Channel<uint8_t, uint8_t>(sourceFrame, {targetFrame0, targetFrame1}, width, height, sourceFramePaddingElements, {targetFramePaddingElements0, targetFramePaddingElements1});
Parameters
sourceFrameThe frame to be separated, must be valid
targetFramesThe pointers to the resulting separated frames each holding one channel of the source frame, with already allocated memory
widthThe width of the source frame in pixel, with range [1, infinity)
heightThe height of the source frame in pixel, with range [1, infinity)
sourceFramePaddingElementsThe number of padding elements at the end of each source row, in elements, with range [0, infinity)
targetFramesPaddingElementsThe array of padding elements at the end of each target row, one for each target frame, in elements, with range [0, infinity)
Template Parameters
TSourceThe data type of each source pixel channel, e.g., 'uint8_t', 'float', ...
TTargetThe data type of each target pixel channel, e.g., 'uint8_t', 'float', ...

◆ separateTo1Channel() [2/5]

template<typename TSource , typename TTarget , unsigned int tChannels>
void Ocean::CV::FrameChannels::separateTo1Channel ( const TSource *const  sourceFrame,
TTarget *const *const  targetFrames,
const unsigned int  width,
const unsigned int  height,
const unsigned int  channels,
const unsigned int  sourceFramePaddingElements,
const unsigned int *  targetFramesPaddingElements 
)
static

Separates a given frame with zipped pixel format e.g., FORMAT_RGB24, FORMAT_YUV24, FORMAT_BGRA32 into individual frames with one channel only.

Usage:

const unsigned int width = ...;
const unsigned int height = ...;
uint8_t* sourceFrame = ...;
const unsigned int sourceFramePaddingElements = ...;
constexpr unsigned int channels = 2u;
const uint8_t* targetFrames[channels] = {..., ...};
const unsigned int targetFramesPaddingElements[2] = {..., ...};
separateTo1Channel<uint8_t, uint8_t, channels>(sourceFrame, targetFrames, width, height, channels, sourceFramePaddingElements, targetFramesPaddingElements);
Parameters
sourceFrameThe frame to be separated, must be valid
targetFramesThe pointers to the resulting separated frames each holding one channel of the source frame, with already allocated memory
widthThe width of the source frame in pixel, with range [1, infinity)
heightThe height of the source frame in pixel, with range [1, infinity)
channelsThe number of channels the source frame has, with range [1, infinity)
sourceFramePaddingElementsThe number of padding elements at the end of each source row, in elements, with range [0, infinity)
targetFramesPaddingElementsThe array of padding elements at the end of each target row, one for each target frame, in elements, with range [0, infinity), nullptr if all are zero
Template Parameters
TSourceThe data type of each source pixel channel, e.g., 'uint8_t', 'float', ...
TTargetThe data type of each target pixel channel, e.g., 'uint8_t', 'float', ...
tChannelsThe number of source frames (and target channels) if known at compile time; otherwise CHANNELS_NOT_KNOWN_AT_COMPILE_TIME == 0, if know at compile time must be identical with 'channels'

◆ separateTo1Channel() [3/5]

template<>
void Ocean::CV::FrameChannels::separateTo1Channel ( const uint8_t *const  sourceFrame,
uint8_t *const *const  targetFrames,
const unsigned int  width,
const unsigned int  height,
const unsigned int  channels,
const unsigned int  sourceFramePaddingElements,
const unsigned int *  targetFramesPaddingElements 
)
inlinestatic

◆ separateTo1Channel() [4/5]

template<>
void Ocean::CV::FrameChannels::separateTo1Channel ( const uint8_t *const  sourceFrame,
uint8_t *const *const  targetFrames,
const unsigned int  width,
const unsigned int  height,
const unsigned int  channels,
const unsigned int  sourceFramePaddingElements,
const unsigned int *  targetFramesPaddingElements 
)
inlinestatic

◆ separateTo1Channel() [5/5]

template<>
void Ocean::CV::FrameChannels::separateTo1Channel ( const uint8_t *const  sourceFrame,
uint8_t *const *const  targetFrames,
const unsigned int  width,
const unsigned int  height,
const unsigned int  channels,
const unsigned int  sourceFramePaddingElements,
const unsigned int *  targetFramesPaddingElements 
)
inlinestatic

◆ separateTo1ChannelRuntime()

template<typename TSource , typename TTarget >
void Ocean::CV::FrameChannels::separateTo1ChannelRuntime ( const TSource *const  sourceFrame,
TTarget *const *const  targetFrames,
const unsigned int  width,
const unsigned int  height,
const unsigned int  channels,
const unsigned int  sourceFramePaddingElements,
const unsigned int *  targetFramesPaddingElements 
)
staticprotected

Separates a given frame with zipped pixel format e.g., FORMAT_RGB24, FORMAT_YUV24, FORMAT_BGRA32 into individual frames with one channel only.

Parameters
sourceFrameThe frame to be separated, must be valid
targetFramesThe pointers to the resulting separated frames each holding one channel of the source frame, with already allocated memory
widthThe width of the source frame in pixel, with range [1, infinity)
heightThe height of the source frame in pixel, with range [1, infinity)
channelsThe number of channels the source frame has, with range [1, infinity)
sourceFramePaddingElementsThe number of padding elements at the end of each source row, in elements, with range [0, infinity)
targetFramesPaddingElementsThe array of padding elements at the end of each target row, one for each target frame, in elements, with range [0, infinity)
Template Parameters
TSourceThe data type of each source pixel channel, e.g., 'uint8_t', 'float', ...
TTargetThe data type of each target pixel channel, e.g., 'uint8_t', 'float', ...

◆ setChannel()

template<typename T , unsigned int tChannel, unsigned int tChannels>
void Ocean::CV::FrameChannels::setChannel ( T *  frame,
const unsigned int  width,
const unsigned int  height,
const T  value,
const unsigned int  framePaddingElements,
Worker worker = nullptr 
)
inlinestatic

Sets one channel of a frame with a specific unique value.

Parameters
frameThe frame in that one channel of each pixel will be set
widthThe width of the frame in pixel, with range [1, infinity)
heightThe height of the frame in pixel, with range [1, infinity)
valueThe value to be set
framePaddingElementsThe number of padding elements at the end of each frame row, in elements, with range [0, infinity)
workerOptional worker object to distribute the computation
Template Parameters
TData type of each channel pixel value
tChannelIndex of the channel that will be inverted, with range [0, tChannels)
tChannelsNumber of data channels of the frames, with range [1, infinity)

◆ setChannelSubset()

template<typename T , unsigned int tChannel, unsigned int tChannels>
void Ocean::CV::FrameChannels::setChannelSubset ( T *  frame,
const unsigned int  width,
const T  value,
const unsigned int  framePaddingElements,
const unsigned int  firstRow,
const unsigned int  numberRows 
)
staticprotected

Sets one channel of a frame with one unique value.

Parameters
frameThe frame in that one channel of each pixel will be set, must be valid
widthThe width of the frame in pixel, with range [1, infinity)
valueThe value to be set
framePaddingElementsThe number of padding elements at the end of each frame row, in elements, with range [0, infinity)
firstRowFirst row to be handled
numberRowsNumber of rows to be handled
Template Parameters
TData type of each channel pixel value
tChannelIndex of the channel that will be inverted, with range [0, tChannels)
tChannelsNumber of data channels of the frames, with range [1, infinity)

◆ shuffleChannels()

template<typename T , unsigned int tSourceChannels, unsigned int tTargetChannels, unsigned int tShufflePattern>
void Ocean::CV::FrameChannels::shuffleChannels ( const T *  source,
T *  target,
const unsigned int  width,
const unsigned int  height,
const ConversionFlag  conversionFlag,
const unsigned int  sourcePaddingElements,
const unsigned int  targetPaddingElements,
Worker worker = nullptr 
)
inlinestatic

Shuffles the channels of a frame by an arbitrary pattern.

The shuffle pattern is defined in groups of four bits defining the source channels.
For the shuffling from e.g., an RGBA32 row to a BGRA32 row the pattern 0x3012u must be defined:

source pixel  R G B A
              0 1 2 3
target pixel  B G R A
              2 1 0 3
pattern (with reversed order): 0x3012
Parameters
sourceThe source frame for which the channels will be shuffled, must be valid
targetThe target frame that receives the shuffled channels, must be valid
widthThe width of the source frame in pixel, with range [1, infinity)
heightThe height of the source frame in pixel, with range [1, infinity)
conversionFlagThe conversion to be applied
sourcePaddingElementsOptional padding at the end of each source row in elements, with range [0, infinity)
targetPaddingElementsOptional padding at the end of each target row in elements, with range [0, infinity)
workerOptional worker object to distribute the computation
Template Parameters
TData type of each channel pixel value
tSourceChannelsNumber of source data channels, with range [1, 8u]
tTargetChannelsNumber of target data channels, with range [1, 8u]
tShufflePatternGroups of four bits define the source channel, e.g., 0x76543210 defines the identity transformation, 0x01234567 defines the reverse transformation

◆ shuffleChannelsAndSetLastChannelValue()

template<typename T , unsigned int tSourceChannels, unsigned int tTargetChannels, unsigned int tShufflePattern>
void Ocean::CV::FrameChannels::shuffleChannelsAndSetLastChannelValue ( const T *  source,
const T  newChannelValue,
T *  target,
const unsigned int  width,
const unsigned int  height,
const ConversionFlag  conversionFlag,
const unsigned int  sourcePaddingElements,
const unsigned int  targetPaddingElements,
Worker worker = nullptr 
)
inlinestatic

Shuffles the channels of source frame and sets the last channel with constant value in the target frame.

The shuffle pattern is defined in groups of four bits defining the source channels.
For the shuffling from e.g., an RGB24 row to a BGRA32 row the pattern 0x012u must be defined:

source pixel  R G B
              0 1 2
target pixel  B G R A
              2 1 0
pattern (with reversed order): 0x012
Parameters
sourceThe source frame for which the channels will be shuffled, must be valid
newChannelValueThe constant channel value which will be added as last channel to the target frame, with range [0, infinity)
targetThe target frame that receives the shuffled channels, must be valid
widthThe width of the source frame in pixel, with range [1, infinity)
heightThe height of the source frame in pixel, with range [1, infinity)
conversionFlagThe conversion to be applied
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 computation
Template Parameters
TData type of each channel pixel value
tSourceChannelsNumber of source data channels, with range [1, 8u]
tTargetChannelsNumber of target data channels, including the additional extra target channel, with range [2, 8u]
tShufflePatternGroups of four bits define the source channel, e.g., 0x76543210 defines the identity transformation, 0x01234567 defines the reverse transformation

◆ shuffleRowChannels()

template<typename T , unsigned int tSourceChannels, unsigned int tTargetChannels, unsigned int tShufflePattern>
void Ocean::CV::FrameChannels::shuffleRowChannels ( const T *  source,
T *  target,
const size_t  size,
const void *  unusedOptions = nullptr 
)
inlinestatic

Shuffles the channels of row pixels by application of a specified shuffle pattern.

The shuffle pattern is defined in groups of four bits defining the source channels.
For the shuffling from e.g., an RGBA32 row to a BGRA32 row the pattern 0x3012u must be defined:

source pixel  R G B A
              0 1 2 3
target pixel  B G R A
              2 1 0 3
pattern (with reversed order): 0x3012
Parameters
sourceThe pointer to the source pixels, must be valid
targetThe pointer to the target pixels, receiving the shuffled channels, must be valid
sizeThe number of source (and target pixels) to convert, with range [1, infinity)
unusedOptionsAn unused options parameters, must be nullptr
Template Parameters
TData type of each channel pixel value, e.g, 'uint8_t' or 'float'
tSourceChannelsNumber of source data channels, with range [1, 8u]
tTargetChannelsNumber of target data channels, with range [1, 8u]
tShufflePatternGroups of four bits define the source channel, e.g., 0x76543210 defines the identity transformation, 0x01234567 defines the reverse transformation

◆ shuffleRowChannelsAndSetLastChannelValue()

template<typename T , unsigned int tSourceChannels, unsigned int tTargetChannels, unsigned int tShufflePattern>
void Ocean::CV::FrameChannels::shuffleRowChannelsAndSetLastChannelValue ( const T *  source,
T *  target,
const size_t  size,
const void *  options = nullptr 
)
inlinestatic

Shuffles the channels of row pixels by application of a specified shuffle pattern and sets the last channel with constant value in the target row.

The shuffle pattern is defined in groups of four bits defining the source channels.
For the shuffling from e.g., an RGB24 row to a BGRA32 row the pattern 0x012u must be defined:

source pixel  R G B
              0 1 2
target pixel  B G R A
              2 1 0
pattern (with reversed order): 0x012
Parameters
sourceThe pointer to the source pixels, must be valid
targetThe pointer to the target pixels, receiving the shuffled channels, must be valid
sizeThe number of source (and target pixels) to convert, with range [1, infinity)
optionsPointer to the constant channel value which will be added to the end of the target channels, must be valid
Template Parameters
TData type of each channel pixel value, e.g, 'uint8_t' or 'float'
tSourceChannelsNumber of source data channels, with range [1, 8u]
tTargetChannelsNumber of target data channels, including the additional extra target channel, with range [2, 8u]
tShufflePatternGroups of four bits define the source channel, e.g., 0x76543210 defines the identity transformation, 0x01234567 defines the reverse transformation

◆ straightAlphaToPremultipliedAlpha8BitPerChannel() [1/2]

template<unsigned int tChannels, unsigned int tAlphaChannelIndex>
void Ocean::CV::FrameChannels::straightAlphaToPremultipliedAlpha8BitPerChannel ( const uint8_t *const  source,
uint8_t *const  target,
const unsigned int  width,
const unsigned int  height,
const unsigned int  sourcePaddingElements,
const unsigned int  targetPaddingElements,
Worker worker = nullptr 
)
inlinestatic

Converts an image with straight alpha (without premultiplied alpha) to an image with premultiplied alpha.

Parameters
sourceThe source image to convert, must be valid
targetThe resulting converted target image, must be valid
widthThe width of the image in pixel, with range [1, infinity)
heightThe height of the image in pixel, with range [1, 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 computation
Template Parameters
tChannelsThe number of frame channels, with range [2, infinity)
tAlphaChannelIndexThe index of the alpha channel, with range [0, tChannels - 1]
See also
premultipliedAlphaToStraightAlpha8BitPerChannel().

◆ straightAlphaToPremultipliedAlpha8BitPerChannel() [2/2]

template<unsigned int tChannels, unsigned int tAlphaChannelIndex>
void Ocean::CV::FrameChannels::straightAlphaToPremultipliedAlpha8BitPerChannel ( uint8_t *const  frame,
const unsigned int  width,
const unsigned int  height,
const unsigned int  framePaddingElements,
Worker worker = nullptr 
)
inlinestatic

Converts an image with straight alpha (without premultiplied alpha) to an image with premultiplied alpha.

Parameters
frameThe image to convert, must be valid
widthThe width of the image in pixel, with range [1, infinity)
heightThe height of the image in pixel, with range [1, infinity)
framePaddingElementsThe number of padding elements at the end of each frame row, in elements, with range [0, infinity)
workerOptional worker object to distribute the computation
Template Parameters
tChannelsThe number of frame channels, with range [2, infinity)
tAlphaChannelIndexThe index of the alpha channel, with range [0, tChannels - 1]
See also
premultipliedAlphaToStraightAlpha8BitPerChannel().

◆ straightAlphaToPremultipliedAlpha8BitPerChannelSubset() [1/2]

template<unsigned int tChannels, unsigned int tAlphaChannelIndex>
void Ocean::CV::FrameChannels::straightAlphaToPremultipliedAlpha8BitPerChannelSubset ( const uint8_t *const  source,
uint8_t *const  target,
const unsigned int  width,
const unsigned int  sourcePaddingElements,
const unsigned int  targetPaddingElements,
const unsigned int  firstRow,
const unsigned int  numberRows 
)
staticprotected

Converts an image with straight alpha (without premultiplied alpha) to an image with premultiplied alpha.

Parameters
sourceThe source image to convert, must be valid
targetThe resulting converted target image, must be valid
widthThe width of the image in pixel, with range [1, 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)
firstRowThe first row to be handled, with range [0, height - 1]
numberRowsThe number of rows to be handled, with range [1, height - firstRow]
Template Parameters
tChannelsThe number of frame channels, with range [2, infinity)
tAlphaChannelIndexThe index of the alpha channel, with range [0, tChannels - 1]

◆ straightAlphaToPremultipliedAlpha8BitPerChannelSubset() [2/2]

template<unsigned int tChannels, unsigned int tAlphaChannelIndex>
void Ocean::CV::FrameChannels::straightAlphaToPremultipliedAlpha8BitPerChannelSubset ( uint8_t *const  frame,
const unsigned int  width,
const unsigned int  framePaddingElements,
const unsigned int  firstRow,
const unsigned int  numberRows 
)
staticprotected

Converts an image with straight alpha (without premultiplied alpha) to an image with premultiplied alpha.

Parameters
frameThe image to convert, must be valid
widthThe width of the image in pixel, with range [1, infinity)
framePaddingElementsThe number of padding elements at the end of each frame row, in elements, with range [0, infinity)
firstRowThe first row to be handled, with range [0, height - 1]
numberRowsThe number of rows to be handled, with range [1, height - firstRow]
Template Parameters
tChannelsThe number of frame channels, with range [2, infinity)
tAlphaChannelIndexThe index of the alpha channel, with range [0, tChannels - 1]

◆ transformGeneric()

template<typename T , unsigned int tChannels>
void Ocean::CV::FrameChannels::transformGeneric ( const T *  source,
T *  target,
const unsigned int  width,
const unsigned int  height,
const ConversionFlag  conversionFlag,
const unsigned int  sourcePaddingElements,
const unsigned int  targetPaddingElements,
Worker worker 
)
inlinestatic

Transforms a frame with generic pixel format (with zipped pixel information) like RGB24 or YUV24, to a frame with same pixel format and channel number.

This function mainly mirrors or flips an image.

Parameters
sourceThe source frame buffer, must be valid
targetThe target frame buffer, must be valid
widthThe width of the frame in pixel, with range [1, infinity)
heightThe height of the frame in pixel, with range [1, infinity)
conversionFlagThe conversion to be applied
sourcePaddingElementsOptional padding at the end of each source row in elements, with range [0, infinity)
targetPaddingElementsOptional padding at the end of each target row in elements, with range [0, infinity)
workerOptional worker object to distribute the computation
Template Parameters
TData type of each channel pixel value, e.g., 'uint8_t', 'float', ...
tChannelsNumber of channels of the frame, with range [1, infinity)

◆ transformGenericSubset()

static void Ocean::CV::FrameChannels::transformGenericSubset ( const uint8_t *  source,
uint8_t *  target,
const unsigned int  width,
const unsigned int  height,
const ConversionFlag  conversionFlag,
const RowReversePixelOrderFunction< void >  rowReversePixelOrderFunction,
const unsigned int  bytesPerRow,
const unsigned int  sourceStrideBytes,
const unsigned int  targetStrideBytes,
const unsigned int  firstRow,
const unsigned int  numberRows 
)
staticprotected

Transforms a subset of a frame with generic pixel format (with zipped pixel information) like RGB24 or YUV24, to a frame with same pixel format and channel number.

Parameters
sourceThe source frame buffer, must be valid
targetThe target frame buffer, must be valid
widthThe width of the frame in pixel, with range [1, infinity)
heightThe height of the frame in pixel, with range [1, infinity)
conversionFlagThe conversion to be applied
rowReversePixelOrderFunctionThe function able to reverse the pixel order, must be valid
bytesPerRowThe actual number of bytes each row covers, not including optional padding bytes at the end of each row, with range [width, infinity)
sourceStrideBytesThe number of bytes between to start points of successive rows in the source frame, with range [0, infinity)
targetStrideBytesThe number of bytes between to start points of successive rows in the target frame, with range [0, infinity)
firstRowThe first row to be handled, with range [0, height - 1]
numberRowsThe number of rows to be handled, with range [1, height - firstRow]

◆ zipChannels() [1/8]

template<>
void Ocean::CV::FrameChannels::zipChannels ( const float *const *  sourceFrames,
uint8_t *const  targetFrame,
const unsigned int  width,
const unsigned int  height,
const unsigned int  channels,
const unsigned int *  sourceFramesPaddingElements,
const unsigned int  targetFramePaddingElements 
)
inlinestatic

◆ zipChannels() [2/8]

template<>
void Ocean::CV::FrameChannels::zipChannels ( const float *const *  sourceFrames,
uint8_t *const  targetFrame,
const unsigned int  width,
const unsigned int  height,
const unsigned int  channels,
const unsigned int *  sourceFramesPaddingElements,
const unsigned int  targetFramePaddingElements 
)
inlinestatic

◆ zipChannels() [3/8]

template<>
void Ocean::CV::FrameChannels::zipChannels ( const float *const *  sourceFrames,
uint8_t *const  targetFrame,
const unsigned int  width,
const unsigned int  height,
const unsigned int  channels,
const unsigned int *  sourceFramesPaddingElements,
const unsigned int  targetFramePaddingElements 
)
inlinestatic

◆ zipChannels() [4/8]

template<typename TSource , typename TTarget >
void Ocean::CV::FrameChannels::zipChannels ( const std::initializer_list< const TSource * > &  sourceFrames,
TTarget *const  targetFrame,
const unsigned int  width,
const unsigned int  height,
const std::initializer_list< unsigned int > &  sourceFramesPaddingElements,
const unsigned int  targetFramePaddingElements 
)
static

Zips/interleaves 1-channel images into one image with n-channels.

Usage:

const unsigned int width = ...;
const unsigned int height = ...;
const uint8_t* sourceFrame0 = ...;
const uint8_t* sourceFrame1 = ...;
const unsigned int sourceFramePaddingElements0 = ...;
const unsigned int sourceFramePaddingElements1 = ...;
uint8_t* targetFrame = ...;
const unsigned int targetFramePaddingElements = ...;
zipChannels<uint8_t, uint8_t>({sourceFrame0, sourceFrame1}, targetFrame, width, height, {sourceFramePaddingElements0, sourceFramePaddingElements1}, targetFramePaddingElements);
Parameters
sourceFramesThe pointers to the individual 1-channel frames, one for each image, must be valid
targetFrameThe pointer to the resulting zipped frame holding n-channels, must be valid
widthThe width of the source frames in pixel, with range [1, infinity)
heightThe height of the source frames in pixel, with range [1, infinity)
sourceFramesPaddingElementsThe array of padding elements at the end of each source row, one for each source frame, in elements, with range [0, infinity)
targetFramePaddingElementsThe number of padding elements at the end of each target row, in elements, with range [0, infinity)
Template Parameters
TSourceThe data type of each source pixel channel, e.g., 'uint8_t', 'float', ...
TTargetThe data type of each target pixel channel, e.g., 'uint8_t', 'float', ...

◆ zipChannels() [5/8]

template<typename TSource , typename TTarget , unsigned int tChannels>
void Ocean::CV::FrameChannels::zipChannels ( const TSource *const *const  sourceFrames,
TTarget *const  targetFrame,
const unsigned int  width,
const unsigned int  height,
const unsigned int  channels,
const unsigned int *  sourceFramesPaddingElements,
const unsigned int  targetFramePaddingElements 
)
static

Zips/interleaves 1-channel images into one image with n-channels.

Usage:

const unsigned int width = ...;
const unsigned int height = ...;
const uint8_t* sourceFrames[2] = {..., ...};
const unsigned int sourceFramesPaddingElements[2] = {..., ...};
uint8_t* targetFrame = ...;
const unsigned int targetFramePaddingElements = ...;
zipChannels<uint8_t, uint8_t>(sourceFrames, targetFrame, width, height, 2u, sourceFramesPaddingElements, targetFramePaddingElements);
Parameters
sourceFramesThe pointers to the individual 1-channel frames, one for each image, must be valid
targetFrameThe pointer to the resulting zipped frame holding n-channels, must be valid
widthThe width of the source frames in pixel, with range [1, infinity)
heightThe height of the source frames in pixel, with range [1, infinity)
channelsThe number of provided source frames (and the number of channels the target frame will have), with range [1, infinity)
sourceFramesPaddingElementsThe array of padding elements at the end of each source row, one for each source frame, in elements, with range [0, infinity), nullptr if all are zero
targetFramePaddingElementsThe number of padding elements at the end of each target row, in elements, with range [0, infinity)
Template Parameters
TSourceThe data type of each source pixel channel, e.g., 'uint8_t', 'float', ...
TTargetThe data type of each target pixel channel, e.g., 'uint8_t', 'float', ...
tChannelsThe number of source frames (and target channels) if known at compile time; otherwise CHANNELS_NOT_KNOWN_AT_COMPILE_TIME == 0, if know at compile time must be identical with 'channels'

◆ zipChannels() [6/8]

template<>
void Ocean::CV::FrameChannels::zipChannels ( const uint8_t *const *  sourceFrames,
uint8_t *const  targetFrame,
const unsigned int  width,
const unsigned int  height,
const unsigned int  channels,
const unsigned int *  sourceFramesPaddingElements,
const unsigned int  targetFramePaddingElements 
)
inlinestatic

◆ zipChannels() [7/8]

template<>
void Ocean::CV::FrameChannels::zipChannels ( const uint8_t *const *  sourceFrames,
uint8_t *const  targetFrame,
const unsigned int  width,
const unsigned int  height,
const unsigned int  channels,
const unsigned int *  sourceFramesPaddingElements,
const unsigned int  targetFramePaddingElements 
)
inlinestatic

◆ zipChannels() [8/8]

template<>
void Ocean::CV::FrameChannels::zipChannels ( const uint8_t *const *  sourceFrames,
uint8_t *const  targetFrame,
const unsigned int  width,
const unsigned int  height,
const unsigned int  channels,
const unsigned int *  sourceFramesPaddingElements,
const unsigned int  targetFramePaddingElements 
)
inlinestatic

◆ zipChannelsRuntime()

template<typename TSource , typename TTarget >
void Ocean::CV::FrameChannels::zipChannelsRuntime ( const TSource *const *const  sourceFrames,
TTarget *const  targetFrame,
const unsigned int  width,
const unsigned int  height,
const unsigned int  channels,
const unsigned int *  sourceFramesPaddingElements,
const unsigned int  targetFramePaddingElements 
)
staticprotected

Zips/interleaves 1-channel images into one image with n-channels.

Parameters
sourceFramesThe pointers to the individual 1-channel frames, one for each image, must be valid
targetFrameThe pointer to the resulting zipped frame holding n-channels, must be valid
widthThe width of the source frames in pixel, with range [1, infinity)
heightThe height of the source frames in pixel, with range [1, infinity)
channelsThe number of provided source frames (and the number of channels the target frame will have), with range [1, infinity)
sourceFramesPaddingElementsThe array of padding elements at the end of each source row, one for each source frame, in elements, with range [0, infinity)
targetFramePaddingElementsThe number of padding elements at the end of each target row, in elements, with range [0, infinity)
Template Parameters
TSourceThe data type of each source pixel channel, e.g., 'uint8_t', 'float', ...
TTargetThe data type of each target pixel channel, e.g., 'uint8_t', 'float', ...

Field Documentation

◆ CHANNELS_NOT_KNOWN_AT_COMPILE_TIME

constexpr unsigned int Ocean::CV::FrameChannels::CHANNELS_NOT_KNOWN_AT_COMPILE_TIME = 0u
staticconstexpr

Definition of a constant to specify that the number of channels are not known at compile time but at runtime only.


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