Ocean
Ocean::CV::FrameConverter Class Reference

This is the base class for all frame converter classes. More...

Inheritance diagram for Ocean::CV::FrameConverter:

Data Structures

class  Comfort
 The following comfort class provides comfortable functions simplifying prototyping applications but also increasing binary size of the resulting applications. More...
 
class  ConversionFunctionMap
 This class implements a singleton-based map for function pointers of conversion functions. More...
 
class  Options
 Definition of a class storing options for frame conversions. More...
 
struct  RGGB10ToRGB24AdvancedOptions
 Definition of the parameters used by the function for row-wise conversion of RGGB14_PACKED to RGB24/BGR24. More...
 

Public Types

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<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 >
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...
 

Protected Types

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...
 

Static Protected Member Functions

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)
 

Detailed Description

This is the base class for all frame converter classes.

Member Typedef Documentation

◆ ConversionFlags

Definition of a vector holding conversion flags.

◆ MultipleRowsConversionFunction

using Ocean::CV::FrameConverter::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)
protected

Definition of a function pointer to a function able to convert multiple image row from an arbitrary pixel format to another arbitrary pixel format.

Parameters
sourcesThe memory pointers defining the source rows, must be valid
targetsThe memory pointers defining the target rows, must be valid
multipleRowIndexThe index of the rows to be converted, with range [0, height / multipleRowsPerIteration - 1]
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
optionsOptional options which are necessary for the conversion, otherwise nullptr

◆ RowConversionFunction

template<typename TSource , typename TTarget >
using Ocean::CV::FrameConverter::RowConversionFunction = void (*)(const TSource* sourceRow, TTarget* targetRow, const size_t width, const void* options)
protected

Definition of a function pointer to a function able to convert one image row from one generic pixel format to another generic pixel format.

Parameters
sourceRowThe row in the source frame, must be valid
targetRowThe row in the target frame, must be valid
widthThe number of pixels to convert, with range [1, infinity)
optionsOptional options which are necessary for the conversion, otherwise nullptr
Template Parameters
TSourceThe data type of each source pixel channel, e.g., 'uint8_t' or 'float'
TTargetThe data type of each target pixel channel, e.g., 'uint8_t' or 'float'

◆ RowReversePixelOrderFunction

template<typename T >
using Ocean::CV::FrameConverter::RowReversePixelOrderFunction = void (*)(const T* inputRow, T* targetRow, const size_t width)
protected

Definition of a function pointer to a function able to reverse the order of pixels in an image row with a generic pixel format.

Parameters
inputRowThe row to reverse, must be valid
targetRowThe row receiving the reversed pixels, must be different from 'inputRow', must be valid
widthThe number of pixels to reverse, with range [1, infinity)
Template Parameters
TThe data type of each pixel channel, e.g., 'uint8_t' or 'float'

◆ RowReversePixelOrderInPlaceFunction

template<typename T >
using Ocean::CV::FrameConverter::RowReversePixelOrderInPlaceFunction = void (*)(T* row, const size_t width)
protected

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.

Parameters
rowThe row to reverse, must be valid
widthThe number of pixels to reverse, with range [1, infinity)
Template Parameters
TThe data type of each pixel channel, e.g., 'uint8_t' or 'float'

Member Enumeration Documentation

◆ ConversionFlag

Definition of individual conversion flags.

Enumerator
CONVERT_NORMAL 

Normal conversion, neither flips nor mirrors the image.

The following pattern shows the conversion for an image with resolution 2x2:

Input:    Output:
| A B |   | A B |
| C D |   | C D |
CONVERT_FLIPPED 

Flipped conversion, exchanges top and bottom of the image (flipping around the x-axis).

The following pattern shows the conversion for an image with resolution 2x2:

Input:    Output:
| A B |   | C D |
| C D |   | A B |
CONVERT_MIRRORED 

Mirrored conversion, exchanges left and right of the image (like in a mirror, mirroring around the y-axis).

The following pattern shows the conversion for an image with resolution 2x2:

Input:    Output:
| A B |   | B A |
| C D |   | D C |
CONVERT_FLIPPED_AND_MIRRORED 

Rotated conversion, rotates the image by 180.0 degrees with anchor in the center of the image.

The following pattern shows the conversion for an image with resolution 2x2:

Input:    Output:
| A B |   | D C |
| C D |   | B A |

◆ CopyPreference

Definition of a boolean enum for copy preferences (to improve code readability).

Enumerator
CP_AVOID_COPY_IF_POSSIBLE 

Tries to avoid copying the frame data whenever possible.

CP_ALWAYS_COPY 

Forces a copy of the frame data in any case.

Member Function Documentation

◆ cast() [1/2]

template<typename TSource , typename TTarget >
static void Ocean::CV::FrameConverter::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 
)
static

Casts the pixel values from one frame type to another frame type.

The source frame must be a zipped frame e.g., FrameType::FORMAT_Y8, FrameType::FORMAT_RGB24, ...
Beware: This function does not handle any out of range issues and does not apply rounding.
This function mainly does the following:

for each pixel and channel:
targetValue = TTarget(sourceValue)
Parameters
sourceThe source frame to be casted, must be valid
targetThe target frame receiving the casted pixel values, must be valid (and not overlap the source frame)
widthThe width of the source (and target frame) in pixel, with range [1, infinity)
heightThe height of the source (and target frame) in pixel, with range [1, infinity)
channelsThe number of channels the source frame (and target frame) has, 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)
Template Parameters
TSourceThe data type of each pixel channel of the source frame, e.g., 'uint8_t', 'int', 'float', ...
TTargetThe data type of each pixel channel of the target frame, e.g., 'uint8_t', 'int', 'float', ...

Here is an example how to use this function:

void function()
{
// we have a source frame e.g., with pixel format RGB 24 bit, 'uint8_t' for each pixel channel
Frame sourceFrame(FrameType(1920u, 1080u, FrameType::FORMAT_RGB24, FrameType::ORIGIN_UPPER_LEFT));
// set the pixel values of sourceFrame here ...
// we want to cast this frame to a frame with 32 bit floating point values
// we use the frame type of the source as pattern and change the pixel format only
Frame targetFrame(FrameType(sourceFrame, FrameType::genericPixelFormat(FrameType::DT_SIGNED_FLOAT_32, 3u)));
// now we simply cast the values from the source frame to the target frame
FrameConverter::cast<uint8_t, float>(sourceFrame.constdata<uint8_t>(), targetFrame.data<float>(), sourceFrame.width(), sourceFrame.height(), sourceFrame.channels());
// now we can access the floating point pixel values of target
const float* floatRGBValues = targetFrame.constdata<float>();
}
@ FORMAT_RGB24
Pixel format with byte order RGB and 24 bits per pixel.
Definition: Frame.h:315
constexpr static PixelFormat genericPixelFormat()
Returns a specific generic pixel format with a specified data type and channel number.
@ ORIGIN_UPPER_LEFT
The first pixel lies in the upper left corner, the last pixel in the lower right corner.
Definition: Frame.h:1018
@ DT_SIGNED_FLOAT_32
Signed 32 bit float data type (float).
Definition: Frame.h:59
See also
normalizedCast().

◆ cast() [2/2]

template<typename TSource , typename TTarget >
OCEAN_RE_ENABLE_DOCUMENTATION_DIAGNOSTIC void Ocean::CV::FrameConverter::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 
)

◆ cast16Elements() [1/8]

template<>
OCEAN_FORCE_INLINE void Ocean::CV::FrameConverter::cast16Elements ( const float *const  source,
uint8_t *const  target 
)
staticprotected

◆ cast16Elements() [2/8]

template<typename TSource , typename TTarget >
static void Ocean::CV::FrameConverter::cast16Elements ( const TSource *const  source,
TTarget *const  target 
)
inlinestaticprotected

Casts 16 successive elements from one data type to another data type.

Parameters
sourceThe 16 source elements that will be casted, must be valid
targetThe 16 target elements receiving the casted pixel values, must be valid
Template Parameters
TSourceThe data type of each pixel channel of the source frame, e.g., 'uint8_t', 'int', 'float', ...
TTargetThe data type of each pixel channel of the target frame, e.g., 'uint8_t', 'int', 'float', ...

◆ cast16Elements() [3/8]

template<typename TSource , typename TTarget >
OCEAN_FORCE_INLINE void Ocean::CV::FrameConverter::cast16Elements ( const TSource *const  source,
TTarget *const  target 
)

◆ cast16Elements() [4/8]

template<>
OCEAN_FORCE_INLINE void Ocean::CV::FrameConverter::cast16Elements ( const uint8_t *const  source,
float *const  target 
)
staticprotected

◆ cast16Elements() [5/8]

template<>
OCEAN_FORCE_INLINE void Ocean::CV::FrameConverter::cast16Elements ( const uint8_t *const  source,
int16_t *const  target 
)
staticprotected

◆ cast16Elements() [6/8]

template<>
OCEAN_FORCE_INLINE void Ocean::CV::FrameConverter::cast16Elements ( const uint8_t *const  source,
int32_t *const  target 
)
staticprotected

◆ cast16Elements() [7/8]

template<>
OCEAN_FORCE_INLINE void Ocean::CV::FrameConverter::cast16Elements ( const uint8_t *const  source,
uint16_t *const  target 
)
staticprotected

◆ cast16Elements() [8/8]

template<>
OCEAN_FORCE_INLINE void Ocean::CV::FrameConverter::cast16Elements ( const uint8_t *const  source,
uint32_t *const  target 
)
staticprotected

◆ conversionFlags()

static const ConversionFlags& Ocean::CV::FrameConverter::conversionFlags ( )
static

Returns a vector holding all possible conversion flags.

Returns
The vector with conversion flags, will be four.

◆ convertArbitraryPixelFormat()

void Ocean::CV::FrameConverter::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 
)
inlinestaticprotected

Converts a frame with arbitrary pixel format (e.g., Y_UV12, Y_VU12, YUYV16, ...) to a frame with arbitrary pixel format.

This function needs a function pointer that is able to convert multiple rows.

Parameters
sourcesThe memory pointers defining the source frame, e.g., several individual points to individual blocks in memory, must be valid
targetsThe memory pointers defining the target frame, e.g., several individual points to individual blocks in memory, must be valid
widthThe width of the frame, with range [1, infinity)
heightThe height of the frame, with range [multipleRowsPerIteration, infinity), must be a multiple of 'multipleRowsPerIteration'
flagThe conversion type to be applied
multipleRowsPerIterationThe number of rows, the specified rows-conversion-functions 'multipleRowsConversionFunction' can handle within one iteration, with range [1, infinity)
multipleRowsConversionFunctionThe function able to convert several row, must be valid
optionsOptional options which are necessary in the rows conversion function, otherwise nullptr
workerOptional worker to distribute the computation to several CPU cores

◆ convertArbitraryPixelFormatSubset()

static void Ocean::CV::FrameConverter::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 
)
staticprotected

Converts a subset of a frame with arbitrary pixel format (e.g., Y_UV12, Y_VU12, YUYV16, ...) to a frame with arbitrary pixel format.

