Flair
Framework Libre Air
|
Base class for Camera. More...
#include <Camera.h>
Public Types | |
enum | LogFormat { LogFormat::NONE, LogFormat::RAW, LogFormat::JPG } |
log formats More... | |
Public Types inherited from flair::core::Object | |
enum | color_t { Auto = 0, Red = 31, Green = 32, Orange = 33 } |
Public Member Functions | |
Camera (std::string name, uint16_t width, uint16_t height, core::cvimage::Type::Format format) | |
Constructor. More... | |
Camera (const core::IODevice *parent, std::string name) | |
Constructor. More... | |
~Camera () | |
Destructor. More... | |
void | UseDefaultPlot (const core::cvimage *image) |
Use default plot. More... | |
gui::GridLayout * | GetLayout (void) const |
get Layout More... | |
gui::Tab * | GetPlotTab (void) const |
plot tab More... | |
void | SaveRawPictureToFile (std::string filename) const |
Save raw picture to file. More... | |
void | SavePictureToFile (std::string filename="") const |
Save picture to file. More... | |
uint16_t | Width (void) const |
Width. More... | |
uint16_t | Height (void) const |
Height. More... | |
core::cvimage * | Output (void) |
Output matrix. More... | |
core::DataType const & | GetOutputDataType () const |
void | SetLogFormat (LogFormat logFormat) |
Set log format. More... | |
void | ProcessUpdate (core::io_data *data) |
Public Member Functions inherited from flair::core::IODevice | |
IODevice (const Object *parent, std::string name) | |
Constructor. More... | |
virtual | ~IODevice () |
Destructor. More... | |
void | AddDeviceToLog (const IODevice *device) |
Add an IODevice to the logs. More... | |
void | AddDataToLog (const io_data *data) |
Add an io_data to the log. More... | |
void | OutputToShMem (bool enabled) |
Send the output to a shared memory. More... | |
bool | IsReady (void) const |
is device ready More... | |
virtual DataType const & | GetInputDataType () const |
Public Member Functions inherited from flair::core::Object | |
Object (const Object *parent=NULL, std::string name="", std::string type="") | |
Constructor. More... | |
virtual | ~Object () |
Destructor. More... | |
std::string | ObjectName (void) const |
Name. More... | |
std::string | ObjectType (void) const |
Type. More... | |
const Object * | Parent (void) const |
Parent. More... | |
std::vector< const Object * > * | TypeChilds (void) const |
Childs of the same type. More... | |
std::vector< const Object * > * | Childs (void) const |
Childs. More... | |
void | Information (const char *function, int line, const char *format,...) const |
Formatted information. More... | |
void | Warning (const char *function, const char *format,...) const |
Formatted warning. More... | |
void | Error (const char *function, const char *format,...) const |
Formatted error. More... | |
bool | ErrorOccured (bool recursive=true) const |
Has an errror occured? More... | |
Protected Member Functions | |
gui::GroupBox * | GetGroupBox (void) const |
get GroupBox More... | |
Protected Member Functions inherited from flair::core::IODevice | |
void | ProcessUpdate (io_data *data) |
Process the childs of type IODevice, and log if needed. More... | |
void | SetIsReady (bool status) |
set is ready More... | |
virtual void | UpdateFrom (const io_data *data)=0 |
Update using provided datas. More... | |
Protected Attributes | |
core::cvimage * | output |
|
strong |
flair::sensor::Camera::Camera | ( | std::string | name, |
uint16_t | width, | ||
uint16_t | height, | ||
core::cvimage::Type::Format | format | ||
) |
Constructor.
Construct a Camera. It will be child of the FrameworkManager.
name | name |
width | width |
height | height |
format | image format |
flair::sensor::Camera::Camera | ( | const core::IODevice * | parent, |
std::string | name | ||
) |
Constructor.
Construct a Camera.
This contructor must only be called for a simulated device.
parent | parent |
name | name |
flair::sensor::Camera::~Camera | ( | ) |
Destructor.
void flair::sensor::Camera::UseDefaultPlot | ( | const core::cvimage * | image | ) |
Use default plot.
image | image to display |
gui::GridLayout* flair::sensor::Camera::GetLayout | ( | void | ) | const |
get Layout
gui::Tab* flair::sensor::Camera::GetPlotTab | ( | void | ) | const |
plot tab
void flair::sensor::Camera::SaveRawPictureToFile | ( | std::string | filename | ) | const |
Save raw picture to file.
filename | filename |
void flair::sensor::Camera::SavePictureToFile | ( | std::string | filename = "" | ) | const |
Save picture to file.
filename | filename; if ommitted, current time is used and file is saved in current directory with jpg compression |
uint16_t flair::sensor::Camera::Width | ( | void | ) | const |
Width.
uint16_t flair::sensor::Camera::Height | ( | void | ) | const |
Height.
core::cvimage* flair::sensor::Camera::Output | ( | void | ) |
Output matrix.
Output matrix is of the same size as declared in constructor.
void flair::sensor::Camera::SetLogFormat | ( | LogFormat | logFormat | ) |
Set log format.
Set the log format.
Logging of the camera will be disabled if this method is not called.
Calling this method enables logging of camera.
LogFormat | log format |
|
protected |
get GroupBox