Globals: LW Comp Info

LightWave

Color Picker Context Menu Services Globals Table of Contents

Comp Info

Availability  LightWave 6.0
Component  Layout
Header  lwrender.h

The compositing info global identifies the images being used as the background, foreground and foreground alpha images. This data structure is read-only.

Global Call

   LWCompInfo *compinfo;
   compinfo = global( LWCOMPINFO_GLOBAL, GFUSE_TRANSIENT );

The global function returns a pointer to an LWCompInfo.

   typedef struct st_LWCompInfo {
      LWImageID bg;
      LWImageID fg;
      LWImageID fgAlpha;
   } LWCompInfo;
bg
The background image.

fg
The foreground image.

fgAlpha
The foreground alpha image.

Example

This code fragment retrieves information about the background image.

   #include <lwserver.h>
   #include <lwrender.h>
   #include <lwimage.h>

   LWCompInfo *compinfo;
   LWImageList *imglist;
   char *name;
   int width, height;

   compinfo = global( LWCOMPINFO_GLOBAL, GFUSE_TRANSIENT );
   imglist = global( LWIMAGELIST_GLOBAL, GFUSE_TRANSIENT );
   if ( !compinfo || !imglist ) goto ErrorBadGlobal;

   name = imglist->name( compinfo.bg );
   imglist->size( compinfo.bg, &width, &height );
   ...