Parameters
sourcesThe memory pointers defining the source frame, e.g., several individual points to individual blocks in memory, must be valid
targetsThe memory pointers defining the target frame, e.g., several individual points to individual blocks in memory, must be valid
widthThe width of the frame, with range [1, infinity)
heightThe height of the frame, with range [multipleRowsPerIteration, infinity), must be a multiple of 'multipleRowsPerIteration'
flagThe conversion type to be applied
multipleRowsPerIterationThe number of rows, the specified rows-conversion-functions 'multipleRowsConversionFunction' can handle within one iteration, with range [1, infinity)
multipleRowsConversionFunctionThe function able to convert several row, must be valid
optionsOptional options which are necessary in the rows conversion function, otherwise nullptr
firstMultipleRowThe first multiple-row to be handled, with range [0, height / multipleRowsPerIteration - 1]
numberMultipleRowsThe number of multiple-rows to be handled, with range [1, height / multipleRowsPerIteration]
See also
convertArbitraryPixelFormat().

◆ convertGenericPixelFormat()

template<typename TSource , typename TTarget >
void Ocean::CV::FrameConverter::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 
)
inlinestaticprotected

Converts a frame with generic pixel format (e.g., RGBA32, BGR24, YUV24, ...) to a frame with generic pixel format (e.g., RGB24, Y8).

This function needs a function pointer that is able to convert one row, and to reverse the order of pixels in one row in the target frame.

Parameters
sourceThe source frame with generic pixel format, must be valid
targetThe target frame with generic pixel format, must be valid
widthThe width of the frame, with range [1, infinity)
heightThe height of the frame, with range [1, infinity)
sourceStrideElementsNumber of horizontal elements between the start of two source rows, in elements, with range [width * elementsPerSourcePixel, infinity)
targetStrideElementsNumber of horizontal elements between the start of two target rows, in elements, with range [width * elementsPerTargetPixel, infinity)
flagDetermining the type of conversion
rowConversionFunctionThe function able to convert one row, must be valid
targetReversePixelOrderInPlaceFunctionThe function able to reverse the pixel order in one target row, must be valid if 'flag == CONVERT_MIRRORED || CONVERT_FLIPPED_AND_MIRRORED', can be nullptr otherwise
areContinuousTrue, if source and target frame have continuous memory (without padding); False, otherwise
optionsOptional options which are necessary in the row conversion function, otherwise nullptr
workerOptional worker to distribute the computation to several CPU cores
Template Parameters
TSourceThe data type of each source pixel element, e.g., 'uint8_t' or 'float'
TTargetThe data type of each target pixel element, e.g., 'uint8_t' or 'float'

◆ convertGenericPixelFormatSubset()

static void Ocean::CV::FrameConverter::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 
)
staticprotected

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).

This function needs a function pointer that is able to convert one row, and to reverse the order of pixels in one row in the target frame.

Parameters
sourceThe source frame with generic pixel format, must be valid
targetThe target frame with generic pixel format, must be valid
widthThe width of the frame, with range [1, infinity)
heightThe height of the frame, with range [1, infinity)
sourceStrideBytesNumber of bytes between the start of two source rows, in bytes, with range [width * elementsPerSourcePixel * sizeof(channelElement), infinity)
targetStrideBytesNumber of bytes between the start of two target rows, in bytes, with range [width * elementsPerTargetPixel * sizeof(channelElement), infinity)
flagDetermining the type of conversion
rowConversionFunctionThe function able to convert one row, must be valid
targetReversePixelOrderInPlaceFunctionThe function able to reverse the pixel order in one target row, must be valid
areContinuousTrue, if source and target frame have continuous memory (without padding); False, otherwise
optionsOptional options which are necessary in the row conversion function, otherwise nullptr
firstRowThe first row to be handled, with range [0, height - 1]
numberRowsThe number of rows to be handled, with range [1, height - firstRow]
See also
convertGenericPixelFormat<T>().

◆ convertOneRow_1Plane1ChannelAnd1Plane2ChannelsDownsampled2x2_To_1Plane3Channels_8BitPerChannel_Precision10Bit()

static void Ocean::CV::FrameConverter::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 
)
staticprotected

This function is not used anymore due to the corresponding 2-row function.

Converts one row of an image with e.g., a Y_UV12 pixel format to one row of an image with e.g., RGB24 pixel format with 10 bit precision. This function needs one plane with the first channel and another plane/block of 2x2 sub-sampled pixels containing the second and third channels.
The layout of the source image of e.g., an Y_UV12 image looks like this:

 source0:        source1:
 ---------       ---------
| Y Y Y Y |     | U V U V |
| Y Y Y Y |     | U V U V |
| Y Y Y Y |      ---------
| Y Y Y Y |
 ---------

The layout of the target image of e.g., a RGB24 image looks like this:

 target:
 ----------------------------
| R G B  R G B  R G B  R G B |
| R G B  R G B  R G B  R G B |
| R G B  R G B  R G B  R G B |
| R G B  R G B  R G B  R G B |
 ----------------------------

The layout of the options parameters is as follows:

options[ 0] uint32_t: sourcePlane0PaddingElements
options[ 1] uint32_t: sourcePlane1PaddingElements
options[ 2] uint32_t: targetPlanePaddingElements

options[ 3] int32_t: f00
options[ 4] int32_t: f10
options[ 5] int32_t: f20
options[ 6] int32_t: f01
options[  ] ...
options[11] int32_t: f22

options[12] int32_t: b0
options[13] int32_t: b1
options[14] int32_t: b2

with transformation:
t0 = f00 * s0 + f01 * s1 + f02 * s2 + b0
t1 = f10 * s0 + f11 * s1 + f12 * s2 + b1
t2 = f20 * s0 + f21 * s1 + f22 * s2 + b2
Parameters
sourcesThe pointer to the first and second memory block of the source image, 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 15 options parameters: 3 padding parameters, 9 multiplication parameters, and 3 bias parameters, must be valid
See also
convertOneRow_1Plane1ChannelAnd1Plane2ChannelsDownsampled2x2_To_1Plane3Channels_8BitPerChannel_Precision6Bit().

◆ convertOneRow_1Plane1ChannelAnd1Plane2ChannelsDownsampled2x2_To_1Plane3Channels_8BitPerChannel_Precision6Bit()

static void Ocean::CV::FrameConverter::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 
)
staticprotected

This function is not used anymore due to the corresponding 2-row function.

Converts one row of an image with e.g., a Y_UV12 pixel format to one row of an image with e.g., RGB24 pixel format with 6 bit precision. This function needs one plane with the first channel and another plane/block of 2x2 sub-sampled pixels containing the second and third channels.
The layout of the source image of e.g., an Y_UV12 image looks like this:

 source0:        source1:
 ---------       ---------
| Y Y Y Y |     | U V U V |
| Y Y Y Y |     | U V U V |
| Y Y Y Y |      ---------
| Y Y Y Y |
 ---------

The layout of the target image of e.g., a RGB24 image looks like this:

 target:
 ----------------------------
| R G B  R G B  R G B  R G B |
| R G B  R G B  R G B  R G B |
| R G B  R G B  R G B  R G B |
| R G B  R G B  R G B  R G B |
 ----------------------------

The layout of the options parameters is as follows:

options[ 0] uint32_t: sourcePlane0PaddingElements
options[ 1] uint32_t: sourcePlane1PaddingElements
options[ 2] uint32_t: targetPlanePaddingElements

options[ 3] int32_t: f00
options[ 4] int32_t: f10
options[ 5] int32_t: f20
options[ 6] int32_t: f01
options[  ] ...
options[11] int32_t: f22

options[12] int32_t: b0
options[13] int32_t: b1
options[14] int32_t: b2

with transformation:
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)
Parameters
sourcesThe pointer to the first and second memory block of the source image, 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 15 options parameters: 3 padding parameters, 9 multiplication parameters, and 3 bias parameters, must be valid
See also
convertOneRow_1Plane1ChannelAnd1Plane2ChannelsDownsampled2x2_To_1Plane3Channels_8BitPerChannel_Precision10Bit().

◆ convertOneRow_1Plane1ChannelAnd2Planes1ChannelDownsampled2x2_To_1Plane3Channels_8BitPerChannel_Precision10Bit()

static void Ocean::CV::FrameConverter::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 
)
staticprotected

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.

This function needs one plane with the first channel, and two additional planes with 2x2 sub-sampled pixels containing the second and third channels.
The layout of the source image of e.g., an Y_U_V12 image looks like this:

 source0:        source1:    source2:
 ---------       -----       -----
| Y Y Y Y |     | U U |     | V V |
| Y Y Y Y |     | U U |     | V V |
| Y Y Y Y |      -----       -----
| Y Y Y Y |
 ---------

The layout of the options parameters is as follows:

options[ 0] uint32_t: sourcePlane0PaddingElements
options[ 1] uint32_t: sourcePlane1PaddingElements
options[ 2] uint32_t: sourcePlane2PaddingElements
options[ 3] uint32_t: targetZippedPaddingElements

options[ 4] int32_t: f00
options[ 5] int32_t: f10
options[ 6] int32_t: f20
options[ 7] int32_t: f01
options[  ] ...
options[12] int32_t: f22

options[13] int32_t: b0
options[14] int32_t: b1
options[15] int32_t: b2

with transformation:
t0 = f00 * s0 + f01 * s1 + f02 * s2 + b0
t1 = f10 * s0 + f11 * s1 + f12 * s2 + b1
t2 = f20 * s0 + f21 * s1 + f22 * s2 + b2
Parameters
sourcesThe pointer to the first, second, and third memory block of the source image, 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 [2, infinity), must be even
heightThe height of the frame in pixel, with range [2, infinity), must be even
conversionFlagThe conversion to be applied
optionsThe 16 options parameters: 4 padding parameters, 9 multiplication parameters, and 3 bias parameters, must be valid

◆ convertOneRow_1Plane1ChannelAnd2Planes1ChannelDownsampled2x2_To_1Plane4Channels_8BitPerChannel_Precision6Bit()

static void Ocean::CV::FrameConverter::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 
)
staticprotected

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.

This function needs one plane with the first channel, and two additional planes with 2x2 sub-sampled pixels containing the second and third channels.
The layout of the source image of e.g., an Y_U_V12 image looks like this:

 source0:        source1:    source2:
 ---------       -----       -----
| Y Y Y Y |     | U U |     | V V |
| Y Y Y Y |     | U U |     | V V |
| Y Y Y Y |      -----       -----
| Y Y Y Y |
 ---------

The layout of the options parameters is as follows:

options[ 0] uint32_t: sourcePlane0PaddingElements
options[ 1] uint32_t: sourcePlane1PaddingElements
options[ 2] uint32_t: sourcePlane2PaddingElements
options[ 3] uint32_t: targetZippedPaddingElements

options[ 4] int32_t: f00
options[ 5] int32_t: f10
options[ 6] int32_t: f20
options[ 7] int32_t: f01
options[  ] ...
options[12] int32_t: f22

options[13] int32_t: b0
options[14] int32_t: b1
options[15] int32_t: b2

options[16] int32_t: channelValue3

with transformation:
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 = channelValue3
Parameters
sourcesThe pointer to the first, second, and third memory block of the source image, 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)
heightThe height of the frame in pixel, with range [1, infinity)
conversionFlagThe conversion to be applied
optionsThe 17 options parameters: 4 padding parameters, 9 multiplication parameters, and 3 bias parameters, one constant channel value, must be valid

◆ convertOneRow_1Plane3ChannelsWith2ChannelsDownsampled2x1BackIsDownsampled_To_1Plane3Channels_8BitPerChannel_Precision10Bit()

static void Ocean::CV::FrameConverter::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 
)
staticprotected

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.

The layout of the options parameters is as follows:

options[ 0] uint32_t: sourcePaddingElements
options[ 1] uint32_t: targetPaddingElements

