ViSP  2.8.0

#include <vp1394Grabber.h>

+ Inheritance diagram for vp1394Grabber:

Public Types

enum  vp1394ImageFormatType {
  YUV444, YUV422, YUV411, RGB,
  RGBa, MONO, MONO16
}
 

Public Member Functions

vp_deprecated vp1394Grabber ()
 
vp_deprecated vp1394Grabber (vpImage< unsigned char > &I)
 
virtual ~vp1394Grabber ()
 
void setCamera (unsigned int camera)
 
void getCamera (unsigned int &camera)
 
void setFormat (int format)
 
void getFormat (int &format)
 
int getFormatSupported (vpList< int > &formats)
 
void setMode (int mode)
 
void getMode (int &mode)
 
int getModeSupported (int format, vpList< int > &modes)
 
void setFramerate (int framerate)
 
void getFramerate (int &framerate)
 
int getFramerateSupported (int format, int mode, vpList< int > &framerates)
 
int convertFormat (std::string format)
 
int convertMode (std::string mode)
 
int convertFramerate (std::string framerate)
 
std::string convertFormat (int format)
 
std::string convertMode (int mode)
 
std::string convertFramerate (int framerate)
 
void setShutter (unsigned int shutter)
 
void getShutter (unsigned int &min_shutter, unsigned int &shutter, unsigned int &max_shutter)
 
void setGain (unsigned int gain)
 
void getGain (unsigned int &min_gain, unsigned int &gain, unsigned int &max_gain)
 
void open (vpImage< unsigned char > &I)
 
void acquire (vpImage< unsigned char > &I)
 
void open (vpImage< vpRGBa > &I)
 
void acquire (vpImage< vpRGBa > &I)
 
void close ()
 
void getWidth (unsigned int &width)
 
void getHeight (unsigned int &height)
 
void getNumCameras (unsigned int &cameras)
 
unsigned int getHeight () const
 
unsigned int getWidth () const
 

Public Attributes

bool init
 

Static Public Attributes

static const int DROP_FRAMES = 1
 
static const int NUM_BUFFERS = 8
 
static const int MAX_PORTS = 4
 
static const int MAX_CAMERAS = 8
 
static const char * strFormats [NUM_FORMATS]
 
static const char * strModesInFormat0 [NUM_FORMAT0_MODES]
 
static const char * strModesInFormat1 [NUM_FORMAT1_MODES]
 
static const char * strModesInFormat2 [NUM_FORMAT2_MODES]
 
static const char * strModesInFormat6 [NUM_FORMAT6_MODES]
 
static const char * strModesInFormat7 [NUM_MODE_FORMAT7]
 
static const char * strColorsInFormat7 [NUM_COLOR_FORMAT7]
 
static const char * strFramerates [NUM_FRAMERATES]
 

Protected Attributes

unsigned int height
 
unsigned int width
 

Detailed Description

Class for firewire ieee1394 video devices using libdc1394-1.x api.

Deprecated:
This class is deprecated. You should use vp1394TwoGrabber class instead.

Needs libraw1394-1.2.0 and libdc1394-1.1.0 or more recent versions available on http://sourceforge.net.

This class was tested with Marlin F033C and F131B cameras. This grabber is not working with a PointGrey DragonFly 2 camera. Since libdc1394-1.x is deprecated, you should better use vp1394TwoGrabber based on libdc1394-2.x.

The code below shows how to use this class.

#include <visp/vpConfig.h>
#include <visp/vpImage.h>
#include <visp/vpImageIo.h>
#include <visp/vp1394Grabber.h>
int main()
{
#if defined(VISP_HAVE_DC1394_1)
vpImage<unsigned char> I; // Create a gray level image container
vp1394Grabber g; // Create a grabber based on libdc1394-1.x third party lib
g.setFormat(FORMAT_VGA_NONCOMPRESSED); // Format_0
g.setMode(MODE_640x480_MONO); // Mode 5
g.setFramerate(FRAMERATE_15); // 15 fps
g.open(I); // Open the framegrabber
g.acquire(I); // Acquire an image
vpImageIo::write(I, "image.pgm"); // Write image on the disk
#endif
}
Author
Fabien Spindler (Fabie.nosp@m.n.Sp.nosp@m.indle.nosp@m.r@ir.nosp@m.isa.f.nosp@m.r), Irisa / Inria Rennes
Examples:
manGrab1394-1.cpp, and servoPtu46Point2DArtVelocity.cpp.

