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 |
|
---|
19 | namespace flair {
|
---|
20 | namespace core {
|
---|
21 | class Image;
|
---|
22 | }
|
---|
23 | }
|
---|
24 |
|
---|
25 | class V4LCamera_impl;
|
---|
26 |
|
---|
27 | namespace flair {
|
---|
28 | namespace sensor {
|
---|
29 | /*! \class V4LCamera
|
---|
30 | *
|
---|
31 | * \brief Base class for V4l camera
|
---|
32 | */
|
---|
33 | class V4LCamera : public core::Thread, public Camera {
|
---|
34 | friend class ::V4LCamera_impl;
|
---|
35 | public:
|
---|
36 | /*!
|
---|
37 | * \brief Constructor
|
---|
38 | *
|
---|
39 | * Construct a Camera.
|
---|
40 | * It will be child of the FrameworkManager.
|
---|
41 | *
|
---|
42 | * \param name name
|
---|
43 | * \param camera_index camera index
|
---|
44 | * \param width width
|
---|
45 | * \param height height
|
---|
46 | * \param format image format
|
---|
47 | * \param priority priority of the Thread
|
---|
48 | */
|
---|
49 | V4LCamera(std::string name,
|
---|
50 | uint8_t camera_index, uint16_t width, uint16_t height,
|
---|
51 | core::Image::Type::Format format, uint8_t priority);
|
---|
52 |
|
---|
53 | /*!
|
---|
54 | * \brief Destructor
|
---|
55 | *
|
---|
56 | */
|
---|
57 | ~V4LCamera();
|
---|
58 |
|
---|
59 | //hack for ps3eye in hds uav
|
---|
60 | //TODO: put this in ps3eye class
|
---|
61 | bool HasProblems(void);
|
---|
62 |
|
---|
63 | protected:
|
---|
64 | /*!
|
---|
65 | * \brief Set Gain
|
---|
66 | *
|
---|
67 | * \param value value between 0 and 1
|
---|
68 | */
|
---|
69 | virtual void SetGain(float value);
|
---|
70 |
|
---|
71 | /*!
|
---|
72 | * \brief Set Auto Gain
|
---|
73 | *
|
---|
74 | * \param value value
|
---|
75 | */
|
---|
76 | virtual void SetAutoGain(bool value);
|
---|
77 |
|
---|
78 | /*!
|
---|
79 | * \brief Set Exposure
|
---|
80 | *
|
---|
81 | * \param value value between 0 and 1
|
---|
82 | */
|
---|
83 | virtual void SetExposure(float value);
|
---|
84 |
|
---|
85 | /*!
|
---|
86 | * \brief Set Auto Exposure
|
---|
87 | *
|
---|
88 | * \param value value
|
---|
89 | */
|
---|
90 | virtual void SetAutoExposure(bool value);
|
---|
91 |
|
---|
92 | /*!
|
---|
93 | * \brief Set Brightness
|
---|
94 | *
|
---|
95 | * \param value value between 0 and 1
|
---|
96 | */
|
---|
97 | virtual void SetBrightness(float value);
|
---|
98 |
|
---|
99 | /*!
|
---|
100 | * \brief Set Saturation
|
---|
101 | *
|
---|
102 | * \param value value between 0 and 1
|
---|
103 | */
|
---|
104 | virtual void SetSaturation(float value);
|
---|
105 |
|
---|
106 | /*!
|
---|
107 | * \brief Set Hue
|
---|
108 | *
|
---|
109 | * \param value value between 0 and 1
|
---|
110 | */
|
---|
111 | virtual void SetHue(float value);
|
---|
112 |
|
---|
113 | /*!
|
---|
114 | * \brief Set Contrast
|
---|
115 | *
|
---|
116 | * \param value value between 0 and 1
|
---|
117 | */
|
---|
118 | virtual void SetContrast(float value);
|
---|
119 |
|
---|
120 | private:
|
---|
121 | /*!
|
---|
122 | * \brief Update using provided datas
|
---|
123 | *
|
---|
124 | * Reimplemented from IODevice.
|
---|
125 | *
|
---|
126 | * \param data data from the parent to process
|
---|
127 | */
|
---|
128 | void UpdateFrom(const core::io_data *data){};
|
---|
129 |
|
---|
130 | /*!
|
---|
131 | * \brief Run function
|
---|
132 | *
|
---|
133 | * Reimplemented from Thread.
|
---|
134 | *
|
---|
135 | */
|
---|
136 | void Run(void);
|
---|
137 |
|
---|
138 | class V4LCamera_impl *pimpl_;
|
---|
139 | };
|
---|
140 | } // end namespace sensor
|
---|
141 | } // end namespace flair
|
---|
142 | #endif // V4LCAMERA_H
|
---|