options[ 2] int32_t: f00
options[ 3] int32_t: f10
options[ 4] int32_t: f20
options[ 5] int32_t: f01
options[  ] ...
options[10] int32_t: f22

options[11] int32_t: b0
options[12] int32_t: b1
options[13] int32_t: b2

with transformation:
t0 = f00 * s0 + f01 * s1 + f02 * s2 + b0
t1 = f10 * s0 + f11 * s1 + f12 * s2 + b1
t2 = f20 * s0 + f21 * s1 + f22 * s2 + b2
Parameters
sourcesThe pointer to the first, second, and third memory block of the source image, 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 [2, infinity), must be even
heightThe height of the frame in pixel, with range [1, infinity), must be even
conversionFlagThe conversion to be applied
optionsThe 14 options parameters: 2 padding parameters, 9 multiplication parameters, and 3 bias parameters, must be valid

◆ convertOneRow_1Plane3ChannelsWith2ChannelsDownsampled2x1FrontIsDownsampled_To_1Plane3Channels_8BitPerChannel_Precision10Bit()

static void Ocean::CV::FrameConverter::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 
)
staticprotected

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.

The layout of the options parameters is as follows:

options[ 0] uint32_t: sourcePaddingElements
options[ 1] uint32_t: targetPaddingElements

options[ 2] int32_t: f00
options[ 3] int32_t: f10
options[ 4] int32_t: f20
options[ 5] int32_t: f01
options[  ] ...
options[10] int32_t: f22

options[11] int32_t: b0
options[12] int32_t: b1
options[13] int32_t: b2

with transformation:
t0 = f00 * s0 + f01 * s1 + f02 * s2 + b0
t1 = f10 * s0 + f11 * s1 + f12 * s2 + b1
t2 = f20 * s0 + f21 * s1 + f22 * s2 + b2
Parameters
sourcesThe pointer to the first, second, and third memory block of the source image, 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 [2, infinity), must be even
heightThe height of the frame in pixel, with range [1, infinity), must be even
conversionFlagThe conversion to be applied
optionsThe 14 options parameters: 2 padding parameters, 9 multiplication parameters, and 3 bias parameters, must be valid

◆ convertOneRow_3Planes1Channel_To_1Plane3Channels_8BitPerChannel_Precision6Bit()

static void Ocean::CV::FrameConverter::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 
)
staticprotected

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.

This function needs three source planes/blocks with three individual channels. The layout of the options parameters is as follows:

options[ 0] uint32_t: sourcePlane0PaddingElements
options[ 1] uint32_t: sourcePlane1PaddingElements
options[ 2] uint32_t: sourcePlane2PaddingElements
options[ 3] uint32_t: targetZippedPaddingElements

options[ 4] int32_t: f00
options[ 5] int32_t: f10
options[ 6] int32_t: f20
options[ 7] int32_t: f01
options[  ] ...
options[12] int32_t: f22

options[13] int32_t: b0
options[14] int32_t: b1
options[15] int32_t: b2

with transformation:
t0 = f00 * s0 + f01 * s1 + f02 * s2 + b0
t1 = f10 * s0 + f11 * s1 + f12 * s2 + b1
t2 = f20 * s0 + f21 * s1 + f22 * s2 + b2
Parameters
sourcesThe pointer to the first, second, and third memory block of the source image, 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)
heightThe height of the frame in pixel, with range [1, infinity)
conversionFlagThe conversion to be applied
optionsThe 16 options parameters: 4 padding parameters, 9 multiplication parameters, and 3 bias parameters, must be valid

◆ convertOneRow_3Planes1Channel_To_1Plane4Channels_8BitPerChannel_Precision6Bit()

static void Ocean::CV::FrameConverter::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 
)
staticprotected

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.

This function needs three source planes/blocks with three individual channels. The layout of the options parameters is as follows:

options[ 0] uint32_t: sourcePlane0PaddingElements
options[ 1] uint32_t: sourcePlane1PaddingElements
options[ 2] uint32_t: sourcePlane2PaddingElements
options[ 3] uint32_t: targetZippedPaddingElements

options[ 4] int32_t: f00
options[ 5] int32_t: f10
options[ 6] int32_t: f20
options[ 7] int32_t: f01
options[  ] ...
options[12] int32_t: f22

options[13] int32_t: b0
options[14] int32_t: b1
options[15] int32_t: b2

options[16] uint32_t: channelValue3

with transformation:
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 = channelValue3
Parameters
sourcesThe pointer to the first, second, and third memory block of the source image, 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)
heightThe height of the frame in pixel, with range [1, infinity)
conversionFlagThe conversion to be applied
optionsThe 17 options parameters: 4 padding parameters, 9 multiplication parameters, and 3 bias parameters, one constant channel value, must be valid

◆ convertTwoRows_1Plane1ChannelAnd1Plane2ChannelsDownsampled2x2_To_1Plane3Channels_8BitPerChannel_Precision10Bit()

static void Ocean::CV::FrameConverter::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 
)
staticprotected

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.

This function needs one plane with the first channel and another plane/block of 2x2 sub-sampled pixels containing the second and third channels.
The layout of the source image of e.g., an Y_UV12 image looks like this:

 source0:        source1:
 ---------       ---------
| Y Y Y Y |     | U V U V |
| Y Y Y Y |     | U V U V |
| Y Y Y Y |      ---------
| Y Y Y Y |
 ---------

The layout of the target image of e.g., a RGB24 image looks like this:

 target:
 ----------------------------
| R G B  R G B  R G B  R G B |
| R G B  R G B  R G B  R G B |
| R G B  R G B  R G B  R G B |
| R G B  R G B  R G B  R G B |
 ----------------------------

The layout of the options parameters is as follows:

options[ 0] uint32_t: sourcePlane0PaddingElements
options[ 1] uint32_t: sourcePlane1PaddingElements
options[ 2] uint32_t: targetPlanePaddingElements

options[ 3] int32_t: f00
options[ 4] int32_t: f10
options[ 5] int32_t: f20
options[ 6] int32_t: f01
options[  ] ...
options[11] int32_t: f22

options[12] int32_t: b0
options[13] int32_t: b1
options[14] int32_t: b2

with transformation:
t0 = f00 * s0 + f01 * s1 + f02 * s2 + b0
t1 = f10 * s0 + f11 * s1 + f12 * s2 + b1
t2 = f20 * s0 + f21 * s1 + f22 * s2 + b2
Parameters
sourcesThe pointer to the first and second memory block of the source image, 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 / 2 - 1]
widthThe width of the frame in pixel, with range [2, infinity), must be even
heightThe height of the frame in pixel, with range [2, infinity), must be even
conversionFlagThe conversion to be applied
optionsThe 15 options parameters: 3 padding parameters, 9 multiplication parameters, and 3 bias parameters, must be valid

◆ convertTwoRows_1Plane1ChannelAnd1Plane2ChannelsDownsampled2x2_To_1Plane3Channels_8BitPerChannel_Precision6Bit()

static void Ocean::CV::FrameConverter::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 
)
staticprotected

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.

This function needs one plane with the first channel and another plane/block of 2x2 sub-sampled pixels containing the second and third channels.
The layout of the source image of e.g., an Y_UV12 image looks like this:

 source0:        source1:
 ---------       ---------
| Y Y Y Y |     | U V U V |
| Y Y Y Y |     | U V U V |
| Y Y Y Y |      ---------
| Y Y Y Y |
 ---------

The layout of the target image of e.g., a RGB24 image looks like this:

 target:
 ----------------------------
| R G B  R G B  R G B  R G B |
| R G B  R G B  R G B  R G B |
| R G B  R G B  R G B  R G B |
| R G B  R G B  R G B  R G B |
 ----------------------------

The layout of the options parameters is as follows:

options[ 0] uint32_t: sourcePlane0PaddingElements
options[ 1] uint32_t: sourcePlane1PaddingElements
options[ 2] uint32_t: targetPlanePaddingElements

options[ 3] int32_t: f00
options[ 4] int32_t: f10
options[ 5] int32_t: f20
options[ 6] int32_t: f01
options[  ] ...
options[11] int32_t: f22

options[12] int32_t: b0
options[13] int32_t: b1
options[14] int32_t: b2

with transformation:
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)
Parameters
sourcesThe pointer to the first and second memory block of the source image, 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 / 2 - 1]
widthThe width of the frame in pixel, with range [2, infinity), must be even
heightThe height of the frame in pixel, with range [2, infinity), must be even
conversionFlagThe conversion to be applied
optionsThe 15 options parameters: 3 padding parameters, 9 multiplication parameters, and 3 bias parameters, must be valid

◆ convertTwoRows_1Plane1ChannelAnd2Planes1ChannelDownsampled2x2_To_1Plane3Channels_8BitPerChannel_Precision10Bit()

static void Ocean::CV::FrameConverter::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 
)
staticprotected

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.

This function needs one plane with the first channel, and two additional planes with 2x2 sub-sampled pixels containing the second and third channels.
The layout of the source image of e.g., an Y_U_V12 image looks like this:

 source0:        source1:    source2:
 ---------       -----       -----
| Y Y Y Y |     | U U |     | V V |
| Y Y Y Y |     | U U |     | V V |
| Y Y Y Y |      -----       -----
| Y Y Y Y |
 ---------

The layout of the options parameters is as follows:

options[ 0] uint32_t: sourcePlane0PaddingElements
options[ 1] uint32_t: sourcePlane1PaddingElements
options[ 2] uint32_t: sourcePlane2PaddingElements
options[ 3] uint32_t: targetZippedPaddingElements

options[ 4] int32_t: f00
options[ 5] int32_t: f10
options[ 6] int32_t: f20
options[ 7] int32_t: f01
options[  ] ...
options[12] int32_t: f22

options[13] int32_t: b0
options[14] int32_t: b1
options[15] int32_t: b2

with transformation:
t0 = f00 * s0 + f01 * s1 + f02 * s2 + b0
t1 = f10 * s0 + f11 * s1 + f12 * s2 + b1
t2 = f20 * s0 + f21 * s1 + f22 * s2 + b2
Parameters
sourcesThe pointer to the first, second, and third memory block of the source image, 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 / 2 - 1]
widthThe width of the frame in pixel, with range [2, infinity), must be even
heightThe height of the frame in pixel, with range [2, infinity), must be even
conversionFlagThe conversion to be applied
optionsThe 16 options parameters: 4 padding parameters, 9 multiplication parameters, and 3 bias parameters, must be valid

◆ convertTwoRows_1Plane1ChannelAnd2Planes1ChannelDownsampled2x2_To_1Plane3Channels_8BitPerChannel_Precision6Bit()

static void Ocean::CV::FrameConverter::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 
)
staticprotected

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.

This function needs one plane with the first channel, and two additional planes with 2x2 sub-sampled pixels containing the second and third channels.
The layout of the source image of e.g., an Y_U_V12 image looks like this:

 source0:        source1:    source2:
 ---------       -----       -----
| Y Y Y Y |     | U U |     | V V |
| Y Y Y Y |     | U U |     | V V |
| Y Y Y Y |      -----       -----
| Y Y Y Y |
 ---------

The layout of the target image of e.g., a RGB24 image looks like this:
 target:
 ----------------------------
| R G B  R G B  R G B  R G B |
| R G B  R G B  R G B  R G B |
| R G B  R G B  R G B  R G B |
| R G B  R G B  R G B  R G B |
 ----------------------------

The layout of the options parameters is as follows:

