RobWorkProject  24.6.21-
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Camera Class Referenceabstract

The Camera class defines a generel interface to a camera. A great deal of the interface resembles the DCAM standard since DCAM allready defines a very wide interface. More...

#include <Camera.hpp>

Inherits Sensor.

Inherited by CameraFirewire.

Public Types

typedef rw::core::Ptr< CameraPtr
 smart pointer type to this class
 
- Public Types inherited from Sensor
typedef rw::core::Ptr< SensorPtr
 smart pointer type
 

Public Member Functions

virtual ~Camera ()
 destructor
 
virtual std::string getModelInfo () const
 returns the camera model information (version, type, size, etc.) More...
 
virtual bool initialize ()=0
 initializes the camera to the current settings (CaptureMode,ColorMode,etc.) More...
 
bool isInitialized () const
 returns whether this camera is initialized or not. More...
 
virtual bool start ()=0
 starts this camera, if the camera has not been initialized the initialize function will be called. More...
 
bool isStarted () const
 returns whether this camera is started or not. More...
 
virtual void stop ()=0
 stops this camera. When the camera is stopped it can be reinitialized using initialize()
 
virtual void acquire ()=0
 aquires an image from the camera. This method is not blocking. Use isImageReady to poll for completion of acquire.
 
virtual bool isImageReady ()=0
 tests whether a image has been acquired More...
 
virtual const ImagegetImage ()=0
 returns the last image acquired from the camera. This method is not blocking, if no image has been acquired yet an empty image is returned. The image returned can for some specific drivers be read only. More...
 
virtual double getFrameRate ()=0
 returns the framerate that this camera is setup with More...
 
virtual void setFrameRate (double framerate)=0
 sets the framerate of this camera. If the framerate is not supported the closest supported framerate is choosen. More...
 
virtual unsigned int getWidth ()=0
 get width of the captured images More...
 
virtual unsigned int getHeight ()=0
 get width of the captured images More...
 
virtual bool addListener (CameraListener &listener)
 adds a CameraListener to this camera More...
 
virtual bool removeListener (CameraListener &listener)
 removes a CameraListener from this cameras listener list. More...
 
virtual bool isShutterAvailable () const
 
virtual double getShutter () const
 
virtual void setShutter (double Value)
 
virtual std::pair< double, double > getShutterBounds () const
 
virtual bool isGainAvailable () const
 
virtual double getGain () const
 
virtual double setGain (double Value)
 
- Public Member Functions inherited from Sensor
virtual ~Sensor ()
 destructor
 
const std::string & getName () const
 returns the name of this sensor More...
 
const std::string & getDescription () const
 returns a description of this sensor More...
 
rw::core::Ptr< rw::sensor::SensorModelgetSensorModel () const
 The frame to which the sensor is attached. More...
 
virtual void setSensorModel (rw::core::Ptr< rw::sensor::SensorModel > smodel)
 Sets the frame to which the sensor should be attached. More...
 
rw::core::PropertyMapgetPropertyMap ()
 gets the propertymap of this sensor
 
const rw::core::PropertyMapgetPropertyMap () const
 gets the propertymap of this sensor
 

Protected Member Functions

 Camera (const std::string &name, const std::string &modelInfo)
 constructor More...
 
void setModelInfo (const std::string info)
 sets the camera model information More...
 
- Protected Member Functions inherited from Sensor
 Sensor (const std::string &name)
 constructor More...
 
 Sensor (const std::string &name, const std::string &description)
 constructor More...
 
void setName (const std::string &name)
 sets the name of this sensor More...
 
void setDescription (const std::string &description)
 sets the description of this sensor More...
 

Protected Attributes

std::vector< CameraListener * > _listeners
 the list of CameraListeners
 
std::string _modelInfo
 name of camera model information
 
bool _initialized
 state variable - true if camera is initialized
 
bool _started
 state variable - true if camera is started
 

Detailed Description

The Camera class defines a generel interface to a camera. A great deal of the interface resembles the DCAM standard since DCAM allready defines a very wide interface.

typical usage: Camera c; // setup camera features modes and so on c.initialize(); c.start(); // acquire images c.stop();

