NAME

Rivl_ComputeSeqImages, Rivl_SeqResolveImage, Rivl_CreateSeqProtoImage - procedures for sequence signals

SYNOPSIS

#include <rivl.h>
int
Rivl_ComputeSeqImages (interp, seq, start, end, sampleRate,
outCountPtr, outImagesPtr)
Rivl_Signal
Rivl_SeqResolveImage (interp, seq, image)
Rivl_Signal
Rivl_CreateSeqProtoImage (interp, valueType, width, height)

ARGUMENTS

Tcl_Interp *interp (in)
The Tcl interpreter.
Rivl_Signal seq (in)
Sequence signal.
Rivl_Signal image (in)
An image signal to conform to seq's image size and type.
Rivl_ValueType valueType (in)
Value type of the new prototype image.
double start, end (in)
Time range to sample in seq.
Rivl_Signal **outImagesPtr (out)
Filled with the address of an array of images sampled from seq.
int *outCountPtr (out)
Filled with the number of images sampled from seq.
double width, height (in)
Size of the new prototype image.

DESCRIPTION

A video sequence is implemented as a one-dimensional signal of pointers to image signals. The value of the signal at (x,0) contains the image at time x. A zero (NULL) value indicates a blank image. In addition to the usual properties of signals, sequence signals have a protoImage property which points to a prototypical blank image of the sequence. This serves as a record of the sequence's image type and image size.

Before an image signal sampled from a sequence signal can be used, it must be converted to the image size and type of the sequence. This ensures that sampling a sequence always yields a consistent image.

Rivl_ComputeSeqImages samples seq from start seconds to end seconds at sampleRate frames per second. It returns a pointer to a dynamically allocated array of image signals in *outImagesPtr and the number of images in *outCountPtr. It is the user's responsibility to free *outImagesPtr. The image signals in *outImagesPtr are processed with Rivl_SeqResolveImage to ensure that they match seq's image size and type.

Rivl_SeqResolveImage converts image, a value sampled from seq, into a valid image with the proper size and type. If image is NULL, then a proper blank image is returned. Otherwise, the size and type of image are matched up with the image size and type of seq. If image's size does not match seq's image size, it is changed. If image's type does not match seq's image type, image is converted. Both of the changes are non-destructive; image is duplicated before either takes place. Rivl_SeqResolveImage returns the resulting image, which will be the same as image if both its size and type were ok.

Rivl_CreateSeqProtoImage returns a blank image signal of the type given by valueType and of the size given by width and height. The result is a suitable value for a signal's protoImage property.