options[ 0] uint32_t: sourcePlane0PaddingElements
options[ 1] uint32_t: sourcePlane1PaddingElements
options[ 2] uint32_t: sourcePlane2PaddingElements
options[ 3] uint32_t: targetPlanePaddingElements

options[ 4] int32_t: f00
options[ 5] int32_t: f10
options[ 6] int32_t: f20
options[ 7] int32_t: f01
options[  ] ...
options[12] int32_t: f22

options[13] int32_t: b0
options[14] int32_t: b1
options[15] int32_t: b2

with transformation:
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 = channelValue3
Parameters
sourcesThe pointer to the first, second, and third memory block of the source image, 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/2 - 1]
widthThe width of the frame in pixel, with range [1, infinity)
heightThe height of the frame in pixel, with range [2, infinity)
conversionFlagThe conversion to be applied
optionsThe 16 options parameters: 4 padding parameters, 9 multiplication parameters, and 3 bias parameters, must be valid

◆ convertTwoRows_1Plane1ChannelAnd2Planes1ChannelDownsampled2x2_To_1Plane4Channels_8BitPerChannel_Precision6Bit()

static void Ocean::CV::FrameConverter::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 
)
staticprotected

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.

This function needs one plane with the first channel, and two additional planes with 2x2 sub-sampled pixels containing the second and third channels.
The layout of the source image of e.g., an Y_U_V12 image looks like this:

 source0:        source1:    source2:
 ---------       -----       -----
| Y Y Y Y |     | U U |     | V V |
| Y Y Y Y |     | U U |     | V V |
| Y Y Y Y |      -----       -----
| Y Y Y Y |
 ---------

The layout of the target image of e.g., a RGBA24 image looks like this:
 target:
 ------------------------------------
| R G B A  R G B A  R G B A  R G B A |
| R G B A  R G B A  R G B A  R G B A |
| R G B A  R G B A  R G B A  R G B A |
| R G B A  R G B A  R G B A  R G B A |
 ------------------------------------

The layout of the options parameters is as follows:

options[ 0] uint32_t: sourcePlane0PaddingElements
options[ 1] uint32_t: sourcePlane1PaddingElements
options[ 2] uint32_t: sourcePlane2PaddingElements
options[ 3] uint32_t: targetPlanePaddingElements

options[ 4] int32_t: f00
options[ 5] int32_t: f10
options[ 6] int32_t: f20
options[ 7] int32_t: f01
options[  ] ...
options[12] int32_t: f22

options[13] int32_t: b0
options[14] int32_t: b1
options[15] int32_t: b2

options[16] uint32_t: channelValue3

with transformation:
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 = channelValue3
Parameters
sourcesThe pointer to the first, second, and third memory block of the source image, 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/2 - 1]
widthThe width of the frame in pixel, with range [1, infinity)
heightThe height of the frame in pixel, with range [2, infinity)
conversionFlagThe conversion to be applied
optionsThe 17 options parameters: 4 padding parameters, 9 multiplication parameters, and 3 bias parameters, one constant channel value, must be valid

◆ convertTwoRows_1Plane3Channels_To_1Plane1ChannelAnd1Plane2ChannelsDownsampled2x2_8BitPerChannel_Precision7Bit()

static void Ocean::CV::FrameConverter::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 
)
staticprotected

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.

This function needs a source image with one plane and a target image with two planes. The layout of the source image of e.g., a RGB24 image looks like this:

 source:
 ----------------------------
| R G B  R G B  R G B  R G B |
| R G B  R G B  R G B  R G B |
| R G B  R G B  R G B  R G B |
| R G B  R G B  R G B  R G B |
 ----------------------------

The layout of the target image of e.g., an Y_UV12 image looks like this:

 target0:        target1:
 ---------       ---------
| Y Y Y Y |     | U V U V |
| Y Y Y Y |     | U V U V |
| Y Y Y Y |      ---------
| Y Y Y Y |
 ---------

The layout of the options parameters is as follows:

options[ 0] uint32_t: sourcePlanePaddingElements
options[ 1] uint32_t: targetPlane0PaddingElements
options[ 2] uint32_t: targetPlane1PaddingElements

options[ 3] int32_t: f00
options[ 4] int32_t: f10
options[ 5] int32_t: f20
options[ 6] int32_t: f01
options[  ] ...
options[11] int32_t: f22

options[12] int32_t: b0
options[13] int32_t: b1
options[14] int32_t: b2

with transformation:
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)
Parameters
sourcesThe pointer to the source plane, must be valid
targetsThe pointers to the first and second target plane, must be valid
multipleRowIndexThe index of the multiple-row to be handled, with range [0, height / 2 - 1]
widthThe width of the frame in pixel, with range [2, infinity), must be even
heightThe height of the frame in pixel, with range [2, infinity), must be even
conversionFlagThe conversion to be applied
optionsThe 15 options parameters: 3 padding parameters, 9 multiplication parameters, and 3 bias parameters, must be valid

◆ convertTwoRows_1Plane3Channels_To_1Plane1ChannelAnd2Planes1ChannelsDownsampled2x2_8BitPerChannel_Precision7Bit()

static void Ocean::CV::FrameConverter::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 
)
staticprotected

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.

This function needs a source image with one plane and a target image with three planes. The layout of the source image of e.g., a RGB24 image looks like this:

 source:
 ----------------------------
| R G B  R G B  R G B  R G B |
| R G B  R G B  R G B  R G B |
| R G B  R G B  R G B  R G B |
| R G B  R G B  R G B  R G B |
 ----------------------------

The layout of the target image of e.g., an Y_U_V12 image looks like this:

 target0:        target1:    target2:
 ---------       -----      -----
| Y Y Y Y |     | U U |    | V V |
| Y Y Y Y |     | U U |    | V V |
| Y Y Y Y |      -----      -----
| Y Y Y Y |
 ---------

The layout of the options parameters is as follows:

options[ 0] uint32_t: sourcePlanePaddingElements
options[ 1] uint32_t: targetPlane0PaddingElements
options[ 2] uint32_t: targetPlane1PaddingElements
options[ 3] uint32_t: targetPlane2PaddingElements

options[ 4] int32_t: f00
options[ 5] int32_t: f10
options[ 6] int32_t: f20
options[ 7] int32_t: f01
options[  ] ...
options[12] int32_t: f22

options[13] int32_t: b0
options[14] int32_t: b1
options[15] int32_t: b2

with transformation:
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)
Parameters
sourcesThe pointer to the source plane, must be valid
targetsThe pointers to the first, second, and third target planes, must be valid
multipleRowIndexThe index of the multiple-row to be handled, with range [0, height / 2 - 1]
widthThe width of the frame in pixel, with range [2, infinity), must be even
heightThe height of the frame in pixel, with range [2, infinity), must be even
conversionFlagThe conversion to be applied
optionsThe 16 options parameters: 4 padding parameters, 9 multiplication parameters, and 3 bias parameters, must be valid

◆ convertTwoRows_1PlaneMosaicPacked10Bit_To_1PlaneUnpacked3Channels16Bit()

template<unsigned int tIndexRed, unsigned int tIndexGreen, unsigned int tIndexBlue>
static void Ocean::CV::FrameConverter::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 
)
staticprotected

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.

The layout of the options parameters is as follows:

options[0] uint32_t: sourcePaddingElements
options[1] uint32_t: targetPaddingElements
Parameters
sourcesThe one pointer to the source image with Bayer mosaic, 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/2 - 1]
widthThe width of the frame in pixel, with range [4, infinity), must be a multiple of 4
heightThe height of the frame in pixel, with range [2, infinity), must be a multiple of 2
conversionFlagThe conversion to be applied
optionsThe 2 options parameters: 2 padding parameters
Template Parameters
tIndexRedThe index of red channel in the target image, with range [0, 2]
tIndexGreenThe index of green channel in the target image, with range [0, 2]
tIndexBlueThe index of blue channel in the target image, with range [0, 2]

◆ convertTwoRows_1PlaneMosaicPacked10Bit_To_1PlaneUnpacked3Channels8Bit()

template<unsigned int tIndexRed, unsigned int tIndexGreen, unsigned int tIndexBlue>
static void Ocean::CV::FrameConverter::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 
)
staticprotected

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.

The layout of the options parameters is as follows:

options[0] uint32_t: sourcePaddingElements
options[1] uint32_t: targetPaddingElements
Parameters
sourcesThe one pointer to the source image with Bayer mosaic, 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/2 - 1]
widthThe width of the frame in pixel, with range [4, infinity), must be a multiple of 4
heightThe height of the frame in pixel, with range [2, infinity), must be a multiple of 2
conversionFlagThe conversion to be applied
optionsThe 2 options parameters: 2 padding parameters
Template Parameters
tIndexRedThe index of red channel in the target image, with range [0, 2]
tIndexGreenThe index of green channel in the target image, with range [0, 2]
tIndexBlueThe index of blue channel in the target image, with range [0, 2]

◆ convertTwoRows_1PlaneMosaicPacked10Bit_To_1PlaneUnpacked3Channels8BitAdvanced()

template<unsigned int tIndexRed, unsigned int tIndexGreen, unsigned int tIndexBlue>
static void Ocean::CV::FrameConverter::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 
)
staticprotected

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.

Parameters
sourcesThe pointer to the first, second, and third memory block of the source image, 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/2 - 1]
widthThe width of the frame in pixel, with range [4, infinity), must be a multiple of 4
heightThe height of the frame in pixel, with range [2, infinity), must be a multiple of 2
conversionFlagThe conversion to be applied
optionsThe 2 options parameters: 2 padding parameters
Template Parameters
tIndexRedThe index of red channel in the target image, with range [0, 2]
tIndexGreenThe index of green channel in the target image, with range [0, 2]
tIndexBlueThe index of blue channel in the target image, with range [0, 2]

◆ mapOneRow_1Plane1ChannelAnd1Plane2ChannelsDownsampled2x2_To_1Plane3Channels_8BitPerChannel()

template<unsigned int tSourceChannelIndex0, unsigned int tSourceChannelIndex1, unsigned int tSourceChannelIndex2>
static void Ocean::CV::FrameConverter::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 
)
staticprotected

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.

This function needs one plane with the first channel and another plane/block of 2x2 sub-sampled pixels containing the second and third channels.
The layout of the source image of e.g., an Y_UV12 image looks like this:

 source0:        source1:
 ---------       ---------
| Y Y Y Y |     | U V U V |
| Y Y Y Y |     | U V U V |
| Y Y Y Y |      ---------
| Y Y Y Y |
 ---------

The layout of the target image of e.g., an YUV24 image looks like this:

 target:
 ----------------------------
| Y U V  Y U V  Y U V  Y U V |
| Y U V  Y U V  Y U V  Y U V |
| Y U V  Y U V  Y U V  Y U V |
| Y U V  Y U V  Y U V  Y U V |
 ----------------------------

The layout of the options parameters is as follows:

options[0] uint32_t: sourcePlane0PaddingElements
options[1] uint32_t: sourcePlane1PaddingElements
options[2] uint32_t: targetPlanePaddingElements

