MbufCopyCond()函数

Synopsis

Copy conditionally the source buffer to the destination buffer.

Format

void MbufCopyCond(SrcBufId, DestBufId, CondBufId, Condition, CondValue)

MIL_ID SrcBufId; Source buffer identifier
MIL_ID DestBufId; Destination buffer identifier
MIL_ID CondBufId; Condition buffer identifier
long Condition; Processing condition
double CondValue; Condition value

Description

This function copies the source buffer data to the destination buffer, modifying only those pixels of the destination buffer that have a corresponding pixel in the conditional buffer that satisfies the specified condition. Other pixels are unchanged. If the source and destination buffers are of different data types, MIL converts the data automatically.

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

The CondBufId parameter specifies the identifier of the condition buffer.

The Condition parameter specifies the condition for which the condition buffer is tested. This parameter can be set to one of the following:

M_EQUAL Modify destination buffer pixels corresponding to condition buffer pixels that are equal to CondValue.
M_NOT_EQUAL Modify destination buffer pixels corresponding to condition buffer pixels that are not equal to CondValue.
M_DEFAULT Modify destination buffer pixels corresponding to condition buffer pixels that are non-zero.

The CondValue parameter specifies the pixel value for the specified condition. Even though this value is of type `long’, it is treated as if it had the same type and depth as the condition buffer. If M_DEFAULT is used, CondValue is ignored. If the condition buffer is binary, this value must be 0 or 1.

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.

See also

MbufCopy, MbufCopyClip, MbufCopyMask

《MbufCopyCond()函数》上有4条评论

评论已关闭。