8 #ifndef META_OCEAN_CV_FRAME_CONVERTER_Y_VU_12_H
9 #define META_OCEAN_CV_FRAME_CONVERTER_Y_VU_12_H
42 static inline void convertY_VU12ToY8(
const uint8_t* ySource,
const uint8_t* vuSource, uint8_t* target,
const unsigned int width,
const unsigned int height,
const ConversionFlag flag,
const unsigned int ySourcePaddingElements,
const unsigned int vuSourcePaddingElements,
const unsigned int targetPaddingElements,
Worker* worker =
nullptr);
62 static inline void convertY_VU12LimitedRangeToBGR24FullRange(
const uint8_t* ySource,
const uint8_t* vuSource, uint8_t* target,
const unsigned int width,
const unsigned int height,
const ConversionFlag flag,
const unsigned int ySourcePaddingElements,
const unsigned int vuSourcePaddingElements,
const unsigned int targetPaddingElements,
Worker* worker =
nullptr);
84 static inline void convertY_VU12FullRangeToBGRA32FullRangeAndroid(
const uint8_t* ySource,
const uint8_t* vuSource, uint8_t* target,
const unsigned int width,
const unsigned int height,
const ConversionFlag flag,
const unsigned int ySourcePaddingElements,
const unsigned int vuSourcePaddingElements,
const unsigned int targetPaddingElements,
const uint8_t alphaValue = 0xFF,
Worker* worker =
nullptr);
104 static inline void convertY_VU12LimitedRangeToRGB24FullRange(
const uint8_t* ySource,
const uint8_t* vuSource, uint8_t* target,
const unsigned int width,
const unsigned int height,
const ConversionFlag flag,
const unsigned int ySourcePaddingElements,
const unsigned int vuSourcePaddingElements,
const unsigned int targetPaddingElements,
Worker* worker =
nullptr);
124 static inline void convertY_VU12FullRangeToRGB24FullRangePrecision6Bit(
const uint8_t* ySource,
const uint8_t* vuSource, uint8_t* target,
const unsigned int width,
const unsigned int height,
const ConversionFlag flag,
const unsigned int ySourcePaddingElements,
const unsigned int vuSourcePaddingElements,
const unsigned int targetPaddingElements,
Worker* worker =
nullptr);
140 static inline void convertY_VU12ToYUV24(
const uint8_t* ySource,
const uint8_t* vuSource, uint8_t* target,
const unsigned int width,
const unsigned int height,
const ConversionFlag flag,
const unsigned int ySourcePaddingElements,
const unsigned int vuSourcePaddingElements,
const unsigned int targetPaddingElements,
Worker* worker =
nullptr);
156 static inline void convertY_VU12ToYVU24(
const uint8_t* ySource,
const uint8_t* vuSource, uint8_t* target,
const unsigned int width,
const unsigned int height,
const ConversionFlag flag,
const unsigned int ySourcePaddingElements,
const unsigned int vuSourcePaddingElements,
const unsigned int targetPaddingElements,
Worker* worker =
nullptr);
201 inline void FrameConverterY_VU12::convertY_VU12ToY8(
const uint8_t* ySource,
const uint8_t* , uint8_t* target,
const unsigned int width,
const unsigned int height,
const ConversionFlag flag,
const unsigned int ySourcePaddingElements,
const unsigned int ,
const unsigned int targetPaddingElements,
Worker* worker)
203 ocean_assert(ySource !=
nullptr && target !=
nullptr);
204 ocean_assert(width >= 1u && height >= 1u);
206 FrameChannels::transformGeneric<uint8_t, 1u>(ySource, target, width, height, flag, ySourcePaddingElements, targetPaddingElements, worker);
211 ocean_assert(ySource !=
nullptr && vuSource !=
nullptr && target !=
nullptr);
213 ocean_assert(width >= 2u && width % 2u == 0u);
214 ocean_assert(height >= 2u && height % 2u == 0u);
216 if (width < 2u || height < 2u || width % 2u != 0u || height % 2u != 0u)
237 const int options[3 + 12] =
240 int(ySourcePaddingElements), int(vuSourcePaddingElements), int(targetPaddingElements),
243 75, 75, 75, 0, -52, 102, 128, -25, 0,
249 const void* sources[2] =
265 const int options[3 + 12] =
268 int(ySourcePaddingElements), int(vuSourcePaddingElements), int(targetPaddingElements),
271 1192, 1192, 1192, 0, -833, 1634, 2066, -400, 0,
277 const void* sources[2] =
283 FrameConverter::convertArbitraryPixelFormat(sources, (
void**)&target, width, height, flag, 1u, FrameConverter::convertOneRow1PlaneAnd2ChannelsZippedDownsampled2x2ToZipped3Channels8BitPerChannelPrecision10Bit, options, worker);
289 inline void FrameConverterY_VU12::convertY_VU12FullRangeToBGRA32FullRangeAndroid(
const uint8_t* ySource,
const uint8_t* vuSource, uint8_t* target,
const unsigned int width,
const unsigned int height,
const ConversionFlag flag,
const unsigned int ySourcePaddingElements,
const unsigned int vuSourcePaddingElements,
const unsigned int targetPaddingElements,
const uint8_t alphaValue,
Worker* worker)
291 ocean_assert(ySource !=
nullptr && vuSource !=
nullptr && target !=
nullptr);
293 ocean_assert(width >= 2u && width % 2u == 0u);
294 ocean_assert(height >= 2u && height % 2u == 0u);
296 if (width < 2u || height < 2u || width % 2u != 0u || height % 2u != 0u)
301 const int options[3 + 1] =
304 int(ySourcePaddingElements), int(vuSourcePaddingElements), int(targetPaddingElements),
310 const void* sources[2] =
326 ocean_assert(ySource !=
nullptr && vuSource !=
nullptr && target !=
nullptr);
328 ocean_assert(width >= 2u && width % 2u == 0u);
329 ocean_assert(height >= 2u && height % 2u == 0u);
331 if (width < 2u || height < 2u || width % 2u != 0u || height % 2u != 0u)
352 const int options[3 + 12] =
355 int(ySourcePaddingElements), int(vuSourcePaddingElements), int(targetPaddingElements),
358 75, 75, 75, 102, -52, 0, 0, -25, 128,
364 const void* sources[2] =
380 const int options[3 + 12] =
383 int(ySourcePaddingElements), int(vuSourcePaddingElements), int(targetPaddingElements),
386 1192, 1192, 1192, 1634, -833, 0, 0, -400, 2066,
392 const void* sources[2] =
398 FrameConverter::convertArbitraryPixelFormat(sources, (
void**)&target, width, height, flag, 1u, FrameConverter::convertOneRow1PlaneAnd2ChannelsZippedDownsampled2x2ToZipped3Channels8BitPerChannelPrecision10Bit, options, worker);
406 ocean_assert(ySource !=
nullptr && vuSource !=
nullptr && target !=
nullptr);
408 ocean_assert(width >= 2u && width % 2u == 0u);
409 ocean_assert(height >= 2u && height % 2u == 0u);
411 if (width < 2u || height < 2u || width % 2u != 0u || height % 2u != 0u)
428 const int options[3 + 12] =
431 int(ySourcePaddingElements), int(vuSourcePaddingElements), int(targetPaddingElements),
434 64, 64, 64, 90, -46, 0, 0, -22, 113,
440 const void* sources[2] =
449 inline void FrameConverterY_VU12::convertY_VU12ToYUV24(
const uint8_t* ySource,
const uint8_t* vuSource, uint8_t* target,
const unsigned int width,
const unsigned int height,
const ConversionFlag flag,
const unsigned int ySourcePaddingElements,
const unsigned int vuSourcePaddingElements,
const unsigned int targetPaddingElements,
Worker* worker)
451 ocean_assert(ySource !=
nullptr && vuSource !=
nullptr && target !=
nullptr);
453 ocean_assert(width >= 2u && width % 2u == 0u);
454 ocean_assert(height >= 2u && height % 2u == 0u);
456 if (width < 2u || height < 2u || width % 2u != 0u || height % 2u != 0u)
461 const unsigned int options[3] = {ySourcePaddingElements, vuSourcePaddingElements, targetPaddingElements};
463 const void* sources[2] =
469 FrameConverter::convertArbitraryPixelFormat(sources, (
void**)&target, width, height, flag, 2u, FrameConverter::mapTwoRows_1Plane1ChannelAnd1Plane2ChannelsDownsampled2x2_To_1Plane3Channels_8BitPerChannel<0u, 2u, 1u>, options, worker);
472 inline void FrameConverterY_VU12::convertY_VU12ToYVU24(
const uint8_t* ySource,
const uint8_t* vuSource, uint8_t* target,
const unsigned int width,
const unsigned int height,
const ConversionFlag flag,
const unsigned int ySourcePaddingElements,
const unsigned int vuSourcePaddingElements,
const unsigned int targetPaddingElements,
Worker* worker)
474 ocean_assert(ySource !=
nullptr && vuSource !=
nullptr && target !=
nullptr);
476 ocean_assert(width >= 2u && width % 2u == 0u);
477 ocean_assert(height >= 2u && height % 2u == 0u);
479 if (width < 2u || height < 2u || width % 2u != 0u || height % 2u != 0u)
484 const unsigned int options[3] = {ySourcePaddingElements, vuSourcePaddingElements, targetPaddingElements};
486 const void* sources[2] =
492 FrameConverter::convertArbitraryPixelFormat(sources, (
void**)&target, width, height, flag, 2u, FrameConverter::mapTwoRows_1Plane1ChannelAnd1Plane2ChannelsDownsampled2x2_To_1Plane3Channels_8BitPerChannel<0u, 1u, 2u>, options, worker);
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 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....
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 arbi...
Definition: FrameConverter.h:3234
This class provides functions to convert frames with Y_VU12 pixel format.
Definition: FrameConverterY_VU12.h:26
static void convertY_VU12LimitedRangeToBGR24FullRange(const uint8_t *ySource, const uint8_t *vuSource, uint8_t *target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int vuSourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
Converts a Y_VU12 frame to an 24 bit BGR frame into a second image buffer.
Definition: FrameConverterY_VU12.h:209
static void convertY_VU12FullRangeToBGRA32FullRangeAndroid(const uint8_t *ySource, const uint8_t *vuSource, uint8_t *target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int vuSourcePaddingElements, const unsigned int targetPaddingElements, const uint8_t alphaValue=0xFF, Worker *worker=nullptr)
Converts a full range Y_VU12 frame to a full range BGRA32 frame into a second image buffer applying a...
Definition: FrameConverterY_VU12.h:289
static void convertTwoRowsY_VU12FullRangeToBGRA32FullRangeAndroidPrecision6Bit(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 Y_UV12 pixel format to two rows of an image with BGRA32 pixel form...
static void convertY_VU12LimitedRangeToRGB24FullRange(const uint8_t *ySource, const uint8_t *vuSource, uint8_t *target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int vuSourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
Converts a Y_VU12 frame to an 24 bit RGB frame into a second image buffer.
Definition: FrameConverterY_VU12.h:324
static void convertY_VU12ToY8(const uint8_t *ySource, const uint8_t *vuSource, uint8_t *target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int vuSourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
Converts a Y_VU12 frame to an 8 bit gray scale frame into a second image buffer.
Definition: FrameConverterY_VU12.h:201
static void convertY_VU12ToYVU24(const uint8_t *ySource, const uint8_t *vuSource, uint8_t *target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int vuSourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
Converts a Y_VU12 frame to an 24 bit YVU frame into a second image buffer.
Definition: FrameConverterY_VU12.h:472
static void convertOneRowY_VU12FullRangeToBGRA32FullRangeAndroidPrecision6Bit(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 Y_UV12 pixel format to one row of an image with BGRA32 pixel format...
static void convertY_VU12ToYUV24(const uint8_t *ySource, const uint8_t *vuSource, uint8_t *target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int vuSourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
Converts a Y_VU12 frame to an 24 bit YUV frame into a second image buffer.
Definition: FrameConverterY_VU12.h:449
static void convertY_VU12FullRangeToRGB24FullRangePrecision6Bit(const uint8_t *ySource, const uint8_t *vuSource, uint8_t *target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int ySourcePaddingElements, const unsigned int vuSourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
Converts a Y_VU12 full range frame to an 24 bit RGB frame into a second image buffer.
Definition: FrameConverterY_VU12.h:404
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