source: flair-src/trunk/lib/FlairSensorActuator/src/V4LCamera.h@ 270

Last change on this file since 270 was 165, checked in by Sanahuja Guillaume, 8 years ago

modifs

File size: 2.8 KB
Line 
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}
5/*!
6 * \file V4LCamera.h
7 * \brief Base class for V4l camera
8 * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
9 * \date 2014/07/17
10 * \version 4.0
11 */
12
13#ifndef V4LCamera_H
14#define V4LCamera_H
15
16#include <Thread.h>
17#include "Camera.h"
18#include <highgui.h>
19
20namespace flair {
21namespace core {
22class cvimage;
23}
24namespace gui {
25class DoubleSpinBox;
26class CheckBox;
27class Label;
28}
29}
30
31namespace flair {
32namespace sensor {
33/*! \class V4LCamera
34*
35* \brief Base class for V4l camera
36*/
37class V4LCamera : public core::Thread, public Camera {
38public:
39 /*!
40 * \brief Constructor
41 *
42 * Construct a Camera.
43 * It will be child of the FrameworkManager.
44 *
45 * \param name name
46 * \param camera_index camera index
47 * \param width width
48 * \param height height
49 * \param format image format
50 * \param priority priority of the Thread
51 */
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
56 /*!
57 * \brief Destructor
58 *
59 */
60 ~V4LCamera();
61
62 //hack for ps3eye in hds uav
63 //TODO: put this in ps3eye class
64 bool HasProblems(void);
65
66protected:
67 /*!
68 * \brief Set Gain
69 *
70 * \param value value between 0 and 1
71 */
72 virtual void SetGain(float value);
73
74 /*!
75 * \brief Set Auto Gain
76 *
77 * \param value value
78 */
79 virtual void SetAutoGain(bool value);
80
81 /*!
82 * \brief Set Exposure
83 *
84 * \param value value between 0 and 1
85 */
86 virtual void SetExposure(float value);
87
88 /*!
89 * \brief Set Auto Exposure
90 *
91 * \param value value
92 */
93 virtual void SetAutoExposure(bool value);
94
95 /*!
96 * \brief Set Brightness
97 *
98 * \param value value between 0 and 1
99 */
100 virtual void SetBrightness(float value);
101
102 /*!
103 * \brief Set Saturation
104 *
105 * \param value value between 0 and 1
106 */
107 virtual void SetSaturation(float value);
108
109 /*!
110 * \brief Set Hue
111 *
112 * \param value value between 0 and 1
113 */
114 virtual void SetHue(float value);
115
116 /*!
117 * \brief Set Contrast
118 *
119 * \param value value between 0 and 1
120 */
121 virtual void SetContrast(float value);
122
123private:
124 /*!
125 * \brief Update using provided datas
126 *
127 * Reimplemented from IODevice.
128 *
129 * \param data data from the parent to process
130 */
131 void UpdateFrom(const core::io_data *data){};
132
133 /*!
134 * \brief Run function
135 *
136 * Reimplemented from Thread.
137 *
138 */
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
Note: See TracBrowser for help on using the repository browser.