MGL_halfTonePixel

Compute color for pixel in halftone palette.

Declaration

uchar MGLAPI MGL_halfTonePixel(
int x,
int y,
uchar R,
uchar G,
uchar B)

Prototype In

mgraph.h

Parameters

x | x pixel coordinate
y | y pixel coordinate
R | Red component for pixel color
G | Green component for pixel color
B | Blue component for pixel color

Return Value

Color index for the pixel in MGL halftone palette

Description

This function computes the color index for a specified 24 bit RGB pixel value in the standard MGL halftone palette, and can be used to perform real-time dithering of pixel values from RGB colors to color index colors. This routine uses a fast table lookup and an 8x8 ordered dither to do the conversion.

See Also

MGL_getHalfTonePalette

Copyright © 2002 SciTech Software, Inc. Visit our web site at http://www.scitechsoft.com