All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Radiant::VideoCamera Class Referenceabstract

VideoCamera provides a common interface for different video cameras. More...

#include <Radiant/VideoCamera.hpp>

Inheritance diagram for Radiant::VideoCamera:
Radiant::VideoInput

Classes

struct  CameraFeature
 A container of basic camera feature information. More...
 
class  CameraInfo
 A container of basic camera information. More...
 

Public Types

enum  FeatureMode { MODE_MANUAL = 0, MODE_AUTO, MODE_ONE_PUSH_AUTO, MODE_MAX }
 Camera feature modes.
 
enum  FeatureType {
  BRIGHTNESS = 0, EXPOSURE, SHARPNESS, WHITE_BALANCE,
  HUE, SATURATION, GAMMA, SHUTTER,
  GAIN, IRIS, FOCUS, TEMPERATURE,
  TRIGGER, TRIGGER_DELAY, WHITE_SHADING, FRAME_RATE,
  ZOOM, PAN, TILT, OPTICAL_FILTER,
  CAPTURE_SIZE, CAPTURE_QUALITY, FEATURE_TYPE_MAX
}
 Camera feature types.
 
enum  TriggerMode {
  TRIGGER_MODE_0 = 0, TRIGGER_MODE_1, TRIGGER_MODE_2, TRIGGER_MODE_3,
  TRIGGER_MODE_4, TRIGGER_MODE_5, TRIGGER_MODE_14 = 14, TRIGGER_MODE_15 = 15,
  TRIGGER_MODE_MAX
}
 Camera external trigger modes.
 
enum  TriggerPolarity { TRIGGER_ACTIVE_LOW = 0, TRIGGER_ACTIVE_HIGH, TRIGGER_ACTIVE_UNDEFINED }
 Camera external trigger polarity.
 
enum  TriggerSource {
  TRIGGER_SOURCE_0 = 0, TRIGGER_SOURCE_1, TRIGGER_SOURCE_2, TRIGGER_SOURCE_3,
  TRIGGER_SOURCE_SOFTWARE, TRIGGER_SOURCE_MAX
}
 Camera external trigger sources.
 

Public Member Functions

virtual CameraInfo cameraInfo ()=0
 Returns information about this particular camera object. More...
 
virtual bool disableTrigger ()=0
 Disables external trigger for the camera. More...
 
CameraDriverdriver ()
 Returns the driver which created this camera. More...
 
virtual bool enableTrigger (TriggerSource src)=0
 Sets the external trigger source for the camera. More...
 
virtual int framesBehind () const =0
 Returns the number of frames that would be immediately readable. More...
 
virtual void getFeatures (std::vector< CameraFeature > *features)=0
 Gets the different features that the camera supports. More...
 
virtual bool open (uint64_t euid, int width, int height, ImageFormat fmt=IMAGE_UNKNOWN, FrameRate framerate=FPS_IGNORE)=0
 Opens a connection to the camera and initializes the image capture parameters. More...
 
virtual bool openFormat7 (uint64_t cameraeuid, Nimble::Recti roi, float fps, int mode)=0
 Opens a connection to the camera and sets up format7 image capture. More...
 
virtual void sendSoftwareTrigger ()=0
 Sends a software trigger signal to the camera.
 
virtual void setBrightness (float value)
 Sets the value of the BRIGHTNESS feature. More...
 
virtual bool setCaptureTimeout (int ms)=0
 Sets the timeout for waiting for a new frame from the camera. More...
 
virtual void setExposure (float value)
 Sets the value of the EXPOSURE feature. More...
 
virtual void setFeature (FeatureType id, float value)=0
 
Sets the relative value of a feature based on the minimum and maximum

values. More...

 
virtual void setFeatureRaw (FeatureType id, int32_t value)=0
 Sets the absolute value of a feature. More...
 
virtual void setFocus (float value)
 Sets the value of the FOCUS feature. More...
 
virtual void setGain (float value)
 Sets the value of the GAIN feature. More...
 
virtual void setGamma (float value)
 Sets the value of the GAMMA feature. More...
 
virtual void setPan (float value)
 Sets the value of the PAN feature. More...
 
virtual void setShutter (float value)
 Sets the value of the SHUTTER feature. More...
 
