xil_set_colorspace(3)
NAME
xil_set_colorspace − set an image’s color space
#include <xil/xil.h>
void xil_set_colorspace (XilImage image,
XilColorspace cspace);
DESCRIPTION
This function specifies the XilColorspace object associated with the image. The default value of this attribute is NULL, which means the image has no color space attached to it.
Images can be supplied in any of the supported color spaces. The following table indicates the character string used to identify the supported color spaces and describes the source of each color space definition:
"rgb709" Nonlinear RGB primaries as defined by CCIR Rec 709
"rgblinear" Linearized RGB using primaries from CCIR Rec 709
"ycc709" YCC as defined by CCIR Rec 709
"y709" Luminance (black and white) from "ycc709"
"ylinear" Linearized version of "y709"
"photoycc" YCC color space defined by Kodak for PhotoCD
"ycc601" YCC as defined by CCIR Rec 601
"y601" Luminance from "ycc601"
"cmy" Linear CMY, derived from "rgblinear"
"cmyk" Linear CMYK, derived from "cmy" through undercolor removal
These color spaces are created by the XIL library at the time of a call to xil_open(3). Handles to these color space objects can be obtained by calling xil_colorspace_get_by_name(3).
XIL Color Spaces
The XIL library supports specification of the color spaces of images and the conversion of images between supported color spaces. Color space conversion is useful for a number of reasons.
Some operations are more easily performed on certain color spaces. JPEG compression, for example, produces better results on color data when the input is supplied as YCC instead of RGB. Extracting luminance information from color data allows the simple use of monochrome output devices. The library supports conversion between a variety of these spaces, and treats luminance as a separate color space.
In most cases for 16-bit image data, there is little concern with artifacts due to limited precision. For 8-bit data, using nonlinear or gamma-corrected color spaces (such as YCC or nonlinear RGB) can prevent the contouring in low-intensity regions of the image that occurs with 8-bit linear data storage. The library supports both linear and nonlinear color spaces in both 8 and 16 bits.
Color separations produce images for output on subtractive color printers. The XIL library supports both CMY and CMYK spaces. Some flexibility in the generation of black color (K) and the associated undercolor removal is provided. The library also provides the ability to separate images into a specified group of process colors by dithering to a user-defined colormap. Sophisticated separations (nonlinear black mappings, for example) are not currently supported by the XIL library. Currently, the library only supports certain standard, or objective, color spaces.
ERRORS
For a complete list of XIL error messages by number, consult Appendix B of the XIL Programmer’s Guide.
EXAMPLES
XilSystemState State;
XilImage image;
XilColorspace cspace;
/∗ get handle to the predefined "rgblinear" colorspace ∗/
/∗ and specify this colorspace for image ∗/
State = xil_open();
image = xil_create(State);
cspace = xil_colorspace_get_by_name(State, "rgblinear");
xil_set_colorspace(image, cspace);
SEE ALSO
xil_colorspace_get_by_name(3), xil_color_convert(3), xil_black_generation(3), xil_open(3).
SunOS 5.6 — Last change: 19 July 1993