'\" te .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved .TH mlib_ImageScale_Fp 3MLIB "2 Mar 2007" "SunOS 5.11" "mediaLib Library Functions" .SH NAME mlib_ImageScale_Fp \- linear scaling .SH SYNOPSIS .LP .nf cc [ \fIflag\fR... ] \fIfile\fR... \fB-lmlib\fR [ \fIlibrary\fR... ] #include \fBmlib_status\fR \fBmlib_ImageScale_Fp\fR(\fBmlib_image *\fR\fIdst\fR, \fBconst mlib_image *\fR\fIsrc\fR, \fBconst mlib_d64 *\fR\fIalpha\fR, \fBconst mlib_d64 *\fR\fIbeta\fR); .fi .SH DESCRIPTION .sp .LP The \fBmlib_ImageScale_Fp()\fR function performs a floating-point linear scaling on the pixels of the source image by multiplying the data by a scale factor, shifting, and then adding an offset. .sp .LP The following equation is used: .sp .in +2 .nf dst[x][y][i] = src[x][y][i] * alpha[i] + beta[i] .fi .in -2 .sp .LP If the result of the operation underflows/overflows the minimum/maximum value supported by the destination image, then it will be clamped to the minimum/maximum value respectively. .sp .LP See the following table for available variations of this linear scaling function. .sp .sp .TS tab(); cw(1.38i) cw(0i) cw(0i) cw(1.38i) cw(1.38i) cw(0i) cw(1.38i) lw(1.38i) lw(0i) lw(0i) lw(1.38i) lw(1.38i) lw(0i) lw(1.38i) . Type [*]BYTESHORTUSHORTINTFLOATDOUBLE _ MLIB_FLOATYYYYYY _ MLIB_DOUBLEYYYYYY .TE .sp .LP [*] Each row represents a source data type. Each column represents a destination data type. .SH PARAMETERS .sp .LP The function takes the following arguments: .sp .ne 2 .mk .na \fB\fIdst\fR\fR .ad .RS 9n .rt Pointer to destination image. .RE .sp .ne 2 .mk .na \fB\fIsrc\fR\fR .ad .RS 9n .rt Pointer to source image. .RE .sp .ne 2 .mk .na \fB\fIalpha\fR\fR .ad .RS 9n .rt Scaling factor. \fBalpha[i]\fR contains the scaling factor for channel \fBi\fR. .RE .sp .ne 2 .mk .na \fB\fIbeta\fR\fR .ad .RS 9n .rt Offset value. \fBbeta[i]\fR contains the offset for channel \fBi\fR. .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_ImageScale\fR(3MLIB), \fBmlib_ImageScale_Fp_Inp\fR(3MLIB), \fBmlib_ImageScale_Inp\fR(3MLIB), \fBmlib_ImageScale2\fR(3MLIB), \fBmlib_ImageScale2_Inp\fR(3MLIB), \fBattributes\fR(5)