++ed by:
SAPER KEEDI MARKELLIS MARKSTOS TOKUHIROM

32 PAUSE users
17 non-PAUSE users.

Tony Cook

NAME

  palimg.c - implements paletted images for Imager.

SYNOPSIS

DESCRIPTION

Implements paletted images using the new image interface.

IIM_base_8bit_pal

Basic 8-bit/sample paletted image

im_img_pal_new(ctx, x, y, channels, maxpal) =category Image creation/destruction =synopsis i_img *img = im_img_pal_new(aIMCTX, width, height, channels, max_palette_size) =synopsis i_img *img = i_img_pal_new(width, height, channels, max_palette_size)

Creates a new paletted image of the supplied dimensions.

maxpal is the maximum palette size and should normally be 256.

Returns a new image or NULL on failure.

Also callable as i_img_pal_new(width, height, channels, max_palette_size).

i_img_rgb_convert(i_img *targ, i_img *src)

Converts paletted data in src to RGB data in targ

Internal function.

src must be a paletted image and targ must be an RGB image with the same width, height and channels.

i_img_to_rgb_inplace(im)

Converts im from a paletted image to an RGB image.

The conversion is done in place.

The conversion cannot be done for virtual images.

i_img_to_pal(i_img *im, i_quantize *quant)

Converts an RGB image to a paletted image

i_img_to_rgb(i_img *src)
i_destroy_p(i_img *im)

Destroys data related to a paletted image.

i_ppix_p(i_img *im, i_img_dim x, i_img_dim y, const i_color *val)

Write to a pixel in the image.

Warning: converts the image to a RGB image if the color isn't already present in the image.

i_gpix_p(i_img *im, i_img_dim x, i_img_dim y, i_color *val)

Retrieve a pixel, converting from a palette index to a color.

i_glinp(i_img *im, i_img_dim l, i_img_dim r, i_img_dim y, i_color *vals)

Retrieve a row of pixels.

i_plin_p(i_img *im, i_img_dim l, i_img_dim r, i_img_dim y, const i_color *vals)

Write a line of color data to the image.

If any color value is not in the image when the image is converted to RGB.

i_gsamp_p(i_img *im, i_img_dim l, i_img_dim r, i_img_dim y, i_sample_t *samps, int chans, int chan_count)
i_gpal_p(i_img *im, i_img_dim l, i_img_dim r, i_img_dim y, i_palidx *vals)
i_ppal_p(i_img *im, i_img_dim l, i_img_dim r, i_img_dim y, const i_palidx *vals)
i_addcolors_p(i_img *im, const i_color *color, int count)
i_getcolors_p(i_img *im, int i, i_color *color, int count)
i_colorcount_p(i_img *im)
i_maxcolors_p(i_img *im)
i_setcolors_p(i_img *im, int index, const i_color *colors, int count)
i_findcolor_p(i_img *im)
i_psamp_p(im, l, r, y, samps, chans, chan_count)

Implement psamp() for paletted images.

Since writing samples doesn't really work as a concept for paletted images, this is slow.

Also, writing samples may convert the image to a direct image in the process, so use i_ppix/i_gpix instead of directly calling the paletted handlers.

i_psampf_p(im, l, r, y, samps, chans, chan_count)

Implement psampf() for paletted images.

Since writing samples doesn't really work as a concept for paletted images, this is slow.

Also, writing samples may convert the image to a direct image in the process, so use i_ppixf/i_gpixf instead of directly calling the paletted handlers.

AUTHOR

Tony Cook <tony@develop-help.com>

SEE ALSO

Imager(3)