| MIL 10 Reference
| Customize Help
| Save Settings

McodeControl



See also
Availability
Not available in MIL-Lite
Available in MIL

Available on Windows
Available on Linux with restrictions

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
Control a code context, code model, or code result buffer setting.
Syntax
void McodeControl(
MIL_ID ContextOrResultCodeId, //in
MIL_INT64 ControlType, //in
MIL_DOUBLE ControlValue //in
)
Description

This function changes the setting of a specified code context, code model, or code result buffer.

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
ContextOrResultCodeId

Specifies the identifier of the code context, code model, or code result buffer.

ControlType

Specifies the setting to change.

See the Parameter associations section for possible values that can be specified.

ControlValue

Specifies the setting's new value.

See the Parameter associations section for possible values that can be specified.

The following ControlType and corresponding ControlValue parameter settings can be specified for a code context to control an McodeRead() operation.

function map Code context settings for McodeRead() operations
CollapseControlType Description
ControlValue
Collapse M_STOP_READ

Stops the current read operation. You must call McodeControl() with M_STOP_READ from another thread (typically of higher priority). The results returned after making this call are invalid and discarded.

(summarize)
Collapse M_DEFAULT

Implements the default behavior.

Collapse M_TOTAL_NUMBER

Sets the maximum number of codes to read in one source image.

Note that this number is limited by the maximum number of occurrences to read of each code model (M_NUMBER). INQ

(summarize)
Collapse M_DEFAULT

Same as M_ALL.

Collapse M_ALL

Specifies to read all code occurrences in the source image, up to the maximum number of occurrences to read of each code model (M_NUMBER).

Collapse Value >= 0

Specifies the maximum number of codes to read in the source image.

The following ControlType and corresponding ControlValue parameter settings for a code context, to control McodeGrade() operations.

function map Code context settings for McodeGrade() operations
CollapseControlType Description
ControlValue
Collapse M_ABSOLUTE_APERTURE_SIZE

Sets the absolute size (diameter) of the aperture. Use this control type when using an absolute aperture mode (using M_APERTURE_MODE set to M_ABSOLUTE).

This control type is only available for 1D, 2D cross-row, and composite code types. INQ

(summarize)
Collapse M_DEFAULT

Specifies the default value; the default value is 0.

Collapse Value >= 0

Specifies the absolute aperture size, relative to the input coordinate system specified using M_ABSOLUTE_APERTURE_SIZE_INPUT_UNITS.

Collapse M_ABSOLUTE_APERTURE_SIZE_INPUT_UNITS

Sets the units with which to interpret the M_ABSOLUTE_APERTURE_SIZE control type. This essentially sets the input coordinate system to use.

This control type is only available for 1D, 2D cross-row, and composite code types. INQ

(summarize)
Collapse M_DEFAULT

Same as M_PIXEL.

Collapse M_PIXEL

Specifies to interpret the value in pixel units, with respect to the pixel coordinate system.

Collapse M_WORLD

Specifies to interpret the value in world units, with respect to the relative coordinate system. If world units are specified, calling McodeGrade() generates an error if the operation is not performed on a calibrated image.

(summarize)
Collapse M_AIMDPM_CALIBRATION_RESULTS

Sets the expected reflectance and mean light values derived during the reflectance calibration phase.

This control type is an alternative to separately obtaining the reflectance and mean light values from the result buffer used during the reflectance calibration phase, and setting M_REFLECTANCE_CALIBRATION and M_MEAN_LIGHT_CALIBRATION to these two values, respectively, in the code context associated with the target code.

This control type is only available for Data Matrix, QR code, and Micro QR code types. INQ

(summarize)
Collapse Result buffer identifier

Specifies the result buffer used during the reflectance calibration phase.

Collapse M_APERTURE_MODE

Sets the way in which the aperture size is determined.

This control type is only available for 1D, 2D cross-row, and composite code types. INQ

(summarize)
Collapse M_DEFAULT

Same as M_RELATIVE.

Collapse M_ABSOLUTE

Specifies to use the absolute aperture size, set using M_ABSOLUTE_APERTURE_SIZE.

Collapse M_DISABLE

Specifies to disable the aperture. Note that this is provided for backwards compatibility with older code. In this case, the grading operation's returned results will more closely resemble the results of a read operation.

(summarize)
Collapse M_RELATIVE

Specifies to use a relative aperture size, based on the cell size (using M_CELL_SIZE...) and the relative aperture factor (using M_RELATIVE_APERTURE_FACTOR).

Collapse M_EXTENDED_AREA_REFLECTANCE_CHECK

Sets whether the grading must perform an additional reflectance check over an extended area beyond the quiet zone. INQ

(summarize)
Collapse M_DEFAULT

Same as M_DISABLE.

Collapse M_DISABLE

Specifies to disable the additional reflectance check.

Collapse M_ENABLE

Specifies to enable the additional reflectance check.

Note that you can only enable this control type when performing an ISO verification (that is, when M_GRADING_STANDARD is set to M_ISO_GRADING).

(summarize)
Collapse M_GRADING_STANDARD

Sets the grading standard to use when performing a grading operation.

The results of the grading operation are dependent on the standard used; some control types have a different implementation or meaning depending on the standard used. These differences are outlined in the control types' description. INQ

(summarize)
Collapse M_AIMDPM_GRADING

Specifies to use the ISO/IEC TR 29158:2011 specification. Note that this is the replacement for the AIM DPM-1-2006 standard.

This control value must be used at the beginning of the target verification phase, and should not be used during the reflectance calibration phase.

This is only available for Data Matrix, QR code, and Micro QR code types.

(summarize)
Collapse M_ISO_GRADING

Specifies to use the ISO standard.

This is the default value.

(summarize)
Collapse M_INSPECTION_BAND_RATIO

Sets the height of the inspection band as a percentage of the average bar height. The inspection band is the area of the code from which the scanlines to grade the code are taken, after the code has been located.

This control type is only available for 1D code types and 2D cross-row code types. INQ

(summarize)
Collapse M_DEFAULT

Specifies the default percentage. The default value is 80% of average bar height.

(summarize)
Collapse 0.0 < Value < 100.0

Specifies the percentage of the average bar height to set as the height of the inspection band.

Collapse M_MAXIMUM_CALIBRATED_REFLECTANCE

Sets the maximum possible grayscale value in the target image. This control type is used in the scan reflectance profile analysis. If this control type does not accurately represent the actual maximum grayscale value from the target image, the resulting values from the scan reflectance profile are invalid. Note that this value must be higher than the value of M_MINIMUM_CALIBRATED_REFLECTANCE. INQ

(summarize)
Collapse M_DEFAULT

Specifies the default value; the default value is 255.

Collapse 0 <= Value <= 255

Specifies the maximum calibrated reflectance.

Collapse M_MEAN_LIGHT_CALIBRATION

Sets the expected mean light (MLcal). This corresponds to the expected mean intensity of the centers of the white elements of the code.

This control type is used during the target verification phase of the ISO/IEC TR 29158:2011 specification.

Note that the value of this control type can also be set using M_AIMDPM_CALIBRATION_RESULTS.

This control type is only available for Data Matrix, QR code, and Micro QR code types. INQ

(summarize)
Collapse M_DEFAULT

Specifies the default value. The default value is equal to M_MAXIMUM_CALIBRATED_REFLECTANCE.

(summarize)
Collapse 0 <= Value <= 255

Specifies the mean intensity. This value is typically derived during the reflectance calibration phase.

(summarize)
Collapse M_MINIMUM_CALIBRATED_REFLECTANCE

Sets the minimum possible grayscale value in the target image. This control type is used in the scan reflectance profile analysis. If this control type does not accurately represent the actual minimum grayscale value from the target image, the resulting values from the scan reflectance profile are invalid. Note that this value must be lower than the value of M_MAXIMUM_CALIBRATED_REFLECTANCE. INQ

(summarize)
Collapse M_DEFAULT

Specifies the default value; the default value is 0.

Collapse 0 <= Value <= 255

Specifies the minimum calibrated reflectance.

Collapse M_NUMBER_OF_SCANLINES

Sets the number of scanlines inside the inspection band to inspect during the grading operation, after the code has been located. Set the height of the inspection band using M_INSPECTION_BAND_RATIO.

This control type is only available for 1D code types and 2D cross-row code types. INQ

(summarize)
Collapse M_DEFAULT

Specifies the default value. The default value is 10 scanlines.

(summarize)
Collapse M_ALL

Specifies to use all possible scanlines inside the inspection band.

Collapse Value > 0

Specifies the number of scanlines to inspect. This value is equivalent to M_ALL if it exceeds the inspection band height.

(summarize)
Collapse M_PIXEL_SIZE_IN_MM

Sets the scale between a pixel and its physical measurement in mm. To simplify the computation of this value, measure the length of the entire code and divide it by its pixel length; this yields a good approximation. Alternatively, calculate the scale using the following formula: (size of the object) / (number of pixels in object). For more information, see point 3 in the MIL calculated aperture setting subsection of the The verification process and grading your code section of Chapter 12: Codes.

Code specifications generally specify constraints in mm units. To compare values known in MIL (for example, the cell size in pixels) to the values in the code specifications, this control type is used. Note that this control type can impact other control types, for example, the aperture size selection, and the M_SCAN_INTERCHARACTER_GAP_GRADE result (retrieved using McodeGetResult()).

Note that this value is needed even when operating on calibrated images because MIL does not know the relationship between mm and the world units of the calibrated context.

This control type is only available for 1D, 2D, and composite code types. INQ

(summarize)
Collapse M_DEFAULT

Same as M_UNKNOWN.

Collapse M_UNKNOWN

Specifies that the scale between a pixel and its physical measurement is not known, in mm per pixel units.

Collapse Value > 0

Specifies the scale between a pixel and its physical measurement, in mm per pixel units.

Collapse M_REFLECTANCE_CALIBRATION

Sets the expected reflectance value (Rcal). This control type is used during the target verification phase of the ISO/IEC TR 29158:2011 specification.

Note that the value of this control type can also be set using M_AIMDPM_CALIBRATION_RESULTS.

This control type is only available for Data Matrix, QR code, and Micro QR code types. INQ

(summarize)
Collapse M_DEFAULT

Specifies the default value. The default value is equal to M_MAXIMUM_CALIBRATED_REFLECTANCE.

(summarize)
Collapse 0 <= Value <= 255

Specifies the reflectance value. This value is typically derived during the reflectance calibration phase.

(summarize)
Collapse M_RELATIVE_APERTURE_FACTOR

Sets the aperture factor to use when M_APERTURE_MODE is set to M_RELATIVE. The aperture factor is multiplied by the M_CELL_SIZE_MIN to determine the aperture's diameter.

This control type is only available for 1D, 2D matrix, 2D cross-row, and composite code types. INQ