with transformation:
t0 = tSourceChannelIndex0 == 0 ? s0, or tSourceChannelIndex0 == 1 ? s1, or tSourceChannelIndex0 == 2 ? s2
t1 = tSourceChannelIndex1 == 0 ? s0, or tSourceChannelIndex1 == 1 ? s1, or tSourceChannelIndex1 == 2 ? s2
t2 = tSourceChannelIndex2 == 0 ? s0, or tSourceChannelIndex2 == 1 ? s1, or tSourceChannelIndex2 == 2 ? s2
Parameters
sourcesThe pointer to the first and second memory block of the source image, 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 [2, infinity), must be even
heightThe height of the frame in pixel, with range [2, infinity), must be even
conversionFlagThe conversion to be applied
optionsThe 3 options parameters: 3 padding parameters, with ranges [0, infinity), must be valid
Template Parameters
tSourceChannelIndex0The index of the source channels which will be mapped to the first target channel, with range [0, 2]
tSourceChannelIndex1The index of the source channels which will be mapped to the second target channel, with range [0, 2]
tSourceChannelIndex2The index of the source channels which will be mapped to the third target channel, with range [0, 2]

◆ mapOneRow_1Plane1ChannelAnd2Planes1ChannelDownsampled2x2_To_1Plane3Channels_8BitPerChannel()

template<unsigned int tSourceChannelIndex0, unsigned int tSourceChannelIndex1, unsigned int tSourceChannelIndex2>
static void Ocean::CV::FrameConverter::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 
)
staticprotected

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.

This function needs one plane with the first channel, and two additional planes with 2x2 sub-sampled pixels containing the second and third channels.
The layout of the source image of e.g., an Y_U_V12 image looks like this:

 source0:        source1:    source2:
 ---------       -----       -----
| Y Y Y Y |     | U U |     | V V |
| Y Y Y Y |     | U U |     | V V |
| Y Y Y Y |      -----       -----
| Y Y Y Y |
 ---------

The layout of the options parameters is as follows:

options[0] uint32_t: sourcePlane0PaddingElements
options[1] uint32_t: sourcePlane1PaddingElements
options[2] uint32_t: sourcePlane2PaddingElements
options[3] uint32_t: targetZippedPaddingElements

with transformation:
t0 = tSourceChannelIndex0 == 0 ? s0, or tSourceChannelIndex0 == 1 ? s1, or tSourceChannelIndex0 == 2 ? s2
t1 = tSourceChannelIndex1 == 0 ? s0, or tSourceChannelIndex1 == 1 ? s1, or tSourceChannelIndex1 == 2 ? s2
t2 = tSourceChannelIndex2 == 0 ? s0, or tSourceChannelIndex2 == 1 ? s1, or tSourceChannelIndex2 == 2 ? s2
Parameters
sourcesThe pointer to the first, second, and third memory block of the source image, 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 [2, infinity), must be even
heightThe height of the frame in pixel, with range [2, infinity), must be even
conversionFlagThe conversion to be applied
optionsThe 4 options parameters: 4 padding parameters, must be valid
Template Parameters
tSourceChannelIndex0The index of the source channels which will be mapped to the first target channel, with range [0, infinity)
tSourceChannelIndex1The index of the source channels which will be mapped to the second target channel, with range [0, infinity)
tSourceChannelIndex2The index of the source channels which will be mapped to the third target channel, with range [0, infinity)
See also
mapTwoRows_1Plane3Channels_To_1Plane1ChannelAnd2Planes1ChannelDownsampled2x2_8BitPerChannel().

◆ mapOneRow_1Plane2Channels_To_2Planes1Channel_8BitPerChannel()

static void Ocean::CV::FrameConverter::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 
)
staticprotected

Maps one row of a 1-plane, 2-channel image to two planes with 1 channels.

Parameters
sourcesThe pointer to the plane of the source image, must be valid
targetsThe pointer to the first and second plane of 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)
heightThe height of the frame in pixel, with range [1, infinity)
conversionFlagThe conversion to be applied
optionsThe 3 options parameters: 3 padding parameters

◆ mapOneRow_1Plane3ChannelsWith2ChannelsDownsampled2x1BackIsDownsampled_To_1Plane3Channels_8BitPerChannel()

template<unsigned int tSourceChannelIndex0, unsigned int tSourceChannelIndex1, unsigned int tSourceChannelIndex2>
static void Ocean::CV::FrameConverter::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 
)
staticprotected

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.

The layout of the options parameters is as follows:

options[0] uint32_t: sourcePaddingElements
options[1] uint32_t: targetPaddingElements

with transformation:
t0 = tSourceChannelIndex0 == 0 ? s0, or tSourceChannelIndex0 == 1 ? s1, or tSourceChannelIndex0 == 2 ? s2
t1 = tSourceChannelIndex1 == 0 ? s0, or tSourceChannelIndex1 == 1 ? s1, or tSourceChannelIndex1 == 2 ? s2
t2 = tSourceChannelIndex2 == 0 ? s0, or tSourceChannelIndex2 == 1 ? s1, or tSourceChannelIndex2 == 2 ? s2
Parameters
sourcesThe pointer to the first, second, and third memory block of the source image, 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 [2, infinity), must be even
heightThe height of the frame in pixel, with range [1, infinity)
conversionFlagThe conversion to be applied
optionsThe 2 options parameters: 2 padding parameters, must be valid
Template Parameters
tSourceChannelIndex0The index of the source channels which will be mapped to the first target channel, with range [0, infinity)
tSourceChannelIndex1The index of the source channels which will be mapped to the second target channel, with range [0, infinity)
tSourceChannelIndex2The index of the source channels which will be mapped to the third target channel, with range [0, infinity)
See also
mapTwoRows_1Plane3Channels_To_1Plane1ChannelAnd2Planes1ChannelDownsampled2x2_8BitPerChannel().

◆ mapOneRow_1Plane3ChannelsWith2ChannelsDownsampled2x1FrontIsDownsampled_To_1Plane3Channels_8BitPerChannel()

template<unsigned int tSourceChannelIndex0, unsigned int tSourceChannelIndex1, unsigned int tSourceChannelIndex2>
static void Ocean::CV::FrameConverter::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 
)
staticprotected

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.

The layout of the options parameters is as follows:

options[0] uint32_t: sourcePaddingElements
options[1] uint32_t: targetPaddingElements

with transformation:
t0 = tSourceChannelIndex0 == 0 ? s0, or tSourceChannelIndex0 == 1 ? s1, or tSourceChannelIndex0 == 2 ? s2
t1 = tSourceChannelIndex1 == 0 ? s0, or tSourceChannelIndex1 == 1 ? s1, or tSourceChannelIndex1 == 2 ? s2
t2 = tSourceChannelIndex2 == 0 ? s0, or tSourceChannelIndex2 == 1 ? s1, or tSourceChannelIndex2 == 2 ? s2
Parameters
sourcesThe pointer to the first, second, and third memory block of the source image, 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 [2, infinity), must be even
heightThe height of the frame in pixel, with range [1, infinity)
conversionFlagThe conversion to be applied
optionsThe 2 options parameters: 2 padding parameters, must be valid
Template Parameters
tSourceChannelIndex0The index of the source channels which will be mapped to the first target channel, with range [0, infinity)
tSourceChannelIndex1The index of the source channels which will be mapped to the second target channel, with range [0, infinity)
tSourceChannelIndex2The index of the source channels which will be mapped to the third target channel, with range [0, infinity)

◆ mapOneRow_3Plane1Channel_To_1Plane3Channels_8BitPerChannel()

template<unsigned int tSourceChannelIndex0, unsigned int tSourceChannelIndex1, unsigned int tSourceChannelIndex2>
static void Ocean::CV::FrameConverter::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 
)
staticprotected

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.

This function needs three source planes each holding one channel.
The layout of the source image of e.g., an Y_U_V24 image looks like this:

 source0:        source1:        source2:
 ---------       ---------       ---------
| Y Y Y Y |     | U U U U |     | V V V V |
| Y Y Y Y |     | U U U U |     | V V V V |
| Y Y Y Y |     | U U U U |     | V V V V |
| Y Y Y Y |     | U U U U |     | V V V V |
 ---------       ---------       ---------

The layout of the target image of e.g., an YUV24 image looks like this:

 target:
 ----------------------------
| Y U V  Y U V  Y U V  Y U V |
| Y U V  Y U V  Y U V  Y U V |
| Y U V  Y U V  Y U V  Y U V |
| Y U V  Y U V  Y U V  Y U V |
 ----------------------------

The layout of the options parameters is as follows:

options[0] uint32_t: sourcePlane0PaddingElements
options[1] uint32_t: sourcePlane1PaddingElements
options[2] uint32_t: sourcePlane2PaddingElements
options[2] uint32_t: targetPlanePaddingElements

with transformation:
t0 = tSourceChannelIndex0 == 0 ? s0, or tSourceChannelIndex0 == 1 ? s1, or tSourceChannelIndex0 == 2 ? s2
t1 = tSourceChannelIndex1 == 0 ? s0, or tSourceChannelIndex1 == 1 ? s1, or tSourceChannelIndex1 == 2 ? s2
t2 = tSourceChannelIndex2 == 0 ? s0, or tSourceChannelIndex2 == 1 ? s1, or tSourceChannelIndex2 == 2 ? s2
Parameters
sourcesThe pointer to the first, second, and third memory block of the source image, 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)
heightThe height of the frame in pixel, with range [1, infinity)
conversionFlagThe conversion to be applied
optionsThe 4 options parameters: 4 padding parameters, with ranges [0, infinity), must be valid
Template Parameters
tSourceChannelIndex0The index of the source channels which will be mapped to the first target channel, with range [0, 2]
tSourceChannelIndex1The index of the source channels which will be mapped to the second target channel, with range [0, 2]
tSourceChannelIndex2The index of the source channels which will be mapped to the third target channel, with range [0, 2]

◆ mapTwoRows_1Plane1ChannelAnd1Plane2ChannelsDownsampled2x2_To_1Plane3Channels_8BitPerChannel()

template<unsigned int tSourceChannelIndex0, unsigned int tSourceChannelIndex1, unsigned int tSourceChannelIndex2>
static void Ocean::CV::FrameConverter::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 
)
staticprotected

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.

This function needs one plane with the first channel and another plane/block of 2x2 sub-sampled pixels containing the second and third channels.
The layout of the source image of e.g., an Y_UV12 image looks like this:

 source0:        source1:
 ---------       ---------
| Y Y Y Y |     | U V U V |
| Y Y Y Y |     | U V U V |
| Y Y Y Y |      ---------
| Y Y Y Y |
 ---------

The layout of the options parameters is as follows:

options[0] uint32_t: sourcePlanePaddingElements
options[1] uint32_t: sourceZippedPaddingElements
options[2] uint32_t: targetZippedPaddingElements

with transformation:
t0 = tSourceChannelIndex0 == 0 ? s0, or tSourceChannelIndex0 == 1 ? s1, or tSourceChannelIndex0 == 2 ? s2
t1 = tSourceChannelIndex1 == 0 ? s0, or tSourceChannelIndex1 == 1 ? s1, or tSourceChannelIndex1 == 2 ? s2
t2 = tSourceChannelIndex2 == 0 ? s0, or tSourceChannelIndex2 == 1 ? s1, or tSourceChannelIndex2 == 2 ? s2
Parameters
sourcesThe pointer to the first and second memory block of the source image, 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 / 2 - 1]
widthThe width of the frame in pixel, with range [2, infinity), must be even
heightThe height of the frame in pixel, with range [2, infinity), must be even
conversionFlagThe conversion to be applied
optionsThe 3 options parameters: 3 padding parameters, with ranges [0, infinity), must be valid
Template Parameters
tSourceChannelIndex0The index of the source channels which will be mapped to the first target channel, with range [0, 2]
tSourceChannelIndex1The index of the source channels which will be mapped to the second target channel, with range [0, 2]
tSourceChannelIndex2The index of the source channels which will be mapped to the third target channel, with range [0, 2]

