XAllocColorCells()XAllocColorCells()Name
XAllocColorCells – allocate read/write (nonshared) colorcells.
Synopsis
Status XAllocColorCells(display, colormap, contig, plane_masks_return,
nplanes, pixels_return, npixels_return)
Display *display;
Colormap colormap;
Bool contig;
unsigned long plane_masks_return[nplanes];
unsigned int nplanes;
unsigned long pixels_return[npixels_return];
unsigned int npixels_return;
Arguments
display Specifies a connection to an X server; returned from
XOpenDisplay().
colormap Specifies the ID of the colormap in which the colorcell is to
be allocated.
contig Specifies a boolean value. Pass True if the planes must be
contiguous or False if the planes need not be contiguous.
plane_mask
Returns an array of plane masks.
nplanes Specifies the number of plane masks returned in the plane
masks array. Must be nonnegative.
pixels_return
Returns an array of pixel values.
npixels_return
Specifies the number of pixel values returned in the pix‐
els_return array. Must be positive.
Returns
Zero on failure, non-zero on success.
DescriptionXAllocColorCells() allocates read/write colorcells in a read/write col‐
ormap. If npixels_return and nplanes are requested, then npix‐
els_return base values and nplanes plane masks are returned. No mask
will have any bits in common with any other mask, or with any of the
pixels. By ORing together each of the pixels_return with any combina‐
tion of the plane_masks_return, npixels_return*2(nplanes) distinct
pixel values can be produced. For GrayScale or PseudoColor, each mask
will have exactly one bit, and for DirectColor each will have exactly
three bits. If contig is True, then if all plane masks are ORed
together, a single contiguous set of bits will be formed for GrayScale
or PseudoColor and three contiguous sets of bits (one within each pixel
subfield) for DirectColor. The RGB values of the allocated entries are
undefined until set with XStoreColor, XStoreColors(), or XStoreNamed‐
Color().
Status is zero on failure, and non-zero on success.
For more information, see Volume One, Chapter 7, Color.
Errors
BadColor
BadValue nplanes is negative.
npixels_return is not positive.
See AlsoXBlackPixel(), XWhitePixel(), XAllocColor(), XAllocColorPlanes(), XAl‐
locNamedColor(), XFreeColors(), XLookupColor(), XParseColor(), XQuery‐
Color(), XQueryColors(), XStoreColor(), XStoreColors(), XStoreNamed‐
Color().
Xlib - Color Cells XAllocColorCells()