(summarize)
Collapse M_DEFAULT

Same as M_AUTO.

Collapse M_AUTO

Specifies that the aperture factor is chosen according to ISO 15416 for all supported code types except 2D matrix code types, which are chosen according to ISO 15415.

Note that if the nominal bar width is less than 0.1 mm, the aperture factor is 0.5. When dealing with EAN/UPC code types the aperture factor is 0.15. When dealing with 2D matrix code types, the aperture factor is 0.8.

(summarize)
Collapse 0 <= Value <= 2

Specifies the aperture factor.

Collapse M_SYSTEM_RESPONSE_CALIBRATION

Sets the System Response value derived during the reflectance calibration phase (SRcal).

The System Response value is a user-defined aggregate of the settings of environmental factors, such as exposure time and/or gain factor, that create the conditions for an acceptable image of the code.

For example, you could define the System Response as, Exposure time + Gain factor. During the reflectance calibration phase, adjust the exposure time and/or gain factor until you obtain an acceptable image of the code, and then add the two values together. At the beginning of the target verification phase, set this result as the System Response value of the reflectance calibration phase.

Note that you should use the same formula to calculate the System Response value, in both the reflectance calibration phase and the target verification phase.

This control type is only available for all Data Matrix, QR code, and Micro QR code types. INQ

(summarize)
Collapse M_DEFAULT

Specifies the default value. The default value is 1.0.

(summarize)
Collapse Value > 0.0

Specifies the System Response value for the reference code.

Collapse M_SYSTEM_RESPONSE_TARGET

Sets the System Response value derived during the target verification phase (SRtarget).

To set this control type, use the same aggregate of environmental factors that was used to calculate M_SYSTEM_RESPONSE_CALIBRATION.

For example, if you set the System Response value of the reflectance calibration phase to the sum of the exposure time and gain factor, set the System Response value of the target verification phase to the sum of the exposure time and gain factor used to create the conditions for an acceptable image of the target code. During the target verification phase, you should not alter any environmental factors other than those used to calculate the System Response value.

This control type is only available for Data Matrix, QR code, and Micro QR code types. INQ

(summarize)
Collapse M_DEFAULT

Specifies the default value. The default value is 1.0.

(summarize)
Collapse Value > 0.0

Specifies the System Response value for the target code.

The following ControlType and ControlValue parameter settings can be specified for a code context, to control McodeRead() and McodeGrade() operations.

function map Code context settings for McodeRead() and McodeGrade() operations
CollapseControlType Description
ControlValue
Collapse M_MINIMUM_CONTRAST

Sets the minimum possible contrast between the foreground and background in the target image for 1D codes (excluding Planet and Postnet) when using the M_ADAPTIVE threshold mode.

Increasing the minimum contrast will typically improve read operations, particularly in the presence of noise and non-uniform lighting. However, if the minimum contrast is higher than the contrast of a code, the code will not be read correctly.

For 2D codes, the minimum contrast is determined automatically, so the adaptive threshold mode does not use the M_MINIMUM_CONTRAST setting. INQ

(summarize)
Collapse M_DEFAULT

Specifies the default value; the default value is 50.

Collapse 1 <= Value <= 255

Specifies the minimum contrast.

Collapse M_SCANLINE_HEIGHT

Sets the height (or thickness) of the scanline. The scanline is the line along which the code is read.

When locating the code, the scanline is usually first taken across the middle of the image or the image's region of interest (ROI), if one is associated. If the code is not found, a scanline is taken either higher or lower in the image or its ROI.

This control type overrides the automatic selection based on the value of M_SPEED. In general, the higher the value for this control type, the slower the code is read. Higher values for this control increase the robustness of read and grading operations. Using the default value is recommended; the higher the search speed, the lower the default value.

Note that during a grading operation, after locating the code, when taking scanlines within the inspection band, MIL uses a scanline height of a single pixel regardless of the value of M_SCANLINE_HEIGHT, as per the ISO standard.

This control type is only available for 1D code types, Micro PDF417, and composite code types. INQ

(summarize)
Collapse M_DEFAULT

Specifies that the scanline height is based on the value of M_SPEED.

Collapse Value

Specifies the scanline height, relative to the input coordinate system specified using M_SCANLINE_INPUT_UNITS.

When entering a value in pixel units, this value must be between 1 and 256, inclusive. The value entered is rounded to the nearest integer.

When entering a value in world units, the number that results from the internal transformation of world units to pixel units must still respect the value's pixel unit constraint. To find the range of allowed values in world units, according to your associated calibration, use McalTransformResult().

(summarize)
Collapse M_SCANLINE_INPUT_UNITS

Sets the units with which to interpret the M_SCANLINE_HEIGHT and M_SCANLINE_STEP control types. This essentially sets the input coordinate system to use.

This control type is only available for 1D code types, Micro PDF417, and composite code types. INQ

(summarize)
Collapse M_DEFAULT

Same as M_PIXEL.

Collapse M_PIXEL

Specifies to interpret the values in pixel units, with respect to the pixel coordinate system.

Collapse M_WORLD

Specifies to interpret the values in world units, with respect to the relative coordinate system. If world units are specified, calling McodeRead() or McodeGrade() generates an error if the operation is not performed on a calibrated image.

(summarize)
Collapse M_SCANLINE_STEP

Sets the scanline step. The scanline step is the distance, or gap, between scanlines taken in the image or the image's region of interest (ROI), if one is associated.

In general, the higher the value for this control type, the faster the code is read, but the greater the chance of missing a readable line of code. Using the default value is recommended; the default value is dependent upon the search speed.

Note that during a grading operation, after locating the code, when taking scanlines within the inspection band, MIL uses a scanline step distance based on the height of the inspection band and the required number of scanlines, regardless of the value of M_SCANLINE_STEP, as per the ISO standard; the ISO standard requires ten evenly spaced scanlines within the inspection band.

This control type is only available for 1D code types, Micro PDF417, and composite code types. INQ

(summarize)
Collapse M_DEFAULT

Specifies that the scanline step is based on the value of M_SPEED.

When dealing with 1D code types and and composite code types, the following values are associated with M_DEFAULT.

M_SPEED value

Default value

M_LOW

5

M_VERY_LOW

5

M_MEDIUM

10

M_HIGH

15

M_VERY_HIGH

25

When dealing with Micro PDF417 code types, the default value is 2, regardless of the value of M_SPEED.

(summarize)
Collapse Value

Specifies the scanline step, relative to the input coordinate system specified using M_SCANLINE_INPUT_UNITS.

When entering a value in pixel units, this value must be greater than or equal to 1. The value entered is rounded to the nearest integer.

When entering a value in world units, the number that results from the internal transformation of world units to pixel units must still respect the value's pixel unit constraint. To find the range of allowed values in world units, according to your associated calibration, use McalTransformResult().

(summarize)
Collapse M_SEARCH_ANGLE_MODE

Sets whether to enable the search angular range algorithm for the code context.

When enabled, codes are sought at the angular range defined by M_SEARCH_ANGLE - M_SEARCH_ANGLE_DELTA_NEG to M_SEARCH_ANGLE + M_SEARCH_ANGLE_DELTA_POS. For 1D codes, the Code module will not use the search angular range algorithm if M_SEARCH_ANGLE_DELTA_NEG and M_SEARCH_ANGLE_DELTA_POS both have a value of less than 5°, regardless of M_SEARCH_ANGLE_MODE.

For the M_PDF417, M_TRUNCATED_PDF417, M_QRCODE, M_MICROQRCODE, M_MAXICODE, and M_DATAMATRIX code types, the angular range does not affect the speed of the operation.

In addition, if you expect that the codes sought are close to their nominal angle, you can try disabling the search angular range algorithm to see if the Code module can still find the required codes. Disabling this algorithm might speed up the search depending on the code and the target. INQ

(summarize)
Collapse M_DEFAULT

Same as M_ENABLE.

Collapse M_DISABLE

Specifies that the search angular range algorithm is not used.

Collapse M_ENABLE

Specifies that the search angular range algorithm is used.

Collapse M_SPEED

Sets the search speed. The faster the search speed, the less robust the operation.

For 1D code types, consider reducing the search speed when the pixel height of the bar code is small.

For 2D code types, consider reducing the search speed when the cell size is small relative to the image size.

For 1D code types, composite code types, and Micro PDF417, you can also affect the search speed by adjusting the value for M_SCANLINE_STEP.

(summarize)
Collapse M_DEFAULT

Same as M_MEDIUM.

Collapse M_HIGH

Specifies a high search speed.

Collapse M_LOW

Specifies a low search speed.

Collapse M_MEDIUM

Specifies a medium search speed.

Collapse M_VERY_HIGH

Specifies a very high search speed.

Collapse M_VERY_LOW

Specifies a very low search speed.

Collapse M_THRESHOLD_MODE

Sets the threshold mode used to internally binarize the source image.

Note that if the background is darker than the code(s) in some places but lighter in others, a simple binarization will not separate the code(s) from the background. In this case, you should use the M_ADAPTIVE mode or process the image before performing the read or grading operation so that the background is strictly darker or strictly lighter than the code. INQ

(summarize)
Collapse M_DEFAULT

Same as M_GLOBAL_SEGMENTATION.

Collapse M_ADAPTIVE

Specifies to use a fast dynamic local threshold. This mode selects an individual threshold for each pixel based on the range of intensity values in its local neighborhood. M_ADAPTIVE works better than M_DEFAULT in cases where the image has non-uniform lighting.

For linear (1D) code types (excluding Planet and Postnet), you must specify the minimum contrast (McodeControl() with M_MINIMUM_CONTRAST) between the foreground and background in the target image when using the M_ADAPTIVE mode.

For 2D codes, the minimum contrast is determined automatically, so the adaptive threshold mode does not use the M_MINIMUM_CONTRAST setting.

M_DATAMATRIX, M_MAXICODE, M_MICROPDF417, M_QRCODE, and 1D code types (excluding 4-state, Planet, and Postnet) are the code types that support M_ADAPTIVE.

(summarize)
Collapse M_GLOBAL_SEGMENTATION

Specifies to use a global threshold value. Specify the value using M_THRESHOLD_VALUE.

(summarize)
Collapse M_GLOBAL_WITH_LOCAL_RESEGMENTATION

Specifies that the source image will be globally thresholded and then the edges in the binarized image are resegmented according to the intensities of the surrounding bars and spaces in the original source image. These individual local thresholds, calculated per region, help enhance the edge positions in the code. Specify the global threshold value using M_THRESHOLD_VALUE.

This binarization method is compatible with the methods described in the various ISO code verification standards. For more information, refer to the Technical code information subsection of the Basic concepts for the MIL Code module section of Chapter 12: Codes.

This control value is available for all 1D, MicroPDF417, and GS1 128 code types.

