1 | /*!
|
---|
2 | * \file ParrotCamV.h
|
---|
3 | * \brief Class for ardrone2 horizontal camera
|
---|
4 | * \author Guillaume Sanahuja
|
---|
5 | * \date 2014/07/16
|
---|
6 | * \version 4.0
|
---|
7 | */
|
---|
8 |
|
---|
9 | #ifndef PARROTCAMV_H
|
---|
10 | #define PARROTCAMV_H
|
---|
11 |
|
---|
12 | #define CMATRIX_LEN 6
|
---|
13 |
|
---|
14 | #include "V4LCamera.h"
|
---|
15 |
|
---|
16 | namespace flair
|
---|
17 | {
|
---|
18 | namespace core
|
---|
19 | {
|
---|
20 | class FrameworkManager;
|
---|
21 | class I2cPort;
|
---|
22 | }
|
---|
23 | }
|
---|
24 |
|
---|
25 | namespace flair
|
---|
26 | {
|
---|
27 | namespace sensor
|
---|
28 | {
|
---|
29 | /*! \class ParrotCamV
|
---|
30 | *
|
---|
31 | * \brief Class for ardrone2 horizontal cameraH
|
---|
32 | */
|
---|
33 | class ParrotCamV : public V4LCamera
|
---|
34 | {
|
---|
35 |
|
---|
36 | public:
|
---|
37 | /*!
|
---|
38 | * \brief Constructor
|
---|
39 | *
|
---|
40 | * Construct a ParrotCamV.
|
---|
41 | *
|
---|
42 | * \param parent parent
|
---|
43 | * \param name name
|
---|
44 | * \param priority priority of the Thread
|
---|
45 | */
|
---|
46 | ParrotCamV(const core::FrameworkManager* parent,std::string name,uint8_t priority);
|
---|
47 |
|
---|
48 | /*!
|
---|
49 | * \brief Destructor
|
---|
50 | *
|
---|
51 | */
|
---|
52 | ~ParrotCamV();
|
---|
53 |
|
---|
54 | private:
|
---|
55 | /*!
|
---|
56 | * \brief Set Gain
|
---|
57 | *
|
---|
58 | * Reimplemented from V4LCamera class
|
---|
59 | *
|
---|
60 | * \param value value between 0 and 1
|
---|
61 | */
|
---|
62 | void SetGain(float value);
|
---|
63 |
|
---|
64 | /*!
|
---|
65 | * \brief Set Auto Gain
|
---|
66 | *
|
---|
67 | * Reimplemented from V4LCamera class
|
---|
68 | *
|
---|
69 | * \param value value
|
---|
70 | */
|
---|
71 | void SetAutoGain(bool value);
|
---|
72 |
|
---|
73 | /*!
|
---|
74 | * \brief Set Exposure
|
---|
75 | *
|
---|
76 | * Reimplemented from V4LCamera class
|
---|
77 | *
|
---|
78 | * \param value value between 0 and 1
|
---|
79 | */
|
---|
80 | void SetExposure(float value);
|
---|
81 |
|
---|
82 | /*!
|
---|
83 | * \brief Set Auto Exposure
|
---|
84 | *
|
---|
85 | * Reimplemented from V4LCamera class
|
---|
86 | *
|
---|
87 | * \param value value
|
---|
88 | */
|
---|
89 | void SetAutoExposure(bool value);
|
---|
90 |
|
---|
91 | /*!
|
---|
92 | * \brief Set Brightness
|
---|
93 | *
|
---|
94 | * Reimplemented from V4LCamera class
|
---|
95 | *
|
---|
96 | * \param value value between 0 and 1
|
---|
97 | */
|
---|
98 | void SetBrightness(float value);
|
---|
99 |
|
---|
100 | /*!
|
---|
101 | * \brief Set Saturation
|
---|
102 | *
|
---|
103 | * Reimplemented from V4LCamera class
|
---|
104 | *
|
---|
105 | * \param value value between 0 and 1
|
---|
106 | */
|
---|
107 | void SetSaturation(float value);
|
---|
108 |
|
---|
109 | /*!
|
---|
110 | * \brief Set Hue
|
---|
111 | *
|
---|
112 | * Reimplemented from V4LCamera class
|
---|
113 | *
|
---|
114 | * \param value value between 0 and 1
|
---|
115 | */
|
---|
116 | void SetHue(float value);
|
---|
117 |
|
---|
118 | /*!
|
---|
119 | * \brief Set Contrast
|
---|
120 | *
|
---|
121 | * Reimplemented from V4LCamera class
|
---|
122 | *
|
---|
123 | * \param value value between 0 and 1
|
---|
124 | */
|
---|
125 | void SetContrast(float value);
|
---|
126 |
|
---|
127 | int ov7670_write(uint8_t reg,uint8_t value);
|
---|
128 | int ov7670_read(uint8_t reg,uint8_t* value);
|
---|
129 | unsigned char ov7670_abs_to_sm(uint8_t v);
|
---|
130 | int ov7670_store_cmatrix(int matrix[CMATRIX_LEN]);
|
---|
131 | void ov7670_calc_cmatrix(int matrix[CMATRIX_LEN]);
|
---|
132 | float hue,sat;
|
---|
133 | core::I2cPort* i2cport;
|
---|
134 | //cmatrix for V4L2_MBUS_FMT_UYVY8_2X8
|
---|
135 | int cmatrix[CMATRIX_LEN]= { 128, -128, 0, -34, -94, 128 };
|
---|
136 | };
|
---|
137 | } // end namespace sensor
|
---|
138 | } // end namespace flair
|
---|
139 | #endif // PARROTCAMV_H
|
---|