[4] | 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 |
|
---|
| 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 | }
|
---|
| 34 | }
|
---|
| 35 |
|
---|
| 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);
|
---|
| 61 |
|
---|
| 62 | /*!
|
---|
| 63 | * \brief Destructor
|
---|
| 64 | *
|
---|
| 65 | */
|
---|
| 66 | ~V4LCamera();
|
---|
| 67 |
|
---|
| 68 | protected:
|
---|
| 69 | /*!
|
---|
| 70 | * \brief Set Gain
|
---|
| 71 | *
|
---|
| 72 | * \param value value between 0 and 1
|
---|
| 73 | */
|
---|
| 74 | virtual void SetGain(float value);
|
---|
| 75 |
|
---|
| 76 | /*!
|
---|
| 77 | * \brief Set Auto Gain
|
---|
| 78 | *
|
---|
| 79 | * \param value value
|
---|
| 80 | */
|
---|
| 81 | virtual void SetAutoGain(bool value);
|
---|
| 82 |
|
---|
| 83 | /*!
|
---|
| 84 | * \brief Set Exposure
|
---|
| 85 | *
|
---|
| 86 | * \param value value between 0 and 1
|
---|
| 87 | */
|
---|
| 88 | virtual void SetExposure(float value);
|
---|
| 89 |
|
---|
| 90 | /*!
|
---|
| 91 | * \brief Set Auto Exposure
|
---|
| 92 | *
|
---|
| 93 | * \param value value
|
---|
| 94 | */
|
---|
| 95 | virtual void SetAutoExposure(bool value);
|
---|
| 96 |
|
---|
| 97 | /*!
|
---|
| 98 | * \brief Set Brightness
|
---|
| 99 | *
|
---|
| 100 | * \param value value between 0 and 1
|
---|
| 101 | */
|
---|
| 102 | virtual void SetBrightness(float value);
|
---|
| 103 |
|
---|
| 104 | /*!
|
---|
| 105 | * \brief Set Saturation
|
---|
| 106 | *
|
---|
| 107 | * \param value value between 0 and 1
|
---|
| 108 | */
|
---|
| 109 | virtual void SetSaturation(float value);
|
---|
| 110 |
|
---|
| 111 | /*!
|
---|
| 112 | * \brief Set Hue
|
---|
| 113 | *
|
---|
| 114 | * \param value value between 0 and 1
|
---|
| 115 | */
|
---|
| 116 | virtual void SetHue(float value);
|
---|
| 117 |
|
---|
| 118 | /*!
|
---|
| 119 | * \brief Set Contrast
|
---|
| 120 | *
|
---|
| 121 | * \param value value between 0 and 1
|
---|
| 122 | */
|
---|
| 123 | virtual void SetContrast(float value);
|
---|
| 124 |
|
---|
| 125 | private:
|
---|
| 126 | /*!
|
---|
| 127 | * \brief Update using provided datas
|
---|
| 128 | *
|
---|
| 129 | * Reimplemented from IODevice.
|
---|
| 130 | *
|
---|
| 131 | * \param data data from the parent to process
|
---|
| 132 | */
|
---|
| 133 | void UpdateFrom(const core::io_data *data){};
|
---|
| 134 |
|
---|
| 135 | /*!
|
---|
| 136 | * \brief Run function
|
---|
| 137 | *
|
---|
| 138 | * Reimplemented from Thread.
|
---|
| 139 | *
|
---|
| 140 | */
|
---|
| 141 | void Run(void);
|
---|
| 142 |
|
---|
| 143 | CvCapture* capture;
|
---|
| 144 |
|
---|
| 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 | };
|
---|
| 150 | } // end namespace sensor
|
---|
| 151 | } // end namespace flair
|
---|
| 152 | #endif // V4LCamera_H
|
---|