Public Member Functions | Private Member Functions | Private Attributes
puma2::GrabbingDevice Class Reference

represents a grabbing-device supported by unicap More...

#include <GrabbingDevice.h>

List of all members.

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

Detailed Description

represents a grabbing-device supported by unicap

Author:
Benjamin Knopp <bknopp@uni-koblenz.de>, David Gossow (R12)

Definition at line 44 of file GrabbingDevice.h.


Constructor & Destructor Documentation

GrabbingDevice::GrabbingDevice ( unicap_handle_t  _handle)

only valid constructor of this class

Parameters:
_handlea 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.


Member Function Documentation

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.

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]
Returns:
the bus type

Definition at line 142 of file GrabbingDevice.h.

std::string puma2::GrabbingDevice::getDevice ( ) [inline]
Returns:
the device path (/dev/videoX)

Definition at line 139 of file GrabbingDevice.h.

Returns:
bits per pixel of the current input format

Definition at line 215 of file GrabbingDevice.cpp.

Returns:
a textual description of the current color format

Definition at line 191 of file GrabbingDevice.cpp.

string GrabbingDevice::getFormatDesc ( const uint  _formatId) [private]
Returns:
a description of the format selected by _formatId

Definition at line 199 of file GrabbingDevice.cpp.

Returns:
a textual list with all supported formats

Definition at line 814 of file GrabbingDevice.cpp.

Returns:
frame height of the current format

Definition at line 228 of file GrabbingDevice.cpp.

Returns:
frame size in bytes (width * height * bpp) of the current format

Definition at line 234 of file GrabbingDevice.cpp.

Returns:
frame width of the current format

Definition at line 222 of file GrabbingDevice.cpp.

std::string puma2::GrabbingDevice::getIdentifier ( ) [inline]
Returns:
the identifier (unique) of this device

Definition at line 136 of file GrabbingDevice.h.

std::string puma2::GrabbingDevice::getModelName ( ) [inline]
Returns:
the model name of this device

Definition at line 130 of file GrabbingDevice.h.

Definition at line 257 of file GrabbingDevice.cpp.

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]
Returns:
the serial number of this device

Definition at line 145 of file GrabbingDevice.h.

std::string puma2::GrabbingDevice::getVendorName ( ) [inline]
Returns:
the vendor name of this device

Definition at line 133 of file GrabbingDevice.h.

bool GrabbingDevice::grabData ( unsigned char *  _data,
std::string  fourcc 
)

grab raw image data

Parameters:
_databyte stream containing image information
fourccFOURCC code of desired output color space

Definition at line 478 of file GrabbingDevice.cpp.

convenience function for grabbing images frames are converted to puma2 rgb-images, colorspace conversion must be available

Parameters:
_imagepointer 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

Returns:
true is format has been successfully set

Definition at line 113 of file GrabbingDevice.cpp.

bool GrabbingDevice::setFormat ( const uint  _formatId,
const uint  _subformatId 
)

set format according to format ID

Returns:
true is format has been successfully set

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]
See also:
above

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

Parameters:
_namename of the property e.g.: "trigger"
_valuevalue off the property e.g.: "free running"
Returns:
true if property was successfully set
bool puma2::GrabbingDevice::setProperty ( const std::string &  _name,
double &  _value,
bool  _normalized = true 
)

set numeric value of a property

Parameters:
_namename of the property e.g.: "brightness"
_valuevalue off the property e.g.: "0.5"
_normalizedif normalized, range is between 0.0 and 1.0, otherwise device specific values are used
Returns:
true if property was successfully set
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]

starts the capturing process

Returns:
returns true if process could be started

Definition at line 534 of file GrabbingDevice.cpp.

stops the capturing process

Definition at line 558 of file GrabbingDevice.cpp.


Member Data Documentation

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.

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.


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


obj_rec_gui
Author(s): AGAS/agas@uni-koblenz.de
autogenerated on Mon Oct 6 2014 02:53:43