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