Next Previous Contents

11. ani.ct

This section describes functions from file ani.ct.

11.1 aniclose

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

11.2 aniopen

[ap] = aniopen(fn,rw...)
 aniopen("outfile","w") opens an MPEG 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" or "MPEG-2" (not case sensitive)
       "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".

   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.

11.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