Ocean
TestAdvancedFrameChannels.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_TESTADVANCED_TEST_ADVANCED_FRAME_CHANNELS_H
9 #define META_OCEAN_TEST_TESTCV_TESTADVANCED_TEST_ADVANCED_FRAME_CHANNELS_H
10 
12 
13 #include "ocean/base/Worker.h"
14 
15 namespace Ocean
16 {
17 
18 namespace Test
19 {
20 
21 namespace TestCV
22 {
23 
24 namespace TestAdvanced
25 {
26 
27 /**
28  * This class implements tests for AdvancedFrameChannels.
29  * @ingroup testcvadvanced
30  */
31 class OCEAN_TEST_CV_ADVANCED_EXPORT TestAdvancedFrameChannels
32 {
33  public:
34 
35  /**
36  * Invokes all tests for AdvancedFrameChannels.
37  * @param width The width of the test frame in pixel, with range [5, infinity)
38  * @param height The height of the test frame in pixel, with range [5, infinity)
39  * @param testDuration The 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 frame separation to one channel function.
47  * @param width The width of the test frame in pixel, with range [1, infinity)
48  * @param height The height of the test frame in pixel, with range [1, infinity)
49  * @param testDuration The number of seconds for each test, with range (0, infinity)
50  * @return True, if succeeded
51  */
52  static bool testSeparateTo1Channel(const unsigned int width, const unsigned int height, const double testDuration);
53 
54  /**
55  * Tests frame zip channels function.
56  * @param width The width of the test frame in pixel, with range [1, infinity)
57  * @param height The height of the test frame in pixel, with range [1, infinity)
58  * @param testDuration The number of seconds for each test, with range (0, infinity)
59  * @return True, if succeeded
60  */
61  static bool testZipChannels(const unsigned int width, const unsigned int height, const double testDuration);
62 
63  protected:
64 
65  /**
66  * Tests frame separation to one channel function.
67  * @param width The width of the test frame in pixel, with range [1, infinity)
68  * @param height The height of the test frame in pixel, with range [1, infinity)
69  * @param channels The number of channels the test frame has, with range [2, infinity)
70  * @param testDuration The number of seconds for each test, with range (0, infinity)
71  * @return True, if succeeded
72  * @tparam TSource The data type of the source elements
73  * @tparam TTarget The data type of the target elements
74  * @tparam tSourceFactor The multiplication factor each source element will be multiplied with, with range (-infinity, infinity)/{0}
75  * @tparam tTargetFactor The multiplication factor each target element will be multiplied with, with range (-infinity, infinity)/{0}
76  */
77  template <typename TSource, typename TTarget>
78  static bool testSeparateTo1Channel(const unsigned int width, const unsigned int height, const unsigned int channels, const double testDuration);
79 
80  /**
81  * Tests zip channels function.
82  * @param width The width of the test frame in pixel, with range [1, infinity)
83  * @param height The height of the test frame in pixel, with range [1, infinity)
84  * @param channels The number of channels the test frame has, with range [2, infinity)
85  * @param testDuration The number of seconds for each test, with range (0, infinity)
86  * @return True, if succeeded
87  * @tparam TSource The data type of the source elements
88  * @tparam TTarget The data type of the target elements
89  */
90  template <typename TSource, typename TTarget>
91  static bool testZipChannels(const unsigned int width, const unsigned int height, const unsigned int channels, const double testDuration);
92 };
93 
94 }
95 
96 }
97 
98 }
99 
100 }
101 
102 #endif // META_OCEAN_TEST_TESTCV_TESTADVANCED_TEST_ADVANCED_FRAME_CHANNELS_H
This class implements tests for AdvancedFrameChannels.
Definition: TestAdvancedFrameChannels.h:32
static bool testZipChannels(const unsigned int width, const unsigned int height, const unsigned int channels, const double testDuration)
Tests zip channels function.
static bool testSeparateTo1Channel(const unsigned int width, const unsigned int height, const double testDuration)
Tests frame separation to one channel function.
static bool testZipChannels(const unsigned int width, const unsigned int height, const double testDuration)
Tests frame zip channels function.
static bool testSeparateTo1Channel(const unsigned int width, const unsigned int height, const unsigned int channels, const double testDuration)
Tests frame separation to one channel function.
static bool test(const unsigned int width, const unsigned int height, const double testDuration, Worker &worker)
Invokes all tests for AdvancedFrameChannels.
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