◆ mapTwoRows_1Plane1ChannelAnd2Planes1ChannelDownsampled2x2_To_1Plane3Channels_8BitPerChannel()

template<unsigned int tSourceChannelIndex0, unsigned int tSourceChannelIndex1, unsigned int tSourceChannelIndex2>
static void Ocean::CV::FrameConverter::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 
)
staticprotected

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.

This function needs one plane with the first channel, and two additional planes with 2x2 sub-sampled pixels containing the second and third channels.
The layout of the source image of e.g., an Y_U_V12 image looks like this:

 source0:        source1:    source2:
 ---------       -----       -----
| Y Y Y Y |     | U U |     | V V |
| Y Y Y Y |     | U U |     | V V |
| Y Y Y Y |      -----       -----
| Y Y Y Y |
 ---------

The layout of the options parameters is as follows:

options[0] uint32_t: sourcePlane0PaddingElements
options[1] uint32_t: sourcePlane1PaddingElements
options[2] uint32_t: sourcePlane2PaddingElements
options[3] uint32_t: targetZippedPaddingElements

with transformation:
t0 = tSourceChannelIndex0 == 0 ? s0, or tSourceChannelIndex0 == 1 ? s1, or tSourceChannelIndex0 == 2 ? s2
t1 = tSourceChannelIndex1 == 0 ? s0, or tSourceChannelIndex1 == 1 ? s1, or tSourceChannelIndex1 == 2 ? s2
t2 = tSourceChannelIndex2 == 0 ? s0, or tSourceChannelIndex2 == 1 ? s1, or tSourceChannelIndex2 == 2 ? s2
Parameters
sourcesThe pointer to the first, second, and third memory block of the source image, 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 / 2 - 1]
widthThe width of the frame in pixel, with range [2, infinity), must be even
heightThe height of the frame in pixel, with range [2, infinity), must be even
conversionFlagThe conversion to be applied
optionsThe 4 options parameters: 4 padding parameters, must be valid
Template Parameters
tSourceChannelIndex0The index of the source channels which will be mapped to the first target channel, with range [0, infinity)
tSourceChannelIndex1The index of the source channels which will be mapped to the second target channel, with range [0, infinity)
tSourceChannelIndex2The index of the source channels which will be mapped to the third target channel, with range [0, infinity)
See also
mapTwoRows_1Plane3Channels_To_1Plane1ChannelAnd2Planes1ChannelDownsampled2x2_8BitPerChannel().

◆ mapTwoRows_1Plane3Channels_To_1Plane1ChannelAnd2Planes1ChannelDownsampled2x2_8BitPerChannel()

template<unsigned int tSourceChannelIndex0, unsigned int tSourceChannelIndex1, unsigned int tSourceChannelIndex2>
static void Ocean::CV::FrameConverter::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 
)
staticprotected

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.

This function is mainly the reverse conversion function of mapTwoRows_1Plane1ChannelAnd2Planes1ChannelDownsampled2x2_To_1Plane3Channels_8BitPerChannel().
The layout of the options parameters is as follows:

options[0] uint32_t: sourceZippedPaddingElements
options[1] uint32_t: targetPlane0PaddingElements
options[2] uint32_t: targetPlane1PaddingElements
options[3] uint32_t: targetPlane2PaddingElements

with transformation:
t0 = tSourceChannelIndex0 == 0 ? s0, or tSourceChannelIndex0 == 1 ? s1, or tSourceChannelIndex0 == 2 ? s2
t1 = tSourceChannelIndex1 == 0 ? s0, or tSourceChannelIndex1 == 1 ? s1, or tSourceChannelIndex1 == 2 ? s2
t2 = tSourceChannelIndex2 == 0 ? s0, or tSourceChannelIndex2 == 1 ? s1, or tSourceChannelIndex2 == 2 ? s2
Parameters
sourcesThe pointer to the first, second, and third memory block of the source image, 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 / 2 - 1]
widthThe width of the frame in pixel, with range [2, infinity), must be even
heightThe height of the frame in pixel, with range [2, infinity), must be even
conversionFlagThe conversion to be applied
optionsThe 4 options parameters: 4 padding parameters, must be valid
Template Parameters
tSourceChannelIndex0The index of the source channels which will be mapped to the first target channel, with range [0, infinity)
tSourceChannelIndex1The index of the source channels which will be mapped to the second target channel, with range [0, infinity)
tSourceChannelIndex2The index of the source channels which will be mapped to the third target channel, with range [0, infinity)
See also
mapTwoRows_1Plane1ChannelAnd2Planes1ChannelDownsampled2x2_To_1Plane3Channels_8BitPerChannel().

◆ normalizedCast()

template<typename TSource , typename TTarget >
void Ocean::CV::FrameConverter::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 
)
static

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).

The source frame must be a zipped frame e.g., FrameType::FORMAT_Y8, FrameType::FORMAT_RGB24, ...
Beware: This function does not handle any out of range issues and does not apply rounding.
This function mainly does the following:

for each pixel and channel:
targetValue = TTarget(sourceValue) * multiplicationFactor + offset
Parameters
sourceThe source frame to be casted, must be valid
targetThe target frame receiving the casted pixel values, must be valid (and not overlap the source frame)
widthThe width of the source (and target frame) in pixel, with range [1, infinity)
heightThe height of the source (and target frame) in pixel, with range [1, infinity)
channelsThe number of channels the source frame (and target frame) has, with range [1, infinity)
multiplicationFactorThe multiplication factor (with data type TTarget) which will be multiplied with each source values before the value is assigned, should not be zero
offsetThe offset (with data type TTarget) that is added to each value after the conversion
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)
Template Parameters
TSourceThe data type of each pixel channel of the source frame, e.g., 'uint8_t', 'int', 'float', ...
TTargetThe data type of each pixel channel of the target frame, e.g., 'uint8_t', 'int', 'float', ...

Here is an example how to use this function:

void function()
{
// we have a source frame e.g., with pixel format RGB 24 bit, 'uint8_t' for each pixel channel
Frame sourceFrame(FrameType(1920u, 1080u, FrameType::FORMAT_RGB24, FrameType::ORIGIN_UPPER_LEFT));
// set the pixel values of sourceFrame here ...
// we want to cast this frame to a frame with 32 bit floating point values
// we use the frame type of the source as pattern and change the pixel format only
Frame targetFrame(FrameType(sourceFrame, FrameType::genericPixelFormat(FrameType::DT_SIGNED_FLOAT_32, 3u)));
// now we normalize the source values by 1/255 and assign the values - so that we get floating point values with range [0, 1]
FrameConverter::normalizedCast<uint8_t, float>(sourceFrame.constdata<uint8_t>(), targetFrame.data<float>(), sourceFrame.width(), sourceFrame.height(), sourceFrame.channels(), 1.0f / 255.0f, 0);
// now we can access the normalized floating point pixel values of target
const float* floatRGBValues = targetFrame.constdata<float>();
}
See also
cast().

◆ patchFrame()

template<typename T >
void Ocean::CV::FrameConverter::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 
)
inlinestatic

Copies a small patch area of a given frame into a buffer holding only the entire patch.

Parameters
sourceThe source frame from which the patch will be copied, must be valid
bufferThe target buffer to which the frame content will be copied, must be valid
widthThe width of the source frame in pixels, with range [patchSize, infinity)
channelsNumber of data channels of the given source frame, with range [1, infinity)
xHorizontal center position of the patch to be copied in pixel, with range [patchSize/2, width - patchSize/2 - 1]
yVertical center position of the patch to be copied in pixel, with range [patchSize/2, height - patchSize/2 - 1]
patchSizeThe side length of the patch to be copied in pixel, with range [1, infinity), must be odd
sourcePaddingElementsThe number of padding elements at the end of each source row, in elements, with range [0, infinity)
bufferPaddingElementsThe number of padding elements at the end of each buffer row, in elements, with range [0, infinity)
Template Parameters
TThe data type of the elements of the source frame and the target buffer, e.g., 'uint8_t', or 'float'

◆ patchFrameMirroredBorder()

template<typename T , unsigned int tChannels>
void Ocean::CV::FrameConverter::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 
)
static

Copies a small patch area of a frame into a buffer holding only the entire patch.

Pixels in the patch mapping to positions outside the frame are mirrored into the frame.

Parameters
sourceThe source frame from which the patch will be copied, must be valid
bufferThe target buffer to which the frame content will be copied, must be valid
widthThe width of the source frame in pixels, with range [patchSize/2+1, infinity)
heightThe height of the source frame in pixels, with range [patchSize/2+1, infinity)
xHorizontal center position of the patch to be copied in pixel, with range [0, width - 1]
yVertical center position of the patch to be copied in pixel, with range [0, height - 1]
patchSizeThe side length of the patch to be copied in pixel, with range [1, infinity), must be odd
sourcePaddingElementsThe number of padding elements at the end of each source row, in elements, with range [0, infinity)
bufferPaddingElementsThe number of padding elements at the end of each buffer row, in elements, with range [0, infinity)
Template Parameters
TThe data type of the elements of the source frame and the target buffer, e.g., 'uint8_t', or 'float'
tChannelsNumber of data channels of the given source frame, with range [1, infinity)

◆ subFrame()

template<typename T >
bool Ocean::CV::FrameConverter::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 
)
static

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.

The dimension of the sub-frame must fit into the source and target frame.

Parameters
sourceThe source frame from which the sub-frame will be copied, must be valid
targetThe target frame to which the sub-frame will be copied, must be valid
sourceWidthWidth of the entire source frame in pixels, with range [1, infinity)
sourceHeightHeight of the entire source frame in pixels, with range [1, infinity)
targetWidthWidth of the entire target frame in pixels, with range [1, infinity)
targetHeightHeight of the entire target frame in pixels, with range [1, infinity)
channelsNumber of data channels of the given source (and target) frame, with range [1, infinity)
sourceLeftHorizontal start position of the sub-frame inside the source frame in pixels, with range [0, sourceWidth - 1]
sourceTopVertical start position of the sub-frame inside the source frame in pixels, with range [0, sourceHeight - 1]
targetLeftHorizontal start position of the sub-frame inside the target frame in pixels, with range [0, targetWidth -1]
targetTopVertical start position of the sub-frame inside the target frame in pixels, with range [0, targetHeight - 1]
widthThe width of the sub-frame in pixel, with range [1, min(sourceWidth - sourceLeft, targetWidth - targetLeft)]
heightThe height of the sub-frame in pixel, with range [1, min(sourceHeight - sourceTop, targetHeight - targetTop)]
sourcePaddingElementsOptional number of padding elements at the end of each source row, with range [0, infinity)
targetPaddingElementsOptional number of padding elements at the end of each target row, with range [0, infinity)
Returns
True, if succeeded
Template Parameters
TThe data type of each element

◆ subFrameMask() [1/2]

template<typename T >
bool Ocean::CV::FrameConverter::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 
)
static

Copies pixels from one sub-frame to another if the pixels are part of a mask; input may use padding.

The behavior of this function can be described as:

target[i] = mask[i] == maskValue ? source[i] : target[i]

The dimension of the sub-frame must fit into the source and target frame. The mask must have the same size as the sub-frame.