(summarize)
Collapse M_THRESHOLD_VALUE

Sets the threshold value used to internally binarize the source image, depending on the specified threshold mode.

Note that if M_THRESHOLD_MODE is set to M_ADAPTIVE, this control type is ignored. INQ

(summarize)
Collapse M_DEFAULT

Same as M_AUTO_COMPUTE.

Collapse M_AUTO_COMPUTE

Specifies the threshold value automatically.

Collapse 0 <= Value <= 255

Specifies the threshold value.

Collapse M_TIMEOUT

Specifies the maximum decoding time for a read or grading operation. INQ

(summarize)
Collapse M_DEFAULT

Specifies the default value; the default value is 2000 msec.

Collapse M_DISABLE

Specifies that there is no maximum decoding time.

Collapse Value >= 0

Specifies the maximum decoding time, in msec.

The following ControlType and corresponding ControlValue parameter settings can be specified for a code model, to control McodeRead() operations. If you pass a code context to the ContextOrResultCodeId parameter, the specified control type setting is applied to all the code models in the context. If none of the code models support the specified control type, an error occurs. If only some code models do not support the specified control type, the control type setting is ignored for these code models.

function map Code model settings for McodeRead() operations
CollapseControlType Description
ControlValue
Collapse M_CHECK_QUIET_ZONE

Sets whether the presence of the quiet zone is necessary for a successful read operation of this code type.

Note that the specifications of a code's quiet zone are dependent upon the code type.

(summarize)
Collapse M_DEFAULT

Same as M_ENABLE.

Collapse M_DISABLE

Specifies that a quiet zone is not necessary. When set to M_DISABLE, the read operation can be less robust, especially for 1D code types.

(summarize)
Collapse M_ENABLE

Specifies that a quiet zone is necessary.

Collapse M_ECC_CORRECTED_NUMBER

Forces McodeRead() to perform a more robust read operation to minimize the number of errors to correct.

Enabling M_ECC_CORRECTED_NUMBER decreases performance, particularly in good quality images or in images where the error count is not important.

This control type is only available for PDF417 and Truncated PDF417 code types. INQ

(summarize)
Collapse M_DEFAULT

Same as M_DISABLE.

Collapse M_DISABLE

Specifies not to perform a more robust read operation.

Collapse M_ENABLE

Specifies to perform a more robust read operation.

Collapse M_NUMBER

Sets the maximum number of codes to read for the specified code model.

Note that this number is limited by the specified maximum total number of codes to read in the image (McodeControl() with M_TOTAL_NUMBER) and does not apply to McodeGrade() operations.

Only 1D code types (excluding GS1 Databar, 4-state, Planet, and Postnet code types) and the 2D Data Matrix code type support searching for multiple occurrences. INQ

(summarize)
Collapse M_DEFAULT

Specifies the default value; the default value is 1.

Collapse M_ALL

Specifies that all code model occurrences are read up to the maximum number limited by M_TOTAL_NUMBER.

Collapse Value >= 0

Specifies the maximum number of codes to read for the specified code model.

Collapse M_POSITION_ACCURACY

Sets the accuracy of positional results. Accuracy depends on the settings of the code context and its models.

Set this control type to M_HIGH when reading multiple code occurrence, for higher accuracy. Note that this can result in longer read times. INQ

(summarize)
Collapse M_DEFAULT

Same as M_LOW.

Collapse M_HIGH

Specifies to report the positional results of code read operations with high accuracy.

Collapse M_LOW

Specifies to report the positional results of code read operations with low accuracy.

The following ControlType and corresponding ControlValue parameter settings can be specified for a code model to control McodeRead() and McodeGrade() operations. If you pass a code context to the ContextOrResultCodeId parameter, the specified control type setting is applied to all the code models in the context. If none of the code models support the specified control type, an error will occur. If only some code models do not support the specified control type, the control type setting is ignored for these code models.

function map Code model settings for McodeRead() and McodeGrade() operations
CollapseControlType Description
ControlValue
Collapse M_BEARER_BAR

Sets whether bearer bars run along the top and bottom of the codes to read (such as, the edge of a sticker). Note that this control type is only taken into account when the search angle is not specified. This value is available only for 1D code types.

In situations where bearer bars don't run along both the top and the bottom of the code to read, setting M_SPEED to M_VERY_LOW will provide more robust results. INQ

(summarize)
Collapse M_DEFAULT

Same as M_ABSENT.

Collapse M_ABSENT

Specifies that no bearer bars are above and below the code.

Collapse M_PRESENT

Specifies that there are bearer bars above an below the code.

Collapse M_CELL_NUMBER_X_MAX

Sets the maximum number of cells for which to search, in the X-direction of a 2D code.

Note that McodeControl() generates an error if you set both a range of cells for which to search (using M_CELL_NUMBER_X_MAX, M_CELL_NUMBER_X_MIN, M_CELL_NUMBER_Y_MAX, and/or M_CELL_NUMBER_Y_MIN) and an explicit number of cells for which to search (using M_CELL_NUMBER_X and/or M_CELL_NUMBER_Y).

This control type is only available for Data Matrix code types. INQ

(summarize)
Collapse M_DEFAULT

Same as M_ANY.

Collapse M_ANY

Specifies to search for codes with any number of cells.

Collapse Value > 0

Specifies the maximum number of cells for which to search. If a value is specified, it must be larger than M_CELL_NUMBER_X_MIN, otherwise an error occurs.

(summarize)
Collapse M_CELL_NUMBER_X_MIN

Sets the minimum number of cells for which to search, in the X-direction of a 2D code.

Note that McodeControl() generates an error if you set both a range of cells for which to search (using M_CELL_NUMBER_X_MAX, M_CELL_NUMBER_X_MIN, M_CELL_NUMBER_Y_MAX, and/or M_CELL_NUMBER_Y_MIN) and an explicit number of cells for which to search (using M_CELL_NUMBER_X and/or M_CELL_NUMBER_Y).

This control type is only available for Data Matrix code types. INQ

(summarize)
Collapse M_DEFAULT

Same as M_ANY.

Collapse M_ANY

Specifies to search for codes with any number of cells.

Collapse Value > 0

Specifies the minimum number of cells for which to search. If a value is specified, it must be smaller than M_CELL_NUMBER_X_MAX, otherwise an error occurs.

(summarize)
Collapse M_CELL_NUMBER_Y_MAX

Sets the maximum number of cells for which to search, in the Y-direction of a 2D code.

Note that McodeControl() generates an error if you set both a range of cells for which to search (using M_CELL_NUMBER_X_MAX, M_CELL_NUMBER_X_MIN, M_CELL_NUMBER_Y_MAX, and/or M_CELL_NUMBER_Y_MIN) and an explicit number of cells for which to search (using M_CELL_NUMBER_X and/or M_CELL_NUMBER_Y).

This control type is only available for Data Matrix code types. INQ

(summarize)
Collapse M_DEFAULT

Same as M_ANY.

Collapse M_ANY

Specifies to search for codes with any number of cells.

Collapse Value > 0

Specifies the maximum number of cells for which to search. If a value is specified, it must be larger than M_CELL_NUMBER_Y_MIN, otherwise an error occurs.

(summarize)
Collapse M_CELL_NUMBER_Y_MIN

Sets the minimum number of cells for which to search, in the Y-direction of a 2D code.

Note that McodeControl() generates an error if you set both a range of cells for which to search (using M_CELL_NUMBER_X_MAX, M_CELL_NUMBER_X_MIN, M_CELL_NUMBER_Y_MAX, and/or M_CELL_NUMBER_Y_MIN) and an explicit number of cells for which to search (using M_CELL_NUMBER_X and/or M_CELL_NUMBER_Y).

This control type is only available for Data Matrix code types. INQ

(summarize)
Collapse M_DEFAULT

Same as M_ANY.

Collapse M_ANY

Specifies to search for codes with any number of cells.

Collapse Value > 0

Specifies the minimum number of cells for which to search. If a value is specified, it must be smaller than M_CELL_NUMBER_Y_MAX, otherwise an error occurs.

(summarize)
Collapse M_CHECK_FINDER_PATTERN

Sets whether checking for a false Data Matrix pattern is enabled.

If this control type is enabled, read and grading operations are more robust, and false Data Matrix code types are not read.

This control type should only be enabled if it is possible that parts of your image could be falsely interpreted as a Data Matrix code types.

This control type is only available for Data Matrix code types. INQ

(summarize)
Collapse M_DEFAULT

Same as M_DISABLE.

Collapse M_DISABLE

Specifies that the Code module will not check for false Data Matrix code types.

Collapse M_ENABLE

Specifies that the Code module will check for false Data Matrix code types.

Collapse M_CODE_FLIP

Sets whether the code needs to be flipped or read in the opposite direction to be read properly. INQ

(summarize)
Collapse M_DEFAULT

Same as M_NO_FLIP.

Collapse M_ANY

Allows MIL to decide whether the code needs to be flipped or read in the opposite direction to be read properly.

Collapse M_FLIP

Specifies that the code needs to be flipped or read in the opposite direction to be read properly. When dealing with 1D code types, the code will be read from left-to-right and from right-to left. When dealing with 2D code types, the code will be flipped before being read.

(summarize)
Collapse M_NO_FLIP

Specifies that the code does not need to be flipped or read in the opposite direction. When dealing with 1D code types, the code will be read from left-to-right. When dealing with 2D code types, the code will not be flipped.

(summarize)
Collapse M_DATAMATRIX_SHAPE

Sets the shape of the Data Matrix code type.

This control type is only available for Data Matrix code types. INQ

(summarize)
Collapse M_DEFAULT

Same as M_ANY.

Collapse M_ANY

Specifies that the Data Matrix code type can be any shape.

Collapse M_RECTANGLE

Specifies that the Data Matrix code has a rectangular shape. This shape can only use the M_ECC_200 error correction scheme.

(summarize)
Collapse M_SQUARE

Specifies that the Data Matrix has a square shape.

Collapse M_DISTORTION

Sets the distortion compensation algorithm that increases the robustness of read and grading operation son distorted codes. Note that distortion compensation can lead to longer processing times in some cases.

This control type is only available for Aztec, Data Matrix, and QR code types. INQ

(summarize)
Collapse M_DEFAULT

Same as M_NONE.

Collapse M_NONE

Specifies not to use distortion compensation.

Collapse M_PERSPECTIVE_UNEVEN_GRID_STEP

Specifies to use an algorithm that reads or grades Data Matrix codes that have perspective distortion and/or different column widths or row heights.

Use M_FINDER_PATTERN_MAX_GAP and M_FINDER_PATTERN_MINIMUM_LENGTH to control this algorithm.

Note that this control value is only available for Data Matrix and QR code types.

(summarize)
Collapse M_UNEVEN_GRID_STEP