virtual void setTilt (float value)
 Sets the value of the TILT feature. More...
 
virtual bool setTriggerMode (TriggerMode mode)=0
 Sets the external trigger mode for the camera. More...
 
virtual bool setTriggerPolarity (TriggerPolarity polarity)=0
 Sets the polarity of external trigger. More...
 
 VideoCamera (CameraDriver *driver)
 Constructs a new video camera. More...
 
virtual ~VideoCamera ()
 Destructor.
 
- Public Member Functions inherited from Radiant::VideoInput
virtual const void * captureAudio (int *frameCount)
 Get audio data. More...
 
virtual const Radiant::VideoImagecaptureImage ()=0
 This method captures an image from the video source. More...
 
virtual bool close ()=0
 Close the device. More...
 
virtual void doneImage ()
 Inform the video handler that the application has used the image. More...
 
virtual Nimble::Vector2i focalPoint () const
 
virtual float fps () const =0
 Returns the current frame rate (int frames per second) of the video stream. More...
 
virtual void getAudioParameters (int *channels, int *sample_rate, AudioSampleFormat *format) const
 Get audio parameters. More...
 
virtual int height () const =0
 Returns the current height of a frame in the video stream images. More...
 
virtual ImageFormat imageFormat () const =0
 Returns the current image format of the stream. More...
 
virtual unsigned int size () const =0
 Returns the total size of one captured image frame in bytes. More...
 
virtual bool start ()=0
 Starts the data transmission. More...
 
virtual bool stop ()=0
 Stops the data transmission. More...
 
virtual uint64_t uid ()
 Returns the unique identifier for the input device. More...
 
virtual int width () const =0
 Returns the current width of a frame in the video stream images. More...
 
virtual ~VideoInput ()
 Destructor.
 

Static Public Member Functions

static CameraDriverFactorydrivers ()
 Returns an instance of the camera driver factory. More...
 
static const char * featureName (FeatureType id)
 Returns a human-readable name for a feature given the feature id. More...
 
static bool hasAutoMode (const CameraFeature &feature)
 Checks if the given camera feature supports a automatic mode. More...
 
static bool hasManualMode (const CameraFeature &feature)
 Checks if the given camera feature supports a manual mode. More...
 
static bool hasMode (const CameraFeature &feature, FeatureMode mode)
 Checks if the given camera feature supports a certain mode. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Radiant::VideoInput
 VideoInput ()
 Disabled.
 

Detailed Description

VideoCamera provides a common interface for different video cameras.

Each new camera driver should implement this interface and the CameraDriver interface.

Constructor & Destructor Documentation

Radiant::VideoCamera::VideoCamera ( CameraDriver driver)

Constructs a new video camera.

Parameters
drivercamera driver from where the camera was instantiated from

Member Function Documentation

virtual CameraInfo Radiant::VideoCamera::cameraInfo ( )
pure virtual

Returns information about this particular camera object.

Returns
Information about this camera
virtual bool Radiant::VideoCamera::disableTrigger ( )
pure virtual

Disables external trigger for the camera.

Returns
True is succeeded, false otherwise
CameraDriver* Radiant::VideoCamera::driver ( )
inline

Returns the driver which created this camera.

Returns
Driver which created this camera
static CameraDriverFactory& Radiant::VideoCamera::drivers ( )
static

Returns an instance of the camera driver factory.

Returns
Factory for creating drivers
virtual bool Radiant::VideoCamera::enableTrigger ( TriggerSource  src)
pure virtual

Sets the external trigger source for the camera.

Parameters
srcSource to set
Returns
True if succeeded, false otherwise
static const char* Radiant::VideoCamera::featureName ( FeatureType  id)
static

Returns a human-readable name for a feature given the feature id.

Parameters
idId of the feature
Returns
Name of the feature
virtual int Radiant::VideoCamera::framesBehind ( ) const
pure virtual

Returns the number of frames that would be immediately readable.

Returns
Number of frames
virtual void Radiant::VideoCamera::getFeatures ( std::vector< CameraFeature > *  features)
pure virtual

Gets the different features that the camera supports.

Parameters
features[out]Vector for features returned
static bool Radiant::VideoCamera::hasAutoMode ( const CameraFeature feature)
inlinestatic

