MIL_ID GraphContId, | //in |
MIL_ID ContextOrResultId, | //in |
MIL_ID DestImageBufId, | //in |
MIL_INT64 DrawOperation, | //in |
MIL_INT AreaLabel, | //in |
MIL_INT SampleIndexOrLabel, | //in |
MIL_INT64 ControlFlag | //in |
This function draws specific features of a selected color-sample (defined in a specified color matching or relative color calibration context), color element (defined in a specified color-sample), or of a color matching result, in the destination image buffer. Drawing operations for color matching results are only available after calling McolMatch().
Color-samples or color elements are drawn using either their triplet values (M_TRIPLET) or their estimated values (for example, the average) taken from a source image (M_IMAGE), depending on how you defined them (McolDefine()).
Specifies the identifier of the graphics context to use when drawing. Set this parameter to one of the following values:
For specifying the graphics
context
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Specifies that the default graphics context of the current MIL application is used. (more details...) |
||||||||||||||||||||||||||||||||||||||
MIL graphics context identifier |
Specifies a valid graphics context identifier, which you have allocated using MgraAlloc(). |
Specifies the context or result buffer for which to perform the drawing operation. The context or result buffer must have been previously allocated on the system using McolAlloc() (with M_COLOR_MATCHING or M_COLOR_CALIBRATION_RELATIVE) or McolAllocResult(), respectively.
Specifies the identifier of the destination image buffer in which to draw. The buffer can be any supported MIL image buffer. By drawing into its display's overlay buffer, you can also annotate the image non-destructively.
This image buffer must not have a region of interest (ROI) associated with it. Using an image buffer with an ROI will cause an error.
The required format and size of the destination image depends on the drawing operation. For a color element, you can retrieve the required format and size using McolInquire() (for example, M_SAMPLE_IMAGE_SIZE_X). For a color matching result, you can retrieve this information using McolGetResult() (for example, M_AREA_IMAGE_SIZE_X). When drawing the mosaic of all color elements within a color-sample, you can retrieve the required information using McolInquire() (for example, M_SAMPLE_MOSAIC_SIZE_X).
The bit depth of the image buffer must accommodate all the color-sample or color element data drawn, including the background color, the outlier color, and the outlier label (when applicable).
The numerical value of the color-sample labels, the background pixels, and the outlier pixels and labels should be different so you can easily identify them if they are drawn (M_DRAW...). To modify these values, use McolControl() with M_SAMPLE_LABEL_VALUE, M_BACKGROUND_DRAW_COLOR, M_OUTLIER_DRAW_COLOR and M_OUTLIER_LABEL. Note that a pixel is considered background when it is outside the target areas, while outlier pixels are pixels inside a target area that did not match with any color-sample.
For a color matching result, the background of the destination image is set to the background color (McolControl() with M_BACKGROUND_DRAW_COLOR) that is in effect when you call McolMatch(). If you set a transparent background, the image background remains untouched.
Specifies the type of drawing operation to perform.
For a selected color-sample, set this parameter to one of the following values:
For drawing specific features of a
color-sample
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_DRAW_SAMPLE_MOSAIC |
Draws the mosaic of all the color elements found in the specified color-sample. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DRAW_SAMPLE_MOSAIC_DONT_CARE |
Draws a mosaic mask of all "don't care" pixels in the specified color-sample. (more details...) |
For a selected color element (of a selected color-sample), set this parameter to one of the following values:
For drawing specific features of a color
element
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_DRAW_SAMPLE |
Draws the internal image of the specified color element in the destination image buffer. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DRAW_SAMPLE_MASK |
Draws the mask image of the specified color element in the destination image buffer. (more details...) |
For a color matching result buffer, set this parameter to one of the following values.
For drawing specific features of a color
matching result
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_DRAW_AREA |
Draws the specified area(s) (AreaLabel) of the area identifier image. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DRAW_AREA_MATCH_USING_COLOR + |
Draws, for each target area, the color of the best-matched color-sample. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DRAW_AREA_MATCH_USING_LABEL |
Draws, for each target area, the label of the best-matched color-sample. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DRAW_DISTANCE |
Draws the distance between the estimated color (average color) of the target area (for an M_STAT_MIN_DIST operation mode) or the color of the target pixel (for an M_MIN_DIST_VOTE operation mode), and the color of its best-matched color-sample. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DRAW_PIXEL_MATCH_USING_COLOR + |
Draws, for each pixel in each target area, the color of the color-sample for which each pixel voted. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DRAW_PIXEL_MATCH_USING_LABEL |
Draws, for each pixel in each target area, the label of the color-sample for which each pixel voted. (more details...) |
For either a color matching context or color matching result, set this parameter to the following value:
For drawing specific features of either a
color-sample or a color matching result (for color
matching)
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_DRAW_SAMPLE_COLOR_LUT + |
Draws the 3-band color-sample label LUT, where the label value of each color-sample is associated with its average color. (more details...) |
You can add the following value to the above-mentioned values to specify whether to invert colors.
For specifying whether to invert
colors
|
|||||||||||||||||||||||||||||||||||||||
Combination value | Description
|
||||||||||||||||||||||||||||||||||||||
M_INVERTED_COLORS |
Inverts the color of the best-matched color-sample in the specified image. |
Specifies the label of the target area for which to perform the drawing operation, for color matching contexts. For a relative color calibration context, there are no target areas; you must specify M_DEFAULT.
Set this parameter to one of the following values:
For specifying the target area's label or
index (for color matching)
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Specifies the default. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_ALL |
Specifies all target areas. (more details...) |
||||||||||||||||||||||||||||||||||||||
Value > 0 |
Specifies the label of the target area, as it appears in the area identifier image. (more details...) |
Specifies the color-sample or color element therein for which to perform the drawing operation. Unless otherwise specified, values apply to both color matching and relative color calibration contexts. Set this parameter to one of the following values:
For specifying the color-sample or color
element
|
|||||||||||||||||||||||||||||||||||||||
Value |
Description
|
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Same as M_ALL. |
||||||||||||||||||||||||||||||||||||||
Specifies the index of a color element (item), relative to the reference color-sample. (more details...) |
|||||||||||||||||||||||||||||||||||||||
Parameters | |||||||||||||||||||||||||||||||||||||||
Specifies the index of a color element (item). The index value must be greater than or equal to 0. |
|||||||||||||||||||||||||||||||||||||||
Specifies the color-sample's index, in a color context or result. (more details...) |
|||||||||||||||||||||||||||||||||||||||
Parameters | |||||||||||||||||||||||||||||||||||||||
Specifies an index value greater than or equal to 0. |
|||||||||||||||||||||||||||||||||||||||
Specifies the index of a color element (item), relative to a color-sample index. (more details...) |
|||||||||||||||||||||||||||||||||||||||
Parameters | |||||||||||||||||||||||||||||||||||||||
Specifies the index of the color-sample that holds the color element (item). The index must be greater than or equal to 0. |
|||||||||||||||||||||||||||||||||||||||
Specifies the index of the color element (item). The index value must be greater than or equal to 0. |
|||||||||||||||||||||||||||||||||||||||
Specifies the label of a color-sample. (more details...) |
|||||||||||||||||||||||||||||||||||||||
Parameters | |||||||||||||||||||||||||||||||||||||||
Specifies a label value greater than 0. |
|||||||||||||||||||||||||||||||||||||||
Specifies the index of a color element (item), relative to a color-sample label. (more details...) |
|||||||||||||||||||||||||||||||||||||||
Parameters | |||||||||||||||||||||||||||||||||||||||
Specifies the label of the color-sample that holds the color element (item). The label value must be greater than 0. |
|||||||||||||||||||||||||||||||||||||||
Specifies the index of the color element (item). The index value must be greater than or equal to 0. |
|||||||||||||||||||||||||||||||||||||||
M_ALL |
Specifies all color-samples. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_REFERENCE_SAMPLE |
Specifies the reference color-sample. (more details...) |
Header | Include mil.h. |
Library | Use mil.lib; milcolor.lib. |
DLL | Requires mil.dll; milcolor.dll. |