TLIB documentation
 

tlSourceVideoFile Class Reference

Inheritance diagram for tlSourceVideoFile:

Inheritance graph
[legend]
Collaboration diagram for tlSourceVideoFile:

Collaboration graph
[legend]

List of all members.


Detailed Description

Video file image source implementation for TLIB.

Public Member Functions

 tlSourceVideoFile (char *filename)
int getLength ()
int getIndex ()
int open (char *filename)
int close ()
int setFrame (int frame)
virtual int grab (tlImage *image)
virtual int grab (tlImage *image, tlRect *rect)
virtual int grabQueued (tlImage *image)
virtual int grabQueued (tlImage *image, tlRect *rect)

Constructor & Destructor Documentation

tlSourceVideoFile::tlSourceVideoFile ( char *  filename  ) 

Open the given filename upon allocation.

Parameters:
filename video file name
Note:
See error management for details.


Member Function Documentation

tlSourceVideoFile::getLength (  )  [inline]

Get the number of frames in the video sequence.

Returns:
The video length [frames]

tlSourceVideoFile::getIndex (  )  [inline]

Get the current frame index.

Returns:
The frame index [frames]

int tlSourceVideoFile::open ( char *  filename  ) 

Open the given filename.

Parameters:
filename video file name
Returns:
0 on success, -1 otherwise.
See error management for details.

int tlSourceVideoFile::close (  ) 

Close the currently open file.

Returns:
0 on success, -1 otherwise.
See error management for details.

int tlSourceVideoFile::setFrame ( int  frame  ) 

Goto a given frame in the movie. The next image acquired via the grab() method will be at the given index in the video stream.

Parameters:
frame image index in the video stream
Returns:
0 on success, -1 otherwise.
See error management for details.

int tlSourceVideoFile::grab ( tlImage image  )  [virtual]

This call acquires a full image from an image source. The image will have the size and format the source is currently configured for.

Parameters:
image [out] a valid image pointer that will receive the image.
Returns:
0 on success, -1 otherwise.
See error management for details.

Implements tlSource.

int tlSourceVideoFile::grab ( tlImage image,
tlRect rect 
) [virtual]

This call acquires a portion of an image from an image source. The image will have the size and format the source is currently configured for, but only the portion defined by the rect argument will contain valid pixel values.

Parameters:
image [out] a valid image pointer that will receive the image.
rect a pointer to the portion of the image to acquire.
Returns:
0 on success, -1 otherwise.
See error management for details.

Implements tlSource.

int tlSourceVideoFile::grabQueued ( tlImage image  )  [virtual]

This call acquires a full image from an image source. The image will have the size and format the source is currently configured for.

Parameters:
image [out] a valid image pointer that will receive the image.
Returns:
0 on success, -1 otherwise.
See error management for details.
Note:
This routine is faster than grab() because image acquisition happens in the background. However, since the grab command is sent to the grabber during the previous call to the grabQueued() routine, the image returned can be out-of-date.

Implements tlSource.

int tlSourceVideoFile::grabQueued ( tlImage image,
tlRect rect 
) [virtual]

This call acquires a portion of an image from an image source. The image will have the size and format the source is currently configured for, but only the portion defined by the rect argument will contain valid pixel values.

Parameters:
image [out] a valid image pointer that will receive the image.
rect a pointer to the portion of the image to acquire.
Returns:
0 on success, -1 otherwise.
See error management for details.
Note:
This routine is faster than grab() because image acquisition happens in the background. However, since the grab command is sent to the grabber during the previous call to the grabQueued() routine, the image returned can be out-of-date.

Implements tlSource.


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

TLIB documentation - generated on 7 May 2008
Please address any questions to seb@tuyphon.com
(C) 2001-2008 - S. Grange
(C) 2001-2007 - VRAI Group, EPFL
All Rights Reserved.