PEXQueryColorApproximation - Find a Supported Color Approximation Table Entry for the Specified Example Drawable (5.2)


Synopsis

 
   int PEXQueryColorApproximation(
          Display *display,
          Drawable example_drawable,
          PEXColorApproxEntry *color_approx
          unsigned long *count_return,
          PEXColorApproxEntry **color_approx_return,
          int *all_return
     )
 

Arguments

display
A pointer to a display structure returned by a successful XOpenDisplay call.

example_drawable
This example drawable indicates which visual, root, and depth the implementation should use when determining support of the color approximation table entry in question.

color_approx
A pointer to the desired color approximation table entry. The implementation determines if this color approximation table entry is supported for drawables of the same visual, root, and depth as the example drawable.

count_return
Returns the number of returned alternative supported color approximation table entries. A function return value of True indicates that this argument does not contain a valid value.

color_approx_return
Returns a list of alternative supported color approximation table entries. A function return value of True indicates that this argument does not contain a valid value.

all_return
A returned value of True indicates that the list returned in color_approx_return is the complete list of supported color approximation table entries. A function return value of True indicates that this argument does not contain a valid value.

Returns

True if the given color approximation table entry is supported; False otherwise. If an error condition was not identified and False is returned, then the output arguments of the function provide alternative color approximation table entries.

Description

Invoke PEXQueryColorApproximation to find a supported color approximation table entry for the specified example drawable.

This function returns a value of True, if there are drawables that support the specified color approximation table entry, and these drawables have the same visual (if the drawable has a visual), root, and depth as the specified example drawable.

If there are no drawables that support the specified color approximation color table, then this function returns a value of False. In this case, this function returns via the color_approx_return argument, a list of color approximations which are supported by drawables of the same visual (if the drawable has one), root and depth as the specified example drawable. A return value of True on the all_return argument indicates that this list is exhaustive.

PEXlib allocates memory if the implementation supports any alternative color approximation table entries. If PEXlib is unable to allocate the memory it requires, then PEXlib sets the count_return argument to zero and sets the color_approx_return argument to NULL. Invoke the XFree function to deallocate this memory.

Errors

BadDrawable
The specified drawable resource identifier is invalid.

BadMatch
The specified drawable is not supported.

BadValue
The type, model or dither members of the PEXColorApproxEntry structure are invalid.

See Also

For an overview, see PEXlib Access and Information Functions.