Specifies to use an algorithm that reads or grades Aztec, Data Matrix, or QR code types that have different column widths or row heights and/or slight perspective distortion.

Collapse M_DOT_SPACING

Sets the distance between 2 dots in a matrix code type composed of dots. Note that the value entered represents half the distance between two dark cells (dots).

When the dark cells in a printed code are oversized (for example, due to printing artifacts) and overlap, set M_DOT_SPACING to a negative value equal to half the width of the overlap. The image below illustrates dark cells overlapping, the gray circle represents the actual cell size, while the black dot represents the expected cell size.

By contrast, when the dots are too far apart, specify a positive dot spacing equal to half the distance between the two dots.

This control type is only available for Aztec, Data Matrix, and QR code types. INQ

(summarize)
Collapse M_DEFAULT

Specifies no spacing.

Collapse Value

Specifies the distance, relative to the input coordinate system specified using M_DOT_SPACING_INPUT_UNITS. Specifying a positive value means that you are specifying half the distance between the edges of the dots. Specifying a negative value means you are specifying the half-depth of the overlap.

Whether to use a negative or positive dot spacing is a situation best determined by testing. For more information, refer to the Dot spacing subsection of the Customizing read and grading operation settings section of Chapter 12: Codes.

When entering a value in pixel units, this value must be between -256 and 256, inclusive.

When entering a value in world units, the number that results from the internal transformation of world units to pixel units must still respect the value's pixel unit constraint. To find the range of allowed values in world units, according to your associated calibration, use McalTransformResult().

(summarize)
Collapse M_DOT_SPACING_INPUT_UNITS

Sets the units with which to interpret the M_DOT_SPACING control type. This essentially sets the input coordinate system to use.

This control type is only available for Aztec, Data Matrix, and QR code types. INQ

(summarize)
Collapse M_DEFAULT

Same as M_PIXEL.

Collapse M_PIXEL

Specifies to interpret the value in pixel units, with respect to the pixel coordinate system.

Collapse M_WORLD

Specifies to interpret the value in world units, with respect to the relative coordinate system. If world units are specified, calling McodeRead() or McodeGrade() generates an error if the operation is not performed on a calibrated image.

(summarize)
Collapse M_FINDER_PATTERN_EXHAUSTIVE_SEARCH

Sets whether to search for the L-shaped finder pattern (the gray boxed area in the following image) to help localize the Data Matrix code. Note that enabling this control type increase the time to read or grade the code, but this control type is more robust when a Data Matrix code has a small amount of contrast between foreground and background colors or when dealing with complex images.

This control type is only available when M_DISTORTION is set to M_PERSPECTIVE_UNEVEN_GRID_STEP or when M_USE_PRESEARCH is set to M_FINDER_PATTERN_BASE.

This control type is only available for Data Matrix code types. INQ

(summarize)
Collapse M_DEFAULT

Same as M_DISABLE.

Collapse M_DISABLE

Specifies to not perform an exhaustive search.

Collapse M_ENABLE

Specifies to perform an exhaustive search.

Collapse M_FINDER_PATTERN_INPUT_UNITS

Sets the units with which to interpret the M_FINDER_PATTERN_MAX_GAP and M_FINDER_PATTERN_MINIMUM_LENGTH control types. This essentially sets the input coordinate system to use.

This control type is only available when M_DISTORTION is set to M_PERSPECTIVE_UNEVEN_GRID_STEP or when M_USE_PRESEARCH is set to M_FINDER_PATTERN_BASE.

This control type is only available for Data Matrix code types. INQ

(summarize)
Collapse M_DEFAULT

Same as M_PIXEL.

Collapse M_PIXEL

Specifies to interpret the values in pixel units, with respect to the pixel coordinate system.

Collapse M_WORLD

Specifies to interpret the values in world units, with respect to the relative coordinate system. If world units are specified, calling McodeRead() or McodeGrade() generates an error if the operation is not performed on a calibrated image.

(summarize)
Collapse M_FINDER_PATTERN_MAX_GAP

Sets the maximum tolerable gap in the finder pattern of a Matrix code. A gap is an unintentional space (area of background color), in the solid foreground color area of a Matrix code's finder pattern. A code that has a finder pattern with a gap larger than the specified value is not read.

This control type is only available when M_DISTORTION is set to M_PERSPECTIVE_UNEVEN_GRID_STEP or when M_USE_PRESEARCH is set to M_FINDER_PATTERN_BASE.

This control type is only available for Data Matrix code types. INQ

(summarize)
Collapse M_DEFAULT

Same as M_AUTO.

Collapse M_AUTO

Specifies that the maximum tolerable gap in the finder pattern is 6 times the minimum cell size specified using M_CELL_SIZE_MIN.

Collapse Value

Specifies the maximum gap allowed, in input units specified using M_FINDER_PATTERN_INPUT_UNITS.

Collapse M_FINDER_PATTERN_MINIMUM_LENGTH

Sets the shortest acceptable length of either "arm" of the finder pattern of a Data Matrix code. If either "arm" is shorter than the minimum, the code is not read.

This control type is only available when M_DISTORTION is set to M_PERSPECTIVE_UNEVEN_GRID_STEP or when M_USE_PRESEARCH is set to M_FINDER_PATTERN_BASE.

This control type is only available for Data Matrix code types. INQ

(summarize)
Collapse M_DEFAULT

Same as M_AUTO.

Collapse M_AUTO

Specifies that the minimum acceptable finder pattern "arm" length is 6 times the minimum cell size specified using M_CELL_SIZE_MIN.

Collapse Value

The minimum acceptable finder pattern "arm" length, in input units specified using M_FINDER_PATTERN_INPUT_UNITS.

Collapse M_SEARCH_ANGLE

Sets the nominal search angle.

The search is performed between the range of angles defined by: (M_SEARCH_ANGLE - M_SEARCH_ANGLE_DELTA_NEG) to (M_SEARCH_ANGLE + M_SEARCH_ANGLE_DELTA_POS), inclusively, starting with an angle closest to that of M_SEARCH_ANGLE.

For the M_PDF417, M_TRUNCATED_PDF417, M_QRCODE, M_MICROQRCODE, M_MAXICODE, and M_DATAMATRIX code types, the angular range does not affect the speed of the operation.

Note that M_SEARCH_ANGLE_DELTA_NEG and M_SEARCH_ANGLE_DELTA_POS must be set to M_DEFAULT when dealing with the following code types: M_PHARMACODE, M_COMPOSITECODE, and M_MICROPDF417.

A few code types have maximum search angles. This limit must also be respected when specifying an angular range.

Code type

Maximum search angle

M_PHARMACODE

±10°

M_COMPOSITECODE

±5°

M_MICROPDF417

±5°

When the search speed is set to M_SPEED set to M_VERY_LOW, a more exhaustive search algorithm is enabled that can exceed the specified angle range. In this case, the specified angle range is used as a starting reference for the search instead of as a search restriction. INQ

(summarize)
Collapse M_DEFAULT

Specifies the default value; the default value is 0.0.

Collapse M_ACCORDING_TO_REGION

Specifies that the nominal angle is set to the angle of the target image's ROI (MbufSetRegion()); Recall that for McodeGrade() and McodeRead(), the ROI must be rectangular. If this value is chosen but no ROI has been defined, the angle is set to 0.0°.

(summarize)
Collapse 0.0 <= Value <= 360.0

Specifies the nominal angle, in degrees, relative to the input coordinate system specified using M_SEARCH_ANGLE_INPUT_UNITS.

An angle interpreted with respect to the pixel coordinate system is always measured counter-clockwise. For information on the angle's direction of rotation when interpreting the angle with respect to the relative coordinate system, see the Angle convention in MIL subsection of the Working with real-world units section of Chapter 25: Calibrating your camera setup.

(summarize)
Collapse M_SEARCH_ANGLE_DELTA_NEG

Sets the negative angular range of the search.

When M_SEARCH_ANGLE_MODE is enabled, codes are sought at the angular range defined by M_SEARCH_ANGLE - M_SEARCH_ANGLE_DELTA_NEG to M_SEARCH_ANGLE + M_SEARCH_ANGLE_DELTA_POS. When M_SEARCH_ANGLE_MODE is disabled, this setting has no effect.

For the M_PDF417, M_TRUNCATED_PDF417, M_QRCODE, M_MICROQRCODE, M_MAXICODE, and M_DATAMATRIX code types, the angular range does not affect the speed of the operation.

For M_PHARMACODE, M_COMPOSITECODE, and M_MICROPDF417, the angular range should still be within the maximum search angle (as described for M_SEARCH_ANGLE).

When the search speed is set to M_SPEED set to M_VERY_LOW, a more exhaustive search algorithm is enabled that can exceed the specified angle range. In this case, the specified angle range is used as a starting reference for the search instead of as a search restriction. INQ

(summarize)
Collapse M_DEFAULT

Specifies the default value; the default value is 5.0.

Collapse 0.0 <= Value <= 180.0

Specifies a negative angular range, in degrees, relative to the nominal angle set by M_SEARCH_ANGLE. Note that while the nominal angle is relative to the input coordinate system specified using M_SEARCH_ANGLE_INPUT_UNITS, M_SEARCH_ANGLE_DELTA_NEG is not affected by the coordinate system used.

For 1D codes, the Code module will not use the search angular range algorithm if M_SEARCH_ANGLE_DELTA_NEG and M_SEARCH_ANGLE_DELTA_POS both have a value of less than 5°, regardless of M_SEARCH_ANGLE_MODE.

(summarize)
Collapse M_SEARCH_ANGLE_DELTA_POS

Sets the positive angular range of the search.

When M_SEARCH_ANGLE_MODE is enabled, codes are sought at the angular range defined by M_SEARCH_ANGLE - M_SEARCH_ANGLE_DELTA_NEG to M_SEARCH_ANGLE + M_SEARCH_ANGLE_DELTA_POS. When M_SEARCH_ANGLE_MODE is disabled, this setting has no effect.

For the M_PDF417, M_TRUNCATED_PDF417, M_QRCODE, M_MICROQRCODE, M_MAXICODE, and M_DATAMATRIX code types, the angular range does not affect the speed of the operation.

For M_PHARMACODE, M_COMPOSITECODE, and M_MICROPDF417, the angular range should still be within the maximum search angle (as described for M_SEARCH_ANGLE).

When the search speed is set to M_SPEED set to M_VERY_LOW, a more exhaustive search algorithm is enabled that can exceed the specified angle range. In this case, the specified angle range is used as a starting reference for the search instead of as a search restriction. INQ

(summarize)
Collapse M_DEFAULT

Specifies the default value; the default value is 5.0.

Collapse 0.0 <= Value <= 180.0

