6.10.1 Prototype Gamut Compression Procedure
The gamut compression callback interface must adhere to the
following:
typedef Status (*XcmsCompressionProc)(ccc, colors_in_out, ncolors, index, compression_flags_return)
XcmsCCC ccc;
XcmsColor colors_in_out[];
unsigned int ncolors;
unsigned int index;
Bool compression_flags_return[];
ccc
| Specifies the CCC.
|
colors_in_out
| Specifies an array of color specifications.
Pixel members should be ignored and must remain unchanged upon return.
|
ncolors
| Specifies the number of
XcmsColor
structures in the color specification array.
|
index
| Specifies the index into the array of
XcmsColor
structures for the encountered color specification that lies outside the
screen's color gamut.
Valid values are 0 (for the first element) to ncolors - 1.
|
compression_flags_return
| Returns an array of Boolean values for indicating compression status.
If a non-NULL pointer is supplied
and a color at a given index is compressed, then
True
should be stored at the corresponding index in this array;
otherwise, the array should not be modified.
|
When implementing a gamut compression procedure, consider the following
rules and assumptions:
-
The gamut compression procedure can attempt to compress one or multiple
specifications at a time.
-
When called, elements 0 to index - 1 in the color specification
array can be assumed to fall within the screen's color gamut.
In addition, these color specifications are already in some device-dependent
format (typically
XcmsRGBi).
If any modifications are made to these color specifications,
they must be in their initial device-dependent format upon return.
-
When called, the element in the color specification array specified
by the index argument contains the color specification outside the
screen's color gamut encountered by the calling routine.
In addition, this color specification can be assumed to be in
XcmsCIEXYZ.
Upon return, this color specification must be in
XcmsCIEXYZ.
-
When called, elements from index to ncolors - 1
in the color specification array may or may not fall within the
screen's color gamut.
In addition, these color specifications can be assumed to be in
XcmsCIEXYZ.
If any modifications are made to these color specifications,
they must be in
XcmsCIEXYZ
upon return.
-
The color specifications passed to the gamut compression procedure
have already been adjusted to the Screen White Point.
This means that at this point the color specification's white point
is the Screen White Point.
-
If the gamut compression procedure uses a device-independent color space not
initially accessible for use in the color management system, use
XcmsAddColorSpace()
to insure that it is added.
Christophe Tronche, [email protected]