MIL_ID SrcImageBufId, | //in |
MIL_ID DstImageBufId, | //in |
MIL_INT64 Condition, | //in |
MIL_DOUBLE CondLow, | //in |
MIL_DOUBLE CondHigh, | //in |
MIL_DOUBLE WriteLow, | //in |
MIL_DOUBLE WriteHigh | //in |
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, the pixels are either replaced with the WriteLow or WriteHigh value depending on the condition. Pixels that do not satisfy the condition are not replaced. Instead, they are copied as is to the destination buffer.
You can limit this function's results to a region of an image buffer using a region of interest (ROI) set using MbufSetRegion(). The ROI must be defined in raster format (M_RASTER or M_VECTOR_AND_RASTER). An error is generated if the ROI is only in vector format (M_VECTOR). If you specify multiple image buffers with an ROI, results are limited to the portion of the ROIs that intersect.
Specifies the identifier of the image data source. If you specify an image buffer that has an ROI associated with it, the ROI must be in raster format; otherwise, you will get an error.
Specifies the identifier of the destination image buffer. If you specify an image buffer that has an ROI associated with it, the ROI must be in raster format; otherwise, you will get an error.
Specifies the clipping condition. This parameter must be set to one of the values below.
The following are conditions that use two clipping points:
For clipping
|
|||||||||||||||||||||||||||||||||||||||
Value | Description | ||||||||||||||||||||||||||||||||||||||
M_IN_RANGE |
Replaces pixel values in the range of CondLow and CondHigh, inclusive, with WriteLow. |
||||||||||||||||||||||||||||||||||||||
M_OUT_RANGE |
Replaces pixel values less than CondLow with WriteLow and those greater than CondHigh with WriteHigh. |
||||||||||||||||||||||||||||||||||||||
M_SATURATION |
Saturates source values according to the minimum and maximum values of the destination image buffer's data type. |
The following are conditions that use one clipping point:
For specifying conditions that use one clipping
point
|
|||||||||||||||||||||||||||||||||||||||
Value | Description | ||||||||||||||||||||||||||||||||||||||
M_EQUAL | |||||||||||||||||||||||||||||||||||||||
M_GREATER | |||||||||||||||||||||||||||||||||||||||
M_GREATER_OR_EQUAL |
Replaces pixel values greater than or equal to CondLow with WriteLow. |
||||||||||||||||||||||||||||||||||||||
M_LESS | |||||||||||||||||||||||||||||||||||||||
M_LESS_OR_EQUAL |
Replaces pixel values less than or equal to CondLow with WriteLow. |
||||||||||||||||||||||||||||||||||||||
M_NOT_EQUAL |
Specifies the lower clipping point of the selected condition. If the condition uses only one limit, use this parameter to specify the required limit.
For specifying the lower clipping point
|
|||||||||||||||||||||||||||||||||||||||
Value | Description | ||||||||||||||||||||||||||||||||||||||
M_NULL |
Specifies that the lower limit is based on the minimum value of the destination image buffer's data type. You must set CondLow to this value when the condition is set to M_SATURATION. (summarize)Specifies that the lower limit is based on the minimum value of the destination image buffer's data type. (more details...) |
||||||||||||||||||||||||||||||||||||||
Value |
Specifies the lower limit. This value is cast to the source buffer's data type and interpreted accordingly. Note, if the source buffer is binary, CondLow must be equal to 0 or 1. (summarize)Specifies the lower limit. (more details...) |
Specifies the upper clipping point of the selected condition. If the condition uses only one limit, this parameter is ignored and should be set to M_NULL.
For specifying the upper clipping point
|
|||||||||||||||||||||||||||||||||||||||
Value | Description | ||||||||||||||||||||||||||||||||||||||
M_NULL |
Specifies that the upper limit is based on the maximum value of the destination image buffer's data type, or that the condition only uses one limit. You must set CondHigh to this value when the condition is set to M_SATURATION. (summarize)Specifies that the upper limit is based on the maximum value of the destination image buffer's data type, or that the condition only uses one limit. (more details...) |
||||||||||||||||||||||||||||||||||||||
Value |
Specifies the upper limit. This value is cast to the source buffer's data type and interpreted accordingly. Note, if the source buffer is binary, CondHigh must be equal to 0 or 1. (summarize)Specifies the upper limit. (more details...) |
Specifies the value to write to the destination buffer when a pixel satisfies the specified low clipping condition. If the condition uses only one replacement value, use this parameter to specify the required value.
For specifying the value to write to the destination
buffer when a pixel satisfies the specified low clipping
point
|
|||||||||||||||||||||||||||||||||||||||
Value | Description | ||||||||||||||||||||||||||||||||||||||
M_NULL |
Specifies that the value to write is the minimum value of the destination image buffer's data type. You must set WriteLow to this value when the condition is set to M_SATURATION. (summarize)Specifies that the value to write is the minimum value of the destination image buffer's data type. (more details...) |
||||||||||||||||||||||||||||||||||||||
Value |
Specifies the value to write when the pixel satisfies the low clipping condition. This value is cast to the destination buffer's data type. Note, if the destination buffer is binary, WriteLow must be equal to 0 or 1. (summarize)Specifies the value to write when the pixel satisfies the low clipping condition. (more details...) |
Specifies the value to write to the destination buffer when a pixel satisfies the specified high clipping condition. If the condition uses only one replacement value, this parameter is not used and must be set to M_NULL.
For specifying the value to write to the destination
buffer when a pixel satisfies the specified high clipping
point
|
|||||||||||||||||||||||||||||||||||||||
Value | Description | ||||||||||||||||||||||||||||||||||||||
M_NULL |
Specifies that the value to write is the maximum value of the destination image buffer's data type, or that the condition only uses the low replacement value. You must set WriteHigh to this value when the condition is set to M_SATURATION. (summarize)Specifies that the value to write is the maximum value of the destination image buffer's data type, or that the condition only uses the low replacement value. (more details...) |
||||||||||||||||||||||||||||||||||||||
Value |
Specifies the value to write when the pixel satisfies the high clipping condition. This value is cast to the destination buffer's data type. Note, if the destination buffer is binary, WriteHigh must be equal to 0 or 1. (summarize)Specifies the value to write when the pixel satisfies the high clipping condition. (more details...) |
Header | Include mil.h. |
Library | Use mil.lib; milim.lib. |
DLL | Requires mil.dll; milim.dll. |