MIL_ID ContextId, | //in |
MIL_INT IndexOrLabel, | //in |
MIL_INT64 ControlType, | //in |
MIL_DOUBLE ControlValue | //in |
This function sets the specified control type for a color matching context, its color-samples, or the color-samples of a relative color calibration context. These control type settings affect the execution of McolPreprocess(), McolMatch(), McolTransform(), and McolDraw(). Typically, you can inquire the control type setting, using McolInquire().
Changing certain control type settings require you to preprocess the context again, using McolPreprocess(). To know if the context needs to be preprocessed, call McolInquire() with the M_PREPROCESSED inquire type.
Specifies the identifier of the color matching or relative color calibration context. The context must have been previously allocated on the required system using McolAlloc() with M_COLOR_MATCHING or M_COLOR_CALIBRATION_RELATIVE.
Specifies what to control. Set this parameter to one of the following values. Unless otherwise specified, these values are only available for color matching contexts.
For specifying what to
control
|
|||||||||||||||||||||||||||||||||||||||
Value |
Description
|
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Same as M_CONTEXT. |
||||||||||||||||||||||||||||||||||||||
Specifies the index of the color-sample to control. (more details...) |
|||||||||||||||||||||||||||||||||||||||
Parameters | |||||||||||||||||||||||||||||||||||||||
Specifies an index value greater than or equal to 0. |
|||||||||||||||||||||||||||||||||||||||
Specifies the label of the color-sample to control. (more details...) |
|||||||||||||||||||||||||||||||||||||||
Parameters | |||||||||||||||||||||||||||||||||||||||
Specifies a label value greater than 0. |
|||||||||||||||||||||||||||||||||||||||
M_ALL |
Specifies to control all color-samples within the color matching context. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_CONTEXT |
Specifies to control a global setting of the color matching context. |
Specifies the setting to change.
See the Parameter associations section for possible values that can be specified.
Specifies the setting's new value.
See the Parameter associations section for possible values that can be specified.
The tables below list possible values for the ControlType and ControlValue parameters.
The following ControlType and corresponding ControlValue parameter settings are used to control general color matching context settings. In this case, you must set the IndexOrLabel parameter to M_CONTEXT. These values are only available for color matching contexts.
For controlling general color matching
context settings
|
|||||||||||||||||||||||||||||||||||||||
ControlType | Description
|
||||||||||||||||||||||||||||||||||||||
ControlValue | |||||||||||||||||||||||||||||||||||||||
M_ACCEPTANCE |
Sets the acceptance level for the color-sample's score (M_SCORE with McolGetResult()). INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Specifies the default value; the default value is 0.0%. |
||||||||||||||||||||||||||||||||||||||
0.0 <= Value <= 100.0 |
Specifies an acceptable score, as a percentage. |
||||||||||||||||||||||||||||||||||||||
M_ACCEPTANCE_RELEVANCE |
Sets the acceptance level for the target area's relevance score (M_SCORE_RELEVANCE). INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Specifies the default value; the default value is 0.0%. |
||||||||||||||||||||||||||||||||||||||
0.0 <= Value <= 100.0 |
Specifies an acceptable relevance score, as a percentage. |
||||||||||||||||||||||||||||||||||||||
M_BACKGROUND_DRAW_COLOR |
Sets the color to use to draw background pixels when drawing or generating the color images (M_DRAW_..._USING_COLOR), the distance image (M_DRAW_DISTANCE), or the grayscale label images (M_DRAW_..._USING_LABEL), using McolDraw() or McolMatch(). INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Same as M_TRANSPARENT. |
||||||||||||||||||||||||||||||||||||||
Specifies a 24-bit color value (eight bits per band) with which to set the background pixels. (more details...) |
|||||||||||||||||||||||||||||||||||||||
Parameters | |||||||||||||||||||||||||||||||||||||||
Specifies the first component, as a value between 0 and 255. |
|||||||||||||||||||||||||||||||||||||||
Specifies the second component, as a value between 0 and 255. |
|||||||||||||||||||||||||||||||||||||||
Specifies the third component, as a value between 0 and 255. |
|||||||||||||||||||||||||||||||||||||||
M_TRANSPARENT |
Specifies not to change the background. (more details...) |
||||||||||||||||||||||||||||||||||||||
Value > 0 |
Specifies a grayscale value for the background pixels, as a double or integer. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_BAND_MODE |
Specifies the color bands to use when performing a match. INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Same as M_ALL_BANDS. |
||||||||||||||||||||||||||||||||||||||
M_ALL_BANDS |
Specifies to use all bands. |
||||||||||||||||||||||||||||||||||||||
M_COLOR_BAND_0 |
Specifies to use band 0. |
||||||||||||||||||||||||||||||||||||||
M_COLOR_BAND_0 + M_COLOR_BAND_1 |
Specifies to use bands 0 and 1. |
||||||||||||||||||||||||||||||||||||||
M_COLOR_BAND_0 + M_COLOR_BAND_2 |
Specifies to use bands 0 and 2. |
||||||||||||||||||||||||||||||||||||||
M_COLOR_BAND_1 |
Specifies to use band 1. |
||||||||||||||||||||||||||||||||||||||
M_COLOR_BAND_1 + M_COLOR_BAND_2 |
Specifies to use bands 1 and 2. |
||||||||||||||||||||||||||||||||||||||
M_COLOR_BAND_2 |
Specifies to use band 2. |
||||||||||||||||||||||||||||||||||||||
M_CONVERSION_GAMMA |
Specifies whether to remove gamma correction when internally converting RGB source colors before the match using McolSetMethod() with the CIELAB conversion mode. INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Same as M_ENABLE. |
||||||||||||||||||||||||||||||||||||||
M_DISABLE |
Specifies not to remove gamma correction. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_ENABLE |
Specifies to remove gamma correction. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DISTANCE_IMAGE_NORMALIZE |
Sets the normalization factor when drawing or generating M_DRAW_DISTANCE, using McolDraw() or McolMatch(). INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Same as M_NO_NORMALIZE. |
||||||||||||||||||||||||||||||||||||||
M_MAX_NORMALIZE |
Specifies to normalize distance values according to the greatest calculated distance. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_NO_NORMALIZE |
Specifies no normalization. (more details...) |
||||||||||||||||||||||||||||||||||||||
Value > 0.0 |
Specifies to normalize distance values according to the specified normalization value. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DISTANCE_TOLERANCE_MODE |
Sets the strategy with which to use the tolerance value (M_DISTANCE_TOLERANCE) to calculate the acceptable (matching) color distance (tolerance) between the color-sample and a target area. INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Same as M_ABSOLUTE. |
||||||||||||||||||||||||||||||||||||||
M_ABSOLUTE |
Specifies that the M_DISTANCE_TOLERANCE value will be untouched and used as the acceptable distance tolerance. |
||||||||||||||||||||||||||||||||||||||
M_RELATIVE |
Specifies a tolerance strategy based on the relative distances between pairs of color-samples. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_SAMPLE_STDDEV |
Specifies a tolerance strategy based on the color-sample's standard deviation. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_GENERATE_DISTANCE_IMAGE |
Sets whether to generate the distance image and store it in the result buffer. INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Same as M_DISABLE. |
||||||||||||||||||||||||||||||||||||||
M_DISABLE |
Specifies not to generate the image. |
||||||||||||||||||||||||||||||||||||||
M_ENABLE |
Specifies to generate the image. |
||||||||||||||||||||||||||||||||||||||
M_GENERATE_PIXEL_MATCH |
Sets whether to generate the image containing the label of the color-sample for which each pixel voted. INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Same as M_DISABLE. |
||||||||||||||||||||||||||||||||||||||
M_DISABLE |
Specifies not to generate the image. |
||||||||||||||||||||||||||||||||||||||
M_ENABLE |
Specifies to generate the image. |
||||||||||||||||||||||||||||||||||||||
M_GENERATE_SAMPLE_COLOR_LUT |
Sets whether to generate the color-sample label LUT and store it in the result buffer. INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Same as M_DISABLE. |
||||||||||||||||||||||||||||||||||||||
M_DISABLE |
Specifies not to generate the LUT. |
||||||||||||||||||||||||||||||||||||||
M_ENABLE |
Specifies to generate the LUT. |
||||||||||||||||||||||||||||||||||||||
M_NB_BINS_BAND_0 |
Sets the number of histogram bins for color band 0. INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Specifies the default value; the default value is 10. |
||||||||||||||||||||||||||||||||||||||
Value > 0 |
Specifies the number of histogram bins for color band 0. |
||||||||||||||||||||||||||||||||||||||
M_NB_BINS_BAND_1 |
Sets the number of histogram bins for color band 1. INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Specifies the default value; the default value is 10. |
||||||||||||||||||||||||||||||||||||||
Value > 0 |
Number of histogram bins for color band 1. |
||||||||||||||||||||||||||||||||||||||
M_NB_BINS_BAND_2 |
Sets the number of histogram bins for color band 2. INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Specifies the default value; the default value is 10. |
||||||||||||||||||||||||||||||||||||||
Value > 0 |
Number of histogram bins for color band 2. |
||||||||||||||||||||||||||||||||||||||
M_OUTLIER_DRAW_COLOR |
Sets the color to use to draw outlier pixels when drawing or generating the color images (M_DRAW_..._USING_COLOR) or the distance image (M_DRAW_DISTANCE), using McolDraw() or McolMatch(). INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Specifies the default value; the default value is 0. |
||||||||||||||||||||||||||||||||||||||
Specifies a 24-bit color value (eight bits per band) with which to set the outlier pixels. (more details...) |
|||||||||||||||||||||||||||||||||||||||
Parameters | |||||||||||||||||||||||||||||||||||||||
Specifies the first component, as a value between 0 and 255. |
|||||||||||||||||||||||||||||||||||||||
Specifies the second component, as a value between 0 and 255. |
|||||||||||||||||||||||||||||||||||||||
Specifies the third component, as a value between 0 and 255. |
|||||||||||||||||||||||||||||||||||||||
M_TRANSPARENT |
Specifies not to change the value of the outlier pixels. (more details...) |
||||||||||||||||||||||||||||||||||||||
Value > 0 |
Specifies a grayscale value for the outlier pixels, as a double or integer. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_OUTLIER_LABEL |
Sets the label to use for outlier pixels when drawing or generating the label images (M_DRAW_..._USING_LABEL) using McolDraw() or McolMatch(). INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Specifies the default value; the default value is 0. |
||||||||||||||||||||||||||||||||||||||
Value > 0 |
Specifies the label of the outlier pixels, as an integer. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_SAVE_AREA_IMAGE |
Sets whether to save the area identifier image in the result buffer. INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Same as M_DISABLE. |
||||||||||||||||||||||||||||||||||||||
M_DISABLE |
Specifies not to save the image. |
||||||||||||||||||||||||||||||||||||||
M_ENABLE |
Specifies to save the image. |
The following ControlType and corresponding ControlValue parameter settings are used to control color space encoding, according to the actual dynamic range of your color data. In this case, you must set the IndexOrLabel parameter to M_CONTEXT. These values are only available for color matching contexts.
Color space encoding defines how color is transformed from the range represented in an image buffer to its native (theoretical) range. For example, RGB color space data is represented in an image buffer as values between 0 and 255 (8-bit); these values are then mapped to their native data range, which consists of all real numbers between 0 and 1.
The Color Analysis module allows you to perform this transformation automatically, using M_ENCODING with M_nBIT, which is typically sufficient. You can also use M_USER_DEFINED to explicitly control the transformation according to offset (M_OFFSET_BAND_n) and scale (M_SCALE_BAND_n) values. For more information, see the Color space encoding subsection of the Advanced color matching settings and concepts section of Chapter 16: Color processing and analysis.
For controlling color matching context
settings that are used for color space encoding
|
|||||||||||||||||||||||||||||||||||||||
ControlType |
Description
|
||||||||||||||||||||||||||||||||||||||
ControlValue | |||||||||||||||||||||||||||||||||||||||
M_ENCODING |
Sets the color space encoding, which defines how color is transformed from the range represented in an image buffer to its native (theoretical) range. INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Same as M_8BIT. |
||||||||||||||||||||||||||||||||||||||
M_8BIT |
Specifies an internally defined color space encoding for 8-bit images. |
||||||||||||||||||||||||||||||||||||||
M_10BIT |
Specifies an internally defined color space encoding for 10-bit images. |
||||||||||||||||||||||||||||||||||||||
M_12BIT |
Specifies an internally defined color space encoding for 12-bit images. |
||||||||||||||||||||||||||||||||||||||
M_14BIT |
Specifies an internally defined color space encoding for 14-bit images. |
||||||||||||||||||||||||||||||||||||||
M_16BIT |
Specifies an internally defined color space encoding for 16-bit images. |
||||||||||||||||||||||||||||||||||||||
M_USER_DEFINED |
Specifies that the color space encoding is defined using M_OFFSET_BAND_n and M_SCALE_BAND_n. |
||||||||||||||||||||||||||||||||||||||
M_OFFSET_BAND_0 |
Sets the offset for the color space encoding, for band 0. INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
Value |
Specifies the offset, as a double. |
||||||||||||||||||||||||||||||||||||||
M_OFFSET_BAND_1 |
Sets the offset for the color space encoding, for band 1. INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
Value |
Specifies the offset, as a double. |
||||||||||||||||||||||||||||||||||||||
M_OFFSET_BAND_2 |
Sets the offset for the color space encoding, for band 2. INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
Value |
Specifies the offset, as a double. |
||||||||||||||||||||||||||||||||||||||
M_SCALE_BAND_0 |
Sets the scale for the color space encoding, for band 0. INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
Value |
Specifies the scale, as a double. |
||||||||||||||||||||||||||||||||||||||
M_SCALE_BAND_1 |
Sets the scale for the color space encoding, for band 1. INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
Value |
Specifies the scale, as a double. |
||||||||||||||||||||||||||||||||||||||
M_SCALE_BAND_2 |
Sets the scale for the color space encoding, for band 2. INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
Value |
Specifies the scale, as a double. |
The following ControlType and corresponding ControlValue parameter settings are used to control color-samples defined in the context. In this case, you must set the IndexOrLabel parameter to M_SAMPLE_INDEX() or M_SAMPLE_LABEL(). Unless otherwise specified, these values are only available for color matching contexts.
For controlling
color-samples
|
|||||||||||||||||||||||||||||||||||||||
ControlType |
Description
|
||||||||||||||||||||||||||||||||||||||
ControlValue | |||||||||||||||||||||||||||||||||||||||
M_DISTANCE_TOLERANCE |
Sets the acceptable tolerance for the color distance between the color-sample and a target area. INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Same as M_AUTO. |
||||||||||||||||||||||||||||||||||||||
M_AUTO |
Specifies the tolerance automatically. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_INFINITE |
Specifies an infinite tolerance. |
||||||||||||||||||||||||||||||||||||||
Value >= 0.0 |
Specifies the tolerance value. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_HISTOGRAM_FREQUENCY_THRESHOLD |
Sets the minimal frequency, in pixels, for a histogram bin to count in the matching process. INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Specifies the default value; the default value is 1 pixel. |
||||||||||||||||||||||||||||||||||||||
Value > 0 |
Specifies the minimal frequency, as an integer. |
||||||||||||||||||||||||||||||||||||||
M_SAMPLE_LABEL_VALUE |
Sets the color-sample's label. INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
Value > 0 |
Specifies the label, as an integer. (more details...) |
void McolControlInt64
(MIL_ID ContextId,
MIL_INT IndexOrLabel,
MIL_INT64 ControlType,
MIL_INT64 ControlValue)
Parameters
ContextId See ContextId of the main function for a description. IndexOrLabel See IndexOrLabel of the main function for a description. ControlType See ControlType of the main function for a description. ControlValue See ControlValue of the main function for a description. |
Header | Include mil.h. |
Library | Use mil.lib; milcolor.lib. |
DLL | Requires mil.dll; milcolor.dll. |