Definition at line 123 of file vp1394Grabber.h.

Member Enumeration Documentation

Supported image coding format.

Enumerator
YUV444 

YUV 4:4:4 coding format (24 bits/pixel)

YUV422 

YUV 4:2:2 coding format (16 bits/pixel)

YUV411 

YUV 4:1:1 coding format (12 bits/pixel)

RGB 

RGB coding format (24 bits/pixel)

RGBa 

RGBa coding format (32 bits/pixel)

MONO 

MONO8 coding format (8 bits/pixel)

MONO16 

MONO16 coding format (16 bits/pixel)

Definition at line 129 of file vp1394Grabber.h.

Constructor & Destructor Documentation

vp1394Grabber::vp1394Grabber ( )
Deprecated:
This class is deprecated. You shoud use vp1394TwoGrabber class instead.

Default constructor. Using this constructor, you have explicitly to call open().

By default:

  • the camera is the first found on the bus,

Current camera settings can be changed using setCamera(), setFormat(), setMode() or setFramerate() after a call to open(). The list of supported formats, modes and framerates is available using respectively getFormatSupported(), getModeSupported(), getFramerateSupported().

g.open(I);
g.setFormat(FORMAT_VGA_NONCOMPRESSED); // Format_0
g.setMode(MODE_640x480_MONO); // Mode 5
g.setFramerate(FRAMERATE_15); // 15 fps
See also
open(), setCamera(), setFormat(), setMode(), setFramerate()

Definition at line 172 of file vp1394Grabber.cpp.

References vpFrameGrabber::init, MAX_CAMERAS, and RGB.

vp1394Grabber::vp1394Grabber ( vpImage< unsigned char > &  I)
Deprecated:
This class is deprecated. You shoud use vp1394TwoGrabber class instead.

Constructor which initialize the grabber and call the open() method.

Parameters
I: Image data structure (8 bits image)

By default:

  • the camera is the first found on the bus,

Current camera settings can be changed using setCamera(), setFormat(), setMode() or setFramerate() after a call to open(). The list of supported formats, modes and framerates is available using respectively getFormatSupported(), getModeSupported(), getFramerateSupported().

g.setFormat(FORMAT_VGA_NONCOMPRESSED); // Format_0
g.setMode(MODE_640x480_MONO); // Mode 5
g.setFramerate(FRAMERATE_15); // 15 fps
See also
setCamera(), setFormat(), setMode(), setFramerate()

Definition at line 240 of file vp1394Grabber.cpp.

References vpFrameGrabber::init, MAX_CAMERAS, open(), and RGB.

vp1394Grabber::~vp1394Grabber ( )
virtual

Destructor.

Stops the iso transmission and close the device.

See also
close()

Definition at line 290 of file vp1394Grabber.cpp.

References close().

Member Function Documentation

void vp1394Grabber::close ( )
virtual

Close the link between the camera and the acquisition program

Implements vpFrameGrabber.

Definition at line 2306 of file vp1394Grabber.cpp.

Referenced by acquire(), getFormat(), getFormatSupported(), getFramerate(), getFramerateSupported(), getGain(), getHeight(), getMode(), getModeSupported(), getShutter(), getWidth(), setCamera(), setGain(), setShutter(), and ~vp1394Grabber().

int vp1394Grabber::convertFormat ( std::string  format)

Converts the string containing the description of the format into the format dentifier.

Parameters
format: The string describing the format given by Format(int)
Returns
The camera capture format identifier, either :
  • FORMAT_VGA_NONCOMPRESSED for the Format_0
  • FORMAT_SVGA_NONCOMPRESSED_1 for the Format_1
  • FORMAT_SVGA_NONCOMPRESSED_2 for the Format_2
  • FORMAT_STILL_IMAGE for the Format_6
  • FORMAT_SCALABLE_IMAGE_SIZE for the Format_7
