WDS_Image

WDS_Image

wds

1998 12-05


CLASS

WDS_Image - raster image


SYNOPSIS

Class WDS_Image is a generic image class currently capable of holding and drawing 8-bit color-indexed raster images.


PUBLIC MEMBER FUNCTIONS



long GetSize(long *x,long *y)
Get the image width and height.



long LoadFromFileXPM(char *filename,long number_colors,EW_ColorMapping *remap)

long ReadFromBufferXPM(char **data,long number_colors,EW_ColorMapping *remap)
Load an XPM format image from the specified filename or from a compiled-in xpm data structure. Since XPM format is actually ascii-editable C-code, XPM's can be include'd into source modules.


Input images are automatically converted to the number of WDS premapped colors given as number_colors. The conversion is done by Error Diffusion, currently using a Floyd-Steinburg filter.


If remap is not NULL, the images colors are remapped accordingly.



void Rotate(long clockwise)
Rotate the image 90 degrees (clockwise, if the argument is non-zero).



void Flip(long vertical)
Invert the image (vertically, if the argument is non-zero).



void Draw(EW_Window *root,long posx,long posy,long background=255)
Draw the image on the given root window at the location posx, posy. Transparent pixels, are not drawn by default, but the optional argument background can be used to specify a color to replace transparent pixel with.


FILES

wds/image.h Image header file


SEE ALSO

WDS_intro(3), EW_Window(3), EW_ColorMapping(3)