Defines | Functions

Color Mode Utilities
[Image Representation]

Collaboration diagram for Color Mode Utilities:


#define imColorModeSpace(_cm)   (_cm & 0xFF)
#define imColorModeMatch(_cm1, _cm2)   (imColorModeSpace(_cm1) == imColorModeSpace(_cm2))
#define imColorModeHasAlpha(_cm)   (_cm & IM_ALPHA)
#define imColorModeIsPacked(_cm)   (_cm & IM_PACKED)
#define imColorModeIsTopDown(_cm)   (_cm & IM_TOPDOWN)
#define IM_MAXDEPTH   5


const char * imColorModeSpaceName (int color_mode)
int imColorModeDepth (int color_mode)
int imColorModeToBitmap (int color_mode)
int imColorModeIsBitmap (int color_mode, int data_type)

Detailed Description

See im_util.h

Define Documentation

#define imColorModeSpace (   _cm  )     (_cm & 0xFF)

Returns the color space of the color mode.

im.ColorModeSpace(color_mode: number) -> color_space: number [in Lua 5] 
#define imColorModeMatch (   _cm1,
)    (imColorModeSpace(_cm1) == imColorModeSpace(_cm2))

Check if the two color modes match. Only the color space is compared.

im.ColorModeMatch(color_mode1: number, color_mode2: number) -> match: boolean [in Lua 5] 
#define imColorModeHasAlpha (   _cm  )     (_cm & IM_ALPHA)

Check if the color mode has an alpha channel.

im.ColorModeHasAlpha(color_mode: number) -> has_alpha: boolean [in Lua 5] 
#define imColorModeIsPacked (   _cm  )     (_cm & IM_PACKED)

Check if the color mode components are packed in one plane.

im.ColorModeIsPacked(color_mode: number) -> is_packed: boolean [in Lua 5] 
#define imColorModeIsTopDown (   _cm  )     (_cm & IM_TOPDOWN)

Check if the color mode orients the image from top down to bottom.

im.ColorModeIsTopDown(color_mode: number) -> is_top_down: boolean [in Lua 5] 
#define IM_MAXDEPTH   5

Max depth is 4+1 (cmyk+alpha)

Function Documentation

const char* imColorModeSpaceName ( int  color_mode  ) 

Returns the color mode name.

im.ColorModeSpaceName(color_mode: number) -> name: string [in Lua 5] 
int imColorModeDepth ( int  color_mode  ) 

Returns the number of components of the color space including alpha.

im.ColorModeDepth(color_mode: number) -> depth: number [in Lua 5] 
int imColorModeToBitmap ( int  color_mode  ) 

Returns the color space of the equivalent display bitmap image.
Original packing and alpha are ignored. Returns IM_RGB, IM_GRAY, IM_MAP or IM_BINARY.

im.ColorModeToBitmap(color_mode: number) -> color_space: number [in Lua 5] 
int imColorModeIsBitmap ( int  color_mode,
int  data_type 

Check if the color mode and data_type defines a display bitmap image.

im.ColorModeIsBitmap(color_mode: number, data_type: number) -> is_bitmap: boolean [in Lua 5]