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.

References open(), and TL_NO_ERROR.


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.

References close(), TL_ERRNO_MSG, TL_ERROR, TL_ERROR_CONFIG_FAILED, TL_ERROR_FILE_NOT_FOUND_OR_CORRUPT, TL_ERROR_INVALID_FORMAT, and tlVerbose.

Referenced by tlSourceVideoFile().

int tlSourceVideoFile::close (  ) 

Close the currently open file.

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

Referenced by open().

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.

References TL_ERRNO_MSG, and TL_ERROR_INDEX_OUT_OF_BOUNDS.

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.

References tlPixelArray::init(), tlPixelArray::pixel, RGB, TL_ERRNO_MSG, TL_ERROR, TL_ERROR_GRAB_FAILED, and TL_RGB_WIDTH.

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.

References tlSize::height, tlPixelArray::init(), tlPixelArray::pixel, RGB, TL_ERRNO_MSG, TL_ERROR, TL_ERROR_GRAB_FAILED, TL_MAX, TL_MIN, TL_RGB_WIDTH, tlSize::width, tlLocation::x, and tlLocation::y.

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.

References tlPixelArray::init(), tlPixelArray::pixel, RGB, TL_ERRNO_MSG, TL_ERROR, TL_ERROR_GRAB_FAILED, and TL_RGB_WIDTH.

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.

References tlSize::height, tlPixelArray::init(), tlPixelArray::pixel, RGB, TL_ERRNO_MSG, TL_ERROR, TL_ERROR_GRAB_FAILED, TL_MAX, TL_MIN, TL_RGB_WIDTH, tlSize::width, tlLocation::x, and tlLocation::y.


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


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