'\" te .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved .TH mlib_ImageConv3x3Index 3MLIB "2 Mar 2007" "SunOS 5.11" "mediaLib Library Functions" .SH NAME mlib_ImageConv3x3Index \- 3x3 convolution on a color indexed image .SH SYNOPSIS .LP .nf cc [ \fIflag\fR... ] \fIfile\fR... \fB-lmlib\fR [ \fIlibrary\fR... ] #include \fBmlib_status\fR \fBmlib_ImageConv3x3Index\fR(\fBmlib_image *\fR\fIdst\fR, \fBconst mlib_image *\fR\fIsrc\fR, \fBconst mlib_s32 *\fR\fIkernel\fR, \fBmlib_s32\fR \fIscale\fR, \fBmlib_edge\fR \fIedge\fR, \fBconst void *\fR\fIcolormap\fR); .fi .SH DESCRIPTION .sp .LP The \fBmlib_ImageConv3x3Index()\fR function performs a 3x3 convolution on the color indexed source image by using the user-supplied kernel. .sp .LP The input and output images must have the same image type and size. .sp .LP For this convolution, the key element of the convolution kernel is located at the center of the kernel matrix. .sp .LP This function performs the convolution on color indexed image. The input image and the output image must be single-channel images. The image type must be \fBMLIB_BYTE\fR or \fBMLIB_SHORT\fR. .sp .LP It uses the following equation: .sp .in +2 .nf m-1-dm n-1-dn dst[x][y][i] = SUM SUM src[x+p][y+q][i]*k[p][q]*2**(-scale) p=-dm q=-dn .fi .in -2 .sp .LP where \fBm = 3, n = 3, dm = (m - 1)/2 = 1, dn = (n - 1)/2 = 1\fR. .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 image. .RE .sp .ne 2 .mk .na \fB\fIsrc\fR\fR .ad .RS 12n .rt Pointer to source image. .RE .sp .ne 2 .mk .na \fB\fIkernel\fR\fR .ad .RS 12n .rt Pointer to the convolution kernel, in row major order. .RE .sp .ne 2 .mk .na \fB\fIscale\fR\fR .ad .RS 12n .rt Scaling factor. .RE .sp .ne 2 .mk .na \fB\fIedge\fR\fR .ad .RS 12n .rt Type of edge condition. It can be one of the following: .sp .in +2 .nf MLIB_EDGE_DST_NO_WRITE MLIB_EDGE_DST_FILL_ZERO MLIB_EDGE_DST_COPY_SRC MLIB_EDGE_SRC_EXTEND .fi .in -2 .RE .sp .ne 2 .mk .na \fB\fIcolormap\fR\fR .ad .RS 12n .rt Internal data structure for inverse color mapping. This data structure is generated by the \fBmlib_ImageColorTrue2IndexInit()\fR function. The source and destination images must be single-channel images. .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_ImageConv2x2\fR(3MLIB), \fBmlib_ImageConv2x2_Fp\fR(3MLIB), \fBmlib_ImageConv2x2Index\fR(3MLIB), \fBmlib_ImageConv3x3\fR(3MLIB), \fBmlib_ImageConv3x3_Fp\fR(3MLIB), \fBmlib_ImageConv4x4\fR(3MLIB), \fBmlib_ImageConv4x4_Fp\fR(3MLIB), \fBmlib_ImageConv4x4Index\fR(3MLIB), \fBmlib_ImageConv5x5\fR(3MLIB), \fBmlib_ImageConv5x5_Fp\fR(3MLIB), \fBmlib_ImageConv5x5Index\fR(3MLIB), \fBmlib_ImageConv7x7\fR(3MLIB), \fBmlib_ImageConv7x7_Fp\fR(3MLIB), \fBmlib_ImageConv7x7Index\fR(3MLIB), \fBmlib_ImageConvKernelConvert\fR(3MLIB), \fBmlib_ImageConvMxN\fR(3MLIB), \fBmlib_ImageConvMxN_Fp\fR(3MLIB), \fBmlib_ImageConvMxNIndex\fR(3MLIB), \fBmlib_ImageConvolveMxN\fR(3MLIB), \fBmlib_ImageConvolveMxN_Fp\fR(3MLIB), \fBmlib_ImageSConv3x3\fR(3MLIB), \fBmlib_ImageSConv3x3_Fp\fR(3MLIB), \fBmlib_ImageSConv5x5\fR(3MLIB), \fBmlib_ImageSConv5x5_Fp\fR(3MLIB), \fBmlib_ImageSConv7x7\fR(3MLIB), \fBmlib_ImageSConv7x7_Fp\fR(3MLIB), \fBmlib_ImageSConvKernelConvert\fR(3MLIB), \fBattributes\fR(5)