Ocean
Loading...
Searching...
No Matches
FrameConverterY8.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8#ifndef META_OCEAN_CV_FRAME_CONVERTER_Y_8_H
9#define META_OCEAN_CV_FRAME_CONVERTER_Y_8_H
10
11#include "ocean/cv/CV.h"
14
15#include "ocean/base/Memory.h"
16#include "ocean/base/Worker.h"
17
18namespace Ocean
19{
20
21namespace CV
22{
23
24/**
25 * This class provides functions to convert frames with Y8 pixel format.
26 * @ingroup cv
27 */
28class OCEAN_CV_EXPORT FrameConverterY8 : public FrameConverter
29{
30 protected:
31
32 /**
33 * This class implements the manager for lookup tables.
34 */
35 class LookupTableManager : public Singleton<LookupTableManager>
36 {
37 protected:
38
39 /// Definition of a map mapping gamma values to the memory of lookup tables.
40 using LookupTables = std::unordered_map<float, Memory>;
41
42 public:
43
44 /**
45 * Returns the lookup table for a gamma compression/correction function.
46 * The gamma compression/correction is based the following equation
47 * <pre>
48 * Y8 = 255 * (Y8 / 255) ^ gamma
49 * </pre>
50 * @param gamma The gamma value for which the lookup table will be returned, with range (0, 2)
51 * @return The requested lookup table, will be valid
52 */
53 const uint8_t* lookupTable(const float gamma);
54
55 protected:
56
57 /// The lookup tables.
59
60 /// The lock of the manager.
62 };
63
64 public:
65
66 /**
67 * Converts a Y 8 bit full range [0, 255] frame to a BGR 24 bit frame.
68 * @param source The source frame buffer, must be valid
69 * @param target The target frame buffer, must be valid
70 * @param width The width of the frame in pixel, with range [1, infinity)
71 * @param height The height of the frame in pixel, with range [1, infinity)
72 * @param flag Determining the type of conversion
73 * @param sourcePaddingElements The number of padding elements at the end of each source row, in elements, with range [0, infinity)
74 * @param targetPaddingElements The number of padding elements at the end of each target row, in elements, with range [0, infinity)
75 * @param worker Optional worker object to distribute the computational load
76 */
77 static inline void convertY8FullRangeToBGR24(const uint8_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);
78
79 /**
80 * Converts a Y 8 bit full range [0, 255] frame to a RGB 24 bit frame.
81 * @param source The source frame buffer, must be valid
82 * @param target The target frame buffer, must be valid
83 * @param width The width of the frame in pixel, with range [1, infinity)
84 * @param height The height of the frame in pixel, with range [1, infinity)
85 * @param flag Determining the type of conversion
86 * @param sourcePaddingElements The number of padding elements at the end of each source row, in elements, with range [0, infinity)
87 * @param targetPaddingElements The number of padding elements at the end of each target row, in elements, with range [0, infinity)
88 * @param worker Optional worker object to distribute the computational load
89 */
90 static inline void convertY8FullRangeToRGB24(const uint8_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);
91
92 /**
93 * Converts a Y 8 bit full range [0, 255] frame to a RGBA 32 bit frame.
94 * @param source The source frame buffer, must be valid
95 * @param target The target frame buffer, must be valid
96 * @param width The width of the frame in pixel, with range [1, infinity)
97 * @param height The height of the frame in pixel, with range [1, infinity)
98 * @param flag Determining the type of conversion
99 * @param sourcePaddingElements The number of padding elements at the end of each source row, in elements, with range [0, infinity)
100 * @param targetPaddingElements The number of padding elements at the end of each target row, in elements, with range [0, infinity)
101 * @param alphaValue The value of the alpha channel to be set, with range [0, 255]
102 * @param worker Optional worker object to distribute the computational load
103 */
104 static inline void convertY8FullRangeToRGBA32(const uint8_t* source, uint8_t* target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, const uint8_t alphaValue = 0xFF, Worker* worker = nullptr);
105
106 /**
107 * Converts a Y8 limited range frame [16, 235] to an RGB24 (full range) frame [0, 255].
108 * This function first converts limited range to full range, then expands grayscale to RGB.
109 * @param source The source frame buffer with limited range values, must be valid
110 * @param target The target frame buffer, must be valid
111 * @param width The width of the frame in pixel, with range [1, infinity)
112 * @param height The height of the frame in pixel, with range [1, infinity)
113 * @param flag Determining the type of conversion
114 * @param sourcePaddingElements The number of padding elements at the end of each source row, in elements, with range [0, infinity)
115 * @param targetPaddingElements The number of padding elements at the end of each target row, in elements, with range [0, infinity)
116 * @param worker Optional worker object to distribute the computational load
117 * @tparam tPrecision The precision to use for range conversion: 6 for 6-bit (faster) or 10 for 10-bit (slower, higher quality)
118 */
119 template <unsigned int tPrecision = 10u>
120 static inline void convertY8LimitedRangeToRGB24(const uint8_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);
121
122 /**
123 * Converts a Y8 limited range frame [16, 235] to an RGBA32 (full range) frame [0, 255].
124 * This function first converts limited range to full range, then expands grayscale to RGBA.
125 * @param source The source frame buffer with limited range values, must be valid
126 * @param target The target frame buffer, must be valid
127 * @param width The width of the frame in pixel, with range [1, infinity)
128 * @param height The height of the frame in pixel, with range [1, infinity)
129 * @param flag Determining the type of conversion
130 * @param sourcePaddingElements The number of padding elements at the end of each source row, in elements, with range [0, infinity)
131 * @param targetPaddingElements The number of padding elements at the end of each target row, in elements, with range [0, infinity)
132 * @param alphaValue The value of the alpha channel to be set, with range [0, 255]
133 * @param worker Optional worker object to distribute the computational load
134 * @tparam tPrecision The precision to use for range conversion: 6 for 6-bit (faster) or 10 for 10-bit (slower, higher quality)
135 */
136 template <unsigned int tPrecision = 10u>
137 static inline void convertY8LimitedRangeToRGBA32(const uint8_t* source, uint8_t* target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, const uint8_t alphaValue = 0xFF, Worker* worker = nullptr);
138
139 /**
140 * Converts a Y 8 bit frame to a Y 8 bit frame, either limited range to limited range or full range to full range.
141 * @param source The source frame buffer, must be valid
142 * @param target The target frame buffer, must be valid
143 * @param width The width of the frame in pixel, with range [1, infinity)
144 * @param height The height of the frame in pixel, with range [1, infinity)
145 * @param flag Determining the type of conversion
146 * @param sourcePaddingElements The number of padding elements at the end of each source row, in elements, with range [0, infinity)
147 * @param targetPaddingElements The number of padding elements at the end of each target row, in elements, with range [0, infinity)
148 * @param worker Optional worker object to distribute the computational load
149 */
150 static inline void convertY8ToY8(const uint8_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);
151
152 /**
153 * Converts a Y8 frame to a Y8 frame by applying gamma compression/correction using a lookup table, either limited range to limited range or full range to full range.
154 * The gamma compression/correction is based the following equation
155 * <pre>
156 * Y8 = 255 * (Y8 / 255) ^ gamma
157 * </pre>
158 * @param source The source frame buffer, must be valid
159 * @param target The target frame buffer, must be valid
160 * @param width The width of the frame in pixel, with range [1, infinity)
161 * @param height The height of the frame in pixel, with range [1, infinity)
162 * @param flag Determining the type of conversion
163 * @param gamma The gamma value to be applied, with range (0, 2)
164 * @param sourcePaddingElements The number of padding elements at the end of each source row, in elements, with range [0, infinity)
165 * @param targetPaddingElements The number of padding elements at the end of each target row, in elements, with range [0, infinity)
166 * @param worker Optional worker object to distribute the computational load
167 */
168 static inline void convertY8ToY8GammaLUT(const uint8_t* const source, uint8_t* const target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const float gamma, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, Worker* worker = nullptr);
169
170 /**
171 * Converts a Y8 limited range frame [16, 235] to a Y8 full range frame [0, 255].
172 * @param source The source frame buffer with limited range values, must be valid
173 * @param target The target frame buffer with full range values, must be valid
174 * @param width The width of the frame in pixel, with range [1, infinity)
175 * @param height The height of the frame in pixel, with range [1, infinity)
176 * @param flag Determining the type of conversion
177 * @param sourcePaddingElements The number of padding elements at the end of each source row, in elements, with range [0, infinity)
178 * @param targetPaddingElements The number of padding elements at the end of each target row, in elements, with range [0, infinity)
179 * @param worker Optional worker object to distribute the computational load
180 * @tparam tPrecision The precision to use: 6 for 6-bit precision (faster) or 10 for 10-bit precision (slower)
181 */
182 template <unsigned int tPrecision = 10u>
183 static inline void convertY8LimitedRangeToY8FullRange(const uint8_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);
184
185 /**
186 * Converts a Y8 full range frame [0, 255] to a Y8 limited range frame [16, 235].
187 * @param source The source frame buffer with full range values, must be valid
188 * @param target The target frame buffer with limited range values, must be valid
189 * @param width The width of the frame in pixel, with range [1, infinity)
190 * @param height The height of the frame in pixel, with range [1, infinity)
191 * @param flag Determining the type of conversion
192 * @param sourcePaddingElements The number of padding elements at the end of each source row, in elements, with range [0, infinity)
193 * @param targetPaddingElements The number of padding elements at the end of each target row, in elements, with range [0, infinity)
194 * @param worker Optional worker object to distribute the computational load
195 * @tparam tPrecision The precision to use: 6 for 6-bit precision (faster) or 10 for 10-bit precision (slower)
196 */
197 template <unsigned int tPrecision = 10u>
198 static inline void convertY8FullRangeToY8LimitedRange(const uint8_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);
199
200 protected:
201
202 /**
203 * Converts a Y8 row to a Y8 row by applying gamma compression/correction with a lookup table.
204 * @param source The pointer to the source pixels, must be valid
205 * @param target The pointer to the target pixels receiving the converted pixel data, must be valid
206 * @param size The number of source (and target pixels) to convert, with range [1, infinity)
207 * @param parameters The pointer to the `uint8_t` lookup table to be used, must be valid
208 */
209 static void convertRowY8ToY8GammaLUT(const uint8_t* source, uint8_t* target, const size_t size, const void* parameters);
210};
211
212inline void FrameConverterY8::convertY8FullRangeToBGR24(const uint8_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)
213{
214 ocean_assert(source != nullptr && target != nullptr);
215 ocean_assert(width >= 1u && height >= 1u);
216
217 // source frame Y
218 // 0
219 // target frame B G R
220 // pattern 0 0 0
221 constexpr unsigned int shufflePattern = 0x000u;
222
223 FrameChannels::shuffleChannels<uint8_t, 1u, 3u, shufflePattern>(source, target, width, height, flag, sourcePaddingElements, targetPaddingElements, worker);
224}
225
226inline void FrameConverterY8::convertY8FullRangeToRGB24(const uint8_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)
227{
228 ocean_assert(source != nullptr && target != nullptr);
229 ocean_assert(width >= 1u && height >= 1u);
230
231 // source frame Y
232 // 0
233 // target frame R G B
234 // pattern 0 0 0
235 constexpr unsigned int shufflePattern = 0x000u;
236
237 FrameChannels::shuffleChannels<uint8_t, 1u, 3u, shufflePattern>(source, target, width, height, flag, sourcePaddingElements, targetPaddingElements, worker);
238}
239
240inline void FrameConverterY8::convertY8FullRangeToRGBA32(const uint8_t* source, uint8_t* target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, const uint8_t alphaValue, Worker* worker)
241{
242 ocean_assert(source != nullptr && target != nullptr);
243 ocean_assert(width >= 1u && height >= 1u);
244
245 // source frame Y
246 // 0
247 // target frame R G B A
248 // pattern 0 0 0
249 constexpr unsigned int shufflePattern = 0x000u;
250
251 FrameChannels::shuffleChannelsAndSetLastChannelValue<uint8_t, 1u, 4u, shufflePattern>(source, alphaValue, target, width, height, flag, sourcePaddingElements, targetPaddingElements, worker);
252}
253
254inline void FrameConverterY8::convertY8ToY8(const uint8_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)
255{
256 ocean_assert(source != nullptr && target != nullptr);
257 ocean_assert(width >= 1u && height >= 1u);
258
259 FrameChannels::transformGeneric<uint8_t, 1u>(source, target, width, height, flag, sourcePaddingElements, targetPaddingElements, worker);
260}
261
262inline void FrameConverterY8::convertY8ToY8GammaLUT(const uint8_t* source, uint8_t* target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const float gamma, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, Worker* worker)
263{
264 ocean_assert(source != nullptr && target != nullptr);
265 ocean_assert(width >= 1u && height >= 1u);
266
267 ocean_assert(gamma > 0.0f && gamma < 2.0f);
268
269 if (NumericF::isEqual(gamma, 1.0f))
270 {
271 // no gamma correction necessary
272
273 FrameConverterY8::convertY8ToY8(source, target, width, height, flag, sourcePaddingElements, targetPaddingElements, worker);
274 return;
275 }
276
277 const unsigned int sourceStrideElements = width + sourcePaddingElements;
278 const unsigned int targetStrideElements = width + targetPaddingElements;
279
280 const void* const options = LookupTableManager::get().lookupTable(gamma);
281
282 const bool areContinuous = sourcePaddingElements == 0u && targetPaddingElements == 0u;
283
284 FrameConverter::convertGenericPixelFormat(source, target, width, height, sourceStrideElements, targetStrideElements, flag, convertRowY8ToY8GammaLUT, CV::FrameChannels::reverseRowPixelOrderInPlace<uint8_t, 1u>, areContinuous, options, worker);
285}
286
287template <unsigned int tPrecision>
288inline void FrameConverterY8::convertY8LimitedRangeToY8FullRange(const uint8_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)
289{
290 static_assert(tPrecision == 6u || tPrecision == 10u, "Precision must be 6 or 10");
291
292 ocean_assert(source != nullptr && target != nullptr);
293 ocean_assert(width >= 1u && height >= 1u);
294
295 // Y_full = (Y_limited - 16) * 255 / 219
296 const int32_t options[5] =
297 {
298 int32_t(sourcePaddingElements),
299 int32_t(targetPaddingElements),
300
301 tPrecision == 6u ? int32_t(75) : int32_t(1192), // 6-bit: 75 == (255/219 * 64); 10-bit: 1192 == (255/219 * 1024)
302 16,
303 0
304 };
305
306 const void* sources[1] = {source};
307 void* targets[1] = {target};
308
309 if constexpr (tPrecision == 6u)
310 {
312 }
313 else
314 {
316 }
317}
318
319template <unsigned int tPrecision>
320inline void FrameConverterY8::convertY8FullRangeToY8LimitedRange(const uint8_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)
321{
322 static_assert(tPrecision == 6u || tPrecision == 10u, "Precision must be 6 or 10");
323
324 ocean_assert(source != nullptr && target != nullptr);
325 ocean_assert(width >= 1u && height >= 1u);
326
327 // Y_limited = Y_full * 219 / 255 + 16
328 const int32_t options[5] =
329 {
330 int32_t(sourcePaddingElements),
331 int32_t(targetPaddingElements),
332
333 tPrecision == 6u ? int32_t(55) : int32_t(879), // 6-bit: 55 == (219/255 * 64); 10-bit: 879 == (219/255 * 1024)
334 0,
335 16
336 };
337
338 const void* sources[1] = {source};
339 void* targets[1] = {target};
340
341 if constexpr (tPrecision == 6u)
342 {
344 }
345 else
346 {
348 }
349}
350
351template <unsigned int tPrecision>
352inline void FrameConverterY8::convertY8LimitedRangeToRGB24(const uint8_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)
353{
354 static_assert(tPrecision == 6u || tPrecision == 10u, "Precision must be 6 or 10");
355
356 ocean_assert(source != nullptr && target != nullptr);
357 ocean_assert(width >= 1u && height >= 1u);
358
359 // Y_full = (Y_limited - 16) * 255 / 219
360 const int32_t options[5] =
361 {
362 int32_t(sourcePaddingElements),
363 int32_t(targetPaddingElements),
364
365 tPrecision == 6u ? int32_t(75) : int32_t(1192), // 6-bit: 75 == (255/219 * 64); 10-bit: 1192 == (255/219 * 1024)
366 16,
367 0
368 };
369
370 const void* sources[1] = {source};
371 void* targets[1] = {target};
372
373 if constexpr (tPrecision == 6u)
374 {
376 }
377 else
378 {
380 }
381}
382
383template <unsigned int tPrecision>
384inline void FrameConverterY8::convertY8LimitedRangeToRGBA32(const uint8_t* source, uint8_t* target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, const uint8_t alphaValue, Worker* worker)
385{
386 static_assert(tPrecision == 6u || tPrecision == 10u, "Precision must be 6 or 10");
387
388 ocean_assert(source != nullptr && target != nullptr);
389 ocean_assert(width >= 1u && height >= 1u);
390
391 // Y_full = (Y_limited - 16) * 255 / 219
392 const int32_t options[6] =
393 {
394 int32_t(sourcePaddingElements),
395 int32_t(targetPaddingElements),
396
397 tPrecision == 6u ? int32_t(75) : int32_t(1192), // 6-bit: 75 == (255/219 * 64); 10-bit: 1192 == (255/219 * 1024)
398 16,
399 0,
400 int32_t(alphaValue)
401 };
402
403 const void* sources[1] = {source};
404 void* targets[1] = {target};
405
406 if constexpr (tPrecision == 6u)
407 {
409 }
410 else
411 {
413 }
414}
415
416}
417
418}
419
420#endif // META_OCEAN_CV_FRAME_CONVERTER_Y_8_H
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 convertOneRow_1Plane1Channel_To_1Plane4Channels_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 a single-channel image to a 4-channel image with 10-bit precision and range conve...
static void convertOneRow_1Plane1Channel_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 a single-channel image to a 4-channel image with 6-bit precision and range conver...
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:3483
static void convertOneRow_1Plane1Channel_To_1Plane1Channel_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 a single-channel image to another single-channel image with 10-bit precision.
static void convertOneRow_1Plane1Channel_To_1Plane1Channel_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 a single-channel image to another single-channel image with 6-bit precision.
static void convertOneRow_1Plane1Channel_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 a single-channel image to a 3-channel image with 6-bit precision and range conver...
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:3506
static void convertOneRow_1Plane1Channel_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 a single-channel image to a 3-channel image with 10-bit precision and range conve...
This class implements the manager for lookup tables.
Definition FrameConverterY8.h:36
LookupTables lookupTables_
The lookup tables.
Definition FrameConverterY8.h:58
std::unordered_map< float, Memory > LookupTables
Definition of a map mapping gamma values to the memory of lookup tables.
Definition FrameConverterY8.h:40
const uint8_t * lookupTable(const float gamma)
Returns the lookup table for a gamma compression/correction function.
Lock lock_
The lock of the manager.
Definition FrameConverterY8.h:61
This class provides functions to convert frames with Y8 pixel format.
Definition FrameConverterY8.h:29
static void convertY8FullRangeToY8LimitedRange(const uint8_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 Y8 full range frame [0, 255] to a Y8 limited range frame [16, 235].
Definition FrameConverterY8.h:320
static void convertY8LimitedRangeToRGB24(const uint8_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 Y8 limited range frame [16, 235] to an RGB24 (full range) frame [0, 255].
Definition FrameConverterY8.h:352
static void convertY8FullRangeToBGR24(const uint8_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 8 bit full range [0, 255] frame to a BGR 24 bit frame.
Definition FrameConverterY8.h:212
static void convertY8LimitedRangeToY8FullRange(const uint8_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 Y8 limited range frame [16, 235] to a Y8 full range frame [0, 255].
Definition FrameConverterY8.h:288
static void convertY8ToY8(const uint8_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 8 bit frame to a Y 8 bit frame, either limited range to limited range or full range to f...
Definition FrameConverterY8.h:254
static void convertY8ToY8GammaLUT(const uint8_t *const source, uint8_t *const target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const float gamma, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
Converts a Y8 frame to a Y8 frame by applying gamma compression/correction using a lookup table,...
Definition FrameConverterY8.h:262
static void convertRowY8ToY8GammaLUT(const uint8_t *source, uint8_t *target, const size_t size, const void *parameters)
Converts a Y8 row to a Y8 row by applying gamma compression/correction with a lookup table.
static void convertY8FullRangeToRGBA32(const uint8_t *source, uint8_t *target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, const uint8_t alphaValue=0xFF, Worker *worker=nullptr)
Converts a Y 8 bit full range [0, 255] frame to a RGBA 32 bit frame.
Definition FrameConverterY8.h:240
static void convertY8LimitedRangeToRGBA32(const uint8_t *source, uint8_t *target, const unsigned int width, const unsigned int height, const ConversionFlag flag, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, const uint8_t alphaValue=0xFF, Worker *worker=nullptr)
Converts a Y8 limited range frame [16, 235] to an RGBA32 (full range) frame [0, 255].
Definition FrameConverterY8.h:384
static void convertY8FullRangeToRGB24(const uint8_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 8 bit full range [0, 255] frame to a RGB 24 bit frame.
Definition FrameConverterY8.h:226
This class implements a recursive lock object.
Definition Lock.h:31
static bool isEqual(const T first, const T second)
Returns whether two values are equal up to a small epsilon.
Definition Numeric.h:2395
This template class is the base class for all singleton objects.
Definition Singleton.h:71
static LookupTableManager & get()
Returns a reference to the unique object.
Definition Singleton.h:115
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