Specifies a positive angular range, in degrees, relative to the nominal angle set by M_SEARCH_ANGLE. Note that while the nominal angle is relative to the input coordinate system specified using M_SEARCH_ANGLE_INPUT_UNITS, M_SEARCH_ANGLE_DELTA_POS is not affected by the coordinate system used.

For 1D codes, the Code module will not use the search angular range algorithm if M_SEARCH_ANGLE_DELTA_NEG and M_SEARCH_ANGLE_DELTA_POS both have a value of less than 5°, regardless of M_SEARCH_ANGLE_MODE.

(summarize)
Collapse M_SEARCH_ANGLE_INPUT_UNITS

Sets the units with which to interpret the M_SEARCH_ANGLE control type. This essentially sets the input coordinate system to use. INQ

(summarize)
Collapse M_DEFAULT

Same as M_PIXEL.

Collapse M_PIXEL

Specifies to interpret the value in pixel units, with respect to the pixel coordinate system.

Collapse M_WORLD

Specifies to interpret the value in world units, with respect to the relative coordinate system. If world units are specified, calling McodeRead() or McodeGrade() generates an error if the operation is not performed on a calibrated image.

If there is distortion in the target image, you should correct the image before performing a read or grading operation.

(summarize)
Collapse M_SEARCH_ANGLE_STEP

Sets the angle increment/decrement used when searching for a 1D code through an angular range.

When M_SEARCH_ANGLE_STEP is enabled, the search angular range algorithm will first search at the specified nominal angle. It will then toggle between incrementing and decrementing from the nominal angle, with each iteration moving further away from the initial search angle by the value of M_SEARCH_ANGLE_STEP. The process will continue either until the code is found, or the search falls outside of the range defined by M_SEARCH_ANGLE - M_SEARCH_ANGLE_DELTA_NEG and M_SEARCH_ANGLE + M_SEARCH_ANGLE_DELTA_POS.

Note that this control type is ignored if M_SPEED is set to M_VERY_LOW, or M_SEARCH_ANGLE_MODE is set to M_DISABLE.

(summarize)
Collapse M_DEFAULT

Same as M_DISABLE.

Collapse M_DISABLE

Specifies that no explicit increment/decrement is used. The actual increment/decrement used during the search is determined by the search angular range algorithm.

(summarize)
Collapse 0.1 <= Value <= 180.0

Specifies the explicit angle increment/decrement, in degrees.

Collapse M_STRING_SIZE_MAX

Sets the maximum size (number of characters) of the string encoded in the code. INQ

(summarize)
Collapse M_DEFAULT

Same as M_ANY.

Collapse M_ANY

Specifies that there is no maximum string size.

Collapse 1 <= Value <= 65535

Specifies the maximum string size.

For a M_POSTNET code, the value must be either 5, 9, or 11.

For a M_PLANET code, the value must be 11 or 13.

For a M_CODABAR code, the value must be at least 3.

(summarize)
Collapse M_STRING_SIZE_MIN

Sets the minimum size (number of characters) of the string encoded in the code. INQ

(summarize)
Collapse M_DEFAULT

Same as M_ANY.

Collapse M_ANY

Specifies that there is no minimum string size.

Collapse 1 <= Value <= 65535

Specifies the minimum string size.

For a M_POSTNET code, the value must be either 5, 9, or 11.

For a M_PLANET code, the value must be 11 or 13.

For a M_CODABAR code, the value must be at least 3.

(summarize)
Collapse M_SUB_TYPE

Sets the particular code sub-types for which to search. Enabling fewer sub-types will help increase the speed of the operation.

Some versions of GS1 Databar codes only differ by their bar height and not their structure. In these cases, the operation is successful even if only one of the sub-types is enabled. For example, GS1 Databar Omni and GS1 Databar Truncated can be decoded if either M_GS1_DATABAR_OMNI or M_GS1_DATABAR_TRUNCATED is enabled.

The sub-types are additive. If you set the sub-type to M_UPC_A + M_GS1_DATABAR_OMNI, you can search for UPC A and GS1 Databar codes. If you enabled sub-types previously, they are no longer enabled. INQ

(summarize)
Collapse M_DEFAULT

Same as M_ANY.

Collapse M_ANY

Specifies to search for all of the code sub-types that can be specified for M_SUB_TYPE.

M_COMPOSITECODE and M_GS1_DATABAR are the only code types that support this setting.

(summarize)
Collapse M_EAN8

Specifies that the EAN 8 code sub-type is enabled.

M_COMPOSITECODE is the only code type that supports this setting.

(summarize)
Collapse M_EAN13

Specifies that the EAN 13 code sub-type is enabled.

M_COMPOSITECODE is the only code type that supports this setting.

(summarize)
Collapse M_GS1_128

Specifies that the GS1-128 code sub-type is enabled.

M_COMPOSITECODE is the only code type that supports this setting.

(summarize)
Collapse M_GS1_DATABAR_EXPANDED

Specifies that the GS1 Databar Expanded code sub-type is enabled.

M_COMPOSITECODE and M_GS1_DATABAR are the only code types that support this setting.

(summarize)
Collapse M_GS1_DATABAR_EXPANDED_STACKED

Specifies that the GS1 Databar Expanded Stacked code sub-type is enabled.

M_COMPOSITECODE and M_GS1_DATABAR are the only code types that support this setting.

(summarize)
Collapse M_GS1_DATABAR_LIMITED

Specifies that the GS1 Databar Limited code sub-type is enabled.

M_COMPOSITECODE and M_GS1_DATABAR are the only code types that support this setting.

(summarize)
Collapse M_GS1_DATABAR_OMNI

Specifies that the GS1 Databar omni code sub-type is enabled.

M_COMPOSITECODE and M_GS1_DATABAR are the only code types that support this setting.

(summarize)
Collapse M_GS1_DATABAR_STACKED

Specifies that the GS1 Databar Stacked code sub-type is enabled.

M_COMPOSITECODE and M_GS1_DATABAR are the only code types that support this setting.

(summarize)
Collapse M_GS1_DATABAR_STACKED_OMNI

Specifies that the GS1 Databar Stacked Omni code sub-type is enabled.

M_COMPOSITECODE and M_GS1_DATABAR are the only code types that support this setting.

(summarize)
Collapse M_GS1_DATABAR_TRUNCATED

Specifies that the GS1 Databar Truncated code sub-type is enabled.

M_COMPOSITECODE and M_GS1_DATABAR are the only code types that support this setting.

(summarize)
Collapse M_UPC_A

Specifies that the UPC-A code sub-type is enabled.

M_COMPOSITECODE is the only code type that supports this setting.

(summarize)
Collapse M_UPC_E

Specifies that the UPC-E code sub-type is enabled.

M_COMPOSITECODE is the only code type that supports this setting.

(summarize)
Collapse M_USE_PRESEARCH

Sets whether the localization operation is performed prior to the decoding step of an operation.

Note that, when reading multiple occurrences of Data Matrix codes, the setting of this control type is ignored.

This control type is only available for 2D code types. INQ

(summarize)
Collapse M_DEFAULT

Same as M_DISABLE.

Collapse M_DISABLE

Specifies that the operation is not performed.

Collapse M_FINDER_PATTERN_BASE

Specifies that the localization operation is only performed on the base pattern of the Data Matrix code (an "L" starting at the top-most left corner, and ending on the bottom-most right corner of the code). This localization operation is more robust than an M_STAT_BASE localization operation. Note that if the surrounding image is very complex, better results might be obtained by setting M_FINDER_PATTERN_EXHAUSTIVE_SEARCH to M_ENABLE.

M_DATAMATRIX is the only code type that supports this setting.

(summarize)
Collapse M_STAT_BASE

Specifies to localize the code within the image with the statistical characteristics of a 2D bar code (for example, local variance and the presence of a lot of edges). This localization operation is performed faster than an M_FINDER_PATTERN_BASE localization operation.

(summarize)

The following ControlType and corresponding ControlValue parameter settings can be specified for a code model to control McodeRead(), McodeGrade() and McodeWrite() operations. If you pass a code context to the ContextOrResultCodeId parameter, the specified control type setting is applied to all the code models in the context. If none of the code models support the specified control type, an error occurs. If only some code models do not support the specified control type, the control type setting is ignored for these code models.

function map Code model settings for McodeRead(), McodeGrade(), and McodeWrite() operations
CollapseControlType Description
ControlValue
Collapse M_CELL_NUMBER_X

Sets the number of cells of a 2D code in the X-direction. Note that setting the number of cells in both the X- and Y-direction, increases the robustness of the operation.

Note that McodeControl() generates an error if you set both a range of cells for which to search (using M_CELL_NUMBER_X_MAX, M_CELL_NUMBER_X_MIN, M_CELL_NUMBER_Y_MAX, and/or M_CELL_NUMBER_Y_MIN) and an explicit number of cells for which to search (using M_CELL_NUMBER_X and/or M_CELL_NUMBER_Y).

This control type is only used for 2D code types (for example, M_DATAMATRIX, M_PDF417, and M_TRUNCATED_PDF417 code types), not for bar codes. The number of cells is not required for Maxicode because it is a fixed size. INQ

(summarize)
Collapse M_DEFAULT

Same as M_ANY.

Collapse M_ANY

Specifies to search for a code with any number of cells, when performing an McodeRead() or McodeGrade() operation.

Fits the string to be encoded into the smallest possible number of cells, when performing an McodeWrite() operation.

(summarize)
Collapse Value > 0

Specifies the number of cells. This can be any integer value. Note that for the PDF417 code type, the value that you pass must be equal to 17c + 35, where c is the required number of columns, and 35 represents the number of cells required for the start and stop characters.

For the Truncated PDF417 code type, the value that you pass must be equal to 17c + 18, where c is the required number of columns, and 18 represents the number of cells required for the start and stop characters.

For the MicroPDF417 code type, this setting should be set to 38 for a one-column code, 55 for a two-column code, 82 for a three-column code, and 99 for a four-column code.

(summarize)
Collapse M_CELL_NUMBER_Y

Sets the number of cells of a 2D code in the Y-direction. Note that setting the number of cells in both the X- and Y-direction, increases the robustness of the operation.

Note that McodeControl() generates an error if you set both a range of cells for which to search (using M_CELL_NUMBER_X_MAX, M_CELL_NUMBER_X_MIN, M_CELL_NUMBER_Y_MAX, and/or M_CELL_NUMBER_Y_MIN) and an explicit number of cells for which to search (using M_CELL_NUMBER_X and/or M_CELL_NUMBER_Y).

When used with M_PDF417, M_TRUNCATED_PDF417, and M_MICROPDF417, this represents the number of rows. INQ

(summarize)
Collapse M_DEFAULT

Same as M_ANY.

Collapse M_ANY

Specifies to search for a code with any number of cells, when performing an McodeRead() or McodeGrade() operation.

Fits the string to be encoded into the smallest possible number of cells, when performing an McodeWrite() operation.

