AnimLoaderHandler BRDFHandler Classes Table of Contents

AnimSaverHandler
AnimSaverInterface

Animation savers write out a sequence of rendered images as an animation file.

Background

Anim savers add frames to the animation file as each frame is rendered. The rendered image is passed to the saver in the same way it's passed to frame buffer display plug-ins, except that there is no pause function call after each frame, and animation savers are initially given a filename.

Handler Activation Function

   XCALL_( int ) MyAnimSaver( long version, GlobalFunc *global,
      LWAnimSaverHandler *local, void *serverData );

The local argument to an anim saver's activation function is an LWAnimSaverHandler.

   typedef struct st_LWAnimSaverHandler {
      LWInstanceFuncs *inst;
      LWItemFuncs     *item;
      int              type;
      LWError         (*open)  (LWInstance, int w, int h,
                                const char *filename);
      void            (*close) (LWInstance);
      LWError         (*begin) (LWInstance);
      LWError         (*write) (LWInstance,
                                const void *R,
                                const void *G,
                                const void *B,
                                const void *alpha);
   } LWAnimSaverHandler;

The first two member of this structure point to the standard handler functions. In addition to these, an anim loader also provides functions for opening and closing the file and for writing a frame, and it specifies what type of data it wants to receive.

type
The type of pixel data Layout should send to the write function. This can be one of the following.

LWIMTYP_RGB24
LWIMTYP_GREY8
LWIMTYP_GREYFP
LWIMTYP_RGBFP
LWIMTYP_RGBA32
LWIMTYP_RGBAFP

open( instance, w, h, filename )
Open the file. This function receives the width and height of the frame in pixels, and the name of the file. It's called when rendering starts.
close( instance )
Close the file. This is called when rendering is complete.
begin( instance )
Layout calls this to signal that it's about to send a new frame.
write( instance, R, G, B, alpha )
Called by Layout to send a new scanline. The scanlines for each frame are sent in order from top to bottom. The buffer arguments point to arrays of color channel values. There are exactly w values for each channel, one for each pixel in a scanline.

Interface Activation Function

   XCALL_( int ) MyInterface( long version, GlobalFunc *global,
      ??? *???, void *serverData );

TBD.