_HP_RGB_SMOOTH_MAP_LIST is a list of colormaps that are associated with window visual IDs that support Color Recovery. When the XGetRGBColormaps routine searches this list for a colormap with a visual ID that matches your window's visual ID and it finds one, your application knows that your visual supports Color Recovery, and uses that colormap for any Color Recovery window in your window's visual.
Color Recovery uses all 256 entries of one of the available colormaps. The color visual used by Color Recovery emulates the
For Color Recovery to produce the best results, the emulated
A pixel to be dithered is sent to the routine provided in this example. The values of the variables RedValue, GreenValue, and BlueValue are generated by an application. In this example, the color values are assumed to be in the range 0..255.
The given routine receives the color values and the X and Y window address (Xp and Yp) of the pixel. The X and Y address is used to access the dither tables. The values from the dither tables are added to the color values. After the dither addition, the resultant color values are quantized to three bits of red and green and two bits of blue. The quantized results are packed into an
Here is a routine that can be used to dither the
unsigned char dither_pixel_for_CR(RedValue,GreenValue,BlueValue,Xp,Yp)
int RedValue,GreenValueBlueValue,Xp,Yp;
{
static short dither_red[2][16] = {
{ 15, | |||
static short | dither_green[2][16] = { |
{
static short | dither_blue[2][16] = { | |
{ | 7, | |
{ | ||
int | red, green, blue; | |
int | x_dither_table, y_dither_table; | |
unsigned char | pixel; |
/* Determine the dither table entries to use based on the pixel address */ x_dither_table = Xp % 16; /* X Pixel Address MOD 16 */
Page 65 | Graphics Administration Guide for |