IM: Color Mode Utilities

IM - Imaging Libray

Color Mode Utilities
[Image Representation]


Detailed Description

See im_util.h


Defines

#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)

Functions

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

Define Documentation

#define imColorModeSpace _cm   )     (_cm & 0xFF)
 

Returns the color space of the color mode.

#define imColorModeMatch _cm1,
_cm2   )     (imColorModeSpace(_cm1) == imColorModeSpace(_cm2))
 

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

#define imColorModeHasAlpha _cm   )     (_cm & IM_ALPHA)
 

Check if the color mode has an alpha channel.

#define imColorModeIsPacked _cm   )     (_cm & IM_PACKED)
 

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

#define imColorModeIsTopDown _cm   )     (_cm & IM_TOPDOWN)
 

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


Function Documentation

const char* imColorModeSpaceName int  color_mode  ) 
 

Returns the color mode name.

int imColorModeDepth int  color_mode  ) 
 

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

int imColorModeToBitmap int  color_mode  ) 
 

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

int imColorModeIsBitmap int  color_mode,
int  data_type
 

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