imagePlayer
Synopsis
Animates a number of AVS x format image files stored in memory or on
disk.
Parameters
The following lists all of the parameters found in the parameter block
ImagePlayerParams, which are accessed by the module AVSImagePlayer and the UI Macro
ImagePlayerUI.
| Name |
Type |
Description |
UI Control |
|
| file_format |
string |
filename specification |
File Format |
| nb_images |
int |
total number of images |
Number of Images |
| first_image |
int |
first index number |
First Image |
| step |
int |
value of loop increment |
Step |
| access_mode |
int |
memory or disk access |
Access Mode |
| run_mode |
int |
forward, backwards or cycle control |
Run Mode |
| fps |
float |
animation rate in frames per second |
Frames per sec |
| nsec_before |
int |
secs before animation is restarted |
Nsec Before |
| nsec_after |
int |
secs before animation returns to first frame |
Nsec After |
| count |
int |
index number of current image |
Image Number slider |
| real_fps |
string |
actual animation rate |
Real Frame/s label |
|
Output Ports
| Name |
Type |
Description |
|
| out |
field data |
currently displayed image data |
| obj |
DataObject |
directly renderable object |
|
Description
The imagePlayer macro is a high level user macro that is able to read in
image files in the AVS x format and then animate them either from memory
or by loading each image as it is required. The image filenames are
specified by using a C-style format-string and a number of parameters.
The module is also able to control the rate at which the images are
animated, whether the animation runs forward or backwards and whether
the animation cycles continously. All of these functions are
controllable through a User Interface. The images are output as both a
uniform mesh with colours represented by node data, and a renderable
DataObject that is generated from the uniform mesh.
Parameters
ImagePlayerParams.file_format
A member of the ImagePlayerParams parameter block group, this string
value is used to specify the filename formatting string that is used to
load the sequence of image files. This is down by using a C-style
formatting expression to generate indexed filenames.
Therefore setting file_format to "Imag%d.x" will
generate filenames of the form "Image0.x" with no leading
characters; whilst setting the parameter to "Image%04d.x" will
generate filenames which are padded with zeros to be 8 characters long
(i.e. "Imag0001.x"). More information can be found in any C
reference book.
ImagePlayerParams.nb_images
A member of the ImagePlayerParams parameter block group, this int value
specifies the total number of images that are to be animated. The
animation will stop or repeat as appropriate when this many frames have
been displayed.
ImagePlayerParams.first_image
A member of the ImagePlayerParams parameter block group, this int value
specifies the index number of the first image to be animated.
ImagePlayerParams.step
A member of the ImagePlayerParams parameter block group, this int value
specifies the value that the index number should be incremented by
during each iteration of the animation loop.
ImagePlayerParams.access_mode
A member of the ImagePlayerParams parameter block group, this int value
specifies whether images should be animated from memory or from disk.
Setting the parameter to 0 specifies that each image should be read from
disk immediately before it is displayed. Setting the parameter to 1
specifies that all the images should be loaded into memory before the
animation begins and displayed directly from memory.
ImagePlayerParams.run_mode
A member of the ImagePlayerParams parameter block group, this int value
specifies how the animation should be performed. There are four possible
values for this parameter:-
- 0
- Play forwards until last frame is reached
- 1
- Play forwards continously, cycling to start when last frame is reached
- 2
- Play backwards until first frame is reached
- 3
- Play backwards continously, cycling to end when first frame is reached
ImagePlayerParams.fps
A member of the ImagePlayerParams parameter block group, this float value
specifies the rate at which the animation should run in frames per
second. This is the intended animation rate. If the system is unable to
achieve this rate then the animation will run at a lower rate.
ImagePlayerParams.nsec_before
A member of the ImagePlayerParams parameter block group, this int value
specifies the number of seconds that the animation should wait at the
starting frame before the animation is restarted. This parameter only
applies when the animation is cycling.
ImagePlayerParams.nsec_after
A member of the ImagePlayerParams parameter block group, this int value
specifies the number of seconds that the animation should wait at the
ending frame before the animation returns to the starting frame. This
parameter only applies when the animation is cycling.
ImagePlayerParams.count
A member of the ImagePlayerParams parameter block group, this int value
specifies the index number of the currently displayed image. Setting
this parameter will cause the currently displayed image to change
immediately.
ImagePlayerParams.real_fps
A member of the ImagePlayerParams parameter block group, this string
value displays the number of frames per second that the animation is
actually running at. The parameter is intended for display only and to
ease display the number of frames per second is included along with an
appropriate message by the module.
Output Ports
out
The currently displayed image output as Field data. The image is
represented by a uniform mesh. The colour of each pixel is represented
by a vector of length 4 (i.e. alpha, red, green, blue) at each node data
point.
obj
The directly renderable output field of the AVSImagePlayer module. This
contains a DataObject object that can be rendered by the standard data
viewers. The DataObject is generated directly from the field data
created from the currently displayed image.
Utility Macros
The low-level AVSImagePlayer module is used in the User Macro
imagePlayer. Additionally, this macro also uses the ImagePlayerParams
parameter block group object, as does the ImagePlayerUI UI Macro.
Example
An example application AVSImagePlayerEg is provided, which uses the
animation module to display a sequence of images generated for a
Meteorological Office presentation on global warming.
Files
iac_proj/ximg_ply/iplymacs.v contains the imagePlayer User Macro,
the ImagePlayerUI UI Macro, and the example application AVSImagePlayerEg
V definitions.
Other Notes
The AVSImagePlayerMacs library inherits its process. As this library
contains no procedural code, the process is not important. The low-level
AVSImagePlayer module, executes under the process specified in its library,
not the process defined in the high-level library.
Authors
Fernand Alcatrao
Modifications
Andrew Dodd
Contact
International AVS Centre
Manchester Visualization Centre
Manchester Computing
University of Manchester
Oxford Road
Manchester
United Kingdom
M13 9PL
See Also
ImagePlayerParams, ImagePlayerUI and AVSImagePlayer.
|