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

Last change on this file since 403 was 403, checked in by Sanahuja Guillaume, 6 months ago

select user memory pointer (v4l) if using custom alloc function in images (ie if initdsp was called)

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