#include <image_dc1394input.h>
Inheritance diagram for mimas::image_dc1394input< T >:
Public Member Functions | |
image_dc1394input (int _mode, int _framerate=FRAMERATE_15, int _node=0, const char *_device=NULL, int _channel=0, int _speed=SPEED_400) throw (mimasexception) | |
Constructor. | |
virtual | ~image_dc1394input (void) |
virtual void | read (image< T > &img) throw (mimasexception) |
Read image from arbitrary source. | |
dc1394_feature_info | get_feature (int _id) throw (mimasexception) |
void | set_feature_value (int _id, unsigned int _value) throw (mimasexception) |
unsigned int | get_feature_value (int _id) throw (mimasexception) |
Protected Attributes | |
raw1394handle_t | handle |
dc1394_cameracapture | camera |
int | mode |
int | node |
At the moment only grabbing of grayscale and YUV422-encoded images is supported. Grabbing has been tested with the following device:
Here is an example on how to use this class:
#include <fstream> #include <GL/glut.h> #include "image_dc1394input.h" #include "image_mesaoutput.h" using namespace std; using namespace mimas; // Minimal program for displaying multiple images from a single file. int main( int argc, char *argv[] ) { int retVal = 0; try { // Initialise GLUT. glutInit( &argc, argv ); // Open X11 display. x11_display disp; // Load file. image_dc1394input< rgba< unsigned char > > input( MODE_640x480_YUV422, FRAMERATE_15 ); // Open window. image_mesaoutput< rgba< unsigned char > > win( &disp ); // Allocate image. image< rgba< unsigned char > > img; while( input ) { // Read image. input >> img; // Display image. win << img; }; } catch ( exception &e ) { // Print error message. cerr << e.what() << endl; retVal = 1; }; return retVal; }
Definition at line 32 of file image_dc1394input.h.
mimas::image_dc1394input< T >::image_dc1394input | ( | int | _mode, | |
int | _framerate = FRAMERATE_15 , |
|||
int | _node = 0 , |
|||
const char * | _device = NULL , |
|||
int | _channel = 0 , |
|||
int | _speed = SPEED_400 | |||
) | throw (mimasexception) |
Constructor.
At the moment, there is no support to get a list of available modes or automatically select the best mode. You need to use f.e. the software `coriander', if you want to know the capabilities of the camera.
virtual mimas::image_dc1394input< T >::~image_dc1394input | ( | void | ) | [virtual] |
virtual void mimas::image_dc1394input< T >::read | ( | image< T > & | img | ) | throw (mimasexception) [virtual] |
Read image from arbitrary source.
This function is virtual and has to be implemented by the inheriting class.
img | Object to store image in. |
Implements mimas::image_input< T >.
dc1394_feature_info mimas::image_dc1394input< T >::get_feature | ( | int | _id | ) | throw (mimasexception) |
void mimas::image_dc1394input< T >::set_feature_value | ( | int | _id, | |
unsigned int | _value | |||
) | throw (mimasexception) |
unsigned int mimas::image_dc1394input< T >::get_feature_value | ( | int | _id | ) | throw (mimasexception) |
raw1394handle_t mimas::image_dc1394input< T >::handle [protected] |
Definition at line 58 of file image_dc1394input.h.
dc1394_cameracapture mimas::image_dc1394input< T >::camera [protected] |
Definition at line 60 of file image_dc1394input.h.
int mimas::image_dc1394input< T >::mode [protected] |
Definition at line 62 of file image_dc1394input.h.
int mimas::image_dc1394input< T >::node [protected] |
Definition at line 64 of file image_dc1394input.h.