Parameters
sourceFrameThe source frame from which the sub-frame will be copied, must be valid
targetFrameThe target frame to which the sub-frame will be copied, must be valid
maskFrameThe binary mask that is used to indicate which source pixels to copy to the target frame, must be valid, have one channel, and have the same size of the region that is copied (subFrameWidth x subFrameHeight)
sourceLeftHorizontal start position of the sub-frame inside the source frame in pixels, with range [0, sourceWidth - 1]
sourceTopVertical start position of the sub-frame inside the source frame in pixels, with range [0, sourceHeight - 1]
targetLeftHorizontal start position of the sub-frame inside the target frame in pixels, with range [0, targetWidth -1]
targetTopVertical start position of the sub-frame inside the target frame in pixels, with range [0, targetHeight - 1]
subFrameWidthWidth of the sub-frame in pixel, with range [0, min(sourceWidth - sourceLeft, targetWidth - targetLeft)]
subFrameHeightHeight of the sub-frame in pixel, with range [1, min(sourceHeight - sourceTop, targetHeight - targetTop)]
maskValueOptional value which indicates which pixel value should be interpreted as the foreground (and copied)
Returns
True, if succeeded
Template Parameters
TThe data type of the elements of the source and target frames

◆ subFrameMask() [2/2]

template<typename T >
bool Ocean::CV::FrameConverter::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 
)
static

Copies pixels from one sub-frame to another if the pixels are part of a mask; input may use padding.

The behavior of this function can be described as:

target[i] = mask[i] == maskValue ? source[i] : target[i]

The dimension of the sub-frame must fit into the source and target frame. The mask must have the same size as the sub-frame.

Parameters
sourceThe source frame from which the sub-frame will be copied, must be valid
targetThe target frame to which the sub-frame will be copied, must be valid
maskThe binary mask that is used to indicate which source pixels to copy to the target frame, must be valid, have one channel, and have the same size of the region that is copied (subFrameWidth x subFrameHeight)
sourceWidthWidth of the entire source frame in pixels, with range [1, infinity)
sourceHeightHeight of the entire source frame in pixels, with range [1, infinity)
targetWidthWidth of the entire target frame in pixels, with range [1, infinity)
targetHeightHeight of the entire target frame in pixels, with range [1, infinity)
channelsNumber of data channels of the given source (and target) frame, with range [1, infinity)
sourceLeftHorizontal start position of the sub-frame inside the source frame in pixels, with range [0, sourceWidth - 1]
sourceTopVertical start position of the sub-frame inside the source frame in pixels, with range [0, sourceHeight - 1]
targetLeftHorizontal start position of the sub-frame inside the target frame in pixels, with range [0, targetWidth -1]
targetTopVertical start position of the sub-frame inside the target frame in pixels, with range [0, targetHeight - 1]
subFrameWidthWidth of the sub-frame in pixel, with range [1, min(sourceWidth - sourceLeft, targetWidth - targetLeft)]
subFrameHeightHeight of the sub-frame in pixel, with range [1, min(sourceHeight - sourceTop, targetHeight - targetTop)]
sourcePaddingElementsOptional number of padding elements at the end of each source row, with range [0, infinity)
targetPaddingElementsOptional number of padding elements at the end of each target row, with range [0, infinity)
maskPaddingElementsOptional number of padding elements at the end of each source row, with range [0, infinity)
maskValueOptional value which indicates which pixel value should be interpreted as the foreground (and copied)
Returns
True, if succeeded
Template Parameters
TThe data type of the elements of the source and target frames

◆ transformationMatrix_FullRangeBGR24_To_FullRangeYUV24_BT601()

static MatrixD Ocean::CV::FrameConverter::transformationMatrix_FullRangeBGR24_To_FullRangeYUV24_BT601 ( )
static

Returns the 3x4 color space transformation matrix from full range BGR24 to full range YUV24 using BT.601, analog BGR to (analog) YPbPr.

Below the precise transformation matrices are given:

BGR input value range:  [0, 255]x[0, 255]x[0, 255]
YUV output value range: [0, 255]x[0, 255]x[0, 255]

| Y |   |  0.114       0.587       0.299        0 |   | B |
| U | = |  0.5        -0.331264   -0.168736   128 | * | G |
| V |   | -0.081312   -0.418688    0.5        128 |   | R |
                                                      | 1 |
Approximation with 7 bit precision:
      | Y |     |  15     75    38      0   128 |   | B |
128 * | U |  =  |  64    -42   -22    128 * 128 | * | G |
      | V |     | -10    -54    64    128 * 128 |   | R |
                                                    | 1 |
Returns
The 3x4 transformation matrix
See also
transformationMatrix_FullRangeRGB24_To_FullRangeYUV24_BT601().

◆ transformationMatrix_FullRangeBGR24_To_FullRangeYVU24_BT601()

static MatrixD Ocean::CV::FrameConverter::transformationMatrix_FullRangeBGR24_To_FullRangeYVU24_BT601 ( )
static

Returns the 3x4 color space transformation matrix from full range BGR24 to full range YVU24 using BT.601, analog BGR to (analog) YPbPr.

Below the precise transformation matrices are given:

BGR input value range:  [0, 255]x[0, 255]x[0, 255]
YVU output value range: [0, 255]x[0, 255]x[0, 255]
Returns
The 3x4 transformation matrix
See also
transformationMatrix_FullRangeBGR24_To_FullRangeYUV24_BT601().

◆ transformationMatrix_FullRangeBGR24_To_LimitedRangeYUV24_BT601()

static MatrixD Ocean::CV::FrameConverter::transformationMatrix_FullRangeBGR24_To_LimitedRangeYUV24_BT601 ( )
static

Returns the color space transformation matrix from full range BGR24 to limited range YUV24 using BT.601, analog RGB to (digital) YCbCr.

BGR input value range:  [0, 255]x[0, 255]x[0, 255]
YUV output value range: [16, 235]x[16, 240]x[16, 240]
Returns
The 3x4 transformation matrix
See also
transformationMatrixFullRangeRGB24ToLimitedRangeYUV24_BT601().

◆ transformationMatrix_FullRangeRGB24_To_FullRangeYUV24_BT601()

static MatrixD Ocean::CV::FrameConverter::transformationMatrix_FullRangeRGB24_To_FullRangeYUV24_BT601 ( )
static

Returns the 3x4 color space transformation matrix from full range RGB24 to full range YUV24 using BT.601, analog RGB to (analog) YPbPr.

Below the precise transformation matrices are given:

RGB input value range:  [0, 255]x[0, 255]x[0, 255]
YUV output value range: [0, 255]x[0, 255]x[0, 255]

| Y |   |  0.299       0.587       0.114        0 |   | R |
| U | = | -0.168736   -0.331264    0.5        128 | * | G |
| V |   |  0.5        -0.418688   -0.081312   128 |   | B |
                                                      | 1 |
Approximation with 7 bit precision:
      | Y |     |  38     75    15      0   128 |   | R |
128 * | U |  =  | -22    -42    64    128 * 128 | * | G |
      | V |     |  64    -54   -10    128 * 128 |   | B |
                                                    | 1 |
Returns
The 3x4 transformation matrix
See also
transformationMatrix_FullRangeRGB24_To_FullRangeYVU24_BT601().

◆ transformationMatrix_FullRangeRGB24_To_FullRangeYVU24_BT601()

static MatrixD Ocean::CV::FrameConverter::transformationMatrix_FullRangeRGB24_To_FullRangeYVU24_BT601 ( )
static

Returns the 3x4 color space transformation matrix from full range RGB24 to full range YVU24 using BT.601, analog RGB to (analog) YPbPr.

Returns
The 3x4 transformation matrix
See also
transformationMatrix_FullRangeRGB24_To_FullRangeYUV24_BT601().

◆ transformationMatrix_FullRangeRGB24_To_LimitedRangeYUV24_BT601()

static MatrixD Ocean::CV::FrameConverter::transformationMatrix_FullRangeRGB24_To_LimitedRangeYUV24_BT601 ( )
static

Returns the 3x4 color space transformation matrix from full range RGB24 to limited range YUV24 using BT.601, analog RGB to (digital) YCbCr.

Below the precise transformation matrices are given:

RGB input value range:  [0, 255]x[0, 255]x[0, 255]
YUV output value range: [16, 235]x[16, 240]x[16, 240]

| Y |   |  0.2578125   0.5039063   0.09765625  16.0  |   | R |
| U | = | -0.1484375  -0.2890625   0.4375      128.0 | * | G |
| V |   |  0.4375     -0.3671875  -0.0703125   128.0 |   | B |
                                                         | 1 |
Approximation with 7 bit precision:
      | Y |     |  33     64    13     16 * 128 |   | R |
128 * | U |  =  | -19    -37    56    128 * 128 | * | G |
      | V |     |  56    -47   -9     128 * 128 |   | B |
                                                    | 1 |
Returns
The 3x4 transformation matrix
See also
transformationMatrix_FullRangeRGB24_To_LimitedRangeYVU24_BT601().

◆ transformationMatrix_FullRangeRGB24_To_LimitedRangeYVU24_BT601()

static MatrixD Ocean::CV::FrameConverter::transformationMatrix_FullRangeRGB24_To_LimitedRangeYVU24_BT601 ( )
static

Returns the 3x4 color space transformation matrix from full range RGB24 to limited range YVU24 using BT.601, analog RGB to (digital) YCbCr.

Returns
The 3x4 transformation matrix
See also
transformationMatrix_FullRangeRGB24_To_LimitedRangeYUV24_BT601().

◆ transformationMatrix_FullRangeYUV24_To_FullRangeBGR24_Android()

static MatrixD Ocean::CV::FrameConverter::transformationMatrix_FullRangeYUV24_To_FullRangeBGR24_Android ( )
static

Returns the color space transformation matrix from full range YUV24 to full range BGR24 similar to BT.601, (analog) YPbPr to analog BGR.

This transformation matrix is close to the official BT.601 standard and used on Android for conversion from Y'UV420sp (NV21).

See also
transformationMatrix_FullRangeYUV24_To_FullRangeRGB24_Android().
Returns
The 3x4 transformation matrix

◆ transformationMatrix_FullRangeYUV24_To_FullRangeBGR24_BT601()

static MatrixD Ocean::CV::FrameConverter::transformationMatrix_FullRangeYUV24_To_FullRangeBGR24_BT601 ( )
static

Returns the color space transformation matrix from full range YUV24 to full range BGR24 using BT.601, (analog) YPbPr to analog BGR.

Below the precise transformation matrices are given:

YUV input value range:  [0, 255]x[0, 255]x[0, 255]
RGB output value range: [0, 255]x[0, 255]x[0, 255]

| B |     | 1.0     1.772      0.0       -226.816   |   | Y |
| G |  =  | 1.0    -0.34414   -0.71414    135.45984 | * | U |
| R |     | 1.0     0.0        1.402     -179.456   |   | V |
                                                        | 1 |

Approximation with 6 bit precision:
      | B |     | 64   113     0 |   |    Y    |
 64 * | G |  =  | 64   -22   -46 | * | U - 128 |
      | R |     | 64    0     90 |   | V - 128 |
Returns
The 3x4 transformation matrix
See also
transformationMatrix_FullRangeYUV24_To_FullRangeRGB24_Android().

◆ transformationMatrix_FullRangeYUV24_To_FullRangeRGB24_Android()

static MatrixD Ocean::CV::FrameConverter::transformationMatrix_FullRangeYUV24_To_FullRangeRGB24_Android ( )
static

Returns the color space transformation matrix from full range YUV24 to full range RGB24 similar to BT.601, (analog) YPbPr to analog RGB.

This transformation matrix is close to the official BT.601 standard and used on Android for conversion from Y'UV420sp (NV21).
The conversion can be found in Android's source code: /media/libstagefright/yuv/YUVImage.cpp
Below the precise transformation matrices are given:

