KCMS Application Developer's Guide

KcsComponent

typedef struct KcsComponent_s {
 	char				*addr;
 	KcsSampleType				compType;
 	unsigned long				compDepth;
 	long				bitOffset;
 	long				rowOffset;
 	long				colOffset;
 	unsigned long				maxRow;
 	unsigned long				maxCol;
 	double				rangeStart;
 	double				rangeEnd;
 } KcsComponent;

KcsComponent describes the data structure used in KcsPixelLayout for a channel or component of color. There is one KcsComponent for each channel. For example, three of these structures are required to describe RGB data; four are required to describe CMYK data.

The addr field defines the actual memory address of the first pixel of the channel or component.

The compType field defines the data type of a channel. For example, given RGB data in which each of the 3 channels of the input data is represented as an unsigned 8-bit number, your application specifies KcsCompUFixed with a component depth of 8.

The compDepth field specifies the number of bits used to represent the component. With respect to memory layout, neither the range of values represented nor the data encoding is relevant. The memory layout determines how the data is accessed. Interpreting the data is a higher-level operation.

The bitOffset field, if set to 0, signifies that the component is byte-aligned. If it is not set to 0, non-byte-based components are described. This allows, for example, a 5-5-5 RGB pixel encoding (that is, 5 bits for each channel).

The rowOffset field is the offset between the beginning of a component for one pixel and the beginning of the same component for the pixel in the same column of the next row. It is expressed in units of bits or, if compDepth is a multiple of 8, in bytes.

Similarly, the colOffset field is the offset between the beginning of a component for one pixel and the beginning of the same component for the pixel in the next column of the same row. The pixels need not be contiguous in memory. The offset is expressed in units of bits or, if compDepth is a multiple of 8, in bytes.

The maxRow and maxCol fields specify the number of rows and columns to process. If your application wants to apply the profile to the entire bitmap, it must specify the number of rows and columns (y-size and x-size) of the entire bitmap.

The rangeStart and rangeEnd fields specify values representing minimum and maximum intensities.

See "KcsPixelLayout " and Figure 3-1 for more information on how component data is stored in memory.