'\" te .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved .TH mlib_ImageSetStruct 3MLIB "2 Mar 2007" "SunOS 5.11" "mediaLib Library Functions" .SH NAME mlib_ImageSetStruct \- set image data structure .SH SYNOPSIS .LP .nf cc [ \fIflag\fR... ] \fIfile\fR... \fB-lmlib\fR [ \fIlibrary\fR... ] #include \fBmlib_status\fR \fBmlib_ImageSetStruct\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_ImageSetStruct()\fR function sets a mediaLib image data structure using parameters supplied by the user. .sp .LP The \fBmlib_ImageSetStruct()\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 .RS +4 .TP .ie t \(bu .el o \fBdatbuf\fR should not be \fBNULL\fR .RE .sp .LP Whenever \fBMLIB_FAILURE\fR is returned, the original image data structure is not changed. .sp .LP If the data buffer in the image data structure is not \fBNULL\fR, it is the user's responsibility to free it if necessary. .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 set successfully. \fBMLIB_FAILURE\fR is returned when the image data structure can not be set 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_ImageResetStruct\fR(3MLIB), \fBmlib_ImageDelete\fR(3MLIB), \fBmlib_ImageSetFormat\fR(3MLIB), \fBmlib_ImageSetPaddings\fR(3MLIB), \fBattributes\fR(5)