LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::fireWireDCAM Class Reference

Grab imags from FireWire Cameras. More...

#include <ltiFireWireDCAM.h>

Inheritance diagram for lti::fireWireDCAM:
Inheritance graph
[legend]
Collaboration diagram for lti::fireWireDCAM:
Collaboration graph
[legend]

List of all members.

Classes

class  busInfo
 IEEE 1394 Bus Information Class. More...
class  cameraInfo
 The camera information class. More...
class  cameraSet
 Set of cameras. More...
struct  format7Info
 Structure to hold format 7 information. More...
struct  format7ModeInfo
 Structure to hold format 7 mode information. More...
class  nameDB
 Camera database. More...
class  parameters
 The parameters for the class fireWireDCAM. More...

Public Types

enum  eFixMode { NoFix, AutoFix, Upload }
enum  eFeatureState {
  FeatureNA = 0, FeatureOff = 1, FeatureAuto = 2, FeatureManual = 4,
  FeatureOnePush = 8, FeatureAbsolute = 16
}
enum  eColorMode {
  Mono8 = 0, Mono16, Mono16s, YUV411,
  YUV422, YUV444, RGB8, RGB16,
  RGB16s, Raw8, Raw16, UnknownEncoding
}

Public Member Functions

 fireWireDCAM ()
 fireWireDCAM (const parameters &par)
 fireWireDCAM (const fireWireDCAM &other)
virtual ~fireWireDCAM ()
virtual const char * getTypeName () const
bool apply (image &dest)
bool apply (channel8 &dest)
bool grabRaw (matrix< ubyte > &dest)
bool updateParameters ()
bool getVideoMode (ipoint &resolution, eColorMode &encoding) const
bool getFramerate (float &framerate) const
bool init ()
bool printFeatures () const
bool dumpParameters (parameters &par)
fireWireDCAMcopy (const fireWireDCAM &other)
fireWireDCAMoperator= (const fireWireDCAM &other)
virtual functorclone () const
const parametersgetParameters () const
Direct access to camera features.

These methods access the camera registers directly, and they try to update the internal parameters.

However, since the cameras may adjust themselves, you may find the method fireWireDCAM::dumpParameters() useful, which asks the camera for all parameters in use at once.

If a feature supports the "one-push state", then the automatic configuration will begin as soon as you call the corresponding method with the value FeatureOnePush as state (for example setWhiteBalance(FeatureOnePush) ).

If you set the state of one or more features to one-push, then you may want to wait for them to be ready with the method onePushWait(). Of course, this will work if and only if the camera supports this feature state.

The methods to query information from the camera do indeed ask the camera for the corresponding value (if and only if this is possible). There are cameras which do not support the readout capability for the registers holding the feature values. In that case, the get* methods will return false.



bool setBrightness (const eFeatureState state, const float brightness=0)
bool getBrightness (eFeatureState &state, float &brightness) const
bool setExposure (const eFeatureState state, const float exposure=0)
bool getExposure (eFeatureState &state, float &exposure) const
bool setSharpness (const eFeatureState state, const float sharpness=0)
bool getSharpness (eFeatureState &state, float &sharpness) const
bool setWhiteBalance (const eFeatureState state, const float ubGain=0, const float vrGain=0)
bool getWhiteBalance (eFeatureState &state, float &ubGain, float &vrGain)
bool setHue (const eFeatureState state, const float hue=0)
bool getHue (eFeatureState &state, float &hue) const
bool setSaturation (const eFeatureState state, const float saturation=0)
bool getSaturation (eFeatureState &state, float &saturation) const
bool setGamma (const eFeatureState state, const float gamma=0)
bool getGamma (eFeatureState &state, float &gamma) const
bool setShutter (const eFeatureState state, const float shutter=0)
bool getShutter (eFeatureState &state, float &shutter) const
bool setGain (const eFeatureState state, const float gain=0)
bool getGain (eFeatureState &state, float &gain) const
bool setIris (const eFeatureState state, const float iris=0)
bool getIris (eFeatureState &state, float &iris) const
bool setFocus (const eFeatureState state, const float focus=0)
bool getFocus (eFeatureState &state, float &focus) const
bool setZoom (const eFeatureState state, const float zoom=0)
bool getZoom (eFeatureState &state, float &zoom) const
bool setPan (const eFeatureState state, const float pan=0)
bool getPan (eFeatureState &state, float &pan) const
bool setTilt (const eFeatureState state, const float tilt=0)
bool getTilt (eFeatureState &state, float &tilt) const
Access to internal data structures

The following methods can be found useful by GUI programmers who want to ask for availability of several features in order to set-up properly GUI elements.



