MbufCopyColor2d()函数

Synopsis

Copy a two-dimensional region of one or all bands of an image buffer.

Format

void MbufCopyColor2d(SrcBufId, DstBufId, SrcBand, SrcOffX, SrcOffY, DstBand, DstOffX, DstOffY, SizeX, SizeY)

MIL_ID SrcBufId; Source buffer identifier
MIL_ID DestBufId; Destination buffer identifier
long SrcBand; Index of the source color band to copy
long SrcOffX; X pixel offset relative to the source parent buffer
long SrcOffY; Y pixel offset relative to the source parent buffer
long DstBand; Index of the destination color band to copy
long DstOffX; X pixel offset relative to the destination parent buffer
long DstOffY; Y pixel offset relative to the destination parent buffer
long SizeX; X dimension
long SizeY; Y dimension

Description

This function copies a two-dimensional region of one or all color bands of the specified source buffer to the specified color band(s) of the destination buffer. It can also be used to insert or extract a color component from a color buffer.

The SrcBufId and DstBufId parameters specify the identifiers of the source and destination data buffers.

The SrcBand and DstBand parameters specify the index of the source and destination color bands. These parameters can be set to any index from 0 to (number of bands of the buffer-1), or to one of the following:

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

If the source is a monochrome buffer and the destination is a multi-band (color) buffer, the unique source buffer band is inserted into the specified band of the destination buffer. If the source is a multi-band buffer and the destination is a monochrome buffer, the specified source buffer band is extracted from the source buffer and written to the destination buffer. If both are multi-band buffers, the specified band(s) is copied from the source to the destination.

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.

If the source buffer depth is greater than that of the destination, the most significant bits are truncated when the data is copied to the destination. If the destination depth is greater than that of the source, the source data is zero or sign-extended (depending on the type of the source) when copied to the destination. Also, the buffers must have the same number of bands if all bands are to be copied.

Note, when copying from a non-binary buffer to a binary buffer, all non-zero pixels in the source buffer are represented as ones (1) in the binary buffer.

The SrcOffX parameter specifies the horizontal pixel offset of the region to read in relation to the source buffer starting coordinate. The offset must be within the width of the source buffer.

The SrcOffY parameter specifies the vertical pixel offset of the region to read in relation to the source buffer starting coordinate. The offset must be within the height of the source buffer.

The DstOffX parameter specifies the horizontal pixel offset of the region to write in relation to the destination buffer starting coordinate. The offset must be within the width of the destination buffer.

The DstOffY parameter specifies the vertical pixel offset of the region to write in relation to the destination buffer starting coordinate. The offset must be within the height of the destination buffer.

The SizeX parameter specifies the width of the region to be copied, starting from the specified offset (SrcOffX, DstOffX).

The SizeY parameter specifies the height of the region to be copied, starting from the specified offset (SrcOffY, DestOffY).

See also

MbufCopy, MbufCopyClip, MbufCopyColor, MbufCopyCond, MbufCopyMask

《MbufCopyColor2d()函数》上有1条评论

评论已关闭。