XAllocColorCells

Syntax

Status XAllocColorCells(display, colormap, contig, plane_masks_return, nplanes,
                          pixels_return, npixels)
      Display *display;
      Colormap colormap;
      Bool contig;
      unsigned long plane_masks_return[];
      unsigned int nplanes;
      unsigned long pixels_return[];
      unsigned int npixels;

Arguments

display Specifies the connection to the X server.
colormap Specifies the colormap.
contig Specifies a Boolean value that indicates whether the planes must be contiguous.
plane_mask_return Returns an array of plane masks.
nplanes Specifies the number of plane masks that are to be returned in the plane masks array.
pixels_return Returns an array of pixel values.
npixels Specifies the number of pixel values that are to be returned in the pixels_return array.

Description

The XAllocColorCells() function allocates read/write color cells. The number of colors must be positive and the number of planes nonnegative, or a BadValue error results. If ncolors and nplanes are requested, then ncolors pixels and nplane plane masks are returned. No mask will have any bits set to 1 in common with any other mask or with any of the pixels. By ORing together each pixel with zero or more masks, ncolors * 2nplanes distinct pixels can be produced. All of these are allocated writable by the request. For GrayScale or PseudoColor , each mask has exactly one bit set to 1. For DirectColor , each has exactly three bits set to 1. If contig is True and if all masks are ORed together, a single contiguous set of bits set to 1 will be formed for GrayScale or PseudoColor and three contiguous sets of bits set to 1 (one within each pixel subfield) for DirectColor . The RGB values of the allocated entries are undefined. XAllocColorCells() returns nonzero if it succeeded or zero if it failed.

XAllocColorCells() can generate BadColor and BadValue errors.

Diagnostics

BadColor A value for a Colormap argument does not name a defined Colormap.
BadValue Some numeric value falls outside the range of values accepted by the request. Unless a specific range is specified for an argument, the full range defined by the argument's type is accepted. Any argument defined as a set of alternatives can generate this error.

See also

XAllocColor(), XAllocColorPlanes(), XAllocNamedColor(), XCreateColormap(), XFreeColors(), XQueryColor(), XStoreColors(), "Allocating and Freeing Color Cells".
Christophe Tronche, [email protected]