This method returns 0 if the string does not match to a format string.
See also
convertFormat(int), convertMode(std::string), convertFramerate(std::string&)

Definition at line 911 of file vp1394Grabber.cpp.

std::string vp1394Grabber::convertFormat ( int  format)

Converts the format identifier into a string containing the description of the format.

Parameters
format: The camera capture format, either :
  • FORMAT_VGA_NONCOMPRESSED for the Format_0
  • FORMAT_SVGA_NONCOMPRESSED_1 for the Format_1
  • FORMAT_SVGA_NONCOMPRESSED_2 for the Format_2
  • FORMAT_STILL_IMAGE for the Format_6
  • FORMAT_SCALABLE_IMAGE_SIZE for the Format_7
Returns
A string describing the format, an empty string if the format is not supported.
See also
convertMode(), convertFramerate()

Definition at line 1009 of file vp1394Grabber.cpp.

References strFormats.

int vp1394Grabber::convertFramerate ( std::string  framerate)

Converts the string containing the description of the framerate into the framerate dentifier.

Parameters
framerate: The string describing the framerate given by Framerate(int).
Returns
The camera capture framerate identifier.

This method returns 0 if the string does not match to a framerate string.

See also
convertFramerate(int), convertFormat(std::string &), convertMode(std::string)

Definition at line 980 of file vp1394Grabber.cpp.

std::string vp1394Grabber::convertFramerate ( int  framerate)

Converts the framerate identifier into a string containing the description of the framerate.

Parameters
framerate: The camera capture framerate.
Returns
A string describing the framerate, an empty string if the framerate is not supported.
See also
convertFormat(), convertMode()

Definition at line 1143 of file vp1394Grabber.cpp.

References strFramerates.

int vp1394Grabber::convertMode ( std::string  mode)

Converts the string containing the description of the mode into the mode dentifier.

Parameters
mode: The string describing the mode given by Mode(int)
Returns
The camera capture mode identifier.

This method returns 0 if the string does not match to a mode string.

See also
convertMode(int), convertFormat(std::string), convertFramerate(std::string)

Definition at line 936 of file vp1394Grabber.cpp.

std::string vp1394Grabber::convertMode ( int  mode)

Converts the mode identifier into a string containing the description of the mode.

Parameters
mode: The camera capture mode.
Returns
A string describing the mode, an empty string if the mode is not supported.
See also
convertFormat(), convertFramerate()

Definition at line 1049 of file vp1394Grabber.cpp.

References strColorsInFormat7, strModesInFormat0, strModesInFormat1, strModesInFormat2, strModesInFormat6, and strModesInFormat7.

void vp1394Grabber::getCamera ( unsigned int &  camera)

Get the active camera on the bus.

Parameters
camera: A camera id. The value is comprised between 0 (the first camera) and the number of cameras found on the bus and returned by getNumCameras().
See also
setCamera(), getNumCameras()

Definition at line 348 of file vp1394Grabber.cpp.

void vp1394Grabber::getFormat ( int &  format)

Query the actual capture format of a given camera. The camera supported formats are given by getFormatSupported().

Warning
Before requerying the actual format a handle must be created by calling open(), and a camera must be connected.
Parameters
format: The camera capture format (see file libdc1394/dc1394_control.h), either :
  • FORMAT_VGA_NONCOMPRESSED for the Format_0
  • FORMAT_SVGA_NONCOMPRESSED_1 for the Format_1
  • FORMAT_SVGA_NONCOMPRESSED_2 for the Format_2
  • FORMAT_STILL_IMAGE for the Format_6
  • FORMAT_SCALABLE_IMAGE_SIZE for the Format_7
Exceptions
vpFrameGrabberException::settingError: If the required camera is not present or if an error occurs.
See also
setFormat(), getFormatSupported(), open(), setCamera(), getNumCameras()

Definition at line 421 of file vp1394Grabber.cpp.

References close(), vpFrameGrabberException::settingError, and vpERROR_TRACE.

