8 #ifndef META_OCEAN_CV_FRAME_CONVERTER_Y_32_H
9 #define META_OCEAN_CV_FRAME_CONVERTER_Y_32_H
40 static inline void convertY32ToY8(
const uint32_t* source, uint8_t* target,
const unsigned int width,
const unsigned int height,
const ConversionFlag flag,
const unsigned int sourcePaddingElements,
const unsigned int targetPaddingElements,
Worker* worker =
nullptr);
53 static inline void convertY32ToY16(
const uint32_t* source, uint16_t* target,
const unsigned int width,
const unsigned int height,
const ConversionFlag flag,
const unsigned int sourcePaddingElements,
const unsigned int targetPaddingElements,
Worker* worker =
nullptr);
64 static inline void convertRowY32ToY8(
const uint32_t* source, uint8_t* target,
const size_t size,
const void* unusedParameters =
nullptr);
73 static inline void convertRowY32ToY16(
const uint32_t* source, uint16_t* target,
const size_t size,
const void* unusedParameters =
nullptr);
78 ocean_assert(source !=
nullptr && target !=
nullptr);
79 ocean_assert(width >= 1u && height >= 1u);
81 const unsigned int sourceStrideElements = width + sourcePaddingElements;
82 const unsigned int targetStrideElements = width + targetPaddingElements;
84 const bool areContinuous = sourcePaddingElements == 0u && targetPaddingElements == 0u;
86 FrameConverter::convertGenericPixelFormat(source, target, width, height, sourceStrideElements, targetStrideElements, flag,
convertRowY32ToY8, CV::FrameChannels::reverseRowPixelOrderInPlace<uint8_t, 1u>, areContinuous,
nullptr, worker);
91 ocean_assert(source !=
nullptr && target !=
nullptr);
92 ocean_assert(width >= 1u && height >= 1u);
94 const unsigned int sourceStrideElements = width + sourcePaddingElements;
95 const unsigned int targetStrideElements = width + targetPaddingElements;
97 const bool areContinuous = sourcePaddingElements == 0u && targetPaddingElements == 0u;
99 FrameConverter::convertGenericPixelFormat(source, target, width, height, sourceStrideElements, targetStrideElements, flag,
convertRowY32ToY16, CV::FrameChannels::reverseRowPixelOrderInPlace<uint16_t, 1u>, areContinuous,
nullptr, worker);
104 ocean_assert(source !=
nullptr && target !=
nullptr);
105 ocean_assert(size >= 1);
107 for (
size_t n = 0; n < size; ++n)
109 const uint32_t*
const sourcePixel = source + n;
110 uint8_t*
const targetPixel = target + n;
113 *targetPixel = ((uint8_t*)sourcePixel)[3];
119 ocean_assert(source !=
nullptr && target !=
nullptr);
120 ocean_assert(size >= 1);
122 for (
size_t n = 0; n < size; ++n)
124 const uint32_t*
const sourcePixel = source + n;
125 uint16_t*
const targetPixel = target + n;
128 *targetPixel = ((uint16_t*)sourcePixel)[1];
This is the base class for all frame converter classes.
Definition: FrameConverter.h:32
ConversionFlag
Definition of individual conversion flags.
Definition: FrameConverter.h:39
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 ...
Definition: FrameConverter.h:3211
This class provides functions to convert frames with Y32 pixel format.
Definition: FrameConverterY32.h:26
static void convertRowY32ToY16(const uint32_t *source, uint16_t *target, const size_t size, const void *unusedParameters=nullptr)
Converts a Y32 row to a Y16 row.
Definition: FrameConverterY32.h:117
static void convertY32ToY16(const uint32_t *source, uint16_t *target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
Converts a Y 32 bit frame to a Y 16 bit frame by dividing by 2^16.
Definition: FrameConverterY32.h:89
static void convertRowY32ToY8(const uint32_t *source, uint8_t *target, const size_t size, const void *unusedParameters=nullptr)
Converts a Y32 row to a Y8 row.
Definition: FrameConverterY32.h:102
static void convertY32ToY8(const uint32_t *source, uint8_t *target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
Converts a Y 32 bit frame to a Y 8 bit frame by dividing by 2^24.
Definition: FrameConverterY32.h:76
This class implements a worker able to distribute function calls over different threads.
Definition: Worker.h:33
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15