bool isCameraActive () const
bool hasCameraFormat7 () const
bool isFeatureAvailable (const unsigned int featureId) const
bool isFeatureReadable (const unsigned int featureId) const
unsigned int checkFeatureStates (const unsigned int featureId) const
bool getFeatureState (const unsigned int featureId, eFeatureState &state) const
bool setFeatureState (const unsigned int featureId, const eFeatureState state)
bool setFeatureValue (const unsigned int featureId, const eFeatureState state, const float value=0)
bool getFeatureValue (const unsigned int featureId, eFeatureState &state, float &value) const
bool checkFeatureValueRange (const unsigned int featureId, int &minValue, int &maxValue) const

Protected Member Functions

parametersgetRWParameters ()
eFeatureState fixState (const unsigned int states, const eFeatureState desired) const
bool fixParameters (parameters &par) const
unsigned int convertFramerate (const float fps) const
float convertFramerate (const unsigned int eFR) const
unsigned int convertMode (const ipoint &resolution, const eColorMode &encoding) const
void convertMode (const unsigned int value, ipoint &resolution, eColorMode &encoding) const
bool isModeColor (const unsigned int mode) const
unsigned int computeClosestMode (const unsigned int mode) const
float computeClosestFrameRate (const unsigned int mode, const float fr) const
void convertMode7 (const unsigned int value, ipoint &resolution, eColorMode &encoding) const
eColorMode getColorCode7 (const unsigned int code) const
unsigned int getFormat (const ipoint &resolution) const
void yuv411toRGB (image &srcdest) const
void yuv422toRGB (image &srcdest) const
bool isFeatureAuto (const unsigned int featureId) const
bool setFeatureAuto (const unsigned int featureId, const bool on=true) const
bool setFeatureOn (const unsigned int featureId, const bool on=true)
bool setFeatureAbsoluteState (const unsigned int featureId, const bool on=true)
bool captureFrame ()
bool releaseCamera ()

Protected Attributes

int activeCamera_
std::string activeCameraName_
eColorMode colorMode_
channel8 ch8_
dc1394_cameracapture camera_
bool setupCapture_
mergeYCbCrToImage merger_
bayerDemosaicing bayer_
Shadow and pointers for active camera attributes

This shadows are set in updateParameters()



bool oneShotCapable_
const raw1394handle_t * handle_
const dc1394_feature_set * features_
const nodeid_t * node_
unsigned int busChannel_
unsigned int busSpeed_
bool isoTransStarted_

Hardware singletons

The following attributes represent the IEEE 1394 bus and all available cameras.



static bool hwCreated_
static busInfo bus_
static cameraSet cams_
static nameDB cameraNames_
bool initHardware ()
bool initCamera (const parameters &par)

One-Push Wait Scheduler

The following methods provide a very basic scheduler for check of the successful automatic adjustment of features in the one push mode



std::set< unsigned int > waitingFeatures_
mutex onePushLock_
bool onePushWait ()
bool onePushQueueInsert (const unsigned int featureId)

Detailed Description

Grab imags from FireWire Cameras.

