#ifndef H_IMAGEPALC #define H_IMAGEPALC #ifdef __cplusplus extern "C" { #endif /*** * IMAGE PALETTIZING FUNCTIONS */ /* Create a palette with a maximum of nColors colors for this image. */ int CreateRGBPalette(unsigned char (*data)[3], int w, int h, unsigned char (**palette)[3], int nColors); /* 'Posterize' the image using the specified palette. */ int RGB2Pal(unsigned char (*rgb)[3], unsigned char **pal, int w, int h, unsigned char (*palette)[3], int nColors); /*** * IMAGE DITHERING FUNCTIONS */ /* * Dither from "in" grayscale image to "out" monotone image, * with scaling if necessary. */ int DitherGray2BW(unsigned char *input_image, int xdim_in, int ydim_in, unsigned char **output_image, int xdim_out, int ydim_out); /* * Dither a 24-bit image onto the provided palette. * If 'palette' is NULL, then CreateRGBPalette(data, w, h, [temp], nColors) * before dithering. */ int DitherRGB(unsigned char (*data)[3], int w, int h, unsigned char (*palette)[3], int nColors); /* Convert palettized to RGB data. */ int Pal2RGB(unsigned char *pal, unsigned char (**rgb)[3], int w, int h, unsigned char (*palette)[3], int nColors); #ifdef __cplusplus } #endif #endif