Ocean
StereoImageProviderInterface.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_MEDIA_STEREO_IMAGE_PROVIDER_INTERFACE_H
9 #define META_OCEAN_MEDIA_STEREO_IMAGE_PROVIDER_INTERFACE_H
10 
11 #include "ocean/media/Media.h"
12 
13 #include "ocean/base/Frame.h"
14 #include "ocean/base/Timestamp.h"
15 
18 
19 namespace Ocean
20 {
21 
22 namespace Media
23 {
24 
25 /**
26  * This class is the abstract base class for all stereo image providers.
27  * The provider allows access to stereo images, their corresponding camera calibration data, and optional device poses.
28  * @ingroup media
29  */
31 {
32  public:
33 
34  /**
35  * Destructs this interface.
36  */
37  virtual inline ~StereoImageProviderInterface();
38 
39  /**
40  * Returns the next stereo images from the provider, further optional transformations between device and world, and between cameras and device will be provided.
41  * @param fisheyeCameraA The resulting camera profile of the first stereo image, will be valid
42  * @param fisheyeCameraB The resulting camera profile of the second stereo image, will be valid
43  * @param imageA The resulting first stereo image, will be valid
44  * @param imageB The resulting second stereo image, will be valid
45  * @param world_T_device Optional resulting transformation transforming device to world, if known, otherwise invalid
46  * @param device_T_cameraA Optional resulting transformation transforming the first camera to device, if known, otherwise invalid
47  * @param device_T_cameraB Optional resulting transformation transforming the second camera to device, if known, otherwise invalid
48  * @param world_T_leftHandJoints Optional resulting transformations to map from the left hand joints to world coordinates, if known, otherwise invalid
49  * @param world_T_rightHandJoints Optional resulting transformations to map from the right hand joints to world coordinates, if known, otherwise invalid
50  * @param abort Optional abort statement allowing to abort the pending request at any time; set the value True to abort the request
51  * @return True, if the next stereo images could be provided; False, if no further stereo images exist
52  * @see hasDeviceTransformations(), hasCameraTransformations().
53  */
54  virtual bool nextStereoImages(FisheyeCamera& fisheyeCameraA, FisheyeCamera& fisheyeCameraB, Frame& imageA, Frame& imageB, HomogenousMatrixD4* world_T_device = nullptr, HomogenousMatrixD4* device_T_cameraA = nullptr, HomogenousMatrixD4* device_T_cameraB = nullptr, HomogenousMatricesD4* world_T_leftHandJoints = nullptr, HomogenousMatricesD4* world_T_rightHandJoints = nullptr, bool* abort = nullptr) = 0;
55 
56  /**
57  * Restarts with the first pair of stereo images.
58  * @return True, if succeeded
59  */
60  virtual bool restart() = 0;
61 
62  /**
63  * Returns whether the provider has access to the transformations between device and world (world_T_device).
64  * @return True, if so
65  */
66  virtual bool hasDeviceTransformations() const = 0;
67 
68  /**
69  * Returns whether the provider has access to the transformations between camerans and device (device_T_cameraA and device_T_cameraB).
70  * @return True, if so
71  */
72  virtual bool hasCameraTransformations() const = 0;
73 
74  /**
75  * Returns whether this provider can provide valid stereo images (e.g., whether the underlying resources are initialized and whether the source exists).
76  * @return True, if so
77  */
78  virtual bool isValid() const = 0;
79 
80  /**
81  * Releases all owned resources like e.g., the image sequence objects.
82  */
83  virtual void release() = 0;
84 
85  protected:
86 
87  /**
88  * Protected default constructor.
89  */
91 };
92 
94 {
95  // nothing to do here
96 }
97 
99 {
100  // nothing to do here
101 }
102 
103 }
104 
105 }
106 
107 #endif // META_OCEAN_MEDIA_STEREO_IMAGE_PROVIDER_INTERFACE_H
This class implements Ocean's image class.
Definition: Frame.h:1792
This class is the abstract base class for all stereo image providers.
Definition: StereoImageProviderInterface.h:31
StereoImageProviderInterface()
Protected default constructor.
Definition: StereoImageProviderInterface.h:93
virtual bool nextStereoImages(FisheyeCamera &fisheyeCameraA, FisheyeCamera &fisheyeCameraB, Frame &imageA, Frame &imageB, HomogenousMatrixD4 *world_T_device=nullptr, HomogenousMatrixD4 *device_T_cameraA=nullptr, HomogenousMatrixD4 *device_T_cameraB=nullptr, HomogenousMatricesD4 *world_T_leftHandJoints=nullptr, HomogenousMatricesD4 *world_T_rightHandJoints=nullptr, bool *abort=nullptr)=0
Returns the next stereo images from the provider, further optional transformations between device and...
virtual bool restart()=0
Restarts with the first pair of stereo images.
virtual ~StereoImageProviderInterface()
Destructs this interface.
Definition: StereoImageProviderInterface.h:98
virtual bool hasCameraTransformations() const =0
Returns whether the provider has access to the transformations between camerans and device (device_T_...
virtual bool isValid() const =0
Returns whether this provider can provide valid stereo images (e.g., whether the underlying resources...
virtual void release()=0
Releases all owned resources like e.g., the image sequence objects.
virtual bool hasDeviceTransformations() const =0
Returns whether the provider has access to the transformations between device and world (world_T_devi...
std::vector< HomogenousMatrixD4 > HomogenousMatricesD4
Definition of a vector holding HomogenousMatrixD4 objects.
Definition: HomogenousMatrix4.h:79
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15