This functor permits to interact with standard FireWire DCAM cameras (aka IIDC v1.3x). It is a wrapper of the libdc1394 library in (linux). You may find the information of the IIDC standard useful, which can be found on the net (for instance, in http://damien.douxchamps.net/ieee1394/libdc1394/iidc_specifications.php ).

System requirements:

Installation:

  1. compile or install above kernel modules for your kernel (usually they are in most distributions ready)
  2. create video devicefiles for video1394 (e.g. /dev/video1394). This is also usually automatically done.
  3. compile or install libdc1394 and libraw1394. Most distributions provide packages for them. Do not forget to install the "dev" or "devel" packages of the library as well.
  4. edit extrapaths.mk in the linux directory of your ltilib to permit the use of this functor. (example can be found in extrapaths_template.mk)
  5. compile ltilib
  6. all kernel modules must be loaded before running any code that uses this class.

Example:

    // viewer to display taken shot
    viewer view("FireWireDCAM");
 
    fireWireDCAM::parameters camPar;
    fireWireDCAM cam;

    // will be preserved by init()
    camPar.deviceFile = "/dev/video1394/0";
    camPar.oneShot = true;
    camPar.brightness = 22;

    // as the camera is initialized now, the new parameters will be written
    // into the camera
    cam.setParameters(camPar);
    // take picture
    image img;
    cam.apply(img);

    // show image
    view.show(img);

Not yet implemented:

Other things to do:

Warning:
Even if some code has been developed for support of one-push and format7 features, we haven't got a camera that supports them and therefore that code may not work. Please report any problems, or even better, submit a patch with fixes if they are necessary.

Member Enumeration Documentation

Enumeration of encoding methods allowed by the IIDC standard of the IEEE 1394.

Many of these constants are available for Format7 modes only, i.e., if the camera supports scalable image sizes.

Some of the following encoding methods are not supported by the LTI-Lib yet, specially those with 16 bits. Hence, the equivalent formats with lower precision would be used instead.

Enumerator:
Mono8 

Monochromatic with 8 bits (unsigned) per pixel.

Mono16 

Monochromatic with 16 bits (unsigned) per pixel.

Mono16s 

Monochromatic with 16 bits (signed) per pixel.

YUV411 

Yuv color space with 4:1:1 ratio.

YUV422 

Yuv color space with 4:2:2 ratio.

YUV444 

Yuv color space with 4:4:4 ratio.

RGB8 

RGB encoding with 8 bits per color channel.

RGB16 

RGB encoding with 16 bits (unsigned) per color channel.

RGB16s 

RGB encoding with 16 bits (signed) per color channel.

Raw8 

Raw data in 8 bits.

Raw16 

Raw data in 16 bits.

UnknownEncoding 

Dummy value for an unknown encoding.

Feature state.

Most features, following the IIDC standard, can be used in one of the following states.

Several notes on the values:

  • The FeatureOff can under circumstances be used to check if a feature can be turned off. The use of any other state implies that the feature is on.
  • The FeatureOnePush activates the "one-push" adjustment when the functor parameters are updated (setParameters() do that too, of course), or when one specific methods for direct camera control (like setBrightness()) is used.
  • The FeatureAbsolute is identical to manual, except that, if a camera supports it, the values are given in certain units specified by the standard, like degrees for hue, pan and tilt, percentage for brightness and saturation, meters for focus, and so on.
  • FeatureNA is used to indicate that a feature is not available or that the user wants this functor not to touch the configuration of a given feature.
Enumerator:
FeatureNA 

Feature not available.

FeatureOff 

Feature is deactivated.

FeatureAuto 

Feature adjustments are taken automatically.

FeatureManual 

Feature adjustments are done by the user.

FeatureOnePush 

Feature is automatically adjusted but only once.

FeatureAbsolute 

Feature is manually controled but using absolute values.

Auto correction modes for parameters.

While setting the parameters for a camera, you can decide how to behave on invalid parameters.

Enumerator:
NoFix 

Use the parameters as they are given, and if something is invalid, return an error.

AutoFix 

Try to use the parameters as they are given, but is something is invalid or not supported by the active camera, change it to a valid configuration.

Upload 

Ignore the parameters given, and simply upload the values in use in the camera indicated by the parameters set, which is set as active.


Constructor & Destructor Documentation

lti::fireWireDCAM::fireWireDCAM (  ) 

Default constructor.

You usually avoid using this constructor. Using fireWireDCAM(const parameters&) you can provide directly for which camera the constructed instance should work.

lti::fireWireDCAM::fireWireDCAM ( const parameters par  ) 

Construct with the given parameters instance.

You can give directly in the parameters object for which camera the instance should be created, therefore this is the most used constructor of this functor.

lti::fireWireDCAM::fireWireDCAM ( const fireWireDCAM other  ) 

Copy constructor.

Parameters:
other the object to be copied
virtual lti::fireWireDCAM::~fireWireDCAM (  )  [virtual]

Destructor.


Member Function Documentation

bool lti::fireWireDCAM::apply ( channel8 dest  )  [virtual]

Gets one frame from camera.

Parameters:
dest channel8 the result be left here.
Returns:
true if apply successful or false otherwise.

Implements lti::frameGrabber.

bool lti::fireWireDCAM::apply ( image dest  )  [virtual]

Gets one frame from camera.

Parameters:
dest image the result will be left here.
Returns:
true if apply successful or false otherwise.

Implements lti::frameGrabber.

bool lti::fireWireDCAM::captureFrame (  )  [protected]

Just capture a frame through libdc1394.

unsigned int lti::fireWireDCAM::checkFeatureStates ( const unsigned int  featureId  )  const

Check for availability of feature states.

Following the IIDC 1.3x standard, a given feature (see the list of valid identifiers in lti::fireWireDCAM::isFeatureAvailable() ) can have one of four states:

  • Off state: the feature is deactivated (some features cannot be deactivated).
  • Auto state: the feature is automatically adjusted
  • Manual state: the user controls the values a feature can get
  • One-Push state: the feature is automatically adjusted but only once.

This method asks the active camera which states are supported and returns a bitwise combination of fireWireDCAM::eFeatureState constants.

You have to ensure that a camera is active (see fireWireDCAM::isCameraActive()).

Parameters:
featureId identification for the feature to be modified (see fireWireDCAM::isFeatureAvailable() for a list of valid values)
bool lti::fireWireDCAM::checkFeatureValueRange ( const unsigned int  featureId,
int &  minValue,
int &  maxValue 
) const

Check the valid value range for a specified feature.

You have to ensure that there is an active camera before calling this method. (see fireWireDCAM::isCameraActive() )

Parameters:
featureId identification for the feature to be modified (see fireWireDCAM::isFeatureAvailable() for a list of valid values)
minValue minimum value accepted for the specified feature.
maxValue maximum value accepted for the specified feature.
Returns:
true if successful or false otherwise.
virtual functor* lti::fireWireDCAM::clone (  )  const [virtual]

Returns a pointer to a clone of this functor.

Implements lti::functor.

float lti::fireWireDCAM::computeClosestFrameRate ( const unsigned int  mode,
const float  fr 
) const [protected]

Compute the closest supported framerate for a given mode.

unsigned int lti::fireWireDCAM::computeClosestMode ( const unsigned int  mode  )  const [protected]

Compute the closest supported mode to a given IIDC valid mode.

the approximation is done with the following priorities:

  1. keep the mono or color attribute (unless your camera is monochrome, of course)
  2. select the closest resolution.
float lti::fireWireDCAM::convertFramerate ( const unsigned int  eFR  )  const [protected]

Get the float value in fps equivalent to the framerate enum value of the libdc1394.

unsigned int lti::fireWireDCAM::convertFramerate ( const float  fps  )  const [protected]

Get the closest framerate of the libdc1394 set of enums to the given framerate value coded in a float of fps.

This method does not consider the camera supported framerates, but the simple convertion.

void lti::fireWireDCAM::convertMode ( const unsigned int  value,
ipoint resolution,
eColorMode encoding 
) const [protected]

From the given value for format/mode after IIDC encoding, get the equivalent resolution and pixel encoding.

unsigned int lti::fireWireDCAM::convertMode ( const ipoint resolution,
const eColorMode encoding 
) const [protected]

Get "nearest" IIDC mode value from the given resolution and encoding.

As "nearest" it will be taken the resolution with the most similar number of pixels and within that resolution, the "nearest" encoding will be chosen (RGBs are in a group, Mono in another and YUV in another.

void lti::fireWireDCAM::convertMode7 ( const unsigned int  value,
ipoint resolution,
eColorMode encoding 
) const [protected]

From the given value for format7/mode after IIDC encoding, get the equivalent resolution and pixel encoding.

This method ask only for format 7 resolutions and encodings. For this task it has to ask the camera for that information.

The resolution returned will be the largest the camera supports.

fireWireDCAM& lti::fireWireDCAM::copy ( const fireWireDCAM other  ) 

Copy data of "other" functor.

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

Reimplemented from lti::frameGrabber.

bool lti::fireWireDCAM::dumpParameters ( parameters par  ) 

Read the actual hardware settings of the active camera and leave them into the given parameter instance.

Parameters:
par the parameters instance on which the gained information will be stored.
Returns:
true if operation was successfull, false otherwise (for instance, if there is no active camera to be read)
bool lti::fireWireDCAM::fixParameters ( parameters par  )  const [protected]

Analyse the given parameters instance and change its attributes to contain values supported by the active camera.

This method will work only if the camera of the given parameters is connected and found. Otherwise there will be no way to determine which values are appropriate for the camera.

eFeatureState lti::fireWireDCAM::fixState ( const unsigned int  states,
const eFeatureState  desired 
) const [protected]

For a bitwise combination of available states and a desired state, return a valid supported state.

bool lti::fireWireDCAM::getBrightness ( eFeatureState state,
float &  brightness 
) const

Get brightness state and value directly out of camera.

Parameters:
state Variable where the current brightness state is to be written.
brightness Variable where the brightness value is to be written.
Returns:
true if operation was successfull, false otherwise
eColorMode lti::fireWireDCAM::getColorCode7 ( const unsigned int  code  )  const [protected]

Get a functor valid code for a color space given in the libdc1394 enumeration for a Format7 color code.

bool lti::fireWireDCAM::getExposure ( eFeatureState state,
float &  exposure 
) const

Get exposure state and value directly out of camera.

Parameters:
state Variable where the current exposure state is to be written.
exposure Variable where the exposure value is to be written.
Returns:
true if operation was successfull, false otherwise
bool lti::fireWireDCAM::getFeatureState ( const unsigned int  featureId,
eFeatureState state 
) const

Get feature state of the camera.

Returns:
true if feature state could be successfully read, or false if this was not possible (maybe the camera does not support the given feature at all).
bool lti::fireWireDCAM::getFeatureValue ( const unsigned int  featureId,
eFeatureState state,
float &  value 
) const [inline]

Get control state and value of a particular feature.

This method does not support those features that require two values, like white balance.

Parameters:
featureId identification for the feature to be queried.
state State in which the feature is being used
value if state is manual, the value to be used.
Returns:
true if operation was successfull, false otherwise (for example, if the feature is not supported by the camera).
bool lti::fireWireDCAM::getFocus ( eFeatureState state,
float &  focus 
) const

Get focus state and value directly out of camera.

Parameters:
state Variable where the current focus state is to be written.
focus Variable where the focus value is to be written.
Returns:
true if operation was successfull, false otherwise
unsigned int lti::fireWireDCAM::getFormat ( const ipoint resolution  )  const [protected]

Get the corresponding format for the given resolution.

bool lti::fireWireDCAM::getFramerate ( float &  framerate  )  const

Get current frame rate directly out of camera.

Returns:
true if operation was successfull, false otherwise
bool lti::fireWireDCAM::getGain ( eFeatureState state,
float &  gain 
) const

Get gain state and value directly out of camera.

Parameters:
state Variable where the current gain state is to be written.
gain Variable where the gain value is to be written.
Returns:
true if operation was successfull, false otherwise
bool lti::fireWireDCAM::getGamma ( eFeatureState state,
float &  gamma 
) const

Get gamma state and value directly out of camera.

Parameters:
state Variable where the current gamma state is to be written.
gamma Variable where the gamma value is to be written.
Returns:
true if operation was successfull, false otherwise
bool lti::fireWireDCAM::getHue ( eFeatureState state,
float &  hue 
) const

Get hue state and value directly out of camera.

Parameters:
state Variable where the current hue state is to be written.
hue Variable where the hue value is to be written.
Returns:
true if operation was successfull, false otherwise
bool lti::fireWireDCAM::getIris ( eFeatureState state,
float &  iris 
) const

Get iris state and value directly out of camera.

Parameters:
state Variable where the current iris state is to be written.
iris Variable where the iris value is to be written.
Returns:
true if operation was successfull, false otherwise
bool lti::fireWireDCAM::getPan ( eFeatureState state,
float &  pan 
) const

Get pan state and value directly out of camera.

Parameters:
state Variable where the current pan state is to be written.
pan Variable where the pan value is to be written.
Returns:
true if operation was successfull, false otherwise
const parameters& lti::fireWireDCAM::getParameters (  )  const

Returns used parameters.

Reimplemented from lti::frameGrabber.

parameters& lti::fireWireDCAM::getRWParameters (  )  [protected]

Returns modifieable parameters.

bool lti::fireWireDCAM::getSaturation ( eFeatureState state,
float &  saturation 
) const

Get saturation state and value directly out of camera.

Parameters:
state Variable where the current saturation state is to be written.
saturation Variable where the saturation value is to be written.
Returns:
true if operation was successfull, false otherwise
bool lti::fireWireDCAM::getSharpness ( eFeatureState state,
float &  sharpness 
) const

Get sharpness state and value directly out of camera.

Parameters:
state Variable where the current sharpness state is to be written.
sharpness Variable where the sharpness value is to be written.
Returns:
true if operation was successfull, false otherwise
bool lti::fireWireDCAM::getShutter ( eFeatureState state,
float &  shutter 
) const

Get shutter state and value directly out of camera.

Parameters:
state Variable where the current shutter state is to be written.
shutter Variable where the shutter value is to be written.
Returns:
true if operation was successfull, false otherwise
bool lti::fireWireDCAM::getTilt ( eFeatureState state,
float &  tilt 
) const

Get tilt state and value directly out of camera.

Parameters:
state Variable where the current tilt state is to be written.
tilt Variable where the tilt value is to be written.
Returns:
true if operation was successfull, false otherwise
virtual const char* lti::fireWireDCAM::getTypeName (  )  const [virtual]

Returns the name of this type ("fireWireDCAM").

Reimplemented from lti::frameGrabber.

bool lti::fireWireDCAM::getVideoMode ( ipoint resolution,
eColorMode encoding 
) const

Get current video mode directly out of camera.

The IIDC enum value read from the camera is decoded into a resolution and a pixel encoding value.

Parameters:
resolution ipoint with the image resolution.
encoding encoding type of each pixel (YUV422, RGB, etc.)
Returns:
true if operation was successfull, false otherwise
bool lti::fireWireDCAM::getWhiteBalance ( eFeatureState state,
float &  ubGain,
float &  vrGain 
)

Get whiteBalance state and value directly out of camera.

Parameters:
state Variable where the current whiteBalance state is to be written.
ubGain gain for the blue channel (or U channel)
vrGain gain for the red channel (or V channel)
Returns:
true if operation was successfull, false otherwise
bool lti::fireWireDCAM::getZoom ( eFeatureState state,
float &  zoom 
) const

Get zoom state and value directly out of camera.

Parameters:
state Variable where the current zoom state is to be written.
zoom Variable where the zoom value is to be written.
Returns:
true if operation was successfull, false otherwise
bool lti::fireWireDCAM::grabRaw ( matrix< ubyte > &  dest  ) 

Grabs a raw frame from camera.

Parameters:
dest channle8 where the result will be left.
Returns:
true if apply successful or false otherwise.
bool lti::fireWireDCAM::hasCameraFormat7 (  )  const

Check if the active camera supports format 7.

bool lti::fireWireDCAM::init (  )  [virtual]

Initializes the IEEE Bus and checks for available cameras.

This method will be called automatically, when necessary. Hence, you do not need to worry about it.

Returns:
true if operation was successfull, false otherwise

Implements lti::frameGrabber.

bool lti::fireWireDCAM::initCamera ( const parameters par  )  [protected]

Initialize the current camera.

bool lti::fireWireDCAM::initHardware (  )  [protected]

Initialize the hardware.

bool lti::fireWireDCAM::isCameraActive (  )  const

Check if a camera has been activated for this functor.

Returns:
true if a camera has been successfully activated, or false otherwise.
bool lti::fireWireDCAM::isFeatureAuto ( const unsigned int  featureId  )  const [protected]

Check if a specific feature is set to "auto".

See lti::fireWireDCAM::isFeatureAvailable() for a list of the valid featureId and their meanings.

Parameters:
featureId identification for the feature to be modified (see fireWireDCAM::isFeatureAvailable() for a list of valid values)
Returns:
true if the feature is set to "auto" or false otherwise.
bool lti::fireWireDCAM::isFeatureAvailable ( const unsigned int  featureId  )  const

Check if a particular feature is available in the current active camera.

You have to ensure that a camera is already active (see isCameraActive()).

Parameters:
featureId The identification of the feature expects one of the following values, defined in the libdc1394:

  • FEATURE_BRIGHTNESS
  • FEATURE_EXPOSURE
  • FEATURE_SHARPNESS
  • FEATURE_WHITE_BALANCE
  • FEATURE_HUE
  • FEATURE_SATURATION
  • FEATURE_GAMMA
  • FEATURE_SHUTTER
  • FEATURE_GAIN
  • FEATURE_IRIS
  • FEATURE_FOCUS
  • FEATURE_TEMPERATURE
  • FEATURE_TRIGGER
  • FEATURE_TRIGGER_DELAY
  • FEATURE_WHITE_SHADING
  • FEATURE_FRAME_RATE
  • FEATURE_ZOOM
  • FEATURE_PAN
  • FEATURE_TILT
  • FEATURE_OPTICAL_FILTER
  • FEATURE_CAPTURE_SIZE
  • FEATURE_CAPTURE_QUALITY
bool lti::fireWireDCAM::isFeatureReadable ( const unsigned int  featureId  )  const

Check if a feature is available and is read-out capable.

Parameters:
featureId identification for the feature to be queried. (see fireWireDCAM::isFeatureAvailable() for a list of valid values)
Returns:
true if feature is read-out capable or false if it is not available at all, or if it is not readable.
bool lti::fireWireDCAM::isModeColor ( const unsigned int  mode  )  const [protected]

For a mode of the formats 0, 1 or 2, indicate if it is a color mode.

Returns:
true if the mode is a color mode (RGB or YUV), or false if the mode is monochrome.
bool lti::fireWireDCAM::onePushQueueInsert ( const unsigned int  featureId  )  [protected]

Insert the given feature into the waiting queue.

Parameters:
featureId identification of the feature that want to wait for leaving the one-push state.
Returns:
true if feature could be inserted or false if it was something wrong (not supported, or a real error).
bool lti::fireWireDCAM::onePushWait (  ) 

Wait until all features in the waiting queue have left the queue.

Returns:
true if all features left the one-push state on a time less than the time-out, or false otherwise.
fireWireDCAM& lti::fireWireDCAM::operator= ( const fireWireDCAM other  ) 

Alias for copy member.

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

Reimplemented from lti::functor.

bool lti::fireWireDCAM::printFeatures (  )  const

Member function that prints informations about camera features on stdout.

Returns:
true if operation was successfull, false otherwise
bool lti::fireWireDCAM::releaseCamera (  )  [protected]

Release the active camera.

This allow that another instance can take control of this camera.

bool lti::fireWireDCAM::setBrightness ( const eFeatureState  state,
const float  brightness = 0 
)

Set brightness control state and register in camera directly.

Parameters:
state Camera desired state (
See also:
eFeatureState)
Parameters:
brightness If state is manual, the value to be used.
Returns:
true if operation was successfull, false otherwise
bool lti::fireWireDCAM::setExposure ( const eFeatureState  state,
const float  exposure = 0 
)

Set exposure control state and register in camera directly.

Parameters:
state Camera desired state (
See also:
eFeatureState)
Parameters:
exposure If state is manual, the value to be used.
Returns:
true if operation was successfull, false otherwise
bool lti::fireWireDCAM::setFeatureAbsoluteState ( const unsigned int  featureId,
const bool  on = true 
) [protected]

Turn a feature absolute state on or off.

Parameters:
featureId identification for the feature to be modified (see fireWireDCAM::isFeatureAvailable() for a list of valid values)
on if true the absolute mode is turned on, if false then it is turned off
Returns:
true if feature state could be modified, of false otherwise.
bool lti::fireWireDCAM::setFeatureAuto ( const unsigned int  featureId,
const bool  on = true 
) const [protected]

Set a feature to "auto".

Parameters:
featureId identification for the feature to be modified (see fireWireDCAM::isFeatureAvailable() for a list of valid values)
on (default true) if true, the auto state is activated. If false, the auto state is turned off.
bool lti::fireWireDCAM::setFeatureOn ( const unsigned int  featureId,
const bool  on = true 
) [protected]

Turn a feature on or off.

Parameters:
featureId identification for the feature to be modified (see fireWireDCAM::isFeatureAvailable() for a list of valid values)
on if true the feature is turned on, if false then it is turned off
Returns:
true if feature state could be modified, of false otherwise.
bool lti::fireWireDCAM::setFeatureState ( const unsigned int  featureId,
const eFeatureState  state 
)

Set feature state of the camera.

Returns:
true if feature state could be successfully set, or false if this was not possible (maybe the camera does not support the given state for the feature.
bool lti::fireWireDCAM::setFeatureValue ( const unsigned int  featureId,
const eFeatureState  state,
const float  value = 0 
) [inline]

Set control state and value of a particular feature.

This method does not support those features that require two values, like white balance.

This private method does not modify the internal parameters.

Parameters:
featureId identification for the feature to be modified (see fireWireDCAM::isFeatureAvailable() for a list of valid values)
state Camera desired state (
See also:
eFeatureState)
Parameters:
value If state is manual, the value to be used.
Returns:
true if operation was successfull, false otherwise
bool lti::fireWireDCAM::setFocus ( const eFeatureState  state,
const float  focus = 0 
)

Set focus control state and register in camera directly.

Parameters:
state Camera desired state (
See also:
eFeatureState)
Parameters:
focus If state is manual, the value to be used.
Returns:
true if operation was successfull, false otherwise
bool lti::fireWireDCAM::setGain ( const eFeatureState  state,
const float  gain = 0 
)

Set gain control state and register in camera directly.

Parameters:
state Camera desired state (
See also:
eFeatureState)
Parameters:
gain If state is manual, the value to be used.
Returns:
true if operation was successfull, false otherwise
bool lti::fireWireDCAM::setGamma ( const eFeatureState  state,
const float  gamma = 0 
)

Set gamma control state and register in camera directly.

Parameters:
state Camera desired state (
See also:
eFeatureState)
Parameters:
gamma If state is manual, the value to be used.
Returns:
true if operation was successfull, false otherwise
bool lti::fireWireDCAM::setHue ( const eFeatureState  state,
const float  hue = 0 
)

Set hue control state and register in camera directly.

Parameters:
state Camera desired state (
See also:
eFeatureState)
Parameters:
hue If state is manual, the value to be used.
Returns:
true if operation was successfull, false otherwise
bool lti::fireWireDCAM::setIris ( const eFeatureState  state,
const float  iris = 0 
)

Set iris control state and register in camera directly.

Parameters:
state Camera desired state (
See also:
eFeatureState)
Parameters:
iris If state is manual, the value to be used.
Returns:
true if operation was successfull, false otherwise
bool lti::fireWireDCAM::setPan ( const eFeatureState  state,
const float  pan = 0 
)

Set pan control state and register in camera directly.

Parameters:
state Camera desired state (
See also:
eFeatureState)
Parameters:
pan If state is manual, the value to be used.
Returns:
true if operation was successfull, false otherwise
bool lti::fireWireDCAM::setSaturation ( const eFeatureState  state,
const float  saturation = 0 
)

Set saturation control state and register in camera directly.

Parameters:
state Camera desired state (
See also:
eFeatureState)
Parameters:
saturation If state is manual, the value to be used.
Returns:
true if operation was successfull, false otherwise
bool lti::fireWireDCAM::setSharpness ( const eFeatureState  state,
const float  sharpness = 0 
)

Set sharpness control state and register in camera directly.

Parameters:
state Camera desired state (
See also:
eFeatureState)
Parameters:
sharpness If state is manual, the value to be used.
Returns:
true if operation was successfull, false otherwise
bool lti::fireWireDCAM::setShutter ( const eFeatureState  state,
const float  shutter = 0 
)

Set shutter control state and register in camera directly.

Parameters:
state Camera desired state (
See also:
eFeatureState)
Parameters:
shutter If state is manual, the value to be used.
Returns:
true if operation was successfull, false otherwise
bool lti::fireWireDCAM::setTilt ( const eFeatureState  state,
const float  tilt = 0 
)

Set tilt control state and register in camera directly.

Parameters:
state Camera desired state (
See also:
eFeatureState)
Parameters:
tilt If state is manual, the value to be used.
Returns:
true if operation was successfull, false otherwise
bool lti::fireWireDCAM::setWhiteBalance ( const eFeatureState  state,
const float  ubGain = 0,
const float  vrGain = 0 
)

Set whiteBalance control state and register in camera directly.

Depending on the color space used by the camera (RGB or YUV), the color gains are applied to UV or to BR.

Parameters:
state Camera desired state (
See also:
eFeatureState)
Parameters:
ubGain gain for the blue channel (or U channel)
vrGain gain for the red channel (or V channel)
Returns:
true if operation was successfull, false otherwise
bool lti::fireWireDCAM::setZoom ( const eFeatureState  state,
const float  zoom = 0 
)

Set zoom control state and register in camera directly.

Parameters:
state Camera desired state (
See also:
eFeatureState)
Parameters:
zoom If state is manual, the value to be used.
Returns:
true if operation was successfull, false otherwise
bool lti::fireWireDCAM::updateParameters (  )  [virtual]

write parameters in camera

Reimplemented from lti::functor.

void lti::fireWireDCAM::yuv411toRGB ( image srcdest  )  const [protected]

converts YUV411 to RGB

void lti::fireWireDCAM::yuv422toRGB ( image srcdest  )  const [protected]

converts YUV422 to RGB


Member Data Documentation

Store the index for cams_ of the camera represented by this instance.

If activeCamera_ is less than zero then it indicates that this functor has not initialized its camera yet.

std::string lti::fireWireDCAM::activeCameraName_ [protected]

Active camera name.

The index in activeCamera_ corresponds to the a camera with the name activeCameraName_, which is used to decide if setParameters is telling this functor to change the camera being used.

demosaicing functor for Mono to RGB conversion

busInfo lti::fireWireDCAM::bus_ [static, protected]

The one and only instance for the IEEE1394 bus.

unsigned int lti::fireWireDCAM::busChannel_ [protected]

FireWire channel used for the camera.

unsigned int lti::fireWireDCAM::busSpeed_ [protected]

FireWire bus speed used.

dc1394_cameracapture lti::fireWireDCAM::camera_ [protected]

Capture handle with the camera node, buffer etc.

The camera names database.

cameraSet lti::fireWireDCAM::cams_ [static, protected]

The camera set attached to the IEEE1394 bus found.

Just a buffer channel8.

Colormode used for conversion to rgb image.

const dc1394_feature_set* lti::fireWireDCAM::features_ [protected]

Saves what features are available.

This is a pointer to cams_[activeCamera_].featureSet

const raw1394handle_t* lti::fireWireDCAM::handle_ [protected]

FireWire handle for low level communication.

This is a pointer to cams_[activeCamera_].info.handle

bool lti::fireWireDCAM::hwCreated_ [static, protected]

Flag set to true if the bus and camera set were already initialized or false otherwise.

Flag to indicate if the ISO transmision has been started.

merger for YUV to RGB conversion

const nodeid_t* lti::fireWireDCAM::node_ [protected]

Shadow of the node id.

This is a pointer to cams_[activeCamera_].info.id

Protect the queue from multiple access.

Shadow value of current in use camera to indicate that it is capable of oneShot capture.

This is a shadow of cams_[activeCamera_].miscInfo.one_shot_capable;

If a setup capture succeeded.

std::set<unsigned int> lti::fireWireDCAM::waitingFeatures_ [protected]

Feature list in waiting process.


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

Generated on Sat Apr 10 15:28:01 2010 for LTI-Lib by Doxygen 1.6.1