XcmsColorSpace() XcmsColorSpace()
Name
XcmsColorSpace - Xcms color space structure.
Availability
Release 5 and later.
Description
The XcmsColorSpace structure contain the information necessary to convert the encoding of color specifications to other color spaces, and
to parse a color string encoded specifically for this color space.
The prefix member points to a string that identifies that a color strings encoding is for this particular color space.
<color_space>:<color_space_specific_encoding>
For example, the prefix "cieuvy:" for the color string "CIEuvY:0.119/0.545/0.254". Although the prefix in the color string may be entered
in uppercase or lowercase, all characters of the prefix specified in the XcmsColorSpace must be in lowercase.
The id member is predefined if the color space is registered with the X Consortium; otherwise assigned at run-time (see XcmsAddCol-
orSpace()).
The parseString member points to the color space specific string parsing function.
The to_CIEXYZ member is pointer to an array of functions that, when executed in sequence, will convert a XcmsColor structure encoded for
this color space to the CIEXYZ encoding.
The from_CIEXYZ member is pointer to an array of functions that, when executed in sequence, will convert a XcmsColor structure encoded for
CIEXYZ to this color space's encoding.
The inverse_flag member if set (i.e., 1) indicates that for each function in the to_CIEXYZ list, there is an inverse function in the
from_CIEXYZ list. Note however that the corresponding order is reversed - the inverse of the first function in to_CIEXYZ will be the last
function in from_CIEXYZ.
Structures
The XcmsColorSpace structure contains:
typedef XcmsConversionProc *XcmsFuncListPtr;
typedef struct _XcmsColorSpace {
char *prefix;
XcmsColorFormat id;
XcmsParseStringProc parseString;
XcmsFuncListPtr to_CIEXYZ;
XcmsFuncListPtr from_CIEXYZ;
int inverse_flag;
} XcmsColorSpace;
See Also
XcmsAddColorSpace(), XcmsAddFunctionSet(), XcmsFunctionSet, XcmsConversionProc, XcmsParseStringProc.
Xlib - Device-independent Color XcmsColorSpace()
Check Out this Related Man Page
XcmsLookupColor() XcmsLookupColor()
Name
XcmsLookupColor - obtain color values from a string.
Synopsis
Status XcmsLookupColor(display, colormap, color_string,
color_exact_return, color_screen_return, result_format)
Display *display;
Colormap colormap;
char *color_string;
XcmsColor *color_exact_return;
XcmsColor *color_screen_return;
XcmsColorFormat result_format;
Arguments
display Specifies the connection to the X server.
colormap Specifies the colormap.
color_string
Specifies the color string.
color_exact_return
Returns the color specification parsed from the color string or parsed from the corresponding string found in a color name data-
base.
color_screen_return
Returns the color that can be reproduced on the Screen.
result_format
Specifies the desired color format for the returned color specifications.
Returns
Zero on failure, non-zero on success.
Availability
Release 5 and later.
Description
The XcmsLookupColor() function looks up the string name of a color with respect to the screen associated with the specified colormap, but
does not store the color into any color cell in the color map. It returns both the exact color values and the closest values provided by
the screen with respect to the visual type of the specified colormap. The values are returned in the format specified by result_format.
The color string may contain a color name that appears in the client-side or X server's color database; or a numerical color specification
for any color management supported color spaces such that the string conforms to the uniform syntax:
<color_space>:<color_space_specific_encoding>
For example:
RGB:red/green/blue
RGBi:R/G/B
CIEXYZ:X/Y/Z
CIEuvY:u/v/Y
CIExyY:x/y/Y
CIELab:L/a/b
CIELuv:L/u/v
TekHVC:H/V/C
For the RGB color space, the red, green, and blue parameters are hexadecimal strings of one to four digits. For each of the other color
spaces, each parameter is a floating-point number in standard string format. In each case, each number specifies a value for one of the
parameters of the color space. Old-style RGB color strings beginning with a "#" remain supported for backwards compatibility. If the
color name is not in the Host Portable Character Encoding the result is implementation-dependent. Color names are case-insensitive.
If format is XcmsUndefinedFormat and the color string contains a numerical color specification, the specification is returned in the format
used in that numerical color specification. If format is XcmsUndefinedFormat and the color string contains a color name, the specification
is returned in the format used in the color name database entry for that color name.
XcmsLookupColor() returns XcmsSuccess or XcmsSuccessWithCompression if the name is resolved, otherwise it returns XcmsFailure. If XcmsSuc-
cessWithCompression is returned, then the color specification in color_screen_return is the result of gamut compression.
Structures
The XcmsColor and XcmsColorFormat structures are shown on the XcmsColor reference page.
See Also
XcmsAllocColor(), XcmsAllocNamedColor(), XcmsLookupColor(), XcmsQueryColor(), XcmsQueryColors(), XcmsStoreColor(), XcmsStoreColors(), Xcms-
StoreNamedColor, XAllocColor(), XAllocNamedColor(), XLookupColor(), XParseColor(), XQueryColor(), XQueryColors(), XStoreColor(), XStoreCol-
ors().
Xlib - Device-independent Color XcmsLookupColor()