Ocean
Loading...
Searching...
No Matches
FrameConverterRGBA32.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_RGBA_32_H
9#define META_OCEAN_CV_FRAME_CONVERTER_RGBA_32_H
10
11#include "ocean/cv/CV.h"
14
15namespace Ocean
16{
17
18namespace CV
19{
20
21/**
22 * This class provides functions to convert frames with RGBA32 pixel format.
23 * @ingroup cv
24 */
25class OCEAN_CV_EXPORT FrameConverterRGBA32 : public FrameConverter
26{
27 public:
28
29 /**
30 * Converts an RGBA 32 bit frame to a ABGR 32 bit frame.
31 * @param source The source frame buffer, must be valid
32 * @param target The target frame buffer, must be valid
33 * @param width The width of the frame in pixel, with range [1, infinity)
34 * @param height The height of the frame in pixel, with range [1, infinity)
35 * @param flag Determining the type of conversion
36 * @param sourcePaddingElements The number of padding elements at the end of each source row, in elements, with range [0, infinity)
37 * @param targetPaddingElements The number of padding elements at the end of each target row, in elements, with range [0, infinity)
38 * @param worker Optional worker to distribute the computation to several CPU cores
39 */
40 static inline void convertRGBA32ToABGR32(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);
41
42 /**
43 * Converts an RGBA 32 bit frame to a ARGB 32 bit frame.
44 * @param source The source frame buffer, must be valid
45 * @param target The target frame buffer, must be valid
46 * @param width The width of the frame in pixel, with range [1, infinity)
47 * @param height The height of the frame in pixel, with range [1, infinity)
48 * @param flag Determining the type of conversion
49 * @param sourcePaddingElements The number of padding elements at the end of each source row, in elements, with range [0, infinity)
50 * @param targetPaddingElements The number of padding elements at the end of each target row, in elements, with range [0, infinity)
51 * @param worker Optional worker to distribute the computation to several CPU cores
52 */
53 static inline void convertRGBA32ToARGB32(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);
54
55 /**
56 * Converts an RGBA 32 bit frame to a BGR 24 bit frame.
57 * @param source The source frame buffer, must be valid
58 * @param target The target frame buffer, must be valid
59 * @param width The width of the frame in pixel, with range [1, infinity)
60 * @param height The height of the frame in pixel, with range [1, infinity)
61 * @param flag Determining the type of conversion
62 * @param sourcePaddingElements The number of padding elements at the end of each source row, in elements, with range [0, infinity)
63 * @param targetPaddingElements The number of padding elements at the end of each target row, in elements, with range [0, infinity)
64 * @param worker Optional worker to distribute the computation to several CPU cores
65 */
66 static inline void convertRGBA32ToBGR24(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);
67
68 /**
69 * Converts an RGBA 32 bit frame to a BGR 32 bit frame.
70 * @param source The source frame buffer, must be valid
71 * @param target The target frame buffer, must be valid
72 * @param width The width of the frame in pixel, with range [1, infinity)
73 * @param height The height of the frame in pixel, with range [1, infinity)
74 * @param flag Determining the type of conversion
75 * @param sourcePaddingElements The number of padding elements at the end of each source row, in elements, with range [0, infinity)
76 * @param targetPaddingElements The number of padding elements at the end of each target row, in elements, with range [0, infinity)
77 * @param worker Optional worker to distribute the computation to several CPU cores
78 * @remarks Information in alpha channel of source frame is discarded during conversion. The unused last channel of each pixel in target frame is set to zero.
79 */
80 static inline void convertRGBA32ToBGR32(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);
81
82 /**
83 * Converts an RGBA 32 bit frame to a BGRA 32 bit frame.
84 * @param source The source frame buffer, must be valid
85 * @param target The target frame buffer, must be valid
86 * @param width The width of the frame in pixel, with range [1, infinity)
87 * @param height The height of the frame in pixel, with range [1, infinity)
88 * @param flag Determining the type of conversion
89 * @param sourcePaddingElements The number of padding elements at the end of each source row, in elements, with range [0, infinity)
90 * @param targetPaddingElements The number of padding elements at the end of each target row, in elements, with range [0, infinity)
91 * @param worker Optional worker to distribute the computation to several CPU cores
92 */
93 static inline void convertRGBA32ToBGRA32(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);
94
95 /**
96 * Converts an RGBA 32 bit frame to a RGBA 32 bit frame.
97 * @param source The source frame buffer, must be valid
98 * @param target The target frame buffer, must be valid
99 * @param width The width of the frame in pixel, with range [1, infinity)
100 * @param height The height of the frame in pixel, with range [1, infinity)
101 * @param flag Determining the type of conversion
102 * @param sourcePaddingElements The number of padding elements at the end of each source row, in elements, with range [0, infinity)
103 * @param targetPaddingElements The number of padding elements at the end of each target row, in elements, with range [0, infinity)
104 * @param worker Optional worker to distribute the computation to several CPU cores
105 */
106 static inline void convertRGBA32ToRGBA32(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);
107
108 /**
109 * Converts an RGBA 32 bit frame to a RGB 24 bit frame.
110 * @param source The source frame buffer, must be valid
111 * @param target The target frame buffer, must be valid
112 * @param width The width of the frame in pixel, with range [1, infinity)
113 * @param height The height of the frame in pixel, with range [1, infinity)
114 * @param flag Determining the type of conversion
115 * @param sourcePaddingElements The number of padding elements at the end of each source row, in elements, with range [0, infinity)
116 * @param targetPaddingElements The number of padding elements at the end of each target row, in elements, with range [0, infinity)
117 * @param worker Optional worker to distribute the computation to several CPU cores
118 */
119 static inline void convertRGBA32ToRGB24(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);
120
121 /**
122 * Converts an RGBA 32 bit frame to a RGB 32 bit frame.
123 * @param source The source frame buffer, must be valid
124 * @param target The target frame buffer, must be valid
125 * @param width The width of the frame in pixel, with range [1, infinity)
126 * @param height The height of the frame in pixel, with range [1, infinity)
127 * @param flag Determining the type of conversion
128 * @param sourcePaddingElements The number of padding elements at the end of each source row, in elements, with range [0, infinity)
129 * @param targetPaddingElements The number of padding elements at the end of each target row, in elements, with range [0, infinity)
130 * @param worker Optional worker to distribute the computation to several CPU cores
131 * @remarks Information in alpha channel of source frame is discarded during conversion. The unused last channel of each pixel in target frame is set to zero.
132 */
133 static inline void convertRGBA32ToRGB32(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);
134
135 /**
136 * Converts a RGBA 32 bit frame to a Y 8 bit grayscale frame by the exact conversion.
137 * Gray = Red * 0.299 + Green * 0.587 + Blue * 0.114
138 * @param source The source frame buffer, must be valid
139 * @param target The target frame buffer, must be valid
140 * @param width The width of the frame in pixel, with range [1, infinity)
141 * @param height The height of the frame in pixel, with range [1, infinity)
142 * @param flag Determining the type of conversion
143 * @param sourcePaddingElements The number of padding elements at the end of each source row, in elements, with range [0, infinity)
144 * @param targetPaddingElements The number of padding elements at the end of each target row, in elements, with range [0, infinity)
145 * @param worker Optional worker to distribute the computation to several CPU cores
146 */
147 static inline void convertRGBA32ToY8(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);
148
149 /**
150 * Converts a RGBA 32 bit frame to a YA 16 bit frame by the exact conversion.
151 * Gray = Red * 0.299 + Green * 0.587 + Blue * 0.114
152 * @param source The source frame buffer, must be valid
153 * @param target The target frame buffer, must be valid
154 * @param width The width of the frame in pixel, with range [1, infinity)
155 * @param height The height of the frame in pixel, with range [1, infinity)
156 * @param flag Determining the type of conversion
157 * @param sourcePaddingElements The number of padding elements at the end of each source row, in elements, with range [0, infinity)
158 * @param targetPaddingElements The number of padding elements at the end of each target row, in elements, with range [0, infinity)
159 * @param worker Optional worker to distribute the computation to several CPU cores
160 */
161 static inline void convertRGBA32ToYA16(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);
162
163 /**
164 * Converts a RGBA 32 bit frame to a YUV 24 bit frame.
165 * @param source The source frame buffer, must be valid
166 * @param target The target frame buffer, must be valid
167 * @param width The width of the frame in pixel, with range [1, infinity)
168 * @param height The height of the frame in pixel, with range [1, infinity)
169 * @param flag Determining the type of conversion
170 * @param sourcePaddingElements The number of padding elements at the end of each source row, in elements, with range [0, infinity)
171 * @param targetPaddingElements The number of padding elements at the end of each target row, in elements, with range [0, infinity)
172 * @param worker Optional worker to distribute the computation to several CPU cores
173 */
174 static inline void convertRGBA32ToYUV24(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);
175};
176
177inline void FrameConverterRGBA32::convertRGBA32ToABGR32(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)
178{
179 ocean_assert(source != nullptr && target != nullptr);
180 ocean_assert(width >= 1u && height >= 1u);
181
182 FrameChannels::reverseChannelOrder<uint8_t, 4u>(source, target, width, height, flag, sourcePaddingElements, targetPaddingElements, worker);
183}
184
185inline void FrameConverterRGBA32::convertRGBA32ToARGB32(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)
186{
187 ocean_assert(source != nullptr && target != nullptr);
188 ocean_assert(width >= 1u && height >= 1u);
189
190 // source frame R G B A
191 // 0 1 2 3
192 // target frame A R G B
193 // pattern 3 0 1 2
194 constexpr unsigned int shufflePattern = 0x2103;
195
196 FrameChannels::shuffleChannels<uint8_t, 4u, 4u, shufflePattern>(source, target, width, height, flag, sourcePaddingElements, targetPaddingElements, worker);
197}
198
199inline void FrameConverterRGBA32::convertRGBA32ToBGR24(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)
200{
201 ocean_assert(source != nullptr && target != nullptr);
202 ocean_assert(width >= 1u && height >= 1u);
203
204 // source frame R G B A
205 // 0 1 2 3
206 // target frame B G R
207 // pattern 2 1 0
208 constexpr unsigned int shufflePattern = 0x012;
209
210 FrameChannels::shuffleChannels<uint8_t, 4u, 3u, shufflePattern>(source, target, width, height, flag, sourcePaddingElements, targetPaddingElements, worker);
211}
212
213inline void FrameConverterRGBA32::convertRGBA32ToBGR32(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)
214{
215 ocean_assert(source != nullptr && target != nullptr);
216 ocean_assert(width >= 1u && height >= 1u);
217
218 // source frame R G B A
219 // 0 1 2 3
220 // target frame B G R -
221 // pattern 2 1 0
222 constexpr unsigned int shufflePattern = 0x012u;
223
224 FrameChannels::shuffleChannelsAndSetLastChannelValue<uint8_t, 4u, 4u, shufflePattern>(source, 0u, target, width, height, flag, sourcePaddingElements, targetPaddingElements, worker);
225}
226
227inline void FrameConverterRGBA32::convertRGBA32ToBGRA32(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)
228{
229 ocean_assert(source != nullptr && target != nullptr);
230 ocean_assert(width >= 1u && height >= 1u);
231
232 // source frame R G B A
233 // 0 1 2 3
234 // target frame B G R A
235 // pattern 2 1 0 3
236 constexpr unsigned int shufflePattern = 0x3012;
237
238 FrameChannels::shuffleChannels<uint8_t, 4u, 4u, shufflePattern>(source, target, width, height, flag, sourcePaddingElements, targetPaddingElements, worker);
239}
240
241inline void FrameConverterRGBA32::convertRGBA32ToRGBA32(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)
242{
243 ocean_assert(source != nullptr && target != nullptr);
244 ocean_assert(width >= 1u && height >= 1u);
245
246 FrameChannels::transformGeneric<uint8_t, 4u>(source, target, width, height, flag, sourcePaddingElements, targetPaddingElements, worker);
247}
248
249inline void FrameConverterRGBA32::convertRGBA32ToRGB24(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)
250{
251 ocean_assert(source != nullptr && target != nullptr);
252 ocean_assert(width >= 1u && height >= 1u);
253
254 FrameChannels::removeLastChannel<uint8_t, 4u>(source, target, width, height, flag, sourcePaddingElements, targetPaddingElements, worker);
255}
256
257inline void FrameConverterRGBA32::convertRGBA32ToRGB32(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)
258{
259 ocean_assert(source != nullptr && target != nullptr);
260 ocean_assert(width >= 1u && height >= 1u);
261
262 // source frame R G B A
263 // 0 1 2 3
264 // target frame R G B -
265 // pattern 0 1 2
266 constexpr unsigned int shufflePattern = 0x210u;
267
268 FrameChannels::shuffleChannelsAndSetLastChannelValue<uint8_t, 4u, 4u, shufflePattern>(source, 0u, target, width, height, flag, sourcePaddingElements, targetPaddingElements, worker);
269}
270
271inline void FrameConverterRGBA32::convertRGBA32ToY8(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)
272{
273 ocean_assert(source != nullptr && target != nullptr);
274 ocean_assert(width >= 1u && height >= 1u);
275
276 const unsigned int sourceStrideElements = width * 4u + sourcePaddingElements;
277 const unsigned int targetStrideElements = width + targetPaddingElements;
278
279 constexpr unsigned int channelFactors[4] = {38u, 75u, 15u, 0u};
280
281 static_assert(channelFactors[0] + channelFactors[1] + channelFactors[2] + channelFactors[3] == 128u, "Invalid factors!");
282
283 constexpr bool useFactorChannel0 = channelFactors[0] != 0u;
284 constexpr bool useFactorChannel1 = channelFactors[1] != 0u;
285 constexpr bool useFactorChannel2 = channelFactors[2] != 0u;
286 constexpr bool useFactorChannel3 = channelFactors[3] != 0u;
287
288 const bool areContinuous = sourcePaddingElements == 0u && targetPaddingElements == 0u;
289
290 FrameConverter::convertGenericPixelFormat(source, target, width, height, sourceStrideElements, targetStrideElements, flag, CV::FrameChannels::convertRow4ChannelsTo1Channel8BitPerChannel7BitPrecision<useFactorChannel0, useFactorChannel1, useFactorChannel2, useFactorChannel3>, CV::FrameChannels::reverseRowPixelOrderInPlace<uint8_t, 1u>, areContinuous, channelFactors, worker);
291}
292
293inline void FrameConverterRGBA32::convertRGBA32ToYA16(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)
294{
295 ocean_assert(source != nullptr && target != nullptr);
296 ocean_assert(width >= 1u && height >= 1u);
297
298 const unsigned int sourceStrideElements = width * 4u + sourcePaddingElements;
299 const unsigned int targetStrideElements = width * 2u + targetPaddingElements;
300
301 constexpr unsigned int channelFactors[8] = {38u, 0u, 75u, 0u, 15u, 0u, 0u, 128u};
302
303 const bool areContinuous = sourcePaddingElements == 0u && targetPaddingElements == 0u;
304
305 FrameConverter::convertGenericPixelFormat(source, target, width, height, sourceStrideElements, targetStrideElements, flag, CV::FrameChannels::convertRow4ChannelsTo2Channels8BitPerChannel7BitPrecision, CV::FrameChannels::reverseRowPixelOrderInPlace<uint8_t, 2u>, areContinuous, channelFactors, worker);
306}
307
308inline void FrameConverterRGBA32::convertRGBA32ToYUV24(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)
309{
310 ocean_assert(source != nullptr && target != nullptr);
311 ocean_assert(width >= 1u && height >= 1u);
312
313 const unsigned int sourceStrideElements = width * 4u + sourcePaddingElements;
314 const unsigned int targetStrideElements = width * 3u + targetPaddingElements;
315
316 // approximation:
317 // Y = ( 33 * R + 64 * G + 13 * B + 0 * A) / 128 + 16
318 // U = (-19 * R - 37 * G + 56 * B + 0 * A) / 128 + 128
319 // V = ( 56 * R - 47 * G - 9 * B + 0 * A) / 128 + 128
320
321 const int parameters[15] = {33, -19, 56, 64, -37, -47, 13, 56, -9, 0, 0, 0, 16, 128, 128};
322
323 const bool areContinuous = sourcePaddingElements == 0u && targetPaddingElements == 0u;
324
325 FrameConverter::convertGenericPixelFormat(source, target, width, height, sourceStrideElements, targetStrideElements, flag, CV::FrameChannels::convertRow4ChannelsTo3Channels8BitPerChannel7BitPrecision, CV::FrameChannels::reverseRowPixelOrderInPlace<uint8_t, 3u>, areContinuous, parameters, worker);
326}
327
328}
329
330}
331
332#endif // META_OCEAN_CV_FRAME_CONVERTER_RGBA_32_H
static void convertRow4ChannelsTo2Channels8BitPerChannel7BitPrecision(const uint8_t *source, uint8_t *target, const size_t size, const void *multiplicationFactors_128)
Converts a row of pixels with 4 channels to pixels with two channel by a linear combination of the fo...
static void convertRow4ChannelsTo3Channels8BitPerChannel7BitPrecision(const uint8_t *source, uint8_t *target, const size_t size, const void *parameters)
Converts a row of pixels with 3 channels to pixels with 3 channels by a linear combination of the thr...
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 RGBA32 pixel format.
Definition FrameConverterRGBA32.h:26
static void convertRGBA32ToABGR32(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 an RGBA 32 bit frame to a ABGR 32 bit frame.
Definition FrameConverterRGBA32.h:177
static void convertRGBA32ToBGR24(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)
Converts an RGBA 32 bit frame to a BGR 24 bit frame.
Definition FrameConverterRGBA32.h:199
static void convertRGBA32ToYA16(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 RGBA 32 bit frame to a YA 16 bit frame by the exact conversion.
Definition FrameConverterRGBA32.h:293
static void convertRGBA32ToBGRA32(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 an RGBA 32 bit frame to a BGRA 32 bit frame.
Definition FrameConverterRGBA32.h:227
static void convertRGBA32ToYUV24(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)
Converts a RGBA 32 bit frame to a YUV 24 bit frame.
Definition FrameConverterRGBA32.h:308
static void convertRGBA32ToRGBA32(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 an RGBA 32 bit frame to a RGBA 32 bit frame.
Definition FrameConverterRGBA32.h:241
static void convertRGBA32ToY8(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)
Converts a RGBA 32 bit frame to a Y 8 bit grayscale frame by the exact conversion.
Definition FrameConverterRGBA32.h:271
static void convertRGBA32ToBGR32(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)
Converts an RGBA 32 bit frame to a BGR 32 bit frame.
Definition FrameConverterRGBA32.h:213
static void convertRGBA32ToARGB32(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 an RGBA 32 bit frame to a ARGB 32 bit frame.
Definition FrameConverterRGBA32.h:185
static void convertRGBA32ToRGB32(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)
Converts an RGBA 32 bit frame to a RGB 32 bit frame.
Definition FrameConverterRGBA32.h:257
static void convertRGBA32ToRGB24(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 an RGBA 32 bit frame to a RGB 24 bit frame.
Definition FrameConverterRGBA32.h:249
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