'\" te .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved .TH mlib_ImageColorOrderedDither8x8 3MLIB "2 Mar 2007" "SunOS 5.11" "mediaLib Library Functions" .SH NAME mlib_ImageColorOrderedDither8x8 \- true color to indexed color conversion using ordered dithering .SH SYNOPSIS .LP .nf cc [ \fIflag\fR... ] \fIfile\fR... \fB-lmlib\fR [ \fIlibrary\fR... ] #include \fBmlib_status\fR \fB\fR(\fBmlib_image *\fR\fIdst\fR, \fBconst mlib_image *\fR\fIsrc\fR, \fBconst mlib_s32 *\fR\fIdmask\fR, \fBmlib_s32\fR \fIscale\fR, \fBconst void *\fR\fIcolormap\fR); .fi .SH DESCRIPTION .sp .LP The \fBmlib_ImageColorOrderedDither8x8()\fR function converts a true color image to a pseudo color image with the method of ordered dithering. 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 This function works only with a colorcube, rather than a general lookup table. The last parameter, \fIcolormap\fR, is an internal data structure (which may include a colorcube) 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\fIdmask\fR\fR .ad .RS 12n .rt Pointer to the 8x8 dither mask, in row major order. The dither mask is transposed differently for different channels to reduce artifacts. .RE .sp .ne 2 .mk .na \fB\fIscale\fR\fR .ad .RS 12n .rt Scaling factor for dmask to convert the input integer coefficients into floating-point coefficients: .sp .in +2 .nf floating-point coefficient = integer coefficient * \e 2**(-scale) .fi .in -2 .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_ImageColorTrue2Index\fR(3MLIB), \fBmlib_ImageColorTrue2IndexFree\fR(3MLIB), \fBmlib_ImageColorTrue2IndexInit\fR(3MLIB), \fBattributes\fR(5)