source: flair-src/trunk/lib/FlairSensorActuator/src/Camera.h @ 121

Last change on this file since 121 was 121, checked in by Sanahuja Guillaume, 5 years ago

modifs camera

File size: 3.0 KB
RevLine 
[3]1// %flair:license{
[15]2// This file is part of the Flair framework distributed under the
3// CECILL-C License, Version 1.0.
[3]4// %flair:license}
5/*!
6 * \file Camera.h
7 * \brief Base class for Camera
8 * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
9 * \date 2014/03/06
10 * \version 4.0
11 */
12
13#ifndef CAMERA_H
14#define CAMERA_H
15
16#include <IODevice.h>
17#include <stdint.h>
18#include <cvimage.h>
19
[15]20namespace flair {
[121]21        namespace gui {
22                class GroupBox;
23                class Tab;
24                class TabWidget;
25                class Picture;
26                class GridLayout;
27        }
28        namespace core {
29                class Buffer;
30        }
[3]31}
32
[15]33namespace flair {
34namespace sensor {
35/*! \class Camera
36*
37* \brief Base class for Camera
38*
39* Use this class to define a custom Camera.
40*
41*/
42class Camera : public core::IODevice {
43public:
44  /*!
45  * \brief Constructor
46  *
47  * Construct a Camera.
48  *
49  * \param parent parent
50  * \param name name
51  * \param width width
52  * \param height height
53  * \param format image format
54  */
55  Camera(const core::FrameworkManager *parent, std::string name, uint16_t width,
56         uint16_t height, core::cvimage::Type::Format format);
[3]57
[15]58  /*!
59  * \brief Constructor
60  *
61  * Construct a Camera. \n
62  * This contructor must only be called for a simulated device.
63  *
64  * \param parent parent
65  * \param name name
66  */
67  Camera(const core::IODevice *parent, std::string name);
[3]68
[15]69  /*!
70  * \brief Destructor
71  *
72  */
73  ~Camera();
[3]74
[15]75  /*!
76  * \brief Use default plot
77  *
78  * \param image image to display
79  */
80  void UseDefaultPlot(const core::cvimage *image);
[3]81
[15]82  /*!
83  * \brief get Layout
84  *
85  * \return a Layout available
86  */
87  gui::GridLayout *GetLayout(void) const;
[3]88
[15]89  /*!
90  * \brief plot tab
91  *
92  * \return plot tab
93  */
94  gui::Tab *GetPlotTab(void) const;
[3]95
[15]96  /*!
97  * \brief Save picture to file
98  *
99  * \param filename filename
100  */
101  void SaveToFile(std::string filename) const;
[3]102
[15]103  /*!
104  * \brief Width
105  *
106  * \return width
107  */
108  uint16_t Width(void) const;
[3]109
[15]110  /*!
111  * \brief Height
112  *
113  * \return height
114  */
115  uint16_t Height(void) const;
[3]116
[15]117  /*!
118 * \brief Output matrix
119 *
120 * Output matrix is of the same size as declared in constructor. \n
121 *
122 * \return the output matrix
123 */
124  core::cvimage *Output(void);
[3]125
[15]126  core::DataType const &GetOutputDataType() const;
[121]127       
128        /*!
129        \enum LogFormat
130        \brief log formats
131        */
132        enum class LogFormat {
133                NONE, /*!< by default, no logging */
134                RAW, /*!< raw format */
135                JPG, /*!< jpg format */
136        };
137       
138        /*!
139        * \brief Set log format
140        *
141        * Set the log format. \n
142        * Logging of the camera will be disabled if this method is not called. \n
143        * Calling this method enables logging of camera.
144        *
145        * \param LogFormat log format
146        */
147  void SetLogFormat(LogFormat logFormat);
148void ProcessUpdate(core::io_data* data);
[15]149protected:
150  /*!
151  * \brief get GroupBox
152  *
153  * \return a GroupBox available
154  */
155  gui::GroupBox *GetGroupBox(void) const;
[3]156
[15]157  core::cvimage *output;
[3]158
[15]159private:
160  gui::Tab *main_tab, *sensor_tab, *plot_tab;
161  gui::TabWidget *tab;
162  gui::GroupBox *setup_groupbox;
163  gui::GridLayout *setup_layout;
[121]164        LogFormat logFormat;
165        core::Buffer *jpgBuffer;
[15]166};
[3]167} // end namespace sensor
168} // end namespace flair
169#endif // CAMERA_H
Note: See TracBrowser for help on using the repository browser.