Flair
Framework Libre Air
V4LCamera.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 V4LCamera_H
14 #define V4LCamera_H
15 
16 #include <Thread.h>
17 #include "Camera.h"
18 #include <highgui.h>
19 
20 namespace flair {
21 namespace core {
22 class cvimage;
23 }
24 namespace gui {
25 class DoubleSpinBox;
26 class CheckBox;
27 class Label;
28 }
29 }
30 
31 namespace flair {
32 namespace sensor {
37 class V4LCamera : public core::Thread, public Camera {
38 public:
52  V4LCamera(std::string name,
53  uint8_t camera_index, uint16_t width, uint16_t height,
54  core::cvimage::Type::Format format, uint8_t priority);
55 
60  ~V4LCamera();
61 
62  //hack for ps3eye in hds uav
63  //TODO: put this in ps3eye class
64  bool HasProblems(void);
65 
66 protected:
72  virtual void SetGain(float value);
73 
79  virtual void SetAutoGain(bool value);
80 
86  virtual void SetExposure(float value);
87 
93  virtual void SetAutoExposure(bool value);
94 
100  virtual void SetBrightness(float value);
101 
107  virtual void SetSaturation(float value);
108 
114  virtual void SetHue(float value);
115 
121  virtual void SetContrast(float value);
122 
123 private:
131  void UpdateFrom(const core::io_data *data){};
132 
139  void Run(void);
140 
141  CvCapture *capture;
142 
143  gui::Tab *sensor_tab;
144  gui::DoubleSpinBox *bright, *exposure, *gain, *contrast, *hue, *sharpness,*sat;
145  gui::CheckBox *autogain, *awb, *autoexposure;
146  gui::Label *fps;
147  bool hasProblems;
148 };
149 } // end namespace sensor
150 } // end namespace flair
151 #endif // V4LCamera_H
Abstract class for data types.
Definition: io_data.h:94
Base class for Camera.
Definition: Camera.h:39
virtual void SetBrightness(float value)
Set Brightness.
Class displaying a QCheckBox on the ground station.
Definition: CheckBox.h:28
namespace of the flair Framework
Definition: Ahrs.h:19
virtual void SetHue(float value)
Set Hue.
virtual void SetContrast(float value)
Set Contrast.
virtual void SetGain(float value)
Set Gain.
~V4LCamera()
Destructor.
Format
Definition: cvimage.h:37
virtual void SetSaturation(float value)
Set Saturation.
Class displaying a QLabel on the ground station.
Definition: Label.h:28
V4LCamera(std::string name, uint8_t camera_index, uint16_t width, uint16_t height, core::cvimage::Type::Format format, uint8_t priority)
Constructor.
Abstract class for a thread.
virtual void SetAutoGain(bool value)
Set Auto Gain.
Abstract class for a thread.
Definition: Thread.h:38
Class displaying a QDoubleSpinBox on the ground station.
Definition: DoubleSpinBox.h:28
Base class for Camera.
virtual void SetAutoExposure(bool value)
Set Auto Exposure.
virtual void SetExposure(float value)
Set Exposure.
Class displaying a QTab on the ground station.
Definition: Tab.h:29
Base class for V4l camera.
Definition: V4LCamera.h:37