'\" te .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved .TH mlib_ImageColorTrue2Index 3MLIB "2 Mar 2007" "SunOS 5.11" "mediaLib Library Functions" .SH NAME mlib_ImageColorTrue2Index \- true color to indexed color using nearest matched LUT entries .SH SYNOPSIS .LP .nf cc [ \fIflag\fR... ] \fIfile\fR... \fB-lmlib\fR [ \fIlibrary\fR... ] #include \fBmlib_status\fR \fBmlib_ImageColorTrue2Index\fR(\fBmlib_image *\fR\fIdst\fR, \fBconst mlib_image *\fR\fIsrc\fR, \fBconst void *\fR\fIcolormap\fR); .fi .SH DESCRIPTION .sp .LP The \fBmlib_ImageColorTrue2Index()\fR function converts a true color image to a pseudo color image with the method of finding the nearest matched lookup table entry for each pixel. The source image can be an \fBMLIB_BYTE\fR or \fBMLIB_SHORT\fR image with three or four channels. The destination must be a single-channel \fBMLIB_BYTE\fR or \fBMLIB_SHORT\fR image. .sp .LP The last parameter, \fIcolormap\fR, is an internal data structure (which includes the lookup table) for inverse color mapping. Create it by calling the \fBmlib_ImageColorTrue2IndexInit()\fR function. .SH PARAMETERS .sp .LP The function takes the following arguments: .sp .ne 2 .mk .na \fB\fIdst\fR\fR .ad .RS 12n .rt Pointer to destination or destination image. .RE .sp .ne 2 .mk .na \fB\fIsrc\fR\fR .ad .RS 12n .rt Pointer to source or source image. .RE .sp .ne 2 .mk .na \fB\fIcolormap\fR\fR .ad .RS 12n .rt Internal data structure for inverse color mapping. .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_ImageColorTrue2IndexFree\fR(3MLIB), \fBmlib_ImageColorTrue2IndexInit\fR(3MLIB), \fBattributes\fR(5)