Referenced by open().

int vp1394Grabber::getFormatSupported ( vpList< int > &  formats)

Query the available camera image formats.

Warning
Before requerying supported formats a handle must be created by calling open(), and a camera must be connected.
Parameters
formats: The list of supported camera image formats.
Returns
The number of supported camera image formats, 0 if an error occurs.
Exceptions
vpFrameGrabberException::settingError: If the required camera is not present or if an error occurs.
See also
getModeSupported(), getFramerateSupported(), open(), getFormat(), setCamera()

Definition at line 466 of file vp1394Grabber.cpp.

References vpList< type >::addRight(), close(), vpList< type >::kill(), vpFrameGrabberException::settingError, and vpERROR_TRACE.

void vp1394Grabber::getFramerate ( int &  framerate)

Query the actual capture framerate of a given camera. The camera supported framerates are given by getFramerateSupported().

Warning
Before requerying the actual framerate a handle must be created by calling open(), and a camera must be connected.
Parameters
framerate: The camera capture framerate.
Returns
true if the framerate was obtained, false if an error occurs.
Exceptions
vpFrameGrabberException::settingError: If the required camera is not present.
See also
setFramerate(), getFramerateSupported(), open(), getNumCameras(), setCamera()

Definition at line 783 of file vp1394Grabber.cpp.

References close(), vpFrameGrabberException::settingError, and vpERROR_TRACE.

Referenced by open().

int vp1394Grabber::getFramerateSupported ( int  format,
int  mode,
vpList< int > &  framerates 
)

Query the available framerates for the given camera image format and mode (see file libdc1394/dc1394_control.h). The framerate is only available if format is either FORMAT_VGA_NONCOMPRESSED (format 0), FORMAT_SVGA_NONCOMPRESSED_1 (format 1) or FORMAT_SVGA_NONCOMPRESSED_2 (format 2). If format is equal to FORMAT_STILL_IMAGE (format 6) or FORMAT_SCALABLE_IMAGE_SIZE (format 7), the framerate is not available. In this case, we return 0.

Warning
Before requerying supported framerates for a given format and mode a handle must be created by calling open(), and a camera must be connected.
Parameters
format: Camera image format.
mode: Camera mode.
framerates; The list of supported camera framerates.
Returns
The number of supported camera image framerates, 0 if an error occurs.
Exceptions
vpFrameGrabberException::settingError: If the required camera is not present.
See also
getFormatSupported(), getModeSupported(), open(), getFramerate(), setCamera()

Definition at line 836 of file vp1394Grabber.cpp.

References vpList< type >::addRight(), close(), vpList< type >::kill(), vpFrameGrabberException::settingError, and vpERROR_TRACE.

void vp1394Grabber::getGain ( unsigned int &  min_gain,
unsigned int &  gain,
unsigned int &  max_gain 
)

Query the actual gain value of a given camera and the bounded gain values.

Warning
Before requerying the gain a handle must be created by calling open(), and a camera must be connected.
Parameters
min_gain: Minimal autorized gain value.
gain: The current camera gain value. This value is comprised between min_gain and max_gain.
max_gain: Maximal autorized gain value.
Exceptions
vpFrameGrabberException::settingError:If the required camera is not present or if an error occurs.
See also
setGain(), open(), getNumCameras(), setCamera()

Definition at line 1398 of file vp1394Grabber.cpp.

References close(), vpFrameGrabberException::settingError, and vpERROR_TRACE.

unsigned int vpFrameGrabber::getHeight ( ) const
inlineinherited

Return the number of rows in the image.

Examples:
AROgre.cpp, AROgreBasic.cpp, HelloWorldOgre.cpp, and HelloWorldOgreAdvanced.cpp.

Definition at line 119 of file vpFrameGrabber.h.

Referenced by acquire(), and open().

void vp1394Grabber::getHeight ( unsigned int &  height)

Get the image height. It depends on the camera format setFormat() and mode setMode(). The height of the images is only available after a call to open().

