represents a grabbing-device supported by unicap More...
#include <GrabbingDevice.h>
Public Member Functions | |
void | cleanBuffers () |
Re-enqueue all but newest buffer. Should be called in short intervals. | |
std::string | getBusType () |
std::string | getDevice () |
uint | getFormatDepth () |
std::string | getFormatDesc () |
std::string | getFormatsList () |
uint | getFrameHeight () |
uint | getFrameSize () |
uint | getFrameWidth () |
std::string | getIdentifier () |
std::string | getModelName () |
uint | getNumBuffers () |
std::string | getPropertiesList () |
print informations about supported properties to std::out | |
bool | getProperty (unicap_property_t **_property, uint _id) |
bool | getProperty (unicap_property_t **_property, std::string &_desc) |
std::string | getPropertyInfo (const std::string &_desc) |
print more detailed information about property _desc | |
unsigned long long | getSerialNumber () |
std::string | getVendorName () |
GrabbingDevice (unicap_handle_t _handle) | |
bool | grabData (unsigned char *_data, std::string fourcc) |
grab raw image data | |
bool | grabImage (ColorImageRGB8 &_image) |
bool | setFormat (int width, int height, std::string fourcc) |
set format according to image size and FOURCC color code | |
bool | setFormat (const uint _formatId, const uint _subformatId) |
set format according to format ID | |
bool | setNumBuffers (uint _numBuffers) |
set number of buffers to allocate for the queue | |
bool | setProperty (const std::string &_name, const std::string &_value) |
set string value of a property | |
bool | setProperty (const std::string &_name, double &_value, bool _normalized=true) |
set numeric value of a property | |
bool | setProperty (unicap_property_t &_property) |
directly set unicap property | |
bool | startCapture () |
starts the capturing process | |
bool | stopCapture () |
stops the capturing process | |
~GrabbingDevice () | |
Private Member Functions | |
bool | detectFormats () |
bool | detectProperties () |
bool | findFormatById (unicap_format_t **_format, const uint _formatId, const uint _subformatId) |
bool | findPropertyByDesc (unicap_property_t **_property, const std::string &_desc) |
bool | findPropertyById (unicap_property_t **_property, const uint _id) |
std::string | getFormatDesc (const uint _formatId) |
bool | prepareBuffers () |
bool | setFormat (unicap_format_t *_format) |
set format by providing a unicap format description | |
bool | setOutputColorspace (std::string fourcc) |
bool | setOutputColorspace (uint _fourcc) |
bool | setProperty (const std::string &_name, property_value_t &_value, bool _normalized=true) |
Private Attributes | |
data_buffer_ptr_vec | m_Buffers |
unicap_data_buffer_t | m_ConvertedBuffer |
unicap_format_t * | m_CurrentFormat |
unicap_device_t | m_Device |
format_ptr_vec | m_Formats |
unicap_handle_t | m_Handle |
uint | m_NumBuffers |
property_ptr_vec | m_Properties |
unsigned int | m_TargetFourCC |
represents a grabbing-device supported by unicap
Definition at line 44 of file GrabbingDevice.h.
GrabbingDevice::GrabbingDevice | ( | unicap_handle_t | _handle | ) |
only valid constructor of this class
_handle | a unicap handle, identifying the connected device required for internal communication |
Definition at line 36 of file GrabbingDevice.cpp.
Definition at line 55 of file GrabbingDevice.cpp.
void GrabbingDevice::cleanBuffers | ( | ) |
Re-enqueue all but newest buffer. Should be called in short intervals.
(at least the framerate of the fastest camera connected) so the queue never gets full.
Definition at line 306 of file GrabbingDevice.cpp.
bool GrabbingDevice::detectFormats | ( | ) | [private] |
update list of supported formats
Definition at line 730 of file GrabbingDevice.cpp.
bool GrabbingDevice::detectProperties | ( | ) | [private] |
update list of supported properties, depends on selected format !
Definition at line 777 of file GrabbingDevice.cpp.
bool GrabbingDevice::findFormatById | ( | unicap_format_t ** | _format, |
const uint | _formatId, | ||
const uint | _subformatId | ||
) | [private] |
find unicap format by id
Definition at line 569 of file GrabbingDevice.cpp.
bool GrabbingDevice::findPropertyByDesc | ( | unicap_property_t ** | _property, |
const std::string & | _desc | ||
) | [private] |
find unicap property by description
Definition at line 592 of file GrabbingDevice.cpp.
bool GrabbingDevice::findPropertyById | ( | unicap_property_t ** | _property, |
const uint | _id | ||
) | [private] |
find unicap property by id
Definition at line 583 of file GrabbingDevice.cpp.
std::string puma2::GrabbingDevice::getBusType | ( | ) | [inline] |
Definition at line 142 of file GrabbingDevice.h.
std::string puma2::GrabbingDevice::getDevice | ( | ) | [inline] |
Definition at line 139 of file GrabbingDevice.h.
uint GrabbingDevice::getFormatDepth | ( | ) |
Definition at line 215 of file GrabbingDevice.cpp.
string GrabbingDevice::getFormatDesc | ( | ) |
Definition at line 191 of file GrabbingDevice.cpp.
string GrabbingDevice::getFormatDesc | ( | const uint | _formatId | ) | [private] |
Definition at line 199 of file GrabbingDevice.cpp.
string GrabbingDevice::getFormatsList | ( | ) |
Definition at line 814 of file GrabbingDevice.cpp.
uint GrabbingDevice::getFrameHeight | ( | ) |
Definition at line 228 of file GrabbingDevice.cpp.
uint GrabbingDevice::getFrameSize | ( | ) |
Definition at line 234 of file GrabbingDevice.cpp.
uint GrabbingDevice::getFrameWidth | ( | ) |
Definition at line 222 of file GrabbingDevice.cpp.
std::string puma2::GrabbingDevice::getIdentifier | ( | ) | [inline] |
Definition at line 136 of file GrabbingDevice.h.
std::string puma2::GrabbingDevice::getModelName | ( | ) | [inline] |
Definition at line 130 of file GrabbingDevice.h.
uint GrabbingDevice::getNumBuffers | ( | ) |
Definition at line 257 of file GrabbingDevice.cpp.
string GrabbingDevice::getPropertiesList | ( | ) |
print informations about supported properties to std::out
Definition at line 860 of file GrabbingDevice.cpp.
bool GrabbingDevice::getProperty | ( | unicap_property_t ** | _property, |
uint | _id | ||
) |
Definition at line 293 of file GrabbingDevice.cpp.
bool puma2::GrabbingDevice::getProperty | ( | unicap_property_t ** | _property, |
std::string & | _desc | ||
) |
string GrabbingDevice::getPropertyInfo | ( | const std::string & | _desc | ) |
print more detailed information about property _desc
Definition at line 887 of file GrabbingDevice.cpp.
unsigned long long puma2::GrabbingDevice::getSerialNumber | ( | ) | [inline] |
Definition at line 145 of file GrabbingDevice.h.
std::string puma2::GrabbingDevice::getVendorName | ( | ) | [inline] |
Definition at line 133 of file GrabbingDevice.h.
bool GrabbingDevice::grabData | ( | unsigned char * | _data, |
std::string | fourcc | ||
) |
grab raw image data
_data | byte stream containing image information |
fourcc | FOURCC code of desired output color space |
Definition at line 478 of file GrabbingDevice.cpp.
bool GrabbingDevice::grabImage | ( | ColorImageRGB8 & | _image | ) |
convenience function for grabbing images frames are converted to puma2 rgb-images, colorspace conversion must be available
_image | pointer to the target rgb image true if capture process was successful |
Definition at line 397 of file GrabbingDevice.cpp.
bool GrabbingDevice::prepareBuffers | ( | ) | [private] |
prepare buffers for capturing, set size, enqueue etc..
Definition at line 693 of file GrabbingDevice.cpp.
bool GrabbingDevice::setFormat | ( | int | width, |
int | height, | ||
std::string | fourcc | ||
) |
set format according to image size and FOURCC color code
Definition at line 113 of file GrabbingDevice.cpp.
bool GrabbingDevice::setFormat | ( | const uint | _formatId, |
const uint | _subformatId | ||
) |
set format according to format ID
Definition at line 85 of file GrabbingDevice.cpp.
bool GrabbingDevice::setFormat | ( | unicap_format_t * | _format | ) | [private] |
set format by providing a unicap format description
Definition at line 157 of file GrabbingDevice.cpp.
bool GrabbingDevice::setNumBuffers | ( | uint | _numBuffers | ) |
set number of buffers to allocate for the queue
Definition at line 242 of file GrabbingDevice.cpp.
bool puma2::GrabbingDevice::setOutputColorspace | ( | std::string | fourcc | ) | [private] |
bool GrabbingDevice::setOutputColorspace | ( | uint | _fourcc | ) | [private] |
Definition at line 337 of file GrabbingDevice.cpp.
bool puma2::GrabbingDevice::setProperty | ( | const std::string & | _name, |
const std::string & | _value | ||
) |
set string value of a property
_name | name of the property e.g.: "trigger" |
_value | value off the property e.g.: "free running" |
bool puma2::GrabbingDevice::setProperty | ( | const std::string & | _name, |
double & | _value, | ||
bool | _normalized = true |
||
) |
set numeric value of a property
_name | name of the property e.g.: "brightness" |
_value | value off the property e.g.: "0.5" |
_normalized | if normalized, range is between 0.0 and 1.0, otherwise device specific values are used |
bool GrabbingDevice::setProperty | ( | unicap_property_t & | _property | ) |
directly set unicap property
Definition at line 280 of file GrabbingDevice.cpp.
bool puma2::GrabbingDevice::setProperty | ( | const std::string & | _name, |
property_value_t & | _value, | ||
bool | _normalized = true |
||
) | [private] |
bool GrabbingDevice::startCapture | ( | ) |
starts the capturing process
Definition at line 534 of file GrabbingDevice.cpp.
bool GrabbingDevice::stopCapture | ( | ) |
stops the capturing process
Definition at line 558 of file GrabbingDevice.cpp.
Definition at line 242 of file GrabbingDevice.h.
unicap_data_buffer_t puma2::GrabbingDevice::m_ConvertedBuffer [private] |
Definition at line 231 of file GrabbingDevice.h.
unicap_format_t* puma2::GrabbingDevice::m_CurrentFormat [private] |
Definition at line 238 of file GrabbingDevice.h.
unicap_device_t puma2::GrabbingDevice::m_Device [private] |
Definition at line 228 of file GrabbingDevice.h.
Definition at line 234 of file GrabbingDevice.h.
unicap_handle_t puma2::GrabbingDevice::m_Handle [private] |
Definition at line 227 of file GrabbingDevice.h.
uint puma2::GrabbingDevice::m_NumBuffers [private] |
Definition at line 241 of file GrabbingDevice.h.
Definition at line 235 of file GrabbingDevice.h.
unsigned int puma2::GrabbingDevice::m_TargetFourCC [private] |
Definition at line 230 of file GrabbingDevice.h.