Ocean
Loading...
Searching...
No Matches
TestFrameConverterY_VU12.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_TEST_TESTCV_TEST_FRAME_CONVERTER_Y_VU_12_H
9#define META_OCEAN_TEST_TESTCV_TEST_FRAME_CONVERTER_Y_VU_12_H
10
13
14#include "ocean/base/Worker.h"
15
17
18namespace Ocean
19{
20
21namespace Test
22{
23
24namespace TestCV
25{
26
27/**
28 * This class implements a Y_VU 12bit frame converter test.
29 * @ingroup testcv
30 */
31class OCEAN_TEST_CV_EXPORT TestFrameConverterY_VU12
32{
33 public:
34
35 /**
36 * Tests all Y_VU12 frame conversion functions.
37 * @param width The width of the original frame in pixel, with range [1, infinity)
38 * @param height The height of the original frame in pixel, with range [1, infinity)
39 * @param testDuration Number of seconds for each test, with range (0, infinity)
40 * @param worker The worker object
41 * @return True, if succeeded
42 */
43 static bool test(const unsigned int width, const unsigned int height, const double testDuration, Worker& worker);
44
45 /**
46 * Tests the Y_VU12 (limited range) to BGR24 (full range) conversion.
47 * @param width The width of the original frame in pixel, with range [1, infinity)
48 * @param height The height of the original frame in pixel, with range [1, infinity)
49 * @param conversionFlag The conversion flag that has been applied during conversion
50 * @param testDuration Number of seconds for each test, with range (0, infinity)
51 * @param worker The worker object
52 * @return True, if succeeded
53 */
54 static bool testY_VU12LimitedRangeToBGR24FullRange(const unsigned int width, const unsigned int height, const CV::FrameConverter::ConversionFlag conversionFlag, const double testDuration, Worker& worker);
55
56 /**
57 * Tests the Y_VU12 (full range) to BGR24 (full range) conversion.
58 * @param width The width of the original frame in pixel, with range [1, infinity)
59 * @param height The height of the original frame in pixel, with range [1, infinity)
60 * @param conversionFlag The conversion flag that has been applied during conversion
61 * @param testDuration Number of seconds for each test, with range (0, infinity)
62 * @param worker The worker object
63 * @return True, if succeeded
64 */
65 static bool testY_VU12FullRangeToBGRA32FullRange(const unsigned int width, const unsigned int height, const CV::FrameConverter::ConversionFlag conversionFlag, const double testDuration, Worker& worker);
66
67 /**
68 * Tests the Y_VU12 (limited range) to RGB24 (full range) conversion.
69 * @param width The width of the original frame in pixel, with range [1, infinity)
70 * @param height The height of the original frame in pixel, with range [1, infinity)
71 * @param conversionFlag The conversion flag that has been applied during conversion
72 * @param testDuration Number of seconds for each test, with range (0, infinity)
73 * @param worker The worker object
74 * @return True, if succeeded
75 */
76 static bool testY_VU12LimitedRangeToRGB24FullRange(const unsigned int width, const unsigned int height, const CV::FrameConverter::ConversionFlag conversionFlag, const double testDuration, Worker& worker);
77
78 /**
79 * Tests the Y_VU12 (full range) to RGB24 (full range) conversion.
80 * @param width The width of the original frame in pixel, with range [1, infinity)
81 * @param height The height of the original frame in pixel, with range [1, infinity)
82 * @param conversionFlag The conversion flag that has been applied during conversion
83 * @param testDuration Number of seconds for each test, with range (0, infinity)
84 * @param worker The worker object
85 * @return True, if succeeded
86 */
87 static bool testY_VU12FullRangeToRGB24FullRange(const unsigned int width, const unsigned int height, const CV::FrameConverter::ConversionFlag conversionFlag, const double testDuration, Worker& worker);
88
89 /**
90 * Tests the Y_VU12 to YUV24 conversion.
91 * @param width The width of the original frame in pixel, with range [1, infinity)
92 * @param height The height of the original frame in pixel, with range [1, infinity)
93 * @param conversionFlag The conversion flag that has been applied during conversion
94 * @param testDuration Number of seconds for each test, with range (0, infinity)
95 * @param worker The worker object
96 * @return True, if succeeded
97 */
98 static bool testY_VU12ToYUV24(const unsigned int width, const unsigned int height, const CV::FrameConverter::ConversionFlag conversionFlag, const double testDuration, Worker& worker);
99
100 /**
101 * Tests the Y_VU12 to YVU24 conversion.
102 * @param width The width of the original frame in pixel, with range [1, infinity)
103 * @param height The height of the original frame in pixel, with range [1, infinity)
104 * @param conversionFlag The conversion flag that has been applied during conversion
105 * @param testDuration Number of seconds for each test, with range (0, infinity)
106 * @param worker The worker object
107 * @return True, if succeeded
108 */
109 static bool testY_VU12ToYVU24(const unsigned int width, const unsigned int height, const CV::FrameConverter::ConversionFlag conversionFlag, const double testDuration, Worker& worker);
110
111 /**
112 * Tests the Y_VU12 to Y8 conversion.
113 * @param width The width of the original frame in pixel, with range [1, infinity)
114 * @param height The height of the original frame in pixel, with range [1, infinity)
115 * @param conversionFlag The conversion flag that has been applied during conversion
116 * @param testDuration Number of seconds for each test, with range (0, infinity)
117 * @param worker The worker object
118 * @return True, if succeeded
119 */
120 static bool testY_VU12ToY8(const unsigned int width, const unsigned int height, const CV::FrameConverter::ConversionFlag conversionFlag, const double testDuration, Worker& worker);
121
122 /**
123 * Tests the Y_VU12 (Limited Range) to Y_UV12 (Limited Range) conversion.
124 * @param width The width of the original frame in pixel, with range [1, infinity)
125 * @param height The height of the original frame in pixel, with range [1, infinity)
126 * @param conversionFlag The conversion flag that has been applied during conversion
127 * @param testDuration Number of seconds for each test, with range (0, infinity)
128 * @param worker The worker object
129 * @return True, if succeeded
130 */
131 static bool testY_VU12LimitedRangeToY_UV12LimitedRange(const unsigned int width, const unsigned int height, const CV::FrameConverter::ConversionFlag conversionFlag, const double testDuration, Worker& worker);
132
133 /**
134 * Tests the Y_VU12 (Full Range) to Y_UV12 (Full Range) conversion.
135 * @param width The width of the original frame in pixel, with range [1, infinity)
136 * @param height The height of the original frame in pixel, with range [1, infinity)
137 * @param conversionFlag The conversion flag that has been applied during conversion
138 * @param testDuration Number of seconds for each test, with range (0, infinity)
139 * @param worker The worker object
140 * @return True, if succeeded
141 */
142 static bool testY_VU12FullRangeToY_UV12FullRange(const unsigned int width, const unsigned int height, const CV::FrameConverter::ConversionFlag conversionFlag, const double testDuration, Worker& worker);
143
144 /**
145 * Tests the Y_VU12 (Limited Range) to Y_U_V12 (Limited Range) conversion.
146 * @param width The width of the original frame in pixel, with range [1, infinity)
147 * @param height The height of the original frame in pixel, with range [1, infinity)
148 * @param conversionFlag The conversion flag that has been applied during conversion
149 * @param testDuration Number of seconds for each test, with range (0, infinity)
150 * @param worker The worker object
151 * @return True, if succeeded
152 */
153 static bool testY_VU12LimitedRangeToY_U_V12LimitedRange(const unsigned int width, const unsigned int height, const CV::FrameConverter::ConversionFlag conversionFlag, const double testDuration, Worker& worker);
154
155 /**
156 * Tests the Y_VU12 (Full Range) to Y_U_V12 (Full Range) conversion.
157 * @param width The width of the original frame in pixel, with range [1, infinity)
158 * @param height The height of the original frame in pixel, with range [1, infinity)
159 * @param conversionFlag The conversion flag that has been applied during conversion
160 * @param testDuration Number of seconds for each test, with range (0, infinity)
161 * @param worker The worker object
162 * @return True, if succeeded
163 */
164 static bool testY_VU12FullRangeToY_U_V12FullRange(const unsigned int width, const unsigned int height, const CV::FrameConverter::ConversionFlag conversionFlag, const double testDuration, Worker& worker);
165
166 private:
167
168 /**
169 * Extracts one pixel from a Y_VU12 source frame.
170 * @param frame The frame from which the pixel will be extracted, must be valid
171 * @param x The horizontal pixel location within the frame, with range [0, frame.width() - 1]
172 * @param y The vertical pixel location within the frame, with range [0, frame.height() - 1]
173 * @param conversionFlag The conversion flag that will be applied, must be valid
174 * @return The vector holding the frame's color value at the specified location
175 */
176 static MatrixD pixelFunctionY_VU12ForYVU24(const Frame& frame, const unsigned int x, const unsigned int y, const CV::FrameConverter::ConversionFlag conversionFlag);
177
178 /**
179 * Extracts one pixel from a Y_UV12 source frame.
180 * @param frame The frame from which the pixel will be extracted, must be valid
181 * @param x The horizontal pixel location within the frame, with range [0, frame.width() - 1]
182 * @param y The vertical pixel location within the frame, with range [0, frame.height() - 1]
183 * @param conversionFlag The conversion flag that will be applied, must be valid
184 * @return The vector holding the frame's color value at the specified location
185 */
186 static MatrixD pixelFunctionY_UV12ForYUV24(const Frame& frame, const unsigned int x, const unsigned int y, const CV::FrameConverter::ConversionFlag conversionFlag);
187
188 /**
189 * Extracts one pixel from a Y_U_V12 source frame.
190 * @param frame The frame from which the pixel will be extracted, must be valid
191 * @param x The horizontal pixel location within the frame, with range [0, frame.width() - 1]
192 * @param y The vertical pixel location within the frame, with range [0, frame.height() - 1]
193 * @param conversionFlag The conversion flag that will be applied, must be valid
194 * @return The vector holding the frame's color value at the specified location
195 */
196 static MatrixD pixelFunctionY_U_V12ForYUV24(const Frame& frame, const unsigned int x, const unsigned int y, const CV::FrameConverter::ConversionFlag conversionFlag);
197};
198
199}
200
201}
202
203}
204
205#endif // META_OCEAN_TEST_TESTCV_TEST_FRAME_CONVERTER_Y_VU_12_H
ConversionFlag
Definition of individual conversion flags.
Definition FrameConverter.h:39
This class implements Ocean's image class.
Definition Frame.h:1808
This class implements a matrix with arbitrary size.
Definition Matrix.h:63
This class implements a Y_VU 12bit frame converter test.
Definition TestFrameConverterY_VU12.h:32
static MatrixD pixelFunctionY_VU12ForYVU24(const Frame &frame, const unsigned int x, const unsigned int y, const CV::FrameConverter::ConversionFlag conversionFlag)
Extracts one pixel from a Y_VU12 source frame.
static bool testY_VU12LimitedRangeToY_U_V12LimitedRange(const unsigned int width, const unsigned int height, const CV::FrameConverter::ConversionFlag conversionFlag, const double testDuration, Worker &worker)
Tests the Y_VU12 (Limited Range) to Y_U_V12 (Limited Range) conversion.
static bool testY_VU12FullRangeToBGRA32FullRange(const unsigned int width, const unsigned int height, const CV::FrameConverter::ConversionFlag conversionFlag, const double testDuration, Worker &worker)
Tests the Y_VU12 (full range) to BGR24 (full range) conversion.
static bool testY_VU12FullRangeToY_U_V12FullRange(const unsigned int width, const unsigned int height, const CV::FrameConverter::ConversionFlag conversionFlag, const double testDuration, Worker &worker)
Tests the Y_VU12 (Full Range) to Y_U_V12 (Full Range) conversion.
static bool testY_VU12ToY8(const unsigned int width, const unsigned int height, const CV::FrameConverter::ConversionFlag conversionFlag, const double testDuration, Worker &worker)
Tests the Y_VU12 to Y8 conversion.
static MatrixD pixelFunctionY_U_V12ForYUV24(const Frame &frame, const unsigned int x, const unsigned int y, const CV::FrameConverter::ConversionFlag conversionFlag)
Extracts one pixel from a Y_U_V12 source frame.
static bool test(const unsigned int width, const unsigned int height, const double testDuration, Worker &worker)
Tests all Y_VU12 frame conversion functions.
static bool testY_VU12LimitedRangeToY_UV12LimitedRange(const unsigned int width, const unsigned int height, const CV::FrameConverter::ConversionFlag conversionFlag, const double testDuration, Worker &worker)
Tests the Y_VU12 (Limited Range) to Y_UV12 (Limited Range) conversion.
static bool testY_VU12LimitedRangeToBGR24FullRange(const unsigned int width, const unsigned int height, const CV::FrameConverter::ConversionFlag conversionFlag, const double testDuration, Worker &worker)
Tests the Y_VU12 (limited range) to BGR24 (full range) conversion.
static bool testY_VU12FullRangeToRGB24FullRange(const unsigned int width, const unsigned int height, const CV::FrameConverter::ConversionFlag conversionFlag, const double testDuration, Worker &worker)
Tests the Y_VU12 (full range) to RGB24 (full range) conversion.
static bool testY_VU12LimitedRangeToRGB24FullRange(const unsigned int width, const unsigned int height, const CV::FrameConverter::ConversionFlag conversionFlag, const double testDuration, Worker &worker)
Tests the Y_VU12 (limited range) to RGB24 (full range) conversion.
static bool testY_VU12FullRangeToY_UV12FullRange(const unsigned int width, const unsigned int height, const CV::FrameConverter::ConversionFlag conversionFlag, const double testDuration, Worker &worker)
Tests the Y_VU12 (Full Range) to Y_UV12 (Full Range) conversion.
static bool testY_VU12ToYVU24(const unsigned int width, const unsigned int height, const CV::FrameConverter::ConversionFlag conversionFlag, const double testDuration, Worker &worker)
Tests the Y_VU12 to YVU24 conversion.
static bool testY_VU12ToYUV24(const unsigned int width, const unsigned int height, const CV::FrameConverter::ConversionFlag conversionFlag, const double testDuration, Worker &worker)
Tests the Y_VU12 to YUV24 conversion.
static MatrixD pixelFunctionY_UV12ForYUV24(const Frame &frame, const unsigned int x, const unsigned int y, const CV::FrameConverter::ConversionFlag conversionFlag)
Extracts one pixel from a Y_UV12 source frame.
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