MimClip()函数
Synopsis
Perform a point-to-point clipping operation.
Format
void MimClip(SrcImageBufId, DestImageBufId, Condition, CondLow, CondHigh, WriteLow, WriteHigh)
MIL_ID SrcImageBufId;??? Source image buffer identifier
MIL_ID DestImageBufId;??? Destination image buffer identifier
long Condition;??? Clipping condition
double CondLow;??? Low clipping point
double CondHigh;??? High clipping point
double WriteLow;??? Value written if low clipping condition satisfied
double WriteHigh;??? Value written if high clipping condition satisfied
Description
This function clips each image pixel that meets the specified condition. If the condition has one clipping point, each pixel that satisfies this condition is replaced with the specified WriteLow value. If it has two clipping points, they are either replaced with the WriteLow or WriteHigh value depending on the condition. Pixels that do not satisfy the condition are not affected.
The SrcImageBufId parameter specifies the identifier of the image data source.
The DestImageBufId parameter specifies the identifier of the destination image buffer.
The Condition parameter specifies the clipping condition. This parameter can be set to one of two types of conditions.
Conditions with two clipping points:
M_OUT_RANGE??? Replace pixel values less than CondLow with WriteLow and those greater than CondHigh with WriteHigh.(小于小的,大于大的)
M_IN_RANGE??? Replace pixel values in the range of CondLow and CondHigh, inclusive, with WriteLow.(小于大的,大于小的)
Conditions with one clipping point:
M_EQUAL??? Replace pixel values equal to CondLow with WriteLow.
M_NOT_EQUAL??? Replace pixel values not equal to CondLow with WriteLow.
M_GREATER??? Replace pixel values greater than CondLow with WriteLow.
M_LESS??? Replace pixel values less than CondLow with WriteLow.
M_GREATER_OR_EQUAL??? Replace pixel values greater than or equal to CondLow with WriteLow.
M_LESS_OR_EQUAL??? Replace pixel values less than or equal to CondLow with WriteLow.
The CondLow and CondHigh parameters specify the upper and lower clipping points of the selected condition. If the condition uses only one limit, set the CondLow? parameter to the required limit and set CondHigh to M_NULL. These parameters are cast to the source buffer’s data type and interpreted accordingly. Note, if the source buffer is binary, CondLow and CondHigh must be equal to 0 or 1.
The WriteLow and WriteHigh parameters specify the values to write to the destination buffer when a pixel satisfies the specified clipping condition. The condition determines whether WriteLow or WriteHigh is written. When WriteHigh is not used, you should set it to M_NULL. These parameters are cast to the destination buffer’s data type. Note, if the destination buffer is binary, WriteLow and WriteHigh must be equal to 0 or 1.
注:可用于指定亮度像素提取;去除不用区段亮度,保留需要区段亮度;