Time-of-Flight-SDK
camera.h
1 /*
2  * BSD 3-Clause License
3  *
4  * Copyright (c) 2019, Analog Devices, Inc.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions are met:
9  *
10  * 1. Redistributions of source code must retain the above copyright notice, this
11  * list of conditions and the following disclaimer.
12  *
13  * 2. Redistributions in binary form must reproduce the above copyright notice,
14  * this list of conditions and the following disclaimer in the documentation
15  * and/or other materials provided with the distribution.
16  *
17  * 3. Neither the name of the copyright holder nor the names of its
18  * contributors may be used to endorse or promote products derived from
19  * this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 #ifndef CAMERA_H
33 #define CAMERA_H
34 
35 #include "camera_definitions.h"
36 #include "sdk_exports.h"
37 #include "status_definitions.h"
38 
39 #include <functional>
40 #include <string>
41 #include <vector>
42 
43 namespace aditof {
44 
45 class Frame;
46 class DepthSensorInterface;
47 class StorageInterface;
48 class TemperatureSensorInterface;
49 
54 class SDK_API Camera {
55  public:
59  virtual ~Camera() = default;
60 
66  virtual Status initialize() = 0;
67 
73  virtual Status start() = 0;
74 
79  virtual Status stop() = 0;
80 
89  virtual Status setMode(const std::string &mode,
90  const std::string &modeFilename = {}) = 0;
91 
97  virtual Status
98  getAvailableModes(std::vector<std::string> &availableModes) const = 0;
99 
105  virtual Status setFrameType(const std::string &frameType) = 0;
106 
112  virtual Status getAvailableFrameTypes(
113  std::vector<std::string> &availableFrameTypes) const = 0;
114 
125  virtual Status requestFrame(Frame *frame,
126  FrameUpdateCallback cb = nullptr) = 0;
127 
133  virtual Status getDetails(CameraDetails &details) const = 0;
134 
140  virtual Status
141  getAvailableControls(std::vector<std::string> &controls) const = 0;
142 
149  virtual Status setControl(const std::string &control,
150  const std::string &value) = 0;
151 
158  virtual Status getControl(const std::string &control,
159  std::string &value) const = 0;
160 
167  virtual Status getImageSensors(
168  std::vector<std::shared_ptr<DepthSensorInterface>> &sensors) = 0;
169 
176  virtual Status
177  getEeproms(std::vector<std::shared_ptr<StorageInterface>> &eeproms) = 0;
178 
185  virtual Status getTemperatureSensors(
186  std::vector<std::shared_ptr<TemperatureSensorInterface>> &sensors) = 0;
187 };
188 
189 } // namespace aditof
190 
191 #endif // CAMERA_H
Namespace aditof.
Definition: frame.h:43
Manipulates the underlying camera system.
Definition: camera.h:54
Frame of a camera.
Definition: frame.h:49
std::function< void(Status, Frame *)> FrameUpdateCallback
Callback for frame updates.
Status
Status of any operation that the TOF sdk performs.
Describes the properties of a camera.