Constructor & Destructor Documentation

◆ Camera()

Camera ( const std::string &  name,
const std::string &  modelInfo 
)
protected

constructor

Parameters
name[in] name of sensor
modelInfo[in] info string

Member Function Documentation

◆ addListener()

virtual bool addListener ( CameraListener listener)
virtual

adds a CameraListener to this camera

Parameters
listener[in] the CameraListener that is to be added
Returns
true if listener was added succesfully, false otherwise

◆ getFrameRate()

virtual double getFrameRate ( )
pure virtual

returns the framerate that this camera is setup with

Returns
the framerate in frames per second

◆ getGain()

virtual double getGain ( ) const
inlinevirtual

Get actual gain value. Note: If gain is not available then a dummy implementation returning -1 is used and an error message is produced.

Returns
Gain value.

◆ getHeight()

virtual unsigned int getHeight ( )
pure virtual

get width of the captured images

Returns
width

◆ getImage()

virtual const Image* getImage ( )
pure virtual

returns the last image acquired from the camera. This method is not blocking, if no image has been acquired yet an empty image is returned. The image returned can for some specific drivers be read only.

Returns
last image captured from camera.

◆ getModelInfo()

virtual std::string getModelInfo ( ) const
inlinevirtual

returns the camera model information (version, type, size, etc.)

Returns
camera model information

◆ getShutter()

virtual double getShutter ( ) const
inlinevirtual

Get actual shutter value. Note: If shutter is not available then a dummy implementation will throw an error message.

Returns
shutter value in micro-seconds.

◆ getShutterBounds()

virtual std::pair<double, double> getShutterBounds ( ) const
inlinevirtual

gets the shutter bounds. Note: If shutter is not available then a dummy implementation will throw an error message.

Returns
first value is the min bound and second value is the max bound

◆ getWidth()

virtual unsigned int getWidth ( )
pure virtual

get width of the captured images

Returns
width

◆ initialize()

virtual bool initialize ( )
pure virtual

initializes the camera to the current settings (CaptureMode,ColorMode,etc.)

Returns
true if initialization is succesfully, false otherwise.

◆ isGainAvailable()

virtual bool isGainAvailable ( ) const
inlinevirtual

Check if gain is available.

Returns
True if zoom is available

◆ isImageReady()

virtual bool isImageReady ( )
pure virtual

tests whether a image has been acquired

Returns
true if an image has been acquired, false otherwise.

◆ isInitialized()

bool isInitialized ( ) const
inline

returns whether this camera is initialized or not.

Returns
true if intialized, false otherwise

◆ isShutterAvailable()

virtual bool isShutterAvailable ( ) const
inlinevirtual

Check if shutter is available.

Returns
True if shutter is available

◆ isStarted()

bool isStarted ( ) const
inline

returns whether this camera is started or not.

Returns
true if started, false otherwise

◆ removeListener()

virtual bool removeListener ( CameraListener listener)
virtual

removes a CameraListener from this cameras listener list.

Parameters
listener[in] the listener that is to be removed
Returns
true if listener was removed succesfully, false otherwise.

◆ setFrameRate()

virtual void setFrameRate ( double  framerate)
pure virtual

sets the framerate of this camera. If the framerate is not supported the closest supported framerate is choosen.

Parameters
framerate[in] the framerate

◆ setGain()

virtual double setGain ( double  Value)
inlinevirtual

Set gain value. If the given value is not possible the nearest value are choosen. Note: If gain is not available then a dummy implementation returning -1 is used and an error message is produced.

Parameters
ValueNew gain value.
Returns
New nearest gain value.

◆ setModelInfo()

void setModelInfo ( const std::string  info)
inlineprotected

sets the camera model information

Parameters
info[in] information of the camera

◆ setShutter()

virtual void setShutter ( double  Value)
inlinevirtual

Set shutter value. If the given value is not possible the nearest value are choosen. Note: If shutter is not available then a dummy implementation will throw an error message.

Parameters
ValueNew shutter value.

◆ start()

virtual bool start ( )
pure virtual

starts this camera, if the camera has not been initialized the initialize function will be called.

Returns
true if camera was successfully started, false otherwise

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