(summarize)
Collapse Value > 0

Specifies the number of cells. For exact values, refer to the standard documentation of the code used.

For the PDF417 and the Truncated PDF417 code types, the value of this setting is used when calculating the M_CELL_NUMBER_X.

For the MicroPDF417 code type, this setting should be a value between 1 and 4.

(summarize)
Collapse M_CELL_SIZE_INPUT_UNITS

Sets the units with which to interpret the M_CELL_SIZE_MAX and M_CELL_SIZE_MIN control types. This essentially sets the input coordinate system to use. INQ

(summarize)
Collapse M_DEFAULT

Same as M_PIXEL.

Collapse M_PIXEL

Specifies to interpret the values in pixel units, with respect to the pixel coordinate system.

Collapse M_WORLD

Specifies to interpret the values in world units, with respect to the relative coordinate system. If world units are specified, calling McodeRead(), McodeGrade(), or McodeWrite() generates an error if the operation is not performed on a calibrated image.

(summarize)
Collapse M_CELL_SIZE_MAX

Sets the maximum cell size. Note that setting the maximum and minimum cell size increases both the speed and robustness of the operation. INQ

(summarize)
Collapse M_DEFAULT

Specifies to select an appropriate size, automatically.

Collapse Value

Specifies the maximum cell size, relative to the input coordinate system specified using M_CELL_SIZE_INPUT_UNITS.

When entering a value in pixel units, this value must be between 1 and 256, inclusive.

When entering a value in world units, the number that results from the internal transformation of world units to pixel units must still respect the value's pixel unit constraint. To find the range of allowed values in world units, according to your associated calibration, use McalTransformResult().

(summarize)
Collapse M_CELL_SIZE_MIN

Sets the minimum cell size. Note that setting the maximum and minimum cell size increases both the speed and robustness of the operation. INQ

(summarize)
Collapse M_DEFAULT

Specifies the default cell size, in pixels. Setting the default ignores the input unit type chosen with M_CELL_SIZE_INPUT_UNITS.

The default depends on the operation and the code type. For a read operation, M_DEFAULT is equivalent to 1, except for Aztec, Data Matrix, and QR Codes (which have a default of 3).

If you are using McodeWrite() with M_NULL to inquire about the minimum buffer size required, M_DEFAULT is equivalent to either 10 for a Maxicode code type, or 4 for all other codes types.

If you are using McodeWrite() and specify a buffer, M_DEFAULT causes the code to be resized so as to just fit into the target image of the operation.

(summarize)
Collapse Value

Specifies the minimum cell size, relative to the input coordinate system specified using M_CELL_SIZE_INPUT_UNITS.

When entering a value in pixel units, this value must be between 1 and 256, inclusive.

When entering a value in world units, the number that results from the internal transformation of world units to pixel units must still respect the value's pixel unit constraint. To find the range of allowed values in world units, according to your associated calibration, use McalTransformResult().

(summarize)
Collapse M_ENCODING

Sets the type of encoding scheme. INQ

(summarize)
Collapse M_DEFAULT

Specifies to use the default encoding scheme for the code type. The following table lists the default encoding scheme:

4-state

M_ENC_US_MAIL

Aztec

M_ENC_AZTEC_FULL_RANGE

BC412

M_ENC_STANDARD

Codabar

M_ENC_STANDARD

Code39

M_ENC_STANDARD

Code93

M_ENC_ASCII

Code128

M_ENC_ASCII

Composite

M_ENC_GS1_DATABAR_OMNI

Data Matrix

M_ANY

Ean8

M_ENC_NUM

Ean13

M_ENC_NUM

Ean14

M_ENC_ASCII

GS1 128

M_ENC_ASCII

GS1 Databar

M_ENC_GS1_DATABAR_OMNI

Industrial 2/5

M_ENC_NUM

Interleaved2/5

M_ENC_NUM

Maxicode

M_ANY

MicroPDF417

M_ENC_STANDARD

Micro QR

M_ENC_STANDARD

PDF417

M_ENC_STANDARD

Pharmacode

M_ENC_NUM

Planet

M_ENC_NUM

Postnet

M_ENC_NUM

QR

M_ANY

Truncated PDF

M_ENC_STANDARD

UPC-A

M_ENC_NUM

UPC-E

M_ENC_NUM

(summarize)
Collapse M_ANY

Specifies any type of encoding scheme.

With M_AZTEC and M_QRCODE are the code types that can use this encoding scheme for write operations.

M_AZTEC, M_DATAMATRIX, M_MAXICODE, and M_QRCODE are the code types that can use this encoding scheme for read and grading operations.

(summarize)
Collapse M_ENC_ALPHA

Specifies an encoding scheme that supports uppercase alphabetical characters, along with the space.

M_DATAMATRIX is the code type that can use this encoding scheme.

(summarize)
Collapse M_ENC_ALPHANUM

Specifies an encoding scheme that supports alphanumeric characters, as well as the space.

M_DATAMATRIX is the code types that can use this encoding scheme.

(summarize)
Collapse M_ENC_ALPHANUM_PUNC

Specifies a similar encoding scheme to M_ENC_ALPHANUM, except it also supports the following characters: (,), (-), (/) and (.).

M_DATAMATRIX is the code type that can use this encoding scheme.

(summarize)
Collapse M_ENC_ASCII

Specifies an encoding scheme that supports ASCII characters.

M_DATAMATRIX, M_CODE39, M_CODE93, M_CODE128, and M_EAN14 are the code types that can use this encoding scheme.

(summarize)
Collapse M_ENC_AUSTRALIA_MAIL_C

Specifies an encoding scheme for a 4-state format used with the C encoding table by the Australian Mail service.

M_4_STATE is the code type that can use this encoding scheme.

(summarize)
Collapse M_ENC_AUSTRALIA_MAIL_N

Specifies an encoding scheme for a 4-state format used with the N encoding table by the Australian Mail service.

M_4_STATE is the code type that can use this encoding scheme.

(summarize)
Collapse M_ENC_AUSTRALIA_MAIL_RAW

Specifies an encoding scheme for a 4-state format used by the Australian Mail service.

M_4_STATE is the code type that can use this encoding scheme.

(summarize)
Collapse M_ENC_AZTEC_COMPACT

Specifies an encoding scheme for a compact Aztec code.

M_AZTEC is the code type that can use this encoding scheme.

(summarize)
Collapse M_ENC_AZTEC_FULL_RANGE

Specifies an encoding scheme for a full-range (not compact) Aztec code.

M_AZTEC is the code type that can use this encoding scheme.

(summarize)
Collapse M_ENC_AZTEC_RUNE

Specifies an encoding scheme for an Aztec rune (the smallest version of an Aztec code).

M_AZTEC is the code type that can use this encoding scheme.

(summarize)
Collapse M_ENC_EAN8

Specifies an encoding scheme for a composite code whose 1D portion uses an EAN-8 format and whose 2D portion uses a MicroPDF417 format.

M_COMPOSITECODE is the code type that can use this encoding scheme.

(summarize)
Collapse M_ENC_EAN8_ADDON

Specifies an encoding scheme for a composite code whose 1D portion uses an EAN-8 format and whose 2D portion uses a MicroPDF417 format. When the code is read, the character "|" is used as a separator between the string read from an EAN8 code and the string read from an EAN8 add-on.

M_EAN8 is the code type that can use this encoding scheme.

(summarize)
Collapse M_ENC_EAN13

Specifies an encoding scheme for a composite code whose 1D portion uses an EAN-13 format and whose 2D portion uses a MicroPDF417 format.

M_COMPOSITECODE is the code type that can use this encoding scheme.

(summarize)
Collapse M_ENC_EAN13_ADDON

Specifies an encoding scheme for an EAN-13 format with a supplemental 2 or 5 digit add-on.

M_EAN13 is the code type that can use this encoding scheme.

(summarize)
Collapse M_ENC_GS1_128_MICROPDF417

Specifies an encoding scheme for a composite code whose 1D portion uses a GS1 128 format and whose 2D portion uses a MicroPDF417 format.

M_COMPOSITECODE is the code type that can use this encoding scheme.

(summarize)
Collapse M_ENC_GS1_128_PDF417

Specifies an encoding scheme for a composite code whose 1D portion uses a GS1 128 format and whose 2D portion uses a PDF417 format.

M_COMPOSITECODE is the code type that can use this encoding scheme.

(summarize)
Collapse M_ENC_GS1_DATABAR_EXPANDED

Specifies an encoding scheme that uses a GS1 Databar format.

For a composite code, this encoding scheme specifies that the 1D portion uses a GS1 Databar Expanded format and the 2D portion uses a MicroPDF417 format.

M_COMPOSITECODE and M_GS1_DATABAR are the code types that can use this encoding scheme.

(summarize)
Collapse M_ENC_GS1_DATABAR_EXPANDED_STACKED

Specifies an encoding scheme that uses a GS1 Databar Expanded Stacked format.

For a composite code, this encoding scheme specifies that the 1D portion uses a GS1 Databar Expanded Stacked format and the 2D portion uses a MicroPDF417 format.

M_COMPOSITECODE and M_GS1_DATABAR are the code types that can use this encoding scheme.

(summarize)
Collapse M_ENC_GS1_DATABAR_LIMITED

Specifies an encoding scheme that uses a GS1 Databar Limited format.

For a composite code, this encoding scheme specifies that the 1D portion uses a GS1 Databar Limited format and the 2D portion uses a MicroPDF417 format.

M_COMPOSITECODE and M_GS1_DATABAR are the code types that can use this encoding scheme.

(summarize)
Collapse M_ENC_GS1_DATABAR_OMNI

Specifies an encoding scheme that uses a GS1 Databar format.

For a composite code, this encoding scheme specifies that the 1D portion uses a GS1 Databar format and the 2D portion uses a MicroPDF417 format.

M_COMPOSITECODE and M_GS1_DATABAR are the code types that can use this encoding scheme.

(summarize)
Collapse M_ENC_GS1_DATABAR_STACKED

Specifies an encoding scheme that uses a GS1 Databar Stacked format.

For a composite code, this encoding scheme specifies that the 1D portion uses a GS1 Databar Stacked format and the 2D portion uses a MicroPDF417 format.

M_COMPOSITECODE and M_GS1_DATABAR are the code types that can use this encoding scheme.

(summarize)
Collapse M_ENC_GS1_DATABAR_STACKED_OMNI

Specifies an encoding scheme that uses a GS1 Databar Stacked Omni format.

For a composite code, this encoding scheme specifies that the 1D portion uses a GS1 Databar Stacked Omni format and the 2D portion uses a MicroPDF417 format.

M_COMPOSITECODE and M_GS1_DATABAR are the code types that can use this encoding scheme.

(summarize)
Collapse M_ENC_GS1_DATABAR_TRUNCATED

