| MIL 10 Reference
| Customize Help
| Save Settings

MimClip



See also
Availability
Available in MIL-Lite
Available in MIL

Available on Windows
Available on Linux

Partially supported on:
Partially supported on Matrox GPU processing driver

Fully supported on:
Fully supported on Host system
Fully supported on Matrox CronosPlus
Fully supported on Matrox GigE Vision driver
Fully supported on Matrox IEEE 1394 IIDC driver
Fully supported on Matrox Iris GT
Fully supported on Matrox Morphis
Fully supported on Matrox Morphis QxT
Fully supported on Matrox Orion HD
Fully supported on Matrox Radient eCL
Fully supported on Matrox Radient eV-CXP
Fully supported on Matrox Solios eA/XA
Fully supported on Matrox Solios ecl/xcl/ev-cl
Fully supported on Matrox USB3 Vision driver (requires Update 19)
Fully supported on Matrox Vio

For any information regarding a MIL system added during a MIL Update, see the MIL system’s release note

Available on Non-Matrox computer
Available on Matrox 4Sight-X
Available on Matrox 4Sight GP
Available on Matrox Supersight
function map Function map
Examples
Synopsis
Perform a point-to-point clipping operation.
Syntax
void MimClip(
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
)
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, 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.

Note that this function reference has not been updated for a MIL system added during a MIL update. Refer to the MIL system's release note to see which MIL system’s documentation you should use in its place and any possible differences.
Parameters
This function is not supported on the selected boards.
This function reference has not been updated for the selected MIL system. To show the content of this page, choose a second MIL system; refer to the MIL system's release note to see which MIL system’s documentation to choose and any possible differences.
Parameters
SrcImageBufId

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.

[Matrox GPU processing driver]

The source image buffer must be unsigned monochrome 8- or 16-bit, or M_BGR32 packed.

DstImageBufId

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.

[Matrox GPU processing driver]

The destination image buffer must be unsigned monochrome 8- or 16-bit, or M_BGR32 packed.

Condition

Specifies the clipping condition. This parameter must be set to one of the values below.

The following are conditions that use two clipping points:

function map For clipping
CollapseValue Description
Collapse M_IN_RANGE

Replaces pixel values in the range of CondLow and CondHigh, inclusive, with WriteLow.

Collapse M_OUT_RANGE

Replaces pixel values less than CondLow with WriteLow and those greater than CondHigh with WriteHigh.

Collapse 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:

function map For specifying conditions that use one clipping point
CollapseValue Description
Collapse M_EQUAL

Replaces pixel values equal to CondLow with WriteLow.

Collapse M_GREATER

Replaces pixel values greater than CondLow with WriteLow.

Collapse M_GREATER_OR_EQUAL

Replaces pixel values greater than or equal to CondLow with WriteLow.

Collapse M_LESS

Replaces pixel values less than CondLow with WriteLow.

Collapse M_LESS_OR_EQUAL

Replaces pixel values less than or equal to CondLow with WriteLow.

Collapse M_NOT_EQUAL

Replaces pixel values not equal to CondLow with WriteLow.

CondLow

Specifies the lower clipping point of the selected condition. If the condition uses only one limit, use this parameter to specify the required limit.

function map For specifying the lower clipping point
CollapseValue Description
Collapse 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)
Collapse 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)
CondHigh

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.

function map For specifying the upper clipping point
CollapseValue Description
Collapse 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)
Collapse 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)
WriteLow

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.

function map For specifying the value to write to the destination buffer when a pixel satisfies the specified low clipping point
CollapseValue Description
Collapse 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)
Collapse 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)
WriteHigh

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.

function map For specifying the value to write to the destination buffer when a pixel satisfies the specified high clipping point
CollapseValue Description
Collapse 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)
Collapse 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)
Compilation information
Header Include mil.h.
Library Use mil.lib; milim.lib.
DLL Requires mil.dll; milim.dll.
PROC VECTOR PROC VECTOR IN RANGE OUT RANGE SATURATION EQUAL GREATER GREATER OR EQUAL LESS LESS OR EQUAL NOT EQUAL NULL NULL NULL NULL SATURATION