Ocean
Loading...
Searching...
No Matches
testlibyuv/TestFrameConverterY_UV12.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_TESTLIBYUV_TEST_FRAME_CONVERTER_Y_UV_12_H
9#define META_OCEAN_TEST_TESTCV_TESTLIBYUV_TEST_FRAME_CONVERTER_Y_UV_12_H
10
12
14
15namespace Ocean
16{
17
18namespace Test
19{
20
21namespace TestCV
22{
23
24namespace TestLibyuv
25{
26
27/**
28 * This class tests/benchmarks the performance of the frame converter function of libyuv for Y_UV12 frames.
29 * @ingroup testcvlibyuv
30 */
31class OCEAN_TEST_CV_LIBYUV_EXPORT TestFrameConverterY_UV12
32{
33 public:
34
35 /**
36 * Benchmarks the performance of libyuv agains Ocean for frame converter functions.
37 * @param testDuration Number of seconds for each test, with range (0, infinity)
38 * @param skipValidation True, to skip the validation
39 */
40 static void test(const double testDuration, const bool skipValidation = false);
41
42 /**
43 * Benchmarks the conversion from Y_UV12 frames to BGR24 frames.
44 * @param testDuration Number of seconds for each test, with range (0, infinity)
45 * @param skipValidation True, to skip the validation
46 * @return True, if succeeded
47 */
48 static bool testConvertY_UV12ToBGR24(const double testDuration, const bool skipValidation = false);
49
50 protected:
51
52 /**
53 * Extracts one pixel from a Y_UV12 source frame.
54 * @param frame The frame from which the pixel will be extracted, must be valid
55 * @param x The horizontal pixel location within the frame, with range [0, frame.width() - 1]
56 * @param y The vertical pixel location within the frame, with range [0, frame.height() - 1]
57 * @param conversionFlag The conversion flag that will be applied, must be valid
58 * @return The vector holding the frame's color value at the specified location
59 */
60 static MatrixD pixelFunctionY_UV12ForYUV24(const Frame& frame, const unsigned int x, const unsigned int y, const CV::FrameConverter::ConversionFlag conversionFlag);
61};
62
63}
64
65}
66
67}
68
69}
70
71#endif // META_OCEAN_TEST_TESTCV_TESTLIBYUV_TEST_FRAME_CONVERTER_Y_UV_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 tests/benchmarks the performance of the frame converter function of libyuv for Y_UV12 fram...
Definition testlibyuv/TestFrameConverterY_UV12.h:32
static bool testConvertY_UV12ToBGR24(const double testDuration, const bool skipValidation=false)
Benchmarks the conversion from Y_UV12 frames to BGR24 frames.
static void test(const double testDuration, const bool skipValidation=false)
Benchmarks the performance of libyuv agains Ocean for frame converter functions.
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.
The namespace covering the entire Ocean framework.
Definition Accessor.h:15