BRDFHandler ColorPicker Classes Table of Contents

ChannelHandler

What channel handlers do.

Background

More about channel handlers.

Handler Activation Function

   XCALL_( int ) MyChannel( long version, GlobalFunc *global,
      LWChannelHandler *local, void *serverData );

The local argument to a channel handler's activation function is an LWChannelHandler.

   typedef struct st_LWChannelHandler {
      LWInstanceFuncs *inst;
      void            (*evaluate) (LWInstance, const LWChannelAccess *);
      unsigned int    (*flags)    (LWInstance);
   } LWChannelHandler;

The first member of this structure points to the standard instance handler functions. A channel handler also provides an evaluation function and a flags function.

evaluate( instance, access )
This is where the channel handler does its work.

flags( instance )
Returns an int that tells the renderer ??

Interface Activation Function

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

TBD.

Channel Access

This is the structure passed to the handler's evaluation function.

   typedef struct st_LWChannelAccess {
      LWChannelID   chan;
      LWFrame       frame;
      LWTime        time;
      double        value;
      void         (*getChannel)  (LWChannelID chan, LWTime t,
                      double *value);
      void         (*setChannel)  (LWChannelID chan, const double value);
      const char * (*channelName) (LWChannelID chan);
   } LWChannelAccess;
chan
The channel ID.
frame
The frame number of the evaluation.
time
The time of the evaluation, in seconds.
value
The current value of the channel at the given time.
getChannel( channel, time, value )
Retrieves a value from a channel.
setChannel( channel, value )
Sets the value of a channel.
channelName( channel )
Returns the name associated with the channel ID.