mediaLib Library Functions mlibImageResetStruct(3MLIB)
NAME
mlibImageResetStruct - reset image data structure
SYNOPSIS
cc [ flag... ] file... -lmlib [ library... ]
#include
mlibstatus mlibImageResetStruct(mlibimage *image, mlibtype type,
mlibs32 channels, mlibs32 width, mlibs32 height, mlibs32 stride,
const void *datbuf);
DESCRIPTION
The mlibImageResetStruct() function resets a mediaLib image
data structure using parameters supplied by the user.
The mlibImageResetStruct() function returns MLIBFAILURE if
the supplied parameters do not pass the following sanity
checks:
o image should not be NUL
o type should be MLIBIT, MLIBYTE, MLIBSHORT,
MLIBUSHORT, MLIBINT, MLIBFLOAT, or MLIBDOUBLE
o channels should be between 1 and 4
o width should be greater than 0
o height should be greater than 0
o stride should be no less than width * channels *
(size of type in bytes)
Whenever MLIBFAILURE is returned, the original image data
structure is not changed.
When datbuf is NUL, the original data buffer is reused. If
mlibImageIsUserAllocated(image)==0, such as the case the
image data structure was created by mlibImageCreate(), and
the data buffer size required by the parameters supplied is
larger than the original, MLIBFAILURE is returned.
When datbuf is not NUL, if
mlibImageIsUserAllocated(image)==0, the original data
buffer is freed, otherwise the original data buffer is not
freed. If datbuf points to the original data buffer, it is
not freed.
SunOS 5.11 Last change: 2 Mar 2007 1
mediaLib Library Functions mlibImageResetStruct(3MLIB)
PARAMETERS
The function takes the following arguments:
image Pointer to the image data structure.
type Image data type. It can be MLIBIT, MLIBYTE,
MLIBSHORT, MLIBUSHORT, MLIBINT, MLIBFLOAT,
or MLIBDOUBLE.
channels Number of channels in the image.
width Width of image in pixels.
height Height of image in pixels.
stride Stride of each row of the data space in bytes.
datbuf Pointer to the image data buffer.
RETURN VALUES
MLIBSUCES is returned if the image data structure is
reset successfully. MLIBFAILURE is returned when the image
data structure can not be reset according to the parameters
supplied.
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
ATRIBUTE TYPE ATRIBUTE VALUE
Interface Stability Committed
MT-Level MT-Safe
SEE ALSO
mlibImageCreate(3MLIB), mlibImageCreateSubimage(3MLIB),
mlibImageCreateStruct(3MLIB), mlibImageSetStruct(3MLIB),
mlibImageDelete(3MLIB), mlibImageSetFormat(3MLIB),
mlibImageSetPaddings(3MLIB), attributes(5)
SunOS 5.11 Last change: 2 Mar 2007 2
|