YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
OpenCVGrabber_ParamsParser Class Reference

This class is the parameters parser for class OpenCVGrabber. More...

#include <openCVGrabber/OpenCVGrabber_ParamsParser.h>

+ Inheritance diagram for OpenCVGrabber_ParamsParser:

Classes

struct  parser_version_type
 

Public Member Functions

 OpenCVGrabber_ParamsParser ()
 
 ~OpenCVGrabber_ParamsParser () override=default
 
bool parseParams (const yarp::os::Searchable &config) override
 Parse the DeviceDriver parameters.
 
std::string getDeviceClassName () const override
 Get the name of the DeviceDriver class.
 
std::string getDeviceName () const override
 Get the name of the device (i.e.
 
std::string getDocumentationOfDeviceParams () const override
 Get the documentation of the DeviceDriver's parameters.
 
std::vector< std::string > getListOfParams () const override
 Return a list of all params used by the device.
 
bool getParamValue (const std::string &paramName, std::string &paramValue) const override
 Return the value (represented as a string) of the requested parameter.
 
std::string getConfiguration () const override
 Return the configuration of the device.
 
- Public Member Functions inherited from yarp::dev::IDeviceDriverParams
virtual ~IDeviceDriverParams ()
 

Public Attributes

const std::string m_device_classname = {"OpenCVGrabber"}
 
const std::string m_device_name = {"openCVGrabber"}
 
bool m_parser_is_strict = false
 
const parser_version_type m_parser_version = {}
 
std::string m_provided_configuration
 
const std::string m_movie_defaultValue = {""}
 
const std::string m_loop_defaultValue = {"false"}
 
const std::string m_camera_defaultValue = {"0"}
 
const std::string m_framerate_defaultValue = {"-1"}
 
const std::string m_width_defaultValue = {"0"}
 
const std::string m_height_defaultValue = {"0"}
 
const std::string m_flip_x_defaultValue = {"false"}
 
const std::string m_flip_y_defaultValue = {"false"}
 
const std::string m_transpose_defaultValue = {"false"}
 
std::string m_movie = {}
 
bool m_loop = {false}
 
int m_camera = {0}
 
double m_framerate = {-1}
 
int m_width = {0}
 
int m_height = {0}
 
bool m_flip_x = {false}
 
bool m_flip_y = {false}
 
bool m_transpose = {false}
 

Detailed Description

This class is the parameters parser for class OpenCVGrabber.

These are the used parameters:

Group name Parameter name Type Units Default Value Required Description Notes
- movie string - - 0 if present, read an .avi file instead of opening a camera -
- loop bool - false 0 if true, and movie parameter is set, enable the loop playback of the file -
- camera int - 0 0 Id of the camera hardware device -
- framerate double - -1 0 Framerate. Default value obtained by the hardware -
- width int - 0 0 Width of the frame. Default value obtained by the hardware -
- height int - 0 0 Height of the frame. Default value obtained by the hardware -
- flip_x bool - false 0 Flip along the x axis -
- flip_y bool - false 0 flip along the y axis -
- transpose bool - false 0 Rotate the image by 90 degrees -

The device can be launched by yarpdev using one of the following examples (with and without all optional parameters):

yarpdev --device openCVGrabber --movie <optional_value> --loop false --camera 0 --framerate -1 --width 0 --height 0 --flip_x false --flip_y false --transpose false
yarpdev --device openCVGrabber

Definition at line 49 of file OpenCVGrabber_ParamsParser.h.

Constructor & Destructor Documentation

◆ OpenCVGrabber_ParamsParser()

OpenCVGrabber_ParamsParser::OpenCVGrabber_ParamsParser ( )

Definition at line 23 of file OpenCVGrabber_ParamsParser.cpp.

◆ ~OpenCVGrabber_ParamsParser()

OpenCVGrabber_ParamsParser::~OpenCVGrabber_ParamsParser ( )
overridedefault

Member Function Documentation

◆ getConfiguration()

std::string OpenCVGrabber_ParamsParser::getConfiguration ( ) const
overridevirtual

Return the configuration of the device.

Returns
The configuration of the device, represented in a string format.

Implements yarp::dev::IDeviceDriverParams.

Definition at line 102 of file OpenCVGrabber_ParamsParser.cpp.

◆ getDeviceClassName()

std::string OpenCVGrabber_ParamsParser::getDeviceClassName ( ) const
inlineoverridevirtual

Get the name of the DeviceDriver class.

Returns
A string containing the name of the class.

Implements yarp::dev::IDeviceDriverParams.

Definition at line 89 of file OpenCVGrabber_ParamsParser.h.

◆ getDeviceName()

std::string OpenCVGrabber_ParamsParser::getDeviceName ( ) const
inlineoverridevirtual

Get the name of the device (i.e.

the plugin name).

Returns
A string containing the name of the device.

Implements yarp::dev::IDeviceDriverParams.

Definition at line 90 of file OpenCVGrabber_ParamsParser.h.

◆ getDocumentationOfDeviceParams()

std::string OpenCVGrabber_ParamsParser::getDocumentationOfDeviceParams ( ) const
overridevirtual

Get the documentation of the DeviceDriver's parameters.

Returns
A string containing the documentation.

Implements yarp::dev::IDeviceDriverParams.

Definition at line 277 of file OpenCVGrabber_ParamsParser.cpp.

◆ getListOfParams()

std::vector< std::string > OpenCVGrabber_ParamsParser::getListOfParams ( ) const
overridevirtual

Return a list of all params used by the device.

Returns
A vector containing the names of parameters used by the device.

Implements yarp::dev::IDeviceDriverParams.

Definition at line 28 of file OpenCVGrabber_ParamsParser.cpp.

◆ getParamValue()

bool OpenCVGrabber_ParamsParser::getParamValue ( const std::string &  paramName,
std::string &  paramValue 
) const
overridevirtual

Return the value (represented as a string) of the requested parameter.

Returns
True if the requested parameter was succesfully retrieved.

Implements yarp::dev::IDeviceDriverParams.

Definition at line 44 of file OpenCVGrabber_ParamsParser.cpp.

◆ parseParams()

bool OpenCVGrabber_ParamsParser::parseParams ( const yarp::os::Searchable config)
overridevirtual

Parse the DeviceDriver parameters.

Returns
true if the parsing is successful, false otherwise

Implements yarp::dev::IDeviceDriverParams.

Definition at line 112 of file OpenCVGrabber_ParamsParser.cpp.

Member Data Documentation

◆ m_camera

int OpenCVGrabber_ParamsParser::m_camera = {0}

Definition at line 80 of file OpenCVGrabber_ParamsParser.h.

◆ m_camera_defaultValue

const std::string OpenCVGrabber_ParamsParser::m_camera_defaultValue = {"0"}

Definition at line 70 of file OpenCVGrabber_ParamsParser.h.

◆ m_device_classname

const std::string OpenCVGrabber_ParamsParser::m_device_classname = {"OpenCVGrabber"}

Definition at line 56 of file OpenCVGrabber_ParamsParser.h.

◆ m_device_name

const std::string OpenCVGrabber_ParamsParser::m_device_name = {"openCVGrabber"}

Definition at line 57 of file OpenCVGrabber_ParamsParser.h.

◆ m_flip_x

bool OpenCVGrabber_ParamsParser::m_flip_x = {false}

Definition at line 84 of file OpenCVGrabber_ParamsParser.h.

◆ m_flip_x_defaultValue

const std::string OpenCVGrabber_ParamsParser::m_flip_x_defaultValue = {"false"}

Definition at line 74 of file OpenCVGrabber_ParamsParser.h.

◆ m_flip_y

bool OpenCVGrabber_ParamsParser::m_flip_y = {false}

Definition at line 85 of file OpenCVGrabber_ParamsParser.h.

◆ m_flip_y_defaultValue

const std::string OpenCVGrabber_ParamsParser::m_flip_y_defaultValue = {"false"}

Definition at line 75 of file OpenCVGrabber_ParamsParser.h.

◆ m_framerate

double OpenCVGrabber_ParamsParser::m_framerate = {-1}

Definition at line 81 of file OpenCVGrabber_ParamsParser.h.

◆ m_framerate_defaultValue

const std::string OpenCVGrabber_ParamsParser::m_framerate_defaultValue = {"-1"}

Definition at line 71 of file OpenCVGrabber_ParamsParser.h.

◆ m_height

int OpenCVGrabber_ParamsParser::m_height = {0}

Definition at line 83 of file OpenCVGrabber_ParamsParser.h.

◆ m_height_defaultValue

const std::string OpenCVGrabber_ParamsParser::m_height_defaultValue = {"0"}

Definition at line 73 of file OpenCVGrabber_ParamsParser.h.

◆ m_loop

bool OpenCVGrabber_ParamsParser::m_loop = {false}

Definition at line 79 of file OpenCVGrabber_ParamsParser.h.

◆ m_loop_defaultValue

const std::string OpenCVGrabber_ParamsParser::m_loop_defaultValue = {"false"}

Definition at line 69 of file OpenCVGrabber_ParamsParser.h.

◆ m_movie

std::string OpenCVGrabber_ParamsParser::m_movie = {}

Definition at line 78 of file OpenCVGrabber_ParamsParser.h.

◆ m_movie_defaultValue

const std::string OpenCVGrabber_ParamsParser::m_movie_defaultValue = {""}

Definition at line 68 of file OpenCVGrabber_ParamsParser.h.

◆ m_parser_is_strict

bool OpenCVGrabber_ParamsParser::m_parser_is_strict = false

Definition at line 58 of file OpenCVGrabber_ParamsParser.h.

◆ m_parser_version

const parser_version_type OpenCVGrabber_ParamsParser::m_parser_version = {}

Definition at line 64 of file OpenCVGrabber_ParamsParser.h.

◆ m_provided_configuration

std::string OpenCVGrabber_ParamsParser::m_provided_configuration

Definition at line 66 of file OpenCVGrabber_ParamsParser.h.

◆ m_transpose

bool OpenCVGrabber_ParamsParser::m_transpose = {false}

Definition at line 86 of file OpenCVGrabber_ParamsParser.h.

◆ m_transpose_defaultValue

const std::string OpenCVGrabber_ParamsParser::m_transpose_defaultValue = {"false"}

Definition at line 76 of file OpenCVGrabber_ParamsParser.h.

◆ m_width

int OpenCVGrabber_ParamsParser::m_width = {0}

Definition at line 82 of file OpenCVGrabber_ParamsParser.h.

◆ m_width_defaultValue

const std::string OpenCVGrabber_ParamsParser::m_width_defaultValue = {"0"}

Definition at line 72 of file OpenCVGrabber_ParamsParser.h.


The documentation for this class was generated from the following files: