MbufPutColor()函数

Synopsis

Put data from a user-supplied array into one or all bands of a data buffer.

Format

void MbufPutColor(DestBufId, DataFormat, Band, UserArrayPtr)

MIL_ID DestBufId; Destination buffer identifier
long DataFormat; Data format of source user array
long Band; Color band in destination buffer
void *UserArrayPtr; Source user array

Description

This function copies data from a user-supplied array to one or all bands of a specified MIL destination buffer.

The DestBufId parameter specifies the identifier of the destination buffer.

The DataFormat parameter specifies the user array data format to use when copying the data. Note that Dx and Dy denote the destination width and height, respectively. This parameter must be set to one of the following values:

DataFormat Description
M_SINGLE_BAND Copy to a single color band. The user array must be of the same type as the destination buffer and have a size of Dx x Dy.
M_RGB24+M_PACKED Copy to three bands in an interleaved manner (RGBRGB). The destination buffer must be a three-band, 8-bit buffer and the user array must have a size of Dx x Dy x 3 bytes (Dx x Dy x 3char).
M_RGB32+M_PACKED Copy to three bands in an interleaved manner (RGBXRGBX). The destination buffer must be a three-band, 8-bit buffer and the user array must have a size of Dx x Dy x 4 bytes (Dx x Dy x long).
M_PLANAR Copy the bands one after the other (RRR…GGG…BBB…). The user array must be the same type as the destination buffer and have a size of Dx x Dy x number of color band of the destination buffer. This format is to be used when copying to all color bands of the destination buffer.

The Band parameter specifies the index of the color band in which to copy. This parameter can be set to any index from 0 to (number of bands of the destination buffer – 1), or to one of the following values:

M_RED Copy to the red color band.
M_GREEN Copy to the green color band.
M_BLUE Copy to the blue color band.
M_ALL_BAND Copy to all color bands.

Note, M_ALL_BAND is to be used with data formats M_RGB24+M_PACKED, M_RGB32+M_PACKED, and M_PLANAR.

If the source buffer is in a HLS (hue, luminance, and saturation) format, the band can be set to: M_HUE, M_LUMINANCE, M_SATURATION, or M_ALL_BAND.

The UserArrayPtr parameter specifies the address of the user array from which to copy data into the destination buffer. Ensure that there are enough entries in the user array to fill the color band of the destination buffer.

See also

MbufPut, MbufPut1d, MbufPut2d, MbufGet, MbufGet1d, MbufGet2d, MbufGetColor