YUV input value range:  [0, 255]x[0, 255]x[0, 255s]
RGB output value range: [0, 255]x[0, 255]x[0, 255]

| R |     | 1.0     0.0         1.370705  |   |    Y    |     | 1.0     0.0         1.370705   -175.45024  |   | Y |
| G |  =  | 1.0    -0.337633   -0.698001  | * | U - 128 |  =  | 1.0    -0.337633   -0.698001    132.561152 | * | U |
| B |     | 1.0     1.732446    0.0       |   | V - 128 |     | 1.0     1.732446    0.0        -221.753088 |   | V |
                                                                                                               | 1 |

Approximation with 6 bit precision:
      | R |     | 64    0     88 |   |    Y    |
 64 * | G |  =  | 64   -22   -45 | * | U - 128 |
      | B |     | 64   111     0 |   | V - 128 |
See also
transformationMatrix_FullRangeYUV24_To_FullRangeRGB24_BT601(), transformationMatrix_FullRangeYUV24_To_FullRangeBGR24_Android().
Returns
The 3x4 transformation matrix

◆ transformationMatrix_FullRangeYUV24_To_FullRangeRGB24_BT601()

static MatrixD Ocean::CV::FrameConverter::transformationMatrix_FullRangeYUV24_To_FullRangeRGB24_BT601 ( )
static

Returns the color space transformation matrix from full range YUV24 to full range RGB24 using BT.601, (analog) YPbPr to analog RGB.

Below the precise transformation matrices are given:

YUV input value range:  [0, 255]x[0, 255]x[0, 255s]
RGB output value range: [0, 255]x[0, 255]x[0, 255]

| R |     | 1.0     0.0        1.402     -179.456   |   | Y |
| G |  =  | 1.0    -0.34414   -0.71414    135.45984 | * | U |
| B |     | 1.0     1.772      0.0       -226.816   |   | V |
                                                        | 1 |

Approximation with 6 bit precision:
      | R |     | 64    0     90 |   |    Y    |
 64 * | G |  =  | 64   -22   -46 | * | U - 128 |
      | B |     | 64   113     0 |   | V - 128 |
Returns
The 3x4 transformation matrix
See also
transformationMatrix_FullRangeYUV24_To_FullRangeRGB24_Android().

◆ transformationMatrix_FullRangeYVU24_To_FullRangeBGR24_Android()

static MatrixD Ocean::CV::FrameConverter::transformationMatrix_FullRangeYVU24_To_FullRangeBGR24_Android ( )
static

Returns the color space transformation matrix from full range YVU24 to full range BGR24 similar to BT.601, (analog) YPbPr to analog BGR.

This transformation matrix is close to the official BT.601 standard and used on Android for conversion from Y'UV420sp (NV21).

See also
transformationMatrix_FullRangeYVU24_To_FullRangeRGB24_Android().
Returns
The 3x4 transformation matrix

◆ transformationMatrix_FullRangeYVU24_To_FullRangeBGR24_BT601()

static MatrixD Ocean::CV::FrameConverter::transformationMatrix_FullRangeYVU24_To_FullRangeBGR24_BT601 ( )
static

Returns the color space transformation matrix from full range YVU24 to full range BGR24 using BT.601, (digital) YCrCb to analog BGR.

YVU input value range:  [0, 255]x[0, 255]x[0, 255]
BGR output value range: [0, 255]x[0, 255]x[0, 255]
Returns
The 3x4 transformation matrix
See also
transformationMatrix_FullRangeYUV24_To_FullRangeBGR24_BT601().

◆ transformationMatrix_FullRangeYVU24_To_FullRangeRGB24_Android()

static MatrixD Ocean::CV::FrameConverter::transformationMatrix_FullRangeYVU24_To_FullRangeRGB24_Android ( )
static

Returns the color space transformation matrix from full range YVU24 to full range RGB24 similar to BT.601, (analog) YPbPr to analog RGB.

This transformation matrix is close to the official BT.601 standard and used on Android for conversion from Y'UV420sp (NV21).
The conversion can be found in Android's source code: /media/libstagefright/yuv/YUVImage.cpp
Below the precise transformation matrices are given:

YUV input value range:  [0, 255]x[0, 255]x[0, 255s]
RGB output value range: [0, 255]x[0, 255]x[0, 255]

| R |     | 1.0     1.370705    0.0      |   |    Y    |     | 1.0    1.370705    0.0        -175.45024  |   | Y |
| G |  =  | 1.0    -0.698001   -0.337633 | * | V - 128 |  =  | 1.0   -0.698001   -0.337633    132.561152 | * | V |
| B |     | 1.0     0.0         1.732446 |   | U - 128 |     | 1.0    0.0         1.732446   -221.753088 |   | U |
                                                                                                             | 1 |

Approximation with 6 bit precision:
      | R |     | 64   88   0  |   |    Y    |
 64 * | G |  =  | 64  -45  -22 | * | V - 128 |
      | B |     | 64    0  111 |   | U - 128 |
Returns
The 3x4 transformation matrix

◆ transformationMatrix_FullRangeYVU24_To_FullRangeRGB24_BT601()

static MatrixD Ocean::CV::FrameConverter::transformationMatrix_FullRangeYVU24_To_FullRangeRGB24_BT601 ( )
static

Returns the color space transformation matrix from full range YVU24 to full range RGB24 using BT.601, (digital) YCrCb to analog RGB.

YVU input value range:  [0, 255]x[0, 255]x[0, 255]
RGB output value range: [0, 255]x[0, 255]x[0, 255]
Returns
The 3x4 transformation matrix
See also
transformationMatrix_FullRangeYUV24_To_FullRangeRGB24_BT601().

◆ transformationMatrix_LimitedRangeYUV24_To_FullRangeBGR24_BT601()

static MatrixD Ocean::CV::FrameConverter::transformationMatrix_LimitedRangeYUV24_To_FullRangeBGR24_BT601 ( )
static

Returns the color space transformation matrix from limited range YUV24 to full range BGR24 using BT.601, (digital) YCbCr to analog BGR.

YUV input value range:  [16, 235]x[16, 240]x[16, 240]
BGR output value range: [0, 255]x[0, 255]x[0, 255]
Returns
The 3x4 transformation matrix
See also
transformationMatrixLimitedRangeYUV24ToFullRangeRGB24_BT601().

◆ transformationMatrix_LimitedRangeYUV24_To_FullRangeRGB24_BT601()

static MatrixD Ocean::CV::FrameConverter::transformationMatrix_LimitedRangeYUV24_To_FullRangeRGB24_BT601 ( )
static

Returns the color space transformation matrix from limited range YUV24 to full range RGB24 using BT.601, (digital) YCbCr to analog RGB.

Below the precise transformation matrices are given:

YUV input value range:  [16, 235]x[16, 240]x[16, 240]
RGB output value range: [0, 255]x[0, 255]x[0, 255]

| R |     | 1.1639404296875   0.0              1.595947265625  -222.904296875 |   | Y |
| G |  =  | 1.1639404296875  -0.3909912109375 -0.81298828125    135.486328125 | * | U |
| B |     | 1.1639404296875   2.0179443359375  0.0             -276.919921875 |   | V |
                                                                                  | 1 |

Approximation with 13 bit precision:
       | R |     | 9535     0         13074 |   | Y -  16 |
8192 * | G |  =  | 9535    -3203     -6660  | * | U - 128 |
       | B |     | 9535     16531     0     |   | V - 128 |

Approximation with 10 bit precision:
       | R |     | 1192     0        1634     -223 * 1024 |   | Y |
1024 * | G |  =  | 1192    -400     -833       135 * 1024 | * | U |
       | B |     | 1192     2066     0        -277 * 1024 |   | V |
                                                              | 1 |

Approximation with 8 bit precision:
      | R |     | 298     0       409  |   | Y -  16 |
256 * | G |  =  | 298    -409    -208  | * | U - 128 |
      | B |     | 298     516     0    |   | V - 128 |

Approximation with 6 bit precision:
     | R |     | 75    0     102 |   | Y -  16 |
64 * | G |  =  | 75   -25   -52  | * | U - 128 |
     | B |     | 75   128     0  |   | V - 128 |
Returns
The 3x4 transformation matrix

◆ transformationMatrix_LimitedRangeYVU24_To_FullRangeBGR24_BT601()

static MatrixD Ocean::CV::FrameConverter::transformationMatrix_LimitedRangeYVU24_To_FullRangeBGR24_BT601 ( )
static

Returns the color space transformation matrix from limited range YVU24 to full range BGR24 using BT.601, (digital) YCrCb to analog BGR.

YVU input value range:  [16, 235]x[16, 240]x[16, 240]
BGR output value range: [0, 255]x[0, 255]x[0, 255]
Returns
The 3x4 transformation matrix
See also
transformationMatrixLimitedRangeYUV24ToFullRangeRGB24_BT601().

◆ transformationMatrix_LimitedRangeYVU24_To_FullRangeRGB24_BT601()

static MatrixD Ocean::CV::FrameConverter::transformationMatrix_LimitedRangeYVU24_To_FullRangeRGB24_BT601 ( )
static

Returns the color space transformation matrix from limited range YVU24 to full range RGB24 using BT.601, (digital) YCrCb to analog RGB.

YVU input value range:  [16, 235]x[16, 240]x[16, 240]
RGB output value range: [0, 255]x[0, 255]x[0, 255]
Returns
The 3x4 transformation matrix
See also
transformationMatrixLimitedRangeYUV24ToFullRangeRGB24_BT601().

◆ translateConversionFlag()

static std::string Ocean::CV::FrameConverter::translateConversionFlag ( const ConversionFlag  conversionFlag)
static

Translates a given conversion flag to a string.

Parameters
conversionFlagThe conversion flag to be translated
Returns
The resulting string containing the flag

◆ unpack15ElementsBayerMosaicPacked10BitNEON()

template<bool tAllowLastOverlappingElement>
OCEAN_FORCE_INLINE void Ocean::CV::FrameConverter::unpack15ElementsBayerMosaicPacked10BitNEON ( const uint8_t *const  packed,
uint16x8_t &  unpackedAB_u_16x8,
uint16x4_t &  unpackedC_u_16x4 
)
staticprotected

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.

The memory layout of the output will be: A B C D A B C D A B C D (16 bits per element but only the lowest 10 bits are used) This function is compatible with pixel formats like FrameType::FORMAT_RGGB10_PACKED or FrameType::FORMAT_Y10_PACKED.

Parameters
packedThe packed 15 elements, must be valid
unpackedAB_u_16x8The resulting first 8 uint16_t values
unpackedC_u_16x4The resulting last 4 uint16_t values
Template Parameters
tAllowLastOverlappingElementTrue, to allow reading 16 elements from packed (if the memory is large enough); False, to force reading only 15 elements

◆ unpack5ElementsBayerMosaicPacked10Bit()

OCEAN_FORCE_INLINE void Ocean::CV::FrameConverter::unpack5ElementsBayerMosaicPacked10Bit ( const uint8_t *const  packed,
uint16_t *  unpacked 
)
staticprotected

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.

The memory layout of the output will be: A B C D (16 bits per element but only the lowest 10 bits are used) This function is compatible with pixel formats like FrameType::FORMAT_RGGB10_PACKED or FrameType::FORMAT_Y10_PACKED.

Parameters
packedThe packed 5 elements, must be valid
unpackedThe resulting 4 unpacked elements, must be valid

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