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) |
tlSourceVideoFile::tlSourceVideoFile | ( | char * | filename | ) |
Open the given filename upon allocation.
filename | video file name |
References open(), and TL_NO_ERROR.
tlSourceVideoFile::getLength | ( | ) | [inline] |
Get the number of frames in the video sequence.
tlSourceVideoFile::getIndex | ( | ) | [inline] |
Get the current frame index.
int tlSourceVideoFile::open | ( | char * | filename | ) |
Open the given filename.
filename | video file name |
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.
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.
frame | image index in the video stream |
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.
image | [out] a valid image pointer that will receive the image. |
Implements tlSource.
References tlPixelArray::init(), tlPixelArray::pixel, RGB, TL_ERRNO_MSG, TL_ERROR, TL_ERROR_GRAB_FAILED, and TL_RGB_WIDTH.
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.
image | [out] a valid image pointer that will receive the image. | |
rect | a pointer to the portion of the image to acquire. |
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.
image | [out] a valid image pointer that will receive the image. |
Implements tlSource.
References tlPixelArray::init(), tlPixelArray::pixel, RGB, TL_ERRNO_MSG, TL_ERROR, TL_ERROR_GRAB_FAILED, and TL_RGB_WIDTH.
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.
image | [out] a valid image pointer that will receive the image. | |
rect | a pointer to the portion of the image to acquire. |
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.