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

Last change on this file since 137 was 137, checked in by Sanahuja Guillaume, 7 years ago

singleton manager

File size: 2.6 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
62protected:
63 /*!
64 * \brief Set Gain
65 *
66 * \param value value between 0 and 1
67 */
68 virtual void SetGain(float value);
69
70 /*!
71 * \brief Set Auto Gain
72 *
73 * \param value value
74 */
75 virtual void SetAutoGain(bool value);
76
77 /*!
78 * \brief Set Exposure
79 *
80 * \param value value between 0 and 1
81 */
82 virtual void SetExposure(float value);
83
84 /*!
85 * \brief Set Auto Exposure
86 *
87 * \param value value
88 */
89 virtual void SetAutoExposure(bool value);
90
91 /*!
92 * \brief Set Brightness
93 *
94 * \param value value between 0 and 1
95 */
96 virtual void SetBrightness(float value);
97
98 /*!
99 * \brief Set Saturation
100 *
101 * \param value value between 0 and 1
102 */
103 virtual void SetSaturation(float value);
104
105 /*!
106 * \brief Set Hue
107 *
108 * \param value value between 0 and 1
109 */
110 virtual void SetHue(float value);
111
112 /*!
113 * \brief Set Contrast
114 *
115 * \param value value between 0 and 1
116 */
117 virtual void SetContrast(float value);
118
119private:
120 /*!
121 * \brief Update using provided datas
122 *
123 * Reimplemented from IODevice.
124 *
125 * \param data data from the parent to process
126 */
127 void UpdateFrom(const core::io_data *data){};
128
129 /*!
130 * \brief Run function
131 *
132 * Reimplemented from Thread.
133 *
134 */
135 void Run(void);
136
137 CvCapture *capture;
138
139 gui::Tab *sensor_tab;
140 gui::DoubleSpinBox *bright, *exposure, *gain, *contrast, *hue, *sharpness,
141 *sat;
142 gui::CheckBox *autogain, *awb, *autoexposure;
143 gui::Label *fps;
144};
145} // end namespace sensor
146} // end namespace flair
147#endif // V4LCamera_H
Note: See TracBrowser for help on using the repository browser.