Parameters
height: The image height.
Exceptions
vpFrameGrabberException::settingError: If the required camera is not present.
Warning
Has to be called after open() to be sure that a camera is detected.
See also
getWidth(), getImageFormat(), close(), getNumCameras(), setCamera()

Definition at line 1493 of file vp1394Grabber.cpp.

References close(), vpFrameGrabber::height, and vpFrameGrabberException::settingError.

void vp1394Grabber::getMode ( int &  mode)

Query the actual capture mode of a given camera. Given a format, all the camera supported modes are given by getModeSupported().

Warning
Before requerying the actual mode a handle must be created by calling open(), and a camera must be connected.
Parameters
mode: The camera capture mode.
Exceptions
vpFrameGrabberException::settingError: If the required camera is not present.
See also
setMode(), getModeSupported(), open(), setCamera()

Definition at line 588 of file vp1394Grabber.cpp.

References close(), vpFrameGrabberException::settingError, and vpERROR_TRACE.

Referenced by open().

int vp1394Grabber::getModeSupported ( int  format,
vpList< int > &  modes 
)

Query the available camera modes for the given format.

Warning
Before requerying supported modes for a given format a handle must be created by calling open(), and a camera must be connected.
Parameters
format: Camera image format. Values for format are parts of the list (see file libdc1394/dc1394_control.h):
  • FORMAT_VGA_NONCOMPRESSED = 384 for the Format_0
  • FORMAT_SVGA_NONCOMPRESSED_1 for the Format_1
  • FORMAT_SVGA_NONCOMPRESSED_2 for the Format_2
  • FORMAT_STILL_IMAGE = 390 for the Format_6
  • FORMAT_SCALABLE_IMAGE_SIZE for the Format_7
Parameters
modes: The list of supported camera modes.
Returns
The number of supported camera modes, 0 if an error occurs.
Exceptions
vpFrameGrabberException::settingError: If the required camera is not present.
See also
getMode(), getFramerateSupported(), open(), setCamera()

Definition at line 640 of file vp1394Grabber.cpp.

References vpList< type >::addRight(), close(), vpList< type >::kill(), vpFrameGrabberException::settingError, and vpERROR_TRACE.

void vp1394Grabber::getNumCameras ( unsigned int &  cameras)

Query the number of cameras on the bus.

Parameters
cameras: The number of cameras found on the bus.
Examples:
manGrab1394-1.cpp.

Definition at line 1515 of file vp1394Grabber.cpp.

References vpCTRACE.

void vp1394Grabber::getShutter ( unsigned int &  min_shutter,
unsigned int &  shutter,
unsigned int &  max_shutter 
)

Query the actual shutter value of a given camera and the bounded shutter values.

Warning
Before requerying the shutter a handle must be created by calling open(), and a camera must be connected.
Parameters
min_shutter: Minimal autorized shutter value.
shutter: The current camera shutter value. This value is comprised between min_shutter and max_shutter.
max_shutter: Maximal autorized shutter value.
Exceptions
vpFrameGrabberException::settingError: If the required camera is not present or if an error occurs.
See also
setShutter(), open(), getNumCameras(), setCamera()

Definition at line 1260 of file vp1394Grabber.cpp.

References close(), vpFrameGrabberException::settingError, and vpERROR_TRACE.

unsigned int vpFrameGrabber::getWidth ( ) const
inlineinherited

Return the number of columns in the image.

Examples:
AROgre.cpp, AROgreBasic.cpp, HelloWorldOgre.cpp, and HelloWorldOgreAdvanced.cpp.

Definition at line 121 of file vpFrameGrabber.h.

Referenced by acquire(), and open().

void vp1394Grabber::getWidth ( unsigned int &  width)

Get the image width. It depends on the camera format setFormat() and mode setMode(). The width of the images is only available after a call to open().

Parameters
width: The image width, zero if the required camera is not available.
Exceptions
vpFrameGrabberException::settingError: If the required camera is not present.
Warning
Has to be called after open() to be sure that a camera is detected.
See also
getHeight(), setCamera()

Definition at line 1464 of file vp1394Grabber.cpp.

References close(), vpFrameGrabberException::settingError, and vpFrameGrabber::width.

