IMC_24TO8(3)

FUNCTION
imc_24to8 - Convert a 24 bit truecolour image to an 8 bit pseudocolour image.

SYNOPSIS
#include <karma_imc.h>

flag imc_24to8

(unsigned int image_size, unsigned char *image_reds, unsigned char *image_greens, unsigned char *image_blues, int stride24, unsigned char *out_image, int stride8, unsigned int max_colours, unsigned int speed, packet_desc **pack_desc, char **packet)

DESCRIPTION
Convert a 24 bit truecolour image to an 8 bit pseudocolour image.

image_size
    The size of the image (in pixels).

image_reds
    The red component data of the truecolour image.

image_greens
    The green component data of the truecolour image.

image_blues
    The blue component data of the truecolour image.

stride24
    The stride (in bytes) between adjacent pixels in the truecolour image.

out_image
    The output (8 bit pseudocolour) image data.

stride8
    The stride (in bytes) between adjacent pixels in the pseudocolour image.

max_colours
    The maximum number of unique colours permitted (i.e. the maximum colour palette size that can be supported).

speed
    The desired speed of the routine. This value may range from 0 to 9. A value of 0 will result in the slowest but highest quality conversion (i.e. the routine tries very hard to choose the best colour palette). A value of 9 will result in the fastest conversion, at the expense of image quality.

pack_desc
    The pointer to the top level packet descriptor of the general data structure which contains the colourmap will be written here.

packet
    The pointer to the top level packet of the general data structure which contains the colourmap will be written here.

RETURN VALUE
TRUE on success, else FALSE.

Multi-threading Level
Unsafe.

AUTHOR
Richard Gooch (rgooch@atnf.csiro.au)

AVAILABLITY
The Karma Distribution is available for anonymous ftp from: ftp://ftp.atnf.csiro.au/pub/software/karma/ ftp://wuarchive.wustl.edu/graphics/graphics/packages/karma/ ftp://ftp.pwr.wroc.pl/pub/karma/ The Karma Home Page is: http://www.atnf.csiro.au/karma/