Ocean
Loading...
Searching...
No Matches
TestFrameInterpolatorTrilinear.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_INTERPOLATOR_TRILINEAR_H
9#define META_OCEAN_TEST_TESTCV_TEST_FRAME_INTERPOLATOR_TRILINEAR_H
10
12
14
15#include "ocean/base/Worker.h"
16
17namespace Ocean
18{
19
20namespace Test
21{
22
23namespace TestCV
24{
25
26/**
27 * This class implements tests for the FrameInterpolatorTrilinear class.
28 * @ingroup testcv
29 */
30class OCEAN_TEST_CV_EXPORT TestFrameInterpolatorTrilinear
31{
32 public:
33
34 /**
35 * Starts all tests of the FrameInterpolatorTrilinear class.
36 * @param testDuration Number of seconds for each test, with range (0, infinity)
37 * @param worker Worker object to distribute computational load
38 * @param selector Test selector for filtering sub-tests; default runs all tests
39 * @return True, if succeeded
40 */
41 static bool test(const double testDuration, Worker& worker, const TestSelector& selector = TestSelector());
42
43 /**
44 * Tests resize() with various pixel formats and shrink/enlarge factors.
45 * @param testDuration Number of seconds for the test, with range (0, infinity)
46 * @param worker Worker object
47 * @return True, if succeeded
48 */
49 static bool testResizeFrame(const double testDuration, Worker& worker);
50
51 /**
52 * Tests that resizing to the same size returns a frame matching the input
53 * (target frame type matches expected).
54 * @param testDuration Number of seconds for the test, with range (0, infinity)
55 * @param worker Worker object
56 * @return True, if succeeded
57 */
58 static bool testResizeIdentitySize(const double testDuration, Worker& worker);
59
60 /**
61 * Tests that resizing a constant-colored frame produces a constant-colored
62 * output of approximately the same color.
63 * @param testDuration Number of seconds for the test, with range (0, infinity)
64 * @param worker Worker object
65 * @return True, if succeeded
66 */
67 static bool testResizeConstantFrame(const double testDuration, Worker& worker);
68
69 /**
70 * Tests interpolatePosition() returns sane (in-range) coordinates.
71 * @param testDuration Number of seconds for the test, with range (0, infinity)
72 * @return True, if succeeded
73 */
74 static bool testInterpolatePosition(const double testDuration);
75
76 /**
77 * Stress test: large random shrink/enlarge with random padding and many
78 * channel counts; verifies worker vs single-thread output equality.
79 * @param testDuration Number of seconds for the test, with range (0, infinity)
80 * @param worker Worker object
81 * @return True, if succeeded
82 */
83 static bool testWorkerEquivalenceStress(const double testDuration, Worker& worker);
84
85 /**
86 * Stress test: aggressive shrink (sub-pixel target sampling) and aggressive
87 * enlarge (super-pixel target sampling) keep target valid.
88 * @param testDuration Number of seconds for the test, with range (0, infinity)
89 * @param worker Worker object
90 * @return True, if succeeded
91 */
92 static bool testExtremeScaleStress(const double testDuration, Worker& worker);
93
94 /**
95 * Stress test: random homography on a random source frame produces a
96 * valid output frame and writes every pixel.
97 * @param testDuration Number of seconds for the test, with range (0, infinity)
98 * @param worker Worker object
99 * @return True, if succeeded
100 */
101 static bool testHomographyStress(const double testDuration, Worker& worker);
102
103 /**
104 * Stress test: random parameter combinations exercise the resize path
105 * across many pixel formats / sizes / paddings.
106 * @param testDuration Number of seconds for the test, with range (0, infinity)
107 * @param worker Worker object
108 * @return True, if succeeded
109 */
110 static bool testRandomParametersStress(const double testDuration, Worker& worker);
111};
112
113}
114
115}
116
117}
118
119#endif // META_OCEAN_TEST_TESTCV_TEST_FRAME_INTERPOLATOR_TRILINEAR_H
This class implements tests for the FrameInterpolatorTrilinear class.
Definition TestFrameInterpolatorTrilinear.h:31
static bool testHomographyStress(const double testDuration, Worker &worker)
Stress test: random homography on a random source frame produces a valid output frame and writes ever...
static bool test(const double testDuration, Worker &worker, const TestSelector &selector=TestSelector())
Starts all tests of the FrameInterpolatorTrilinear class.
static bool testResizeIdentitySize(const double testDuration, Worker &worker)
Tests that resizing to the same size returns a frame matching the input (target frame type matches ex...
static bool testInterpolatePosition(const double testDuration)
Tests interpolatePosition() returns sane (in-range) coordinates.
static bool testExtremeScaleStress(const double testDuration, Worker &worker)
Stress test: aggressive shrink (sub-pixel target sampling) and aggressive enlarge (super-pixel target...
static bool testRandomParametersStress(const double testDuration, Worker &worker)
Stress test: random parameter combinations exercise the resize path across many pixel formats / sizes...
static bool testResizeConstantFrame(const double testDuration, Worker &worker)
Tests that resizing a constant-colored frame produces a constant-colored output of approximately the ...
static bool testWorkerEquivalenceStress(const double testDuration, Worker &worker)
Stress test: large random shrink/enlarge with random padding and many channel counts; verifies worker...
static bool testResizeFrame(const double testDuration, Worker &worker)
Tests resize() with various pixel formats and shrink/enlarge factors.
This class implements a test selector that parses test function strings and determines which tests sh...
Definition TestSelector.h:51
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