void vp1394Grabber::open ( vpImage< unsigned char > &  I)
virtual

Initialize grey level image acquisition

Parameters
I: Image data structure (8 bits image)

Implements vpFrameGrabber.

Examples:
servoPtu46Point2DArtVelocity.cpp.

Definition at line 1533 of file vp1394Grabber.cpp.

References getFormat(), getFramerate(), vpFrameGrabber::getHeight(), getMode(), vpFrameGrabber::getWidth(), vpFrameGrabber::init, open(), vpImage< Type >::resize(), and vpDEBUG_TRACE.

Referenced by open(), and vp1394Grabber().

void vp1394Grabber::open ( vpImage< vpRGBa > &  I)
virtual

Initialize color image (in RGBa format) acquisition

Parameters
I: Image data structure (RGBa format)

Implements vpFrameGrabber.

Definition at line 1565 of file vp1394Grabber.cpp.

References getFormat(), getFramerate(), vpFrameGrabber::getHeight(), getMode(), vpFrameGrabber::getWidth(), vpFrameGrabber::init, open(), vpImage< Type >::resize(), and vpDEBUG_TRACE.

void vp1394Grabber::setCamera ( unsigned int  camera)

If multiples cameras are connected on the bus, select the camero to dial with.

Parameters
camera: A camera. The value must be comprised between 0 (the first camera) and the number of cameras found on the bus and returned by getNumCameras(). If two cameras are connected on the bus, setting camera to one allows to communicate with the second one.
Exceptions
vpFrameGrabberException::settingError: If the required camera is not reachable.
Warning
Has to be called after open() to be sure that a camera is detected.
g.open(I);
unsigned int num_cameras; // Number of cameras on the bus
g.getNumCameras(num_cameras);
g.setCamera(num_cameras-1); // To dial with the last camera on the bus
g.acquire(I); // I contains the frame captured by the last camera on the bus
See also
setFormat(), setMode(), setFramerate(), open(), getNumCameras()
Examples:
manGrab1394-1.cpp.

Definition at line 324 of file vp1394Grabber.cpp.

References close(), vpFrameGrabberException::settingError, and vpERROR_TRACE.

void vp1394Grabber::setFormat ( int  format)

Set the capture format for a given camera on the bus. To set the format for a specific camera, call setCamera() before.

Parameters
format: The camera image format. The current camera format is given by getFormat(). The camera supported formats are given by getFormatSupported(). The allowed values given in libdc1394/dc1394_control.h are:
  • FORMAT_VGA_NONCOMPRESSED for the Format_0
  • FORMAT_SVGA_NONCOMPRESSED_1 for the Format_1
  • FORMAT_SVGA_NONCOMPRESSED_2 for the Format_2
  • FORMAT_STILL_IMAGE for the Format_6
  • FORMAT_SCALABLE_IMAGE_SIZE for the Format_7
Warning
The requested format is sent to the camera only after a call to close(). Depending on the format and the camera mode, image size can differ.
Exceptions
vpFrameGrabberException::settingError: If the required camera is not present.
Warning
Has to be called after open() to be sure that a camera is detected.
See also
setMode(), setFramerate(), open(), setCamera(), getNumCameras()
Examples:
manGrab1394-1.cpp.

Definition at line 380 of file vp1394Grabber.cpp.

void vp1394Grabber::setFramerate ( int  framerate)

Set the capture framerate for a given camera on the bus.

Parameters
framerate: The camera framerate. The current framerate of the camera is given by getFramerate(). The camera supported framerates are given by getFramerateSupported(). The allowed values given in libdc1394/dc1394_control.h are:
  • FRAMERATE_1_875 = 32 for 1.875 fps,
  • FRAMERATE_3_75 for 3.75 fps,
  • FRAMERATE_7_5 for 7.5 fps,
  • FRAMERATE_15 for 15 fps,
  • FRAMERATE_30 for 30 fps,
  • FRAMERATE_60 for 60 fps,
  • FRAMERATE_120 for 120 fps,
  • FRAMERATE_240 for 240 fps.