Checks if the given camera feature supports a automatic mode.

Parameters
featureFeature to check
Returns
True if the feature supports automatic mode, false otherwise
static bool Radiant::VideoCamera::hasManualMode ( const CameraFeature feature)
inlinestatic

Checks if the given camera feature supports a manual mode.

Parameters
featureFeature to check
Returns
True if the feature supports manual mode, false otherwise
static bool Radiant::VideoCamera::hasMode ( const CameraFeature feature,
FeatureMode  mode 
)
static

Checks if the given camera feature supports a certain mode.

Parameters
featureFeature to query
modeMode to check
Returns
True if the feature has queried mode, false otherwise
virtual bool Radiant::VideoCamera::open ( uint64_t  euid,
int  width,
int  height,
ImageFormat  fmt = IMAGE_UNKNOWN,
FrameRate  framerate = FPS_IGNORE 
)
pure virtual

Opens a connection to the camera and initializes the image capture parameters.

Parameters
euidhardware id of the camera
widthwidth of the camera image
heightheight of the camera image
fmtimage format
framerateframerate of the camera
Returns
true if the device was successfully opened
virtual bool Radiant::VideoCamera::openFormat7 ( uint64_t  cameraeuid,
Nimble::Recti  roi,
float  fps,
int  mode 
)
pure virtual

Opens a connection to the camera and sets up format7 image capture.

Parameters
cameraeuidhardware id of the camera
roiregion of interest
fpsdesired frames per second
modedesired format7 mode
Returns
true if the device was successfully opened
virtual void Radiant::VideoCamera::setBrightness ( float  value)
virtual

Sets the value of the BRIGHTNESS feature.

Parameters
valueValue to set

Reimplemented from Radiant::VideoInput.

virtual bool Radiant::VideoCamera::setCaptureTimeout ( int  ms)
pure virtual

Sets the timeout for waiting for a new frame from the camera.

Parameters
msTimeout in milliseconds
virtual void Radiant::VideoCamera::setExposure ( float  value)
virtual

Sets the value of the EXPOSURE feature.

Parameters
valueValue to set

Reimplemented from Radiant::VideoInput.

virtual void Radiant::VideoCamera::setFeature ( FeatureType  id,
float  value 
)
pure virtual

Sets the relative value of a feature based on the minimum and maximum

values.

If the value is negative, the feature is set to automatic mode.

Parameters
idid of the feature to set
valuevalue to set
virtual void Radiant::VideoCamera::setFeatureRaw ( FeatureType  id,
int32_t  value 
)
pure virtual

Sets the absolute value of a feature.

Parameters
idid of the feature to set
valuevalue of the feature to set
virtual void Radiant::VideoCamera::setFocus ( float  value)
virtual

Sets the value of the FOCUS feature.

Parameters
valueValue to set
virtual void Radiant::VideoCamera::setGain ( float  value)
virtual

Sets the value of the GAIN feature.

Parameters
valueValue to set

Reimplemented from Radiant::VideoInput.

virtual void Radiant::VideoCamera::setGamma ( float  value)
virtual

Sets the value of the GAMMA feature.

Parameters
valueValue to set

Reimplemented from Radiant::VideoInput.

virtual void Radiant::VideoCamera::setPan ( float  value)
virtual

Sets the value of the PAN feature.

Parameters
valueValue to set
virtual void Radiant::VideoCamera::setShutter ( float  value)
virtual

Sets the value of the SHUTTER feature.

Parameters
valueValue to set

Reimplemented from Radiant::VideoInput.

virtual void Radiant::VideoCamera::setTilt ( float  value)
virtual

Sets the value of the TILT feature.

Parameters
valueValue to set
virtual bool Radiant::VideoCamera::setTriggerMode ( TriggerMode  mode)
pure virtual

Sets the external trigger mode for the camera.

Parameters
modeMode to set
Returns
True if succeeded, false otherwise
virtual bool Radiant::VideoCamera::setTriggerPolarity ( TriggerPolarity  polarity)
pure virtual

Sets the polarity of external trigger.

Parameters
polarityPolarity to set
Returns
True if succeeded, false otherwise