12.07.2015 Views

Xlib − C Language X Interface

Xlib − C Language X Interface

Xlib − C Language X Interface

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Xlib</strong> − C LibraryX11, Release 6.7 DRAFT6.2.3. Device-Independent String SpecificationsThe standard device-independent string specifications have the following syntax:CIEXYZ://CIEuvY://CIExyY://CIELab://CIELuv://TekHVC://All of the values (C, H, V, X,Y,Z,a,b,u,v,y,x)are floating-point values. The syntax for thesevalues is an optional plus or minus sign, a string of digits possibly containing a decimal point, andan optional exponent field consisting of an ‘‘E’’ or‘‘e’’ followed by an optional plus or minus followedby a string of digits.6.3. Color Conversion Contexts and Gamut MappingWhen <strong>Xlib</strong> converts device-independent color specifications into device-dependent specificationsand vice versa, it uses knowledge about the color limitations of the screen hardware. This information,typically called the device profile, is available in a Color Conversion Context (CCC).Because a specified color may be outside the color gamut of the target screen and the white pointassociated with the color specification may differ from the white point inherent to the screen, <strong>Xlib</strong>applies gamut mapping when it encounters certain conditions:• Gamut compression occurs when conversion of device-independent color specifications todevice-dependent color specifications results in a color out of the target screen’s gamut.• White adjustment occurs when the inherent white point of the screen differs from the whitepoint assumed by the client.Gamut handling methods are stored as callbacks in the CCC, which in turn are used by the colorspace conversion routines. Client data is also stored in the CCC for each callback. The CCC alsocontains the white point the client assumes to be associated with color specifications (that is, theClient White Point). The client can specify the gamut handling callbacks and client data as wellas the Client White Point. <strong>Xlib</strong> does not preclude the X client from performing other forms ofgamut handling (for example, gamut expansion); however, <strong>Xlib</strong> does not provide direct supportfor gamut handling other than white adjustment and gamut compression.Associated with each colormap is an initial CCC transparently generated by <strong>Xlib</strong>. Therefore,when you specify a colormap as an argument to an <strong>Xlib</strong> function, you are indirectly specifying aCCC. There is a default CCC associated with each screen. Newly created CCCs inherit attributesfrom the default CCC, so the default CCC attributes can be modified to affect new CCCs.Xcms functions in which gamut mapping can occur return Status and have specific status valuesdefined for them, as follows:• XcmsFailure indicates that the function failed.• XcmsSuccess indicates that the function succeeded. In addition, if the function performedany color conversion, the colors did not need to be compressed.• XcmsSuccessWithCompression indicates the function performed color conversion and atleast one of the colors needed to be compressed. The gamut compression method is determinedby the gamut compression procedure in the CCC that is specified directly as a functionargument or in the CCC indirectly specified by means of the colormap argument.85

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!