Specifies an encoding scheme that uses a GS1 Databar Truncated format.

For a composite code, this encoding scheme specifies that the 1D portion uses a GS1 Databar Truncated format and the 2D portion uses a MicroPDF417 format.

M_COMPOSITECODE and M_GS1_DATABAR are the code types that can use this encoding scheme.

(summarize)
Collapse M_ENC_ISO8

Specifies a similar encoding scheme as M_ENC_ASCII, but supports the extended ASCII character set.

M_DATAMATRIX is the code type that can use this encoding scheme.

(summarize)
Collapse M_ENC_KOREA_MAIL

Specifies an encoding scheme for a 4-state format used by the Korean Mail service.

M_4_STATE is the code type that can use this encoding scheme.

(summarize)
Collapse M_ENC_MODE2

Specifies an encoding scheme that requires a Structured Carrier Message. This encoding scheme can be used for a numeric postal code.

M_MAXICODE is the code type that can use this encoding scheme.

(summarize)
Collapse M_ENC_MODE3

Specifies an encoding scheme that requires a Structured Carrier Message. This encoding scheme can be used for an alphanumeric postal code.

M_MAXICODE is the code type that can use this encoding scheme.

(summarize)
Collapse M_ENC_MODE4

Specifies an encoding scheme that requires a Free Format Message.

M_MAXICODE is the code type that can use this encoding scheme.

(summarize)
Collapse M_ENC_MODE5

Specifies an encoding scheme that requires a Free Format Message. This data type has a higher level of error correction than M_ENC_MODE4.

M_MAXICODE is the code type that can use this encoding scheme.

(summarize)
Collapse M_ENC_MODE6

Specifies an encoding scheme that requires a Free Format Message. This encoding scheme indicates that the resulting code is used to program a code reader.

M_MAXICODE is the code type that can use this encoding scheme.

(summarize)
Collapse M_ENC_NUM

Specifies an encoding scheme that only supports numbers.

M_EAN13, M_DATAMATRIX, M_POSTNET, M_PLANET, M_UPC_A, M_UPC_E, M_PHARMACODE, M_EAN8, M_INDUSTRIAL25, and M_INTERLEAVED25 are the code types that can use this encoding scheme. If the code type is M_DATAMATRIX, spaces are also allowed.

(summarize)
Collapse M_ENC_QRCODE_MODEL1

Specifies an encoding scheme that uses an older version of the QR code format.

M_QRCODE is the code type that can use this encoding scheme.

(summarize)
Collapse M_ENC_QRCODE_MODEL2

Specifies an encoding scheme that uses a newer version of the QR code format. This version can handle more data and is more robust than model 1.

M_QRCODE is the code type that can use this encoding scheme.

(summarize)
Collapse M_ENC_STANDARD

Specifies different types of encoding schemes, depending on what code type is used.

If M_CODE39 or M_CODE93 is the code type, M_ENC_STANDARD supports the alphabet (capital letters), digits 0 - 9, and the (-), space, ($), (/), (+), (.), (%) characters.

If M_BC412 is the code type, M_ENC_STANDARD supports numbers and the alphabet (capital letters), except for the letter O.

If M_PDF417, M_TRUNCATED_PDF417, or M_MICROPDF417 is the code type, M_ENC_STANDARD supports ASCII and extended ASCII characters.

If M_CODABAR is the code type, M_ENC_STANDARD supports digits 0 - 9, the (-), ($), (:), (/), (.), and (+) characters, and the a, b, c, and d characters. It uses the latter four characters as start and stop characters.

(summarize)
Collapse M_ENC_UK_MAIL

Specifies an encoding scheme for a 4-state format used by the UK Mail service.

M_4_STATE is the code type that can use this encoding scheme.

(summarize)
Collapse M_ENC_UPCA

Specifies an encoding scheme for a composite code whose 1D portion uses an UPC-A format and whose 2D portion uses a MicroPDF417 format.

M_COMPOSITECODE is the code type that can use this encoding scheme.

(summarize)
Collapse M_ENC_UPCA_ADDON

Specifies an encoding scheme for an UPC-A format with a supplemental 2 or 5 digit add-on.

M_UPC_A is the code type that can use this encoding scheme.

(summarize)
Collapse M_ENC_UPCE

Specifies an encoding scheme for a composite code whose 1D portion uses an UPC-E format and whose 2D portion uses a MicroPDF417 format.

M_COMPOSITECODE is the code type that can use this encoding scheme.

(summarize)
Collapse M_ENC_UPCE_ADDON

Specifies an encoding scheme for an UPC_E format with a supplemental 2 or 5 digit add-on.

M_UPC_E is the code type that can use this encoding scheme.

(summarize)
Collapse M_ENC_US_MAIL

Specifies an encoding scheme for a 4-state format used by the US Mail service.

M_4_STATE is the code type that can use this encoding scheme.

(summarize)
Collapse 5 <= Value <= 95

Specifies the minimum amount of the symbol that contains error correction information, as a percentage.

M_4_STATE is the code type that can use this encoding scheme.

(summarize)
Collapse M_ERROR_CORRECTION

Sets the type of error correction.

Note that if the size of a M_MICROQRCODE code is the smallest possible size, 11x11 (M1 version), M_ERROR_CORRECTION must be set to either M_ANY or M_DEFAULT when performing McodeRead() or McodeGrade() operations.

(summarize)
Collapse M_DEFAULT

Specifies to use the default error correction scheme for the code type. The following table lists the default error correction scheme:

4-state

M_ECC_4STATE

Aztec

M_ANY

BC412

M_ECC_NONE

Codabar

M_ECC_NONE

Code39

M_ECC_NONE

Code93

M_ECC_CHECK_DIGIT

Code128

M_ECC_CHECK_DIGIT

Composite

M_ECC_COMPOSITE

Data Matrix

M_ANY

Ean8

M_ECC_CHECK_DIGIT

Ean13

M_ECC_CHECK_DIGIT

GS1 Databar

M_ECC_CHECK_DIGIT

Industrial 2/5

M_ECC_NONE

Interleaved 2/5

M_ECC_NONE

Maxicode

M_ECC_REED_SOLOMON

MicroPDF417

M_ECC_REED_SOLOMON

Micro QR

M_ANY

PDF417

M_ANY

Pharmacode

M_ECC_NONE

Planet

M_ECC_CHECK_DIGIT

Postnet

M_ECC_CHECK_DIGIT

QR

M_ANY

Truncated PDF417

M_ANY

UPC-A

M_ECC_CHECK_DIGIT

UPC-E

M_ECC_CHECK_DIGIT

(summarize)
Collapse M_ANY

Specifies that the error correction type for read and grading operations is detected automatically. This error correction scheme is only supported for write operations (McodeWrite()) when dealing with M_AZTEC, M_PDF417, M_QRCODE, M_MICROQRCODE, or M_TRUNCATED_PDF417.

When dealing with M_AZTEC, this value specifies that error correction will make up 23% of the symbol.

M_AZTEC, M_DATAMATRIX, M_PDF417, M_TRUNCATED_PDF417, M_MICROQRCODE, and M_QRCODE are the code types that can use this error correction scheme.

(summarize)
Collapse M_ECC_4STATE

Specifies to use the Reed Solomon-based algorithm or a check digit type of error correction scheme, depending on the specification of the encoding.

M_4_STATE is the code type that can use this error correction scheme.

(summarize)
Collapse M_ECC_200

Specifies to use a Reed Solomon-based algorithm as an error correction scheme.

M_DATAMATRIX is the code type that can use this error correction scheme.

(summarize)
Collapse M_ECC_CHECK_DIGIT

Specifies to use an additional digit to check whether there is an error or not. There is error detection but not correction.

M_4_STATE M_BC412, M_EAN13, M_CODE39, M_CODE93, M_POSTNET, M_PLANET, M_UPC_A, M_UPC_E, M_INDUSTRIAL25, M_INTERLEAVED25, M_GS1_DATABAR, M_EAN8 and M_CODE128 are the code types that can use this error correction scheme.

(summarize)
Collapse M_ECC_COMPOSITE

Specifies to use the default error correction scheme for the 1D and 2D portions of the composite code.

M_COMPOSITECODE is the code type that can use this error correction scheme.

(summarize)
Collapse M_ECC_H

Specifies to use the highest-level error correction scheme.

M_QRCODE is the code type that can use this error correction scheme.

(summarize)
Collapse M_ECC_L

Specifies to use the lowest-level error correction scheme.

M_QRCODE and M_MICROQRCODE are the code types that can use this error correction scheme.

(summarize)
Collapse M_ECC_M

Specifies to use a medium-low level error correction scheme.

M_QRCODE and M_MICROQRCODE are the code types that can use this error correction scheme.

(summarize)
Collapse M_ECC_n

Specifies an error correction algorithm that uses convolution coding. The value of n must be a multiple of 10, between 010 and 140, excluding 20 and 30; n must be represented by three digits.

M_DATAMATRIX is the code type that can use this error correction scheme. If M_DATAMATRIX_SHAPE is set to M_RECTANGLE, the code must use M_ECC_200 error correction scheme instead of this one.

(summarize)
Collapse M_ECC_NONE

Specifies no error correction.

M_DATAMATRIX, M_CODE39, M_INDUSTRIAL25, M_INTERLEAVED25, M_CODABAR, M_PHARMACODE, and M_BC412 are the code types that can use this error correction scheme.

(summarize)
Collapse M_ECC_Q

Specifies to use a medium-high level error correction scheme.

M_QRCODE and M_MICROQRCODE are the code types that can use this error correction scheme.

(summarize)
Collapse M_ECC_REED_SOLOMON

Specifies to use a Reed Solomon type of error correction scheme.

M_MAXICODE and M_MICROPDF417 are the code types that can use this error correction scheme.

(summarize)
Collapse M_ECC_REED_SOLOMON_n

Specifies to use a Reed Solomon type of error correction scheme. n is an integer from 0 to 8. The higher the number, the higher the level of error correction.

M_PDF417 and M_TRUNCATED_PDF417 are the code types that can use this error correction scheme.

(summarize)
Collapse 5 <= Value <= 95

Specifies the minimum percentage of the symbol that contains error correction information.

M_AZTEC is the only the code type that can use this error correction scheme.

(summarize)
Collapse M_FOREGROUND_VALUE

Sets the foreground color of the code. INQ

(summarize)
Collapse M_DEFAULT

Same as M_FOREGROUND_BLACK.

Collapse M_FOREGROUND_ANY

Specifies the foreground color as black or white. This value is available only for 1D code types (excluding Planet, Postnet, and Pharmacode), Aztec, QR code, MicroPDF417, and MicroQrCode. Note that using this value will impact the performance of read and grading operations and should be used only when the foreground can change or cannot be known beforehand. When used for write operations, the default color (M_FOREGROUND_BLACK) is used.

