'\" te .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved .TH mlib_ImageColorTrue2IndexInit 3MLIB "2 Mar 2007" "SunOS 5.11" "mediaLib Library Functions" .SH NAME mlib_ImageColorTrue2IndexInit \- initialization for true color to indexed color conversion .SH SYNOPSIS .LP .nf cc [ \fIflag\fR... ] \fIfile\fR... \fB-lmlib\fR [ \fIlibrary\fR... ] #include \fBmlib_status\fR \fBmlib_ImageColorTrue2IndexInit\fR(\fBvoid **\fR\fIcolormap\fR, \fBmlib_s32\fR \fIbits\fR, \fBmlib_type\fR \fIintype\fR, \fBmlib_type\fR \fIouttype\fR, \fBmlib_s32\fR \fIchannels\fR, \fBmlib_s32\fR \fIentries\fR, \fBmlib_s32\fR \fIoffset\fR, \fBconst void **\fR\fItable\fR); .fi .SH DESCRIPTION .sp .LP The \fBmlib_ImageColorTrue2IndexInit()\fR function creates and initializes an internal data structure based on the input lookup table and other parameters for inverse color mapping. .sp .LP The lookup table can have either three or four channels. The number of channels of the lookup table should match that of the source image provided to the function that will use the \fIcolormap\fR structure created by this function. .sp .LP The type of the lookup table can be one of the following: .sp .in +2 .nf MLIB_BYTE in, MLIB_BYTE out (i.e., BYTE-to-BYTE) MLIB_SHORT in, MLIB_SHORT out (i.e., SHORT-to-SHORT) MLIB_SHORT in, MLIB_BYTE out (i.e., SHORT-to-BYTE) .fi .in -2 .sp .LP The input type of the lookup table should match the type of the destination image; the output type of the lookup table should match the source image type. The source and destination images are the images provided to the function that is going to use the \fIcolormap\fR structure created by \fBmlib_ImageColorTrue2IndexInit()\fR to do inverse color mapping. .SH PARAMETERS .sp .LP The function takes the following arguments: .sp .ne 2 .mk .na \fB\fIcolormap\fR\fR .ad .RS 12n .rt Internal data structure for inverse color mapping. .RE .sp .ne 2 .mk .na \fB\fIbits\fR\fR .ad .RS 12n .rt Number of bits per color component used in the colorcube of the colormap structure. (If \fBbits = 0\fR, then no colorcube is created. But the inverse color mapping might be done by using the original lookup table.) .RE .sp .ne 2 .mk .na \fB\fIintype\fR\fR .ad .RS 12n .rt Data type of the source image and lookup table. .RE .sp .ne 2 .mk .na \fB\fIouttype\fR\fR .ad .RS 12n .rt Data type of the destination indexed image. .RE .sp .ne 2 .mk .na \fB\fIchannels\fR\fR .ad .RS 12n .rt Number of channels of the lookup table. .RE .sp .ne 2 .mk .na \fB\fIentries\fR\fR .ad .RS 12n .rt Number of entries of the lookup table. .RE .sp .ne 2 .mk .na \fB\fIoffset\fR\fR .ad .RS 12n .rt The first entry offset of the lookup table. .RE .sp .ne 2 .mk .na \fB\fItable\fR\fR .ad .RS 12n .rt The lookup table (LUT). .RE .SH RETURN VALUES .sp .LP The function returns \fBMLIB_SUCCESS\fR if successful. Otherwise it returns \fBMLIB_FAILURE\fR. .SH ATTRIBUTES .sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPEATTRIBUTE VALUE _ Interface StabilityCommitted _ MT-LevelMT-Safe .TE .SH SEE ALSO .sp .LP \fBmlib_ImageColorErrorDiffusion3x3\fR(3MLIB), \fBmlib_ImageColorOrderedDither8x8\fR(3MLIB), \fBmlib_ImageColorTrue2Index\fR(3MLIB), \fBmlib_ImageColorTrue2IndexFree\fR(3MLIB), \fBattributes\fR(5)