logoThe Lightwave3D Image Saver:logo

Image saving functions for plugins.

Globsave.p is a global-class plug-in. This means that its functions are only available to other plug-ins, not to end users. To call Globsave.p from a plug-in file, you must first get access to its functions by calling the global function with the name for the plug-in service, in this case "ImageSaver". If the plug-in is loaded in Lightwave3D, the global function will return the address of a GlobalSaverData structure, which has pointers to all the available functions. The definitions for this and other necessary structures are in the file lwisaver.h, which must be #included in your source.

The GlobalSaverData structure has the following elements:

ImageProtocol *open(GlobalFunc *global)
This function returns the address of an ImageProtocol structure you can use to save an image in a line-by-line fashion, as documented the sdk docs.
int setType(ImageProtocol *im, char *name, char *type, int channels)
This function will set the name, image saver type and the number of channels to save (i.e. 1 for grey, 3 for rgb, etc.). It should be given a valid ImageProtocol, like one just returned by open().
void close(ImageProtocol *im)
This function must be called for protocols you have opened when they are no longer needed.
int saveImage(GlobalFunc *global, svImage *img, char *name)
This function will directly save an entire image buffer you have created.

Get the image saver for: