| MIL 10 Reference
| Customize Help
| Save Settings

MbufClearCond



See also
Availability
Available in MIL-Lite
Available in MIL

Available on Windows
Available on Linux

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
Conditionally clears a buffer to a specified color.
Syntax
void MbufClearCond(
MIL_ID BufId, //in
MIL_DOUBLE RedOrMonoVal, //in
MIL_DOUBLE GreenVal, //in
MIL_DOUBLE BlueVal, //in
MIL_ID CondBufId, //in
MIL_INT64 Condition, //in
MIL_DOUBLE CondValue //in
)
Description

This function clears a buffer to the specified color (the clear color), modifying only those entries of the buffer which have a corresponding entry in the condition buffer that satisfies the specified condition. Other entries are unchanged.

The clear color is specified by RedOrMonoVal, GreenVal, and BlueVal. If the buffer is one-band, only RedOrMonoVal is used. The clear color is treated as if it had the same type and depth as the buffer.

Note that if a 1-band condition buffer is used with a 3-band buffer, the one band of the condition buffer will be used for each band in the buffer to clear.

For an image buffer, the clear can be limited to a region of interest (ROI) set using MbufSetRegion().

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 if there is complementary information.
Parameters
This function is not supported on the selected boards.
Parameters
BufId

Specifies the identifier of the data buffer to conditionally clear. If you specify an image buffer, it can have an 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).

RedOrMonoVal

Specifies the red component of the clear color, or, if BufId is a single band, this value is used as the clear color.

function map For specifying the red or mono component
CollapseValue Description
Collapse Value

Specifies the red component of the clear color, or the entire clear color.

GreenVal

Specifies the green component of the clear color.

function map For specifying the green component
CollapseValue Description
Collapse M_NULL

Specifies that BufId is a single band, and that this parameter is ignored.

Collapse Value

Specifies the green component of the clear color.

BlueVal

Specifies the blue component of the clear color.

function map For specifying the blue component
CollapseValue Description
Collapse M_NULL

Specifies that BufId is a single band, and that this parameter is ignored.

Collapse Value

Specifies the blue component of the clear color.

CondBufId

Specifies the identifier of the condition buffer. If you specify an image buffer, it can have a region of interest (ROI) associated with it, but it must be a raster region. Using an image buffer with an other type of ROI will cause an error.

Condition

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

function map For specifying the condition for which the buffer is tested
CollapseValue Description
Collapse M_DEFAULT

Modify destination buffer entries corresponding to condition buffer entries that are non-zero.

Collapse M_EQUAL

Modify destination buffer entries corresponding to condition buffer entries that are equal to CondValue.

Collapse M_NOT_EQUAL

Modify destination buffer entries corresponding to condition buffer entries that are not equal to CondValue.

CondValue

Specifies the color value for the specified condition. Even though this value is of type MIL_DOUBLE, it is treated as if it had the same type and depth as the condition buffer. If the Condition parameter is set to M_DEFAULT, CondValue is ignored.

For a 3-band condition buffer, this parameter can be set to one of the following color values:

function map For specifying a color value
CollapseValue Description
Collapse
M_RGB888(
MIL_INT Red,
MIL_INT Green,
MIL_INT Blue
)

Specifies an RGB value. This is only available when CondBufId is a 3-band buffer, and both BufId and CondBufId are 8-bit buffers.

This allows you to compare each band of the condition buffer against a different value.

(summarize)
Parameters

Specifies the red component, as a value between 0 and 255.

Specifies the green component, as a value between 0 and 255.

Specifies the blue component, as a value between 0 and 255.

Collapse M_COLOR_BLACK

Specifies the color black.

Collapse M_COLOR_BLUE

Specifies the color blue.

Collapse M_COLOR_BRIGHT_GRAY

Specifies the color bright gray.

Collapse M_COLOR_CYAN

Specifies the color cyan.

Collapse M_COLOR_DARK_BLUE

Specifies the color dark blue.

Collapse M_COLOR_DARK_CYAN

Specifies the color dark cyan.

Collapse M_COLOR_DARK_GREEN

Specifies the color dark green.

Collapse M_COLOR_DARK_MAGENTA

Specifies the color dark magenta.

Collapse M_COLOR_DARK_RED

Specifies the color dark red.

Collapse M_COLOR_DARK_YELLOW

Specifies the color dark yellow.

Collapse M_COLOR_GRAY

Specifies the color gray.

Collapse M_COLOR_GREEN

Specifies the color green.

Collapse M_COLOR_LIGHT_BLUE

Specifies the color light blue.

Collapse M_COLOR_LIGHT_GRAY

Specifies the color light gray.

Collapse M_COLOR_LIGHT_GREEN

Specifies the color light green.

Collapse M_COLOR_LIGHT_WHITE

Specifies the color light white.

Collapse M_COLOR_MAGENTA

Specifies the color magenta.

Collapse M_COLOR_RED

Specifies the color red.

Collapse M_COLOR_WHITE

Specifies the color white.

Collapse M_COLOR_YELLOW

Specifies the color yellow.

For a 1-band or 3-band condition buffer, you can set this parameter to the following grayscale value:

function map For specifying a grayscale value to be used with all bands
CollapseValue Description
Collapse Value

Specifies an entry value.

If the condition buffer is binary, this value must be set to 0 or 1.

If the condition buffer is 3-band, this value will be used for each band individually.

(summarize)
Compilation information
Header Include mil.h.
Library Use mil.lib.
DLL Requires mil.dll.
VECTOR NULL NULL VECTOR DEFAULT EQUAL NOT EQUAL COLOR BLACK COLOR BLUE COLOR BRIGHT GRAY COLOR CYAN COLOR DARK BLUE COLOR DARK CYAN COLOR DARK GREEN COLOR DARK MAGENTA COLOR DARK RED COLOR DARK YELLOW COLOR GRAY COLOR GREEN COLOR LIGHT BLUE COLOR LIGHT GRAY COLOR LIGHT GREEN COLOR LIGHT WHITE COLOR MAGENTA COLOR RED COLOR WHITE COLOR YELLOW