Ocean
|
This is the base class for all frame converter classes. More...
Data Structures | |
class | Comfort |
The following comfort class provides comfortable functions simplifying prototyping applications but also increasing binary size of the resulting applications. More... | |
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 ConversionFlags & | conversionFlags () |
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_1Plane3Channels_To_3Plane1Channel_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 RGB24 pixel format to one row of an image with e.g., a R_G_B24 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) |
This is the base class for all frame converter classes.
using Ocean::CV::FrameConverter::ConversionFlags = std::vector<ConversionFlag> |
Definition of a vector holding conversion flags.
|
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.
sources | The memory pointers defining the source rows, must be valid |
targets | The memory pointers defining the target rows, must be valid |
multipleRowIndex | The index of the rows to be converted, with range [0, height / multipleRowsPerIteration - 1] |
width | The width of the frame in pixel, with range [1, infinity) |
height | The height of the frame in pixel, with range [1, infinity) |
conversionFlag | The conversion to be applied |
options | Optional options which are necessary for the conversion, otherwise nullptr |
|
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.
sourceRow | The row in the source frame, must be valid |
targetRow | The row in the target frame, must be valid |
width | The number of pixels to convert, with range [1, infinity) |
options | Optional options which are necessary for the conversion, otherwise nullptr |
TSource | The data type of each source pixel channel, e.g., 'uint8_t' or 'float' |
TTarget | The data type of each target pixel channel, e.g., 'uint8_t' or 'float' |
|
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.
inputRow | The row to reverse, must be valid |
targetRow | The row receiving the reversed pixels, must be different from 'inputRow', must be valid |
width | The number of pixels to reverse, with range [1, infinity) |
T | The data type of each pixel channel, e.g., 'uint8_t' or 'float' |
|
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.
row | The row to reverse, must be valid |
width | The number of pixels to reverse, with range [1, infinity) |
T | The data type of each pixel channel, e.g., 'uint8_t' or 'float' |
enum Ocean::CV::FrameConverter::ConversionFlag : uint32_t |
Definition of individual conversion flags.
enum Ocean::CV::FrameConverter::CopyPreference : bool |
|
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:
source | The source frame to be casted, must be valid |
target | The target frame receiving the casted pixel values, must be valid (and not overlap the source frame) |
width | The width of the source (and target frame) in pixel, with range [1, infinity) |
height | The height of the source (and target frame) in pixel, with range [1, infinity) |
channels | The number of channels the source frame (and target frame) has, with range [1, infinity) |
sourcePaddingElements | The number of padding elements at the end of each source row, in elements, with range [0, infinity) |
targetPaddingElements | The number of padding elements at the end of each target row, in elements, with range [0, infinity) |
TSource | The data type of each pixel channel of the source frame, e.g., 'uint8_t', 'int', 'float', ... |
TTarget | The 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:
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 | ||
) |
|
staticprotected |
|
inlinestaticprotected |
Casts 16 successive elements from one data type to another data type.
source | The 16 source elements that will be casted, must be valid |
target | The 16 target elements receiving the casted pixel values, must be valid |
TSource | The data type of each pixel channel of the source frame, e.g., 'uint8_t', 'int', 'float', ... |
TTarget | The data type of each pixel channel of the target frame, e.g., 'uint8_t', 'int', 'float', ... |
OCEAN_FORCE_INLINE void Ocean::CV::FrameConverter::cast16Elements | ( | const TSource *const | source, |
TTarget *const | target | ||
) |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
static |
Returns a vector holding all possible conversion flags.
|
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.
sources | The memory pointers defining the source frame, e.g., several individual points to individual blocks in memory, must be valid |
targets | The memory pointers defining the target frame, e.g., several individual points to individual blocks in memory, must be valid |
width | The width of the frame, with range [1, infinity) |
height | The height of the frame, with range [multipleRowsPerIteration, infinity), must be a multiple of 'multipleRowsPerIteration' |
flag | The conversion type to be applied |
multipleRowsPerIteration | The number of rows, the specified rows-conversion-functions 'multipleRowsConversionFunction' can handle within one iteration, with range [1, infinity) |
multipleRowsConversionFunction | The function able to convert several row, must be valid |
options | Optional options which are necessary in the rows conversion function, otherwise nullptr |
worker | Optional worker to distribute the computation to several CPU cores |
|
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.
sources | The memory pointers defining the source frame, e.g., several individual points to individual blocks in memory, must be valid |
targets | The memory pointers defining the target frame, e.g., several individual points to individual blocks in memory, must be valid |
width | The width of the frame, with range [1, infinity) |
height | The height of the frame, with range [multipleRowsPerIteration, infinity), must be a multiple of 'multipleRowsPerIteration' |
flag | The conversion type to be applied |
multipleRowsPerIteration | The number of rows, the specified rows-conversion-functions 'multipleRowsConversionFunction' can handle within one iteration, with range [1, infinity) |
multipleRowsConversionFunction | The function able to convert several row, must be valid |
options | Optional options which are necessary in the rows conversion function, otherwise nullptr |
firstMultipleRow | The first multiple-row to be handled, with range [0, height / multipleRowsPerIteration - 1] |
numberMultipleRows | The number of multiple-rows to be handled, with range [1, height / multipleRowsPerIteration] |
|
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.
source | The source frame with generic pixel format, must be valid |
target | The target frame with generic pixel format, must be valid |
width | The width of the frame, with range [1, infinity) |
height | The height of the frame, with range [1, infinity) |
sourceStrideElements | Number of horizontal elements between the start of two source rows, in elements, with range [width * elementsPerSourcePixel, infinity) |
targetStrideElements | Number of horizontal elements between the start of two target rows, in elements, with range [width * elementsPerTargetPixel, infinity) |
flag | Determining the type of conversion |
rowConversionFunction | The function able to convert one row, must be valid |
targetReversePixelOrderInPlaceFunction | The 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 |
areContinuous | True, if source and target frame have continuous memory (without padding); False, otherwise |
options | Optional options which are necessary in the row conversion function, otherwise nullptr |
worker | Optional worker to distribute the computation to several CPU cores |
TSource | The data type of each source pixel element, e.g., 'uint8_t' or 'float' |
TTarget | The data type of each target pixel element, e.g., 'uint8_t' or 'float' |
|
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.
source | The source frame with generic pixel format, must be valid |
target | The target frame with generic pixel format, must be valid |
width | The width of the frame, with range [1, infinity) |
height | The height of the frame, with range [1, infinity) |
sourceStrideBytes | Number of bytes between the start of two source rows, in bytes, with range [width * elementsPerSourcePixel * sizeof(channelElement), infinity) |
targetStrideBytes | Number of bytes between the start of two target rows, in bytes, with range [width * elementsPerTargetPixel * sizeof(channelElement), infinity) |
flag | Determining the type of conversion |
rowConversionFunction | The function able to convert one row, must be valid |
targetReversePixelOrderInPlaceFunction | The function able to reverse the pixel order in one target row, must be valid |
areContinuous | True, if source and target frame have continuous memory (without padding); False, otherwise |
options | Optional options which are necessary in the row conversion function, otherwise nullptr |
firstRow | The first row to be handled, with range [0, height - 1] |
numberRows | The number of rows to be handled, with range [1, height - firstRow] |
|
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
sources | The pointer to the first and second memory block of the source image, must be valid |
targets | The one pointer to the target image, must be valid |
multipleRowIndex | The index of the multiple-row to be handled, with range [0, height 1] |
width | The width of the frame in pixel, with range [1, infinity), must be even |
height | The height of the frame in pixel, with range [1, infinity), must be even |
conversionFlag | The conversion to be applied |
options | The 15 options parameters: 3 padding parameters, 9 multiplication parameters, and 3 bias parameters, must be valid |
|
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)
sources | The pointer to the first and second memory block of the source image, must be valid |
targets | The one pointer to the target image, must be valid |
multipleRowIndex | The index of the multiple-row to be handled, with range [0, height 1] |
width | The width of the frame in pixel, with range [1, infinity), must be even |
height | The height of the frame in pixel, with range [1, infinity), must be even |
conversionFlag | The conversion to be applied |
options | The 15 options parameters: 3 padding parameters, 9 multiplication parameters, and 3 bias parameters, must be valid |
|
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
sources | The pointer to the first, second, and third memory block of the source image, must be valid |
targets | The one pointer to the target image, must be valid |
multipleRowIndex | The index of the multiple-row to be handled, with range [0, height - 1] |
width | The width of the frame in pixel, with range [2, infinity), must be even |
height | The height of the frame in pixel, with range [2, infinity), must be even |
conversionFlag | The conversion to be applied |
options | The 16 options parameters: 4 padding parameters, 9 multiplication parameters, and 3 bias parameters, must be valid |
|
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
sources | The pointer to the first, second, and third memory block of the source image, must be valid |
targets | The one pointer to the target image, must be valid |
multipleRowIndex | The index of the multiple-row to be handled, with range [0, height - 1] |
width | The width of the frame in pixel, with range [1, infinity) |
height | The height of the frame in pixel, with range [1, infinity) |
conversionFlag | The conversion to be applied |
options | The 17 options parameters: 4 padding parameters, 9 multiplication parameters, and 3 bias parameters, one constant channel value, must be valid |
|
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
sources | The pointer to the first, second, and third memory block of the source image, must be valid |
targets | The one pointer to the target image, must be valid |
multipleRowIndex | The index of the multiple-row to be handled, with range [0, height - 1] |
width | The width of the frame in pixel, with range [2, infinity), must be even |
height | The height of the frame in pixel, with range [1, infinity), must be even |
conversionFlag | The conversion to be applied |
options | The 14 options parameters: 2 padding parameters, 9 multiplication parameters, and 3 bias parameters, must be valid |
|
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
sources | The pointer to the first, second, and third memory block of the source image, must be valid |
targets | The one pointer to the target image, must be valid |
multipleRowIndex | The index of the multiple-row to be handled, with range [0, height - 1] |
width | The width of the frame in pixel, with range [2, infinity), must be even |
height | The height of the frame in pixel, with range [1, infinity), must be even |
conversionFlag | The conversion to be applied |
options | The 14 options parameters: 2 padding parameters, 9 multiplication parameters, and 3 bias parameters, must be valid |
|
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
sources | The pointer to the first, second, and third memory block of the source image, must be valid |
targets | The one pointer to the target image, must be valid |
multipleRowIndex | The index of the multiple-row to be handled, with range [0, height - 1] |
width | The width of the frame in pixel, with range [1, infinity) |
height | The height of the frame in pixel, with range [1, infinity) |
conversionFlag | The conversion to be applied |
options | The 16 options parameters: 4 padding parameters, 9 multiplication parameters, and 3 bias parameters, must be valid |
|
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
sources | The pointer to the first, second, and third memory block of the source image, must be valid |
targets | The one pointer to the target image, must be valid |
multipleRowIndex | The index of the multiple-row to be handled, with range [0, height - 1] |
width | The width of the frame in pixel, with range [1, infinity) |
height | The height of the frame in pixel, with range [1, infinity) |
conversionFlag | The conversion to be applied |
options | The 17 options parameters: 4 padding parameters, 9 multiplication parameters, and 3 bias parameters, one constant channel value, must be valid |
|
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
sources | The pointer to the first and second memory block of the source image, must be valid |
targets | The one pointer to the target image, must be valid |
multipleRowIndex | The index of the multiple-row to be handled, with range [0, height / 2 - 1] |
width | The width of the frame in pixel, with range [2, infinity), must be even |
height | The height of the frame in pixel, with range [2, infinity), must be even |
conversionFlag | The conversion to be applied |
options | The 15 options parameters: 3 padding parameters, 9 multiplication parameters, and 3 bias parameters, must be valid |
|
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)
sources | The pointer to the first and second memory block of the source image, must be valid |
targets | The one pointer to the target image, must be valid |
multipleRowIndex | The index of the multiple-row to be handled, with range [0, height / 2 - 1] |
width | The width of the frame in pixel, with range [2, infinity), must be even |
height | The height of the frame in pixel, with range [2, infinity), must be even |
conversionFlag | The conversion to be applied |
options | The 15 options parameters: 3 padding parameters, 9 multiplication parameters, and 3 bias parameters, must be valid |
|
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
sources | The pointer to the first, second, and third memory block of the source image, must be valid |
targets | The one pointer to the target image, must be valid |
multipleRowIndex | The index of the multiple-row to be handled, with range [0, height / 2 - 1] |
width | The width of the frame in pixel, with range [2, infinity), must be even |
height | The height of the frame in pixel, with range [2, infinity), must be even |
conversionFlag | The conversion to be applied |
options | The 16 options parameters: 4 padding parameters, 9 multiplication parameters, and 3 bias parameters, must be valid |
|
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
sources | The pointer to the first, second, and third memory block of the source image, must be valid |
targets | The one pointer to the target image, must be valid |
multipleRowIndex | The index of the multiple-row to be handled, with range [0, height/2 - 1] |
width | The width of the frame in pixel, with range [1, infinity) |
height | The height of the frame in pixel, with range [2, infinity) |
conversionFlag | The conversion to be applied |
options | The 16 options parameters: 4 padding parameters, 9 multiplication parameters, and 3 bias parameters, must be valid |
|
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
sources | The pointer to the first, second, and third memory block of the source image, must be valid |
targets | The one pointer to the target image, must be valid |
multipleRowIndex | The index of the multiple-row to be handled, with range [0, height/2 - 1] |
width | The width of the frame in pixel, with range [1, infinity) |
height | The height of the frame in pixel, with range [2, infinity) |
conversionFlag | The conversion to be applied |
options | The 17 options parameters: 4 padding parameters, 9 multiplication parameters, and 3 bias parameters, one constant channel value, must be valid |
|
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)
sources | The pointer to the source plane, must be valid |
targets | The pointers to the first and second target plane, must be valid |
multipleRowIndex | The index of the multiple-row to be handled, with range [0, height / 2 - 1] |
width | The width of the frame in pixel, with range [2, infinity), must be even |
height | The height of the frame in pixel, with range [2, infinity), must be even |
conversionFlag | The conversion to be applied |
options | The 15 options parameters: 3 padding parameters, 9 multiplication parameters, and 3 bias parameters, must be valid |
|
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)
sources | The pointer to the source plane, must be valid |
targets | The pointers to the first, second, and third target planes, must be valid |
multipleRowIndex | The index of the multiple-row to be handled, with range [0, height / 2 - 1] |
width | The width of the frame in pixel, with range [2, infinity), must be even |
height | The height of the frame in pixel, with range [2, infinity), must be even |
conversionFlag | The conversion to be applied |
options | The 16 options parameters: 4 padding parameters, 9 multiplication parameters, and 3 bias parameters, must be valid |
|
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
sources | The one pointer to the source image with Bayer mosaic, must be valid |
targets | The one pointer to the target image, must be valid |
multipleRowIndex | The index of the multiple-row to be handled, with range [0, height/2 - 1] |
width | The width of the frame in pixel, with range [4, infinity), must be a multiple of 4 |
height | The height of the frame in pixel, with range [2, infinity), must be a multiple of 2 |
conversionFlag | The conversion to be applied |
options | The 2 options parameters: 2 padding parameters |
tIndexRed | The index of red channel in the target image, with range [0, 2] |
tIndexGreen | The index of green channel in the target image, with range [0, 2] |
tIndexBlue | The index of blue channel in the target image, with range [0, 2] |
|
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
sources | The one pointer to the source image with Bayer mosaic, must be valid |
targets | The one pointer to the target image, must be valid |
multipleRowIndex | The index of the multiple-row to be handled, with range [0, height/2 - 1] |
width | The width of the frame in pixel, with range [4, infinity), must be a multiple of 4 |
height | The height of the frame in pixel, with range [2, infinity), must be a multiple of 2 |
conversionFlag | The conversion to be applied |
options | The 2 options parameters: 2 padding parameters |
tIndexRed | The index of red channel in the target image, with range [0, 2] |
tIndexGreen | The index of green channel in the target image, with range [0, 2] |
tIndexBlue | The index of blue channel in the target image, with range [0, 2] |
|
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
.
sources | The pointer to the first, second, and third memory block of the source image, must be valid |
targets | The one pointer to the target image, must be valid |
multipleRowIndex | The index of the multiple-row to be handled, with range [0, height/2 - 1] |
width | The width of the frame in pixel, with range [4, infinity), must be a multiple of 4 |
height | The height of the frame in pixel, with range [2, infinity), must be a multiple of 2 |
conversionFlag | The conversion to be applied |
options | The 2 options parameters: 2 padding parameters |
tIndexRed | The index of red channel in the target image, with range [0, 2] |
tIndexGreen | The index of green channel in the target image, with range [0, 2] |
tIndexBlue | The index of blue channel in the target image, with range [0, 2] |
|
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
sources | The pointer to the first and second memory block of the source image, must be valid |
targets | The one pointer to the target image, must be valid |
multipleRowIndex | The index of the multiple-row to be handled, with range [0, height - 1] |
width | The width of the frame in pixel, with range [2, infinity), must be even |
height | The height of the frame in pixel, with range [2, infinity), must be even |
conversionFlag | The conversion to be applied |
options | The 3 options parameters: 3 padding parameters, with ranges [0, infinity), must be valid |
tSourceChannelIndex0 | The index of the source channels which will be mapped to the first target channel, with range [0, 2] |
tSourceChannelIndex1 | The index of the source channels which will be mapped to the second target channel, with range [0, 2] |
tSourceChannelIndex2 | The index of the source channels which will be mapped to the third target channel, with range [0, 2] |
|
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
sources | The pointer to the first, second, and third memory block of the source image, must be valid |
targets | The one pointer to the target image, must be valid |
multipleRowIndex | The index of the multiple-row to be handled, with range [0, height - 1] |
width | The width of the frame in pixel, with range [2, infinity), must be even |
height | The height of the frame in pixel, with range [2, infinity), must be even |
conversionFlag | The conversion to be applied |
options | The 4 options parameters: 4 padding parameters, must be valid |
tSourceChannelIndex0 | The index of the source channels which will be mapped to the first target channel, with range [0, infinity) |
tSourceChannelIndex1 | The index of the source channels which will be mapped to the second target channel, with range [0, infinity) |
tSourceChannelIndex2 | The index of the source channels which will be mapped to the third target channel, with range [0, infinity) |
|
staticprotected |
Maps one row of a 1-plane, 2-channel image to two planes with 1 channels.
sources | The pointer to the plane of the source image, must be valid |
targets | The pointer to the first and second plane of the target image, must be valid |
multipleRowIndex | The index of the multiple-row to be handled, with range [0, height - 1] |
width | The width of the frame in pixel, with range [1, infinity) |
height | The height of the frame in pixel, with range [1, infinity) |
conversionFlag | The conversion to be applied |
options | The 3 options parameters: 3 padding parameters |
|
staticprotected |
Converts (maps) one row of an image with e.g., a RGB24 pixel format to one row of an image with e.g., a R_G_B24 pixel format.
This function needs one source plane holding three channels.
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., a R_G_B24 image looks like this:
target0: target1: target2: --------- --------- --------- | R R R R | | G G G G | | B B B B | | R R R R | | G G G G | | B B B B | | R R R R | | G G G G | | B B B B | | R R R R | | G G G G | | B B B B | --------- --------- ---------
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 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
sources | The one pointer to the source image, must be valid |
targets | The pointer to the first, second, and third memory block of the target image, must be valid |
multipleRowIndex | The index of the multiple-row to be handled, with range [0, height - 1] |
width | The width of the frame in pixel, with range [1, infinity) |
height | The height of the frame in pixel, with range [1, infinity) |
conversionFlag | The conversion to be applied |
options | The 4 options parameters: 4 padding parameters, with ranges [0, infinity), must be valid |
tSourceChannelIndex0 | The index of the source channels which will be mapped to the first target channel, with range [0, 2] |
tSourceChannelIndex1 | The index of the source channels which will be mapped to the second target channel, with range [0, 2] |
tSourceChannelIndex2 | The index of the source channels which will be mapped to the third target channel, with range [0, 2] |
|
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
sources | The pointer to the first, second, and third memory block of the source image, must be valid |
targets | The one pointer to the target image, must be valid |
multipleRowIndex | The index of the multiple-row to be handled, with range [0, height - 1] |
width | The width of the frame in pixel, with range [2, infinity), must be even |
height | The height of the frame in pixel, with range [1, infinity) |
conversionFlag | The conversion to be applied |
options | The 2 options parameters: 2 padding parameters, must be valid |
tSourceChannelIndex0 | The index of the source channels which will be mapped to the first target channel, with range [0, infinity) |
tSourceChannelIndex1 | The index of the source channels which will be mapped to the second target channel, with range [0, infinity) |
tSourceChannelIndex2 | The index of the source channels which will be mapped to the third target channel, with range [0, infinity) |
|
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
sources | The pointer to the first, second, and third memory block of the source image, must be valid |
targets | The one pointer to the target image, must be valid |
multipleRowIndex | The index of the multiple-row to be handled, with range [0, height - 1] |
width | The width of the frame in pixel, with range [2, infinity), must be even |
height | The height of the frame in pixel, with range [1, infinity) |
conversionFlag | The conversion to be applied |
options | The 2 options parameters: 2 padding parameters, must be valid |
tSourceChannelIndex0 | The index of the source channels which will be mapped to the first target channel, with range [0, infinity) |
tSourceChannelIndex1 | The index of the source channels which will be mapped to the second target channel, with range [0, infinity) |
tSourceChannelIndex2 | The index of the source channels which will be mapped to the third target channel, with range [0, infinity) |
|
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
sources | The pointer to the first, second, and third memory block of the source image, must be valid |
targets | The one pointer to the target image, must be valid |
multipleRowIndex | The index of the multiple-row to be handled, with range [0, height - 1] |
width | The width of the frame in pixel, with range [1, infinity) |
height | The height of the frame in pixel, with range [1, infinity) |
conversionFlag | The conversion to be applied |
options | The 4 options parameters: 4 padding parameters, with ranges [0, infinity), must be valid |
tSourceChannelIndex0 | The index of the source channels which will be mapped to the first target channel, with range [0, 2] |
tSourceChannelIndex1 | The index of the source channels which will be mapped to the second target channel, with range [0, 2] |
tSourceChannelIndex2 | The index of the source channels which will be mapped to the third target channel, with range [0, 2] |
|
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
sources | The pointer to the first and second memory block of the source image, must be valid |
targets | The one pointer to the target image, must be valid |
multipleRowIndex | The index of the multiple-row to be handled, with range [0, height / 2 - 1] |
width | The width of the frame in pixel, with range [2, infinity), must be even |
height | The height of the frame in pixel, with range [2, infinity), must be even |
conversionFlag | The conversion to be applied |
options | The 3 options parameters: 3 padding parameters, with ranges [0, infinity), must be valid |
tSourceChannelIndex0 | The index of the source channels which will be mapped to the first target channel, with range [0, 2] |
tSourceChannelIndex1 | The index of the source channels which will be mapped to the second target channel, with range [0, 2] |
tSourceChannelIndex2 | The index of the source channels which will be mapped to the third target channel, with range [0, 2] |
|
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
sources | The pointer to the first, second, and third memory block of the source image, must be valid |
targets | The one pointer to the target image, must be valid |
multipleRowIndex | The index of the multiple-row to be handled, with range [0, height / 2 - 1] |
width | The width of the frame in pixel, with range [2, infinity), must be even |
height | The height of the frame in pixel, with range [2, infinity), must be even |
conversionFlag | The conversion to be applied |
options | The 4 options parameters: 4 padding parameters, must be valid |
tSourceChannelIndex0 | The index of the source channels which will be mapped to the first target channel, with range [0, infinity) |
tSourceChannelIndex1 | The index of the source channels which will be mapped to the second target channel, with range [0, infinity) |
tSourceChannelIndex2 | The index of the source channels which will be mapped to the third target channel, with range [0, infinity) |
|
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
sources | The one pointer to the source image, must be valid |
targets | The pointer to the first, second, and third memory block of the target image, must be valid |
multipleRowIndex | The index of the multiple-row to be handled, with range [0, height / 2 - 1] |
width | The width of the frame in pixel, with range [2, infinity), must be even |
height | The height of the frame in pixel, with range [2, infinity), must be even |
conversionFlag | The conversion to be applied |
options | The 4 options parameters: 4 padding parameters, must be valid |
tSourceChannelIndex0 | The index of the source channels which will be mapped to the first target channel, with range [0, infinity) |
tSourceChannelIndex1 | The index of the source channels which will be mapped to the second target channel, with range [0, infinity) |
tSourceChannelIndex2 | The index of the source channels which will be mapped to the third target channel, with range [0, infinity) |
|
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:
source | The source frame to be casted, must be valid |
target | The target frame receiving the casted pixel values, must be valid (and not overlap the source frame) |
width | The width of the source (and target frame) in pixel, with range [1, infinity) |
height | The height of the source (and target frame) in pixel, with range [1, infinity) |
channels | The number of channels the source frame (and target frame) has, with range [1, infinity) |
multiplicationFactor | The multiplication factor (with data type TTarget) which will be multiplied with each source values before the value is assigned, should not be zero |
offset | The offset (with data type TTarget) that is added to each value after the conversion |
sourcePaddingElements | The number of padding elements at the end of each source row, in elements, with range [0, infinity) |
targetPaddingElements | The number of padding elements at the end of each target row, in elements, with range [0, infinity) |
TSource | The data type of each pixel channel of the source frame, e.g., 'uint8_t', 'int', 'float', ... |
TTarget | The 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:
|
inlinestatic |
Copies a small patch area of a given frame into a buffer holding only the entire patch.
source | The source frame from which the patch will be copied, must be valid |
buffer | The target buffer to which the frame content will be copied, must be valid |
width | The width of the source frame in pixels, with range [patchSize, infinity) |
channels | Number of data channels of the given source frame, with range [1, infinity) |
x | Horizontal center position of the patch to be copied in pixel, with range [patchSize/2, width - patchSize/2 - 1] |
y | Vertical center position of the patch to be copied in pixel, with range [patchSize/2, height - patchSize/2 - 1] |
patchSize | The side length of the patch to be copied in pixel, with range [1, infinity), must be odd |
sourcePaddingElements | The number of padding elements at the end of each source row, in elements, with range [0, infinity) |
bufferPaddingElements | The number of padding elements at the end of each buffer row, in elements, with range [0, infinity) |
T | The data type of the elements of the source frame and the target buffer, e.g., 'uint8_t', or 'float' |
|
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.
source | The source frame from which the patch will be copied, must be valid |
buffer | The target buffer to which the frame content will be copied, must be valid |
width | The width of the source frame in pixels, with range [patchSize/2+1, infinity) |
height | The height of the source frame in pixels, with range [patchSize/2+1, infinity) |
x | Horizontal center position of the patch to be copied in pixel, with range [0, width - 1] |
y | Vertical center position of the patch to be copied in pixel, with range [0, height - 1] |
patchSize | The side length of the patch to be copied in pixel, with range [1, infinity), must be odd |
sourcePaddingElements | The number of padding elements at the end of each source row, in elements, with range [0, infinity) |
bufferPaddingElements | The number of padding elements at the end of each buffer row, in elements, with range [0, infinity) |
T | The data type of the elements of the source frame and the target buffer, e.g., 'uint8_t', or 'float' |
tChannels | Number of data channels of the given source frame, with range [1, infinity) |
|
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.
source | The source frame from which the sub-frame will be copied, must be valid |
target | The target frame to which the sub-frame will be copied, must be valid |
sourceWidth | Width of the entire source frame in pixels, with range [1, infinity) |
sourceHeight | Height of the entire source frame in pixels, with range [1, infinity) |
targetWidth | Width of the entire target frame in pixels, with range [1, infinity) |
targetHeight | Height of the entire target frame in pixels, with range [1, infinity) |
channels | Number of data channels of the given source (and target) frame, with range [1, infinity) |
sourceLeft | Horizontal start position of the sub-frame inside the source frame in pixels, with range [0, sourceWidth - 1] |
sourceTop | Vertical start position of the sub-frame inside the source frame in pixels, with range [0, sourceHeight - 1] |
targetLeft | Horizontal start position of the sub-frame inside the target frame in pixels, with range [0, targetWidth -1] |
targetTop | Vertical start position of the sub-frame inside the target frame in pixels, with range [0, targetHeight - 1] |
width | The width of the sub-frame in pixel, with range [1, min(sourceWidth - sourceLeft, targetWidth - targetLeft)] |
height | The height of the sub-frame in pixel, with range [1, min(sourceHeight - sourceTop, targetHeight - targetTop)] |
sourcePaddingElements | Optional number of padding elements at the end of each source row, with range [0, infinity) |
targetPaddingElements | Optional number of padding elements at the end of each target row, with range [0, infinity) |
T | The data type of each element |
|
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.
sourceFrame | The source frame from which the sub-frame will be copied, must be valid |
targetFrame | The target frame to which the sub-frame will be copied, must be valid |
maskFrame | The 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 ) |
sourceLeft | Horizontal start position of the sub-frame inside the source frame in pixels, with range [0, sourceWidth - 1] |
sourceTop | Vertical start position of the sub-frame inside the source frame in pixels, with range [0, sourceHeight - 1] |
targetLeft | Horizontal start position of the sub-frame inside the target frame in pixels, with range [0, targetWidth -1] |
targetTop | Vertical start position of the sub-frame inside the target frame in pixels, with range [0, targetHeight - 1] |
subFrameWidth | Width of the sub-frame in pixel, with range [0, min(sourceWidth - sourceLeft, targetWidth - targetLeft)] |
subFrameHeight | Height of the sub-frame in pixel, with range [1, min(sourceHeight - sourceTop, targetHeight - targetTop)] |
maskValue | Optional value which indicates which pixel value should be interpreted as the foreground (and copied) |
T | The data type of the elements of the source and target frames |
|
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.
source | The source frame from which the sub-frame will be copied, must be valid |
target | The target frame to which the sub-frame will be copied, must be valid |
mask | The 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 ) |
sourceWidth | Width of the entire source frame in pixels, with range [1, infinity) |
sourceHeight | Height of the entire source frame in pixels, with range [1, infinity) |
targetWidth | Width of the entire target frame in pixels, with range [1, infinity) |
targetHeight | Height of the entire target frame in pixels, with range [1, infinity) |
channels | Number of data channels of the given source (and target) frame, with range [1, infinity) |
sourceLeft | Horizontal start position of the sub-frame inside the source frame in pixels, with range [0, sourceWidth - 1] |
sourceTop | Vertical start position of the sub-frame inside the source frame in pixels, with range [0, sourceHeight - 1] |
targetLeft | Horizontal start position of the sub-frame inside the target frame in pixels, with range [0, targetWidth -1] |
targetTop | Vertical start position of the sub-frame inside the target frame in pixels, with range [0, targetHeight - 1] |
subFrameWidth | Width of the sub-frame in pixel, with range [1, min(sourceWidth - sourceLeft, targetWidth - targetLeft)] |
subFrameHeight | Height of the sub-frame in pixel, with range [1, min(sourceHeight - sourceTop, targetHeight - targetTop)] |
sourcePaddingElements | Optional number of padding elements at the end of each source row, with range [0, infinity) |
targetPaddingElements | Optional number of padding elements at the end of each target row, with range [0, infinity) |
maskPaddingElements | Optional number of padding elements at the end of each source row, with range [0, infinity) |
maskValue | Optional value which indicates which pixel value should be interpreted as the foreground (and copied) |
T | The data type of the elements of the source and target frames |
|
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 |
|
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]
|
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]
|
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 |
|
static |
Returns the 3x4 color space transformation matrix from full range RGB24 to full range YVU24 using BT.601, analog RGB to (analog) YPbPr.
|
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 |
|
static |
Returns the 3x4 color space transformation matrix from full range RGB24 to limited range YVU24 using BT.601, analog RGB to (digital) YCbCr.
|
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).
|
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 |
|
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 |
|
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 |
|
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).
|
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]
|
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 |
|
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]
|
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]
|
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 |
|
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]
|
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]
|
static |
Translates a given conversion flag to a string.
conversionFlag | The conversion flag to be translated |
|
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
.
packed | The packed 15 elements, must be valid |
unpackedAB_u_16x8 | The resulting first 8 uint16_t values |
unpackedC_u_16x4 | The resulting last 4 uint16_t values |
tAllowLastOverlappingElement | True, to allow reading 16 elements from packed (if the memory is large enough); False, to force reading only 15 elements |
|
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
.
packed | The packed 5 elements, must be valid |
unpacked | The resulting 4 unpacked elements, must be valid |