'\" te .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved .TH mlib_ImageResetStruct 3MLIB "2 Mar 2007" "SunOS 5.11" "mediaLib Library Functions" .SH NAME mlib_ImageResetStruct \- reset image data structure .SH SYNOPSIS .LP .nf cc [ \fIflag\fR... ] \fIfile\fR... \fB-lmlib\fR [ \fIlibrary\fR... ] #include \fBmlib_status\fR \fBmlib_ImageResetStruct\fR(\fBmlib_image *\fR\fIimage\fR, \fBmlib_type\fR \fItype\fR, \fBmlib_s32\fR \fIchannels\fR, \fBmlib_s32\fR \fIwidth\fR, \fBmlib_s32\fR \fIheight\fR, \fBmlib_s32\fR \fIstride\fR, \fBconst void *\fR\fIdatbuf\fR); .fi .SH DESCRIPTION .sp .LP The \fBmlib_ImageResetStruct()\fR function resets a mediaLib image data structure using parameters supplied by the user. .sp .LP The \fBmlib_ImageResetStruct()\fR function returns \fBMLIB_FAILURE\fR if the supplied parameters do not pass the following sanity checks: .RS +4 .TP .ie t \(bu .el o \fBimage\fR should not be \fBNULL\fR .RE .RS +4 .TP .ie t \(bu .el o \fBtype\fR should be \fBMLIB_BIT\fR, \fBMLIB_BYTE\fR, \fBMLIB_SHORT\fR, \fBMLIB_USHORT\fR, \fBMLIB_INT\fR, \fBMLIB_FLOAT\fR, or \fBMLIB_DOUBLE\fR .RE .RS +4 .TP .ie t \(bu .el o \fBchannels\fR should be between 1 and 4 .RE .RS +4 .TP .ie t \(bu .el o \fBwidth\fR should be greater than 0 .RE .RS +4 .TP .ie t \(bu .el o \fBheight\fR should be greater than 0 .RE .RS +4 .TP .ie t \(bu .el o \fBstride\fR should be no less than \fBwidth * channels * (size of type in bytes)\fR .RE .sp .LP Whenever \fBMLIB_FAILURE\fR is returned, the original image data structure is not changed. .sp .LP When datbuf is \fBNULL\fR, the original data buffer is reused. If \fBmlib_ImageIsUserAllocated(image)==0\fR, such as the case the image data structure was created by \fBmlib_ImageCreate()\fR, and the data buffer size required by the parameters supplied is larger than the original, \fBMLIB_FAILURE\fR is returned. .sp .LP When \fBdatbuf\fR is not \fBNULL\fR, if \fBmlib_ImageIsUserAllocated(image)==0\fR, the original data buffer is freed, otherwise the original data buffer is not freed. If \fBdatbuf\fR points to the original data buffer, it is not freed. .SH PARAMETERS .sp .LP The function takes the following arguments: .sp .ne 2 .mk .na \fB\fIimage\fR\fR .ad .RS 12n .rt Pointer to the image data structure. .RE .sp .ne 2 .mk .na \fB\fItype\fR\fR .ad .RS 12n .rt Image data type. It can be \fBMLIB_BIT\fR, \fBMLIB_BYTE\fR, \fBMLIB_SHORT\fR, \fBMLIB_USHORT\fR, \fBMLIB_INT\fR, \fBMLIB_FLOAT\fR, or \fBMLIB_DOUBLE\fR. .RE .sp .ne 2 .mk .na \fB\fIchannels\fR\fR .ad .RS 12n .rt Number of channels in the image. .RE .sp .ne 2 .mk .na \fB\fIwidth\fR\fR .ad .RS 12n .rt Width of image in pixels. .RE .sp .ne 2 .mk .na \fB\fIheight\fR\fR .ad .RS 12n .rt Height of image in pixels. .RE .sp .ne 2 .mk .na \fB\fIstride\fR\fR .ad .RS 12n .rt Stride of each row of the data space in bytes. .RE .sp .ne 2 .mk .na \fB\fIdatbuf\fR\fR .ad .RS 12n .rt Pointer to the image data buffer. .RE .SH RETURN VALUES .sp .LP \fBMLIB_SUCCESS\fR is returned if the image data structure is reset successfully. \fBMLIB_FAILURE\fR is returned when the image data structure can not be reset according to the parameters supplied. .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_ImageCreate\fR(3MLIB), \fBmlib_ImageCreateSubimage\fR(3MLIB), \fBmlib_ImageCreateStruct\fR(3MLIB), \fBmlib_ImageSetStruct\fR(3MLIB), \fBmlib_ImageDelete\fR(3MLIB), \fBmlib_ImageSetFormat\fR(3MLIB), \fBmlib_ImageSetPaddings\fR(3MLIB), \fBattributes\fR(5)