(summarize)
Collapse M_FOREGROUND_BLACK

Specifies that the foreground color is black.

Collapse M_FOREGROUND_WHITE

Specifies that the foreground color is white.

The following ControlType and corresponding ControlValue parameter settings can be specified for a code result buffer.

function map For a result buffer
CollapseControlType Description
ControlValue
Collapse M_RESULT_OUTPUT_UNITS

Sets whether to return results in pixels or world units. This essentially sets the output coordinate system to use. The setting of this control type will only affect functions within this module which return positional results. This control type can be changed at any time to return results in the required output units. INQ

(summarize)
Collapse M_DEFAULT

Same as M_ACCORDING_TO_CALIBRATION.

Collapse M_ACCORDING_TO_CALIBRATION

Specifies that results are returned in world units if the result was calculated on an image associated with a calibration context; otherwise, specifies that results are returned in pixel units.

Collapse M_PIXEL

Specifies that results are returned in pixel units, with respect to the pixel coordinate system.

Collapse M_WORLD

Specifies that results are returned in world units, with respect to the relative coordinate system. If world units are specified, calling McodeGetResult() or McodeGetResultSingle() generates an error if the result was not calculated on a calibrated image.

(summarize)
Collapse M_STRING_FORMAT

Sets the format in which to return the string, retrieved using McodeGetResult() with M_STRING. INQ

(summarize)
Collapse M_DEFAULT

Same as M_AUTO_FORMAT.

Collapse M_AUTO_FORMAT

Specifies that the returned string is in the string format associated with the code type.

Collapse M_GS1_HUMAN_READABLE

Specifies that the returned string is in a format that is human-readable. Note that this is the default format for both a M_EAN14 and M_GS1_128 code type.

This format is only available when reading the following code types: M_CODE128, M_EAN14, M_GS1_128, M_GS1_DATABAR, M_COMPOSITECODE, M_AZTEC, M_QRCODE, and M_DATAMATRIX.

(summarize)
Collapse M_GS1_RAW_DATA

Specifies that the returned string is in a raw data format. This format will have the FNC1 separator at the beginning of the string (represented by the è character) and the group separators (GS) will be included in the string (represented by the ascii=29 character or \x1D) when it is present in the bar code (for example, è01034531200000111708050810ABCD1234\x1D4109501101020917).

This format is only available when reading the following code types: M_CODE128, M_EAN14, M_GS1_128, M_GS1_DATABAR, M_COMPOSITECODE, M_AZTEC, M_QRCODE, and M_DATAMATRIX.

(summarize)
Collapse M_JAPANESE
[This is only applicable to Windows]

Specifies that the returned string uses Japanese (Windows-932) encoding.

This format is only available when reading the following code types: M_AZTEC, M_PDF417, M_MICROPDF417, M_TRUNCATED_PDF417, M_QRCODE, M_MICROQRCODE, and M_DATAMATRIX.

This format is not available with Windows Embedded Compact.

(summarize)
Collapse M_KOREAN
[This is only applicable to Windows]

Specifies that the returned string uses Korean (Windows-949) encoding.

This format is only available when reading the following code types: M_AZTEC, M_PDF417, M_MICROPDF417, M_TRUNCATED_PDF417, M_QRCODE, M_MICROQRCODE, and M_DATAMATRIX.

This format is not available with Windows Embedded Compact.

(summarize)
Collapse M_LATIN
[This is only applicable to Windows]

Specifies that the returned string uses Latin (Windows-1252) encoding.

This format is only available when reading the following code types: M_AZTEC, M_PDF417, M_MICROPDF417, M_TRUNCATED_PDF417, M_QRCODE, M_MICROQRCODE, and M_DATAMATRIX.

This format is not available with Windows Embedded Compact.

(summarize)
Collapse M_SIMPLIFIED_CHINESE
[This is only applicable to Windows]

Specifies that the returned string uses Simplified Chinese (Windows-936) encoding.

This format is only available when reading the following code types: M_AZTEC, M_PDF417, M_MICROPDF417, M_TRUNCATED_PDF417, M_QRCODE, M_MICROQRCODE, and M_DATAMATRIX.

This format is not available with Windows Embedded Compact.

(summarize)
Collapse M_UPCE_COMPRESSED

Specifies that the returned string is in the UPCE compressed string format. Note that this is only available when reading a M_UPC_E code. Otherwise, an error will occur.

(summarize)
Type-specific versions of the function
void McodeControlInt64 (MIL_ID ContextOrResultCodeId, MIL_INT64 ControlType, MIL_INT64 ControlValue)
Parameters

ContextOrResultCodeId

See ContextOrResultCodeId 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.

Compilation information
Header Include mil.h.
Library Use mil.lib; milcode.lib.
DLL Requires mil.dll; milcode.dll.
STOP READ DEFAULT TOTAL NUMBER DEFAULT ALL ABSOLUTE APERTURE SIZE DEFAULT ABSOLUTE APERTURE SIZE INPUT UNITS DEFAULT PIXEL WORLD AIMDPM CALIBRATION RESULTS APERTURE MODE DEFAULT ABSOLUTE DISABLE RELATIVE EXTENDED AREA REFLECTANCE CHECK DEFAULT DISABLE ENABLE GRADING STANDARD AIMDPM GRADING ISO GRADING INSPECTION BAND RATIO DEFAULT MAXIMUM CALIBRATED REFLECTANCE DEFAULT MEAN LIGHT CALIBRATION DEFAULT MINIMUM CALIBRATED REFLECTANCE DEFAULT NUMBER OF SCANLINES DEFAULT ALL PIXEL SIZE IN MM DEFAULT UNKNOWN REFLECTANCE CALIBRATION DEFAULT RELATIVE APERTURE FACTOR DEFAULT AUTO SYSTEM RESPONSE CALIBRATION DEFAULT SYSTEM RESPONSE TARGET DEFAULT MINIMUM CONTRAST DEFAULT SCANLINE HEIGHT DEFAULT SCANLINE INPUT UNITS DEFAULT PIXEL WORLD SCANLINE STEP DEFAULT SEARCH ANGLE MODE DEFAULT DISABLE ENABLE SPEED DEFAULT HIGH LOW MEDIUM VERY HIGH VERY LOW THRESHOLD MODE DEFAULT ADAPTIVE GLOBAL SEGMENTATION GLOBAL WITH LOCAL RESEGMENTATION THRESHOLD VALUE DEFAULT AUTO COMPUTE TIMEOUT DEFAULT DISABLE CHECK QUIET ZONE DEFAULT DISABLE ENABLE ECC CORRECTED NUMBER DEFAULT DISABLE ENABLE NUMBER DEFAULT ALL POSITION ACCURACY DEFAULT HIGH LOW BEARER BAR DEFAULT ABSENT PRESENT CELL NUMBER X MAX DEFAULT ANY CELL NUMBER X MIN DEFAULT ANY CELL NUMBER Y MAX DEFAULT ANY CELL NUMBER Y MIN DEFAULT ANY CHECK FINDER PATTERN DEFAULT DISABLE ENABLE CODE FLIP DEFAULT ANY FLIP NO FLIP DATAMATRIX SHAPE DEFAULT ANY RECTANGLE SQUARE DISTORTION DEFAULT NONE PERSPECTIVE UNEVEN GRID STEP UNEVEN GRID STEP DOT SPACING DEFAULT DOT SPACING INPUT UNITS DEFAULT PIXEL WORLD FINDER PATTERN EXHAUSTIVE SEARCH DEFAULT DISABLE ENABLE FINDER PATTERN INPUT UNITS DEFAULT PIXEL WORLD FINDER PATTERN MAX GAP DEFAULT AUTO FINDER PATTERN MINIMUM LENGTH DEFAULT AUTO SEARCH ANGLE DEFAULT ACCORDING TO REGION SEARCH ANGLE DELTA NEG DEFAULT SEARCH ANGLE DELTA POS DEFAULT SEARCH ANGLE INPUT UNITS DEFAULT PIXEL WORLD SEARCH ANGLE STEP DEFAULT DISABLE STRING SIZE MAX DEFAULT ANY STRING SIZE MIN DEFAULT ANY SUB TYPE DEFAULT ANY EAN8 EAN13 GS1 128 GS1 DATABAR EXPANDED GS1 DATABAR EXPANDED STACKED GS1 DATABAR LIMITED GS1 DATABAR OMNI GS1 DATABAR STACKED GS1 DATABAR STACKED OMNI GS1 DATABAR TRUNCATED UPC A UPC E USE PRESEARCH DEFAULT DISABLE FINDER PATTERN BASE STAT BASE CELL NUMBER X DEFAULT ANY CELL NUMBER Y DEFAULT ANY CELL SIZE INPUT UNITS DEFAULT PIXEL WORLD CELL SIZE MAX DEFAULT CELL SIZE MIN DEFAULT ENCODING DEFAULT ANY ENC ALPHA ENC ALPHANUM ENC ALPHANUM PUNC ENC ASCII ENC AUSTRALIA MAIL C ENC AUSTRALIA MAIL N ENC AUSTRALIA MAIL RAW ENC AZTEC COMPACT ENC AZTEC FULL RANGE ENC AZTEC RUNE ENC EAN8 ENC EAN8 ADDON ENC EAN13 ENC EAN13 ADDON ENC GS1 128 MICROPDF417 ENC GS1 128 PDF417 ENC GS1 DATABAR EXPANDED ENC GS1 DATABAR EXPANDED STACKED ENC GS1 DATABAR LIMITED ENC GS1 DATABAR OMNI ENC GS1 DATABAR STACKED ENC GS1 DATABAR STACKED OMNI ENC GS1 DATABAR TRUNCATED ENC ISO8 ENC KOREA MAIL ENC MODE2 ENC MODE3 ENC MODE4 ENC MODE5 ENC MODE6 ENC NUM ENC QRCODE MODEL1 ENC QRCODE MODEL2 ENC STANDARD ENC UK MAIL ENC UPCA ENC UPCA ADDON ENC UPCE ENC UPCE ADDON ENC US MAIL ERROR CORRECTION DEFAULT ANY ECC 4STATE ECC 200 ECC CHECK DIGIT ECC COMPOSITE ECC H ECC L ECC M ECC n ECC NONE ECC Q ECC REED SOLOMON ECC REED SOLOMON n FOREGROUND VALUE DEFAULT FOREGROUND ANY FOREGROUND BLACK FOREGROUND WHITE RESULT OUTPUT UNITS DEFAULT ACCORDING TO CALIBRATION PIXEL WORLD STRING FORMAT DEFAULT AUTO FORMAT GS1 HUMAN READABLE GS1 RAW DATA JAPANESE KOREAN LATIN SIMPLIFIED CHINESE UPCE COMPRESSED