Exceptions
vpFrameGrabberException::settingError: If the required camera is not present.
Warning
Has to be called after open() to be sure that a camera is detected.
See also
setFormat(), setMode(), open(), getNumCameras(), setCamera()
Examples:
manGrab1394-1.cpp.

Definition at line 746 of file vp1394Grabber.cpp.

void vp1394Grabber::setGain ( unsigned int  gain)

Set the gain for a given camera.

Warning
Before setting the gain a handle must be created by calling open(), and a camera must be connected.
Parameters
gainThe gain value to apply to the camera.
Exceptions
vpFrameGrabberException::settingError: If the required camera is not present or if an error occurs.
See also
getGain(), getNumCameras(), setCamera()

Definition at line 1323 of file vp1394Grabber.cpp.

References close(), vpFrameGrabberException::settingError, vpCERROR, and vpERROR_TRACE.

void vp1394Grabber::setMode ( int  mode)

Set the camera capture mode for a given camera on the bus.

Parameters
mode: The camera capture mode. The current camera mode is given by getMode(). The camera supported modes are given by getSupportedModes(). The allowed values are given in libdc1394/dc1394_control.h file:
  • Allowed mode for Format 0: MODE_160x120_YUV444 = 64, MODE_320x240_YUV422, MODE_640x480_YUV411, MODE_640x480_YUV422, MODE_640x480_RGB, MODE_640x480_MONO, MODE_640x480_MONO16
  • Allowed modes for Format 1: MODE_800x600_YUV422 = 96, MODE_800x600_RGB, MODE_800x600_MONO, MODE_1024x768_YUV422, MODE_1024x768_RGB, MODE_1024x768_MONO, MODE_800x600_MONO16, MODE_1024x768_MONO16
  • Allowed modes for Format 2: MODE_1280x960_YUV422 = 128, MODE_1280x960_RGB, MODE_1280x960_MONO, MODE_1600x1200_YUV422, MODE_1600x1200_RGB, MODE_1600x1200_MONO, MODE_1280x960_MONO16, MODE_1600x1200_MONO16
  • Allowed modes for Format 6: MODE_EXIF= 256
  • Allowed modes for Format 7: MODE_FORMAT7_0= 288, MODE_FORMAT7_1, MODE_FORMAT7_2, MODE_FORMAT7_3, MODE_FORMAT7_4, MODE_FORMAT7_5, MODE_FORMAT7_6, MODE_FORMAT7_7

All these modes are not supported by your camera. The camera supported modes are given by getModeSupported().

Warning
The requested format is sent to the camera only after a call to close(). Depending on the format and the camera mode, image size can differ.
Exceptions
vpFrameGrabberException::settingError: If the required camera is not present.
Warning
Has to be called after open() to be sure that a camera is detected.
See also
setFormat(), setFramerate(), open(), getNumCameras(), setCamera()
Examples:
manGrab1394-1.cpp.

Definition at line 554 of file vp1394Grabber.cpp.

void vp1394Grabber::setShutter ( unsigned int  shutter)

Set the shutter for a given camera.

Parameters
shutter: The shutter value to apply to the camera.
Exceptions
vpFrameGrabberException::settingError: If the required camera is not present or if an error occurs.
Warning
Has to be called after open() to be sure that a camera is detected.
See also
getShutter(), open(), getNumCameras(), setCamera()

Definition at line 1183 of file vp1394Grabber.cpp.

References close(), vpFrameGrabberException::settingError, vpCERROR, and vpERROR_TRACE.

Member Data Documentation

const int vp1394Grabber::DROP_FRAMES = 1
static

With libdc1394-1.0.0 or more rencent versions, DROP_FRAMES has to be set to 1 in order to suppress the latency.

Definition at line 139 of file vp1394Grabber.h.

const int vp1394Grabber::MAX_CAMERAS = 8
static

Maximal number of cameras

Definition at line 142 of file vp1394Grabber.h.

Referenced by vp1394Grabber().

const int vp1394Grabber::MAX_PORTS = 4
static

Maximal number of ports

Definition at line 141 of file vp1394Grabber.h.

