Flyby SDK v0.3.0
Loading...
Searching...
No Matches
camera.h
Go to the documentation of this file.
1
8#pragma once
9
10#include <vector>
11
13#include <flyby/util/error.h>
14
15namespace flyby {
22 STANDARD = 0,
23 THERMAL
24 };
25
31 enum ZoomType {
32 MM = 0,
33 MULTIPLIER
34 };
35
41 enum FocusMode {
42 F_AUTOMATIC = 0,
43 F_MANUAL
44 };
45
52 P_MANUAL = 0,
53 P_AUTOMATIC,
54 P_APERTURE_PRIORITY,
55 P_SHUTTER_PRIORITY
56 };
57
62 enum IRPalette {
63 WHITEHOT = 0,
64 BLACKHOT,
65 LAVA,
66 IRONBOW,
67 ARCTIC,
68 GLOBOW,
69 RAINBOW,
70 RAINBOWHC,
71 HOTTEST,
72 ICEFIRE
73 };
74
80 class CameraInterface : public Component {
81 public:
82 virtual void take_picture() = 0;
83
84 virtual void start_video_recording() = 0;
85
86 virtual void stop_video_recording() = 0;
87
88 virtual void set_optical_zoom_level(int level) = 0;
89
90 virtual unsigned int get_optical_zoom_level() = 0;
91
92 virtual std::vector<unsigned int> get_optical_zoom_range() = 0;
93
94 virtual ZoomType get_optical_zoom_type() = 0;
95
96 virtual void set_digital_zoom_level(int level) = 0;
97
98 virtual unsigned int get_digital_zoom_level() = 0;
99
100 virtual std::vector<unsigned int> get_digital_zoom_range() = 0;
101
102 virtual FocusMode get_focus_mode() = 0;
103
104 virtual void set_focus_mode(FocusMode mode) = 0;
105
106 virtual unsigned int get_focus_position() = 0;
107
108 virtual std::vector<unsigned int> get_focus_position_range() = 0;
109
110 virtual void set_focus_position(unsigned int position) = 0;
111
112 virtual unsigned int get_iso_level() = 0;
113
114 virtual std::vector<unsigned int> get_iso_range() = 0;
115
116 virtual void set_iso_level(unsigned int level) = 0;
117
118 virtual unsigned int get_shutter_speed() = 0;
119
120 virtual std::vector<unsigned int> get_shutter_speed_range() = 0;
121
122 virtual void set_shutter_speed(unsigned int speed) = 0;
123
124 virtual ExposureProgramMode get_exposure_program_mode() = 0;
125
126 virtual void set_exposure_program_mode(ExposureProgramMode mode) = 0;
127
128 virtual float get_aperture() = 0;
129
130 virtual std::vector<float> get_aperture_range() = 0;
131
132 virtual void set_aperture(float aperture) = 0;
133
134 virtual std::string get_white_balance() = 0;
135
136 virtual std::vector<std::string> get_white_balance_options() = 0;
137
138 virtual void set_white_balance(std::string wb) = 0;
139
140 [[nodiscard]] virtual bool get_zoom() const = 0;
141
142 [[nodiscard]] virtual bool get_gimbal() const = 0;
143
144 [[nodiscard]] virtual bool get_picture() const = 0;
145
146 [[nodiscard]] virtual bool get_video() const = 0;
147
148 [[nodiscard]] virtual CameraType get_type() const = 0;
149
150 [[nodiscard]] virtual bool is_recording() const = 0;
151
152 private:
154 };
155
161 class IRCameraInterface : virtual public CameraInterface {
162 public:
163 virtual IRPalette get_color_palette() = 0;
164
165 virtual void set_color_palette(IRPalette palette) = 0;
166
167 virtual std::vector<IRPalette> get_color_palette_options() = 0;
168 };
169
178 class Camera : virtual public CameraInterface {
179 public:
183 Camera() : Camera(std::string()) {}
184
190 explicit Camera(const std::string& name) : CameraInterface(name), m_type { CameraType::STANDARD } {}
191
192 ~Camera() override = default;
193
199 void take_picture() override {
200 throw not_implemented_error();
201 }
202
208 void start_video_recording() override {
209 throw not_implemented_error();
210 }
211
217 void stop_video_recording() override {
218 throw not_implemented_error();
219 }
220
228 void set_optical_zoom_level(int level) override {
229 throw not_implemented_error();
230 }
231
239 unsigned int get_optical_zoom_level() override {
240 throw not_implemented_error();
241 }
242
250 std::vector<unsigned int> get_optical_zoom_range() override {
251 throw not_implemented_error();
252 }
253
262 throw not_implemented_error();
263 }
264
272 void set_digital_zoom_level(int level) override {
273 throw not_implemented_error();
274 }
275
283 unsigned int get_digital_zoom_level() override {
284 throw not_implemented_error();
285 }
286
294 std::vector<unsigned int> get_digital_zoom_range() override {
295 throw not_implemented_error();
296 }
297
305 unsigned int get_iso_level() override {
306 throw not_implemented_error();
307 }
308
316 std::vector<unsigned int> get_iso_range() override {
317 throw not_implemented_error();
318 }
319
327 void set_iso_level(unsigned int level) override {
328 throw not_implemented_error();
329 }
330
338 unsigned int get_shutter_speed() override {
339 throw not_implemented_error();
340 }
341
349 std::vector<unsigned int> get_shutter_speed_range() override {
350 throw not_implemented_error();
351 }
352
360 void set_shutter_speed(unsigned int speed) override {
361 throw not_implemented_error();
362 }
363
374
385
393 float get_aperture() override {
394 throw not_implemented_error();
395 }
396
404 std::vector<float> get_aperture_range() override {
405 throw not_implemented_error();
406 }
407
415 void set_aperture(float aperture) override {
416 throw not_implemented_error();
417 }
418
426 std::string get_white_balance() override {
427 throw not_implemented_error();
428 }
429
437 std::vector<std::string> get_white_balance_options() override {
438 throw not_implemented_error();
439 }
440
448 void set_white_balance(std::string wb) override {
449 throw not_implemented_error();
450 }
451
460 throw not_implemented_error();
461 }
462
470 void set_focus_mode(FocusMode mode) override {
471 throw not_implemented_error();
472 }
473
481 unsigned int get_focus_position() override {
482 throw not_implemented_error();
483 }
484
492 std::vector<unsigned int> get_focus_position_range() override {
493 throw not_implemented_error();
494 }
495
503 void set_focus_position(unsigned int position) override {
504 throw not_implemented_error();
505 }
506
512 [[nodiscard]] bool get_zoom() const final{
513 return m_zoom;
514 }
515
521 [[nodiscard]] bool get_gimbal() const final {
522 return m_gimbal;
523 }
524
530 [[nodiscard]] bool get_picture() const final {
531 return m_picture;
532 }
533
539 [[nodiscard]] bool get_video() const final {
540 return m_video;
541 }
542
548 [[nodiscard]] CameraType get_type() const final {
549 return m_type;
550 }
551
557 [[nodiscard]] bool is_recording() const final {
558 return m_is_recording;
559 }
560
561 protected:
562
567
571 bool m_picture { false };
572
576 bool m_video { false };
577
581 bool m_zoom { false };
582
586 bool m_gimbal { false };
587
591 bool m_is_recording { false };
592 };
593
602 class IRCamera : virtual public Camera, virtual public IRCameraInterface {
603 public:
607 IRCamera() : IRCamera(std::string()) {}
608
612 explicit IRCamera(const std::string& name) : Camera(name) {
613 m_type = CameraType::THERMAL;
614 }
615
624 throw not_implemented_error();
625 }
626
634 void set_color_palette(IRPalette palette) override {
635 throw not_implemented_error();
636 }
637
645 std::vector<IRPalette> get_color_palette_options() override {
646 throw not_implemented_error();
647 }
648 };
649}
CameraType
The type of camera, such as standard EO or thermal.
Definition camera.h:21
IRPalette
The different possible thermal palettes.
Definition camera.h:62
ExposureProgramMode
The exposure program mode, such as manual or aperture priority.
Definition camera.h:51
FocusMode
The focus mode of the camera.
Definition camera.h:41
ZoomType
The zoom format for the camera, such as mm (24mm) or multiplier (3x)
Definition camera.h:31
The base camera class.
Definition camera.h:178
void set_focus_mode(FocusMode mode) override
Sets the focus mode.
Definition camera.h:470
std::vector< float > get_aperture_range() override
Gets the possible aperture values.
Definition camera.h:404
void set_exposure_program_mode(ExposureProgramMode mode) override
Sets the exposure program mode.
Definition camera.h:382
std::vector< unsigned int > get_focus_position_range() override
Gets the focus position range.
Definition camera.h:492
std::vector< unsigned int > get_iso_range() override
Gets the ISO range on the camera.
Definition camera.h:316
std::vector< unsigned int > get_digital_zoom_range() override
Gets the digital zoom range on the camera.
Definition camera.h:294
unsigned int get_shutter_speed() override
Gets the shutter speed on the camera.
Definition camera.h:338
void set_white_balance(std::string wb) override
Sets the white balance.
Definition camera.h:448
bool m_gimbal
Is the camera mounted on a controllable gimbal.
Definition camera.h:586
Camera()
The default constructor.
Definition camera.h:183
unsigned int get_focus_position() override
Gets the focus position.
Definition camera.h:481
unsigned int get_iso_level() override
Gets the ISO level on the camera.
Definition camera.h:305
CameraType get_type() const final
Get the type of camera.
Definition camera.h:548
void set_shutter_speed(unsigned int speed) override
Sets the shutter speed on the camera.
Definition camera.h:360
void set_focus_position(unsigned int position) override
Sets the focus position.
Definition camera.h:503
float get_aperture() override
Gets the aperture.
Definition camera.h:393
std::string get_white_balance() override
Gets the white balance.
Definition camera.h:426
unsigned int get_optical_zoom_level() override
Gets the optical zoom on the camera.
Definition camera.h:239
void set_digital_zoom_level(int level) override
Sets the digital zoom on the camera.
Definition camera.h:272
bool get_zoom() const final
Does the camera support zoom.
Definition camera.h:512
CameraType m_type
The camera type.
Definition camera.h:566
ZoomType get_optical_zoom_type() override
Gets the optical zoom type on the camera.
Definition camera.h:261
unsigned int get_digital_zoom_level() override
Gets the digital zoom on the camera.
Definition camera.h:283
bool m_video
Can the camera take videos.
Definition camera.h:576
ExposureProgramMode get_exposure_program_mode() override
Gets the exposure program mode.
Definition camera.h:371
void take_picture() override
Take a picture on the camera.
Definition camera.h:199
bool get_picture() const final
Does the camera support pictures.
Definition camera.h:530
bool m_zoom
Can the camera zoom.
Definition camera.h:581
void set_iso_level(unsigned int level) override
Sets the ISO level on the camera.
Definition camera.h:327
bool m_picture
Can the camera take pictures.
Definition camera.h:571
std::vector< std::string > get_white_balance_options() override
Gets the white balance options.
Definition camera.h:437
Camera(const std::string &name)
The name constructor.
Definition camera.h:190
bool get_gimbal() const final
Is the camera mounted on a gimbal.
Definition camera.h:521
void set_aperture(float aperture) override
Sets the aperture.
Definition camera.h:415
void set_optical_zoom_level(int level) override
Sets the optical zoom on the camera.
Definition camera.h:228
bool is_recording() const final
Get the recording status of the camera.
Definition camera.h:557
std::vector< unsigned int > get_optical_zoom_range() override
Gets the optical zoom range on the camera.
Definition camera.h:250
bool get_video() const final
Does the camera support videos.
Definition camera.h:539
bool m_is_recording
Is the camera currently recording.
Definition camera.h:591
void stop_video_recording() override
Stop recording a video on the camera.
Definition camera.h:217
FocusMode get_focus_mode() override
Gets the focus mode.
Definition camera.h:459
void start_video_recording() override
Start recording a video on the camera.
Definition camera.h:208
std::vector< unsigned int > get_shutter_speed_range() override
Gets the shutter speed range on the camera.
Definition camera.h:349
Component()=default
The default constructor.
The base infrared/thermal camera class.
Definition camera.h:602
IRPalette get_color_palette() override
Gets the active color palette of the IR camera.
Definition camera.h:623
IRCamera()
Default constructor.
Definition camera.h:607
std::vector< IRPalette > get_color_palette_options() override
Gets the active color palette of the IR camera.
Definition camera.h:645
IRCamera(const std::string &name)
Name constructor.
Definition camera.h:612
void set_color_palette(IRPalette palette) override
Sets the active color palette of the IR camera.
Definition camera.h:634
An error representing a function that is not implemented.
Definition error.h:17