Ocean
Loading...
Searching...
No Matches
TestAnyCamera.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_TESTMATH_TEST_ANY_CAMERA_H
9#define META_OCEAN_TEST_TESTMATH_TEST_ANY_CAMERA_H
10
12
14
16
18
19namespace Ocean
20{
21
22namespace Test
23{
24
25namespace TestMath
26{
27
28/**
29 * This class implements tests for the AnyCamera class.
30 * @ingroup testmath
31 */
32class OCEAN_TEST_MATH_EXPORT TestAnyCamera
33{
34 protected:
35
36 /**
37 * Definition of individual verification results.
38 */
39 enum VerificationResult : uint32_t
40 {
41 /// The verification failed.
42 VR_FAILED = 0u,
43 /// The verification did not meet precision constraints.
45 /// The verification succeeded.
47 };
48
49 public:
50
51 /**
52 * Tests all camera functions.
53 * @param testDuration Number of seconds for each test, with range (0, infinity)
54 * @param selector The test selector
55 * @return True, if succeeded
56 */
57 static bool test(const double testDuration, const TestSelector& selector);
58
59 /**
60 * Tests the constructors.
61 * @param testDuration Number of seconds for each test, with range (0, infinity)
62 * @return True, if succeeded
63 * @tparam T The scalar data type to use
64 */
65 template <typename T>
66 static bool testConstructor(const double testDuration);
67
68 /**
69 * Tests the principal point.
70 * @param testDuration Number of seconds for each test, with range (0, infinity)
71 * @return True, if succeeded
72 * @tparam T The scalar data type to use
73 */
74 template <typename T>
75 static bool testPrincipalPoint(const double testDuration);
76
77 protected:
78
79 /**
80 * Verifies an AnyCamera object.
81 * @param anyCamera The object to be verified, must be valid
82 * @param optionalRandomGenerator Optional explicit random generator object to be used, nullptr to use a default object
83 * @return The verification result
84 * @tparam T The scalar data type of the camera object
85 */
86 template <typename T>
87 static VerificationResult verifyAnyCamera(const AnyCameraT<T>& anyCamera, RandomGenerator* optionalRandomGenerator = nullptr);
88};
89
90}
91
92}
93
94}
95
96#endif // META_OCEAN_TEST_TESTMATH_TEST_ANY_CAMERA_H
This class implements the abstract base class for all AnyCamera objects.
Definition AnyCamera.h:131
This class implements a generator for random numbers.
Definition RandomGenerator.h:42
This class implements tests for the AnyCamera class.
Definition TestAnyCamera.h:33
static bool testConstructor(const double testDuration)
Tests the constructors.
static bool testPrincipalPoint(const double testDuration)
Tests the principal point.
VerificationResult
Definition of individual verification results.
Definition TestAnyCamera.h:40
@ VR_LOW_PRECISION
The verification did not meet precision constraints.
Definition TestAnyCamera.h:44
@ VR_SUCCEEDED
The verification succeeded.
Definition TestAnyCamera.h:46
static VerificationResult verifyAnyCamera(const AnyCameraT< T > &anyCamera, RandomGenerator *optionalRandomGenerator=nullptr)
Verifies an AnyCamera object.
static bool test(const double testDuration, const TestSelector &selector)
Tests all camera functions.
This class implements a test selector that parses test function strings and determines which tests sh...
Definition TestSelector.h:51
The namespace covering the entire Ocean framework.
Definition Accessor.h:15