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