'\" te .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved .TH mlib_ImageZoomTranslateToGray 3MLIB "2 Mar 2007" "SunOS 5.11" "mediaLib Library Functions" .SH NAME mlib_ImageZoomTranslateToGray \- zoom, with translation, and convert to grayscale .SH SYNOPSIS .LP .nf cc [ \fIflag\fR... ] \fIfile\fR... \fB-lmlib\fR [ \fIlibrary\fR... ] #include \fBmlib_status\fR \fBmlib_ImageZoomTranslateToGray\fR(\fBmlib_image *\fR\fIdst\fR, \fBconst mlib_image *\fR\fIsrc\fR, \fBmlib_d64\fR \fIzoomx\fR, \fBmlib_d64\fR \fIzoomy\fR, \fBmlib_d64\fR \fItx\fR, \fBmlib_d64\fR \fIty\fR, \fBmlib_filter\fR \fIfilter\fR, \fBmlib_edge\fR \fIedge\fR, \fBconst mlib_s32 *\fR\fIghigh\fR, \fBconst mlib_s32 *\fR\fIglow\fR); .fi .SH DESCRIPTION .sp .LP The \fBmlib_ImageZoomTranslateToGray()\fR function will enlarge or minify the source binary image by the X and Y zoom factors, with translation, and convert the resulting image into a grayscale image. .sp .LP It uses the following equation for coordinate mapping: .sp .in +2 .nf xd = zoomx*xs + tx yd = zoomy*ys + ty .fi .in -2 .sp .LP where a point with coordinates \fB(xs, ys)\fR in the source image is mapped to a point with coordinates \fB(xd, yd)\fR in the destination image. .sp .LP The width and height of the destination image can be different from the width and height of the source image. .sp .LP The center of the upper-left corner pixel of an image is located at \fB(0.5, 0.5)\fR. .SH PARAMETERS .sp .LP The function takes the following arguments: .sp .ne 2 .mk .na \fB\fIdst\fR\fR .ad .RS 10n .rt Pointer to destination image. It must be of type \fBMLIB_BYTE\fR and have just one channel. .RE .sp .ne 2 .mk .na \fB\fIsrc\fR\fR .ad .RS 10n .rt Pointer to source image. It must be of type \fBMLIB_BIT\fR and have just one channel. .RE .sp .ne 2 .mk .na \fB\fIzoomx\fR\fR .ad .RS 10n .rt X zoom factor. \fBzoomx > 0\fR. .RE .sp .ne 2 .mk .na \fB\fIzoomy\fR\fR .ad .RS 10n .rt Y zoom factor. \fBzoomy > 0\fR. .RE .sp .ne 2 .mk .na \fB\fItx\fR\fR .ad .RS 10n .rt X translation. .RE .sp .ne 2 .mk .na \fB\fIty\fR\fR .ad .RS 10n .rt Y translation. .RE .sp .ne 2 .mk .na \fB\fIfilter\fR\fR .ad .RS 10n .rt Type of resampling filter. It must be MLIB_NEAREST. .RE .sp .ne 2 .mk .na \fB\fIedge\fR\fR .ad .RS 10n .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_OP_NEAREST MLIB_EDGE_SRC_EXTEND MLIB_EDGE_SRC_PADDED .fi .in -2 .RE .sp .ne 2 .mk .na \fB\fIghigh\fR\fR .ad .RS 10n .rt Pointer to value for '1' pixels in source image. .RE .sp .ne 2 .mk .na \fB\fIglow\fR\fR .ad .RS 10n .rt Pointer to value for '0' pixels in source image. .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_ImageSubsampleBinaryToGray\fR(3MLIB), \fBattributes\fR(5)