Flair
Framework Libre Air
Camera.h
Go to the documentation of this file.
1 // %flair:license{
2 // This file is part of the Flair framework distributed under the
3 // CECILL-C License, Version 1.0.
4 // %flair:license}
13 #ifndef CAMERA_H
14 #define CAMERA_H
15 
16 #include <IODevice.h>
17 #include <stdint.h>
18 #include <cvimage.h>
19 
20 namespace flair {
21  namespace gui {
22  class GroupBox;
23  class Tab;
24  class TabWidget;
25  class Picture;
26  class GridLayout;
27  }
28 }
29 
30 namespace flair {
31 namespace sensor {
39 class Camera : public core::IODevice {
40 public:
52  Camera(std::string name, uint16_t width,
53  uint16_t height, core::cvimage::Type::Format format);
54 
64  Camera(const core::IODevice *parent, std::string name);
65 
70  ~Camera();
71 
77  void UseDefaultPlot(const core::cvimage *image);
78 
84  gui::GridLayout *GetLayout(void) const;
85 
91  gui::Tab *GetPlotTab(void) const;
92 
98  void SaveRawPictureToFile(std::string filename) const;
99 
105  void SavePictureToFile(std::string filename="") const;
106 
112  uint16_t Width(void) const;
113 
119  uint16_t Height(void) const;
120 
128  core::cvimage *Output(void);
129 
130  core::DataType const &GetOutputDataType() const;
131 
136  enum class LogFormat {
137  NONE,
138  RAW,
139  JPG,
140  };
141 
151  void SetLogFormat(LogFormat logFormat);
152 void ProcessUpdate(core::io_data* data);
153 protected:
159  gui::GroupBox *GetGroupBox(void) const;
160 
161  core::cvimage *output;
162 
163 private:
164  gui::Tab *main_tab, *sensor_tab, *plot_tab;
165  gui::TabWidget *tab;
166  gui::GroupBox *setup_groupbox;
167  gui::GridLayout *setup_layout;
168  LogFormat logFormat;
169 };
170 } // end namespace sensor
171 } // end namespace flair
172 #endif // CAMERA_H
Abstract class for data types.
Definition: io_data.h:94
Base class for Camera.
Definition: Camera.h:39
Definition: io_data.h:26
Abstract class for input/ouput system.
Definition: IODevice.h:45
namespace of the flair Framework
Definition: Ahrs.h:19
uint16_t Width(void) const
Width.
Class displaying a QGroupBox on the ground station.
Definition: GroupBox.h:27
Class displaying a QGridLayout on the ground station.
Definition: GridLayout.h:27
Abstract class for input/ouput system.
Format
Definition: cvimage.h:37
void SetLogFormat(LogFormat logFormat)
Set log format.
void UseDefaultPlot(const core::cvimage *image)
Use default plot.
LogFormat
log formats
Definition: Camera.h:136
~Camera()
Destructor.
Class defining an image of kind IplImage.
Class displaying a QTabWidget on the ground station.
Definition: TabWidget.h:29
core::cvimage * Output(void)
Output matrix.
gui::Tab * GetPlotTab(void) const
plot tab
Camera(std::string name, uint16_t width, uint16_t height, core::cvimage::Type::Format format)
Constructor.
void SaveRawPictureToFile(std::string filename) const
Save raw picture to file.
gui::GroupBox * GetGroupBox(void) const
get GroupBox
Class defining an image of kind IplImage.
Definition: cvimage.h:29
gui::GridLayout * GetLayout(void) const
get Layout
void SavePictureToFile(std::string filename="") const
Save picture to file.
Class displaying a QTab on the ground station.
Definition: Tab.h:29
uint16_t Height(void) const
Height.