Next Previous Contents

12. ani.ct

This section describes functions from file ani.ct.

12.1 aniclose

[] = aniclose(ap)
 aniclose(ap) closes a previously opened animation file.
   Error codes:
   1: Argument not a valid open animation handle

12.2 aniopen

[ap] = aniopen(fn,rw...)
 aniopen("outfile","w") opens an MPEG or MNG animation file for writing.
   It returns an animation handle that can be passed to aniput
   for writing the frames.

   You can also give option-value pairs as additional arguments,
   the following are recognized (Example values are the defaults):

   aniopen("outfile","w",
     "animtype","mpeg-1",    // "MPEG-1", "MPEG-2" or "MNG" (case insensitive)
     "bytes_per_frame",12e3, // bytes per frame to write, approximately
     "framerate",7,          // frames per second to show when showing
     "I_frames_only",0,      // if flag is 1, write I-frames only
     "verbose",0)            // give some progress report to stderr

   The rates must be positive reals or ints. The flags must be passed as
   0 or 1. Set "I_frames_only" to 1 if you want to view all frames with
   Xanim. Most widely available tools currently show only MPEG-1 animations,
   not MPEG-2 so that default type is still set to "MPEG-1".

   If animtype is "MNG", all other options are ignored (except being
   syntactically checked). MNG animation always uses lossless compression.
   This version writes a VLC (Very Low Complexity) MNG animation, which
   uses adaptive filtering and the default ZLIB compression level.
   Future Tela versions may offer additional options for controlling
   the type of the MNG output (e.g., Delta-PNG animations).

   Error codes:
   -1: First argument not a string
   -2: Second argument not a string
   -3: Cannot open animation file
   -4: Second argument not equal to "w" or "r"
   5: Error with animation options
See also: aniput, aniclose.

12.3 aniput

[] = aniput(ap,r,g,b)
 aniput(ap,r,g,b) writes a new frame to a previously
   opened animation (ap=handle returned by aniopen).
   The first frame defines the image size of the animation.
   Error codes:
   -1: First argument not a valid open animation handle
   -2: Second argument not an int matrix
   -3: Third argument not an int matrix
   -4: Fourth argument not an int matrix
   -5: r,g,b arguments not of the same size with each other
   -6: Image size does not match with first frame
See also: aniopen, aniclose.


Next Previous Contents