const int vp1394Grabber::NUM_BUFFERS = 8
static

Number of buffers

Definition at line 140 of file vp1394Grabber.h.

const char * vp1394Grabber::strColorsInFormat7
static
Initial value:
= {
"Format_7 Color, Mono 8bpp",
"Format_7 Color, YUV 4:1:1",
"Format_7 Color, YUV 4:2:2",
"Format_7 Color, YUV 4:4:4",
"Format_7 Color, RGB 24bpp",
"Format_7 Color, Mono 16bpp",
"Format_7 Color, RGB 48bpp"
}

Definition at line 150 of file vp1394Grabber.h.

Referenced by convertMode().

const char * vp1394Grabber::strFormats
static
Initial value:
= {
"Format_0",
"Format_1",
"Format_2",
"Reserved",
"Reserved",
"Reserved",
"Format_6",
"Format_7"
}

Definition at line 144 of file vp1394Grabber.h.

Referenced by convertFormat().

const char * vp1394Grabber::strFramerates
static
Initial value:
= {
"1.875 Hz",
"3.75 Hz",
"7.5 Hz",
"15 Hz",
"30 Hz",
"60 Hz"
}

Definition at line 151 of file vp1394Grabber.h.

Referenced by convertFramerate().

const char * vp1394Grabber::strModesInFormat0
static
Initial value:
= {
"Format_0, Mode_0: 160x120 YUV (4:4:4)",
"Format_0, Mode_1: 320x240 YUV (4:2:2)",
"Format_0, Mode_2: 640x480 YUV (4:1:1)",
"Format_0, Mode_3: 640x480 YUV (4:2:2)",
"Format_0, Mode_4: 640x480 RGB 24bpp",
"Format_0, Mode_5: 640x480 Mono 8bpp",
"Format_0, Mode_6: 640x480 Mono 16bpp"
}

Definition at line 145 of file vp1394Grabber.h.

Referenced by convertMode().

const char * vp1394Grabber::strModesInFormat1
static
Initial value:
= {
"Format_1, Mode_0: 800x600 YUV (4:2:2)",
"Format_1, Mode_1: 800x600 RGB 24bpp",
"Format_1, Mode_2: 800x600 Mono 8bpp",
"Format_1, Mode_3: 1024x768 YUV (4:2:2)",
"Format_1, Mode_4: 1024x768 RGB 24bpp",
"Format_1, Mode_5: 1024x768 Mono 8bpp",
"Format_1, Mode_6: 800x600 Mono 16bpp",
"Format_1, Mode_7: 1024x768 Mono 16bpp"
}

Definition at line 146 of file vp1394Grabber.h.

Referenced by convertMode().

const char * vp1394Grabber::strModesInFormat2
static
Initial value:
= {
"Format_2, Mode_0: 1280x960 YUV (4:2:2)",
"Format_2, Mode_1: 1280x960 RGB 24bpp",
"Format_2, Mode_2: 1280x960 Mono 8bpp",
"Format_2, Mode_3: 1600x1200 YUV (4:2:2)",
"Format_2, Mode_4: 1600x1200 RGB 24bpp",
"Format_2, Mode_5: 1600x1200 Mono 8bpp",
"Format_2, Mode_6: 1280x960 Mono 16bpp",
"Format_2, Mode_7: 1600x1200 Mono 16bpp"
}

Definition at line 147 of file vp1394Grabber.h.

Referenced by convertMode().

const char * vp1394Grabber::strModesInFormat6
static
Initial value:
= {
"Format6, Mode_0: EXIT (not supported)"
}

Definition at line 148 of file vp1394Grabber.h.

Referenced by convertMode().

const char * vp1394Grabber::strModesInFormat7
static
Initial value:
= {
"Format_7, Mode_0",
"Format_7, Mode_1",
"Format_7, Mode_2",
"Format_7, Mode_3",
"Format_7, Mode_4",
"Format_7, Mode_5",
"Format_7, Mode_6",
"Format_7, Mode_7"
}

Definition at line 149 of file vp1394Grabber.h.

Referenced by convertMode().