Changeset 15 in flair-src for trunk/lib/FlairSensorActuator/src/V4LCamera.h
- Timestamp:
- Apr 8, 2016, 3:40:57 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairSensorActuator/src/V4LCamera.h
r3 r15 18 18 #include <highgui.h> 19 19 20 namespace flair 21 { 22 namespace core 23 { 24 class cvimage; 25 class FrameworkManager; 26 } 27 namespace gui 28 { 29 class GridLayout; 30 class DoubleSpinBox; 31 class CheckBox; 32 class Label; 33 } 20 namespace flair { 21 namespace core { 22 class cvimage; 23 class FrameworkManager; 24 } 25 namespace gui { 26 class GridLayout; 27 class DoubleSpinBox; 28 class CheckBox; 29 class Label; 30 } 34 31 } 35 32 36 namespace flair 37 { 38 namespace sensor 39 { 40 /*! \class V4LCamera 41 * 42 * \brief Base class for V4l camera 43 */ 44 class V4LCamera : public core::Thread, public Camera 45 { 46 public: 47 /*! 48 * \brief Constructor 49 * 50 * Construct a Camera. 51 * 52 * \param parent parent 53 * \param name name 54 * \param camera_index camera index 55 * \param width width 56 * \param height height 57 * \param format image format 58 * \param priority priority of the Thread 59 */ 60 V4LCamera(const core::FrameworkManager* parent,std::string name,uint8_t camera_index,uint16_t width,uint16_t height,core::cvimage::Type::Format format,uint8_t priority); 33 namespace flair { 34 namespace sensor { 35 /*! \class V4LCamera 36 * 37 * \brief Base class for V4l camera 38 */ 39 class V4LCamera : public core::Thread, public Camera { 40 public: 41 /*! 42 * \brief Constructor 43 * 44 * Construct a Camera. 45 * 46 * \param parent parent 47 * \param name name 48 * \param camera_index camera index 49 * \param width width 50 * \param height height 51 * \param format image format 52 * \param priority priority of the Thread 53 */ 54 V4LCamera(const core::FrameworkManager *parent, std::string name, 55 uint8_t camera_index, uint16_t width, uint16_t height, 56 core::cvimage::Type::Format format, uint8_t priority); 61 57 62 63 64 65 66 58 /*! 59 * \brief Destructor 60 * 61 */ 62 ~V4LCamera(); 67 63 68 69 70 71 72 73 74 64 protected: 65 /*! 66 * \brief Set Gain 67 * 68 * \param value value between 0 and 1 69 */ 70 virtual void SetGain(float value); 75 71 76 77 78 79 80 81 72 /*! 73 * \brief Set Auto Gain 74 * 75 * \param value value 76 */ 77 virtual void SetAutoGain(bool value); 82 78 83 84 85 86 87 88 79 /*! 80 * \brief Set Exposure 81 * 82 * \param value value between 0 and 1 83 */ 84 virtual void SetExposure(float value); 89 85 90 91 92 93 94 95 86 /*! 87 * \brief Set Auto Exposure 88 * 89 * \param value value 90 */ 91 virtual void SetAutoExposure(bool value); 96 92 97 98 99 100 101 102 93 /*! 94 * \brief Set Brightness 95 * 96 * \param value value between 0 and 1 97 */ 98 virtual void SetBrightness(float value); 103 99 104 105 106 107 108 109 100 /*! 101 * \brief Set Saturation 102 * 103 * \param value value between 0 and 1 104 */ 105 virtual void SetSaturation(float value); 110 106 111 112 113 114 115 116 107 /*! 108 * \brief Set Hue 109 * 110 * \param value value between 0 and 1 111 */ 112 virtual void SetHue(float value); 117 113 118 119 120 121 122 123 114 /*! 115 * \brief Set Contrast 116 * 117 * \param value value between 0 and 1 118 */ 119 virtual void SetContrast(float value); 124 120 125 126 127 128 129 130 131 132 133 121 private: 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){}; 134 130 135 136 137 138 139 140 141 131 /*! 132 * \brief Run function 133 * 134 * Reimplemented from Thread. 135 * 136 */ 137 void Run(void); 142 138 143 CvCapture*capture;139 CvCapture *capture; 144 140 145 gui::Tab* sensor_tab; 146 gui::DoubleSpinBox *bright,*exposure,*gain,*contrast,*hue,*sharpness,*sat; 147 gui::CheckBox *autogain,*awb,*autoexposure; 148 gui::Label *fps; 149 }; 141 gui::Tab *sensor_tab; 142 gui::DoubleSpinBox *bright, *exposure, *gain, *contrast, *hue, *sharpness, 143 *sat; 144 gui::CheckBox *autogain, *awb, *autoexposure; 145 gui::Label *fps; 146 }; 150 147 } // end namespace sensor 151 148 } // end namespace flair
Note:
See TracChangeset
for help on using the changeset viewer.