Skip to main content

MimRemap

BoardSupported
Host SystemYes
V4L2Yes
Clarity UHDYes
Concord PoENo
GenTLYes
GevIQYes
GigE VisionYes
IndioNo
Iris GTXYes
Radient eV-CLYes
Rapixo CLYes
Rapixo CoFYes
Rapixo CXPYes
USB3 VisionYes

Remap source pixels to destination pixels according to the specified mode.

Syntax

void MimRemap(
AIL_ID RemapContextImId, //in
AIL_ID SrcImageBufId, //in
AIL_ID DstImageBufId, //out
AIL_INT64 ControlFlag //in
)

Description

This function performs window leveling by linearly remapping source pixels to destination pixels according to the specified mode. By default, Aurora Imaging Library performs remapping calculations using the possible minimum and maximum values of the full value range of the specified destination image buffer. You can also use a custom remap image processing context and specify different values.

When using a custom remap image processing context, you can choose the range of source pixel values that are remapped, using MimControl with M_SRC_START_VALUE and M_SRC_END_VALUE, as well as the range of destination pixel values to which they are remapped using M_DST_START_VALUE and M_DST_END_VALUE.

By default, Aurora Imaging Library determines the remapping for the destination image buffer. However, when not using a remap image processing context, you can specify to remap the values such that the value zero in the source buffer maps to the value zero in the destination buffer with M_CENTERED. Note that saturation can occur when M_CENTERED is specified.

Parameters

RemapContextImId (in, AIL_ID)

Specifies the identifier of a remap image processing context. If a custom remap image processing context is not used, this parameter must be set to M_DEFAULT.

For specifying the remap context identifier

ValueDescription
M_DEFAULTSpecifies a linear remapping from source pixel to corresponding destination pixel.

Note: Note, Aurora Imaging Library performs remapping calculations using the possible minimum and maximum values of the specified destination image buffer. By default, this is the full value range according to the buffer type. To control these values, use MbufControl with M_MIN and M_MAX. For the source image buffer, the minimum and maximum values used for calculations depend on the specified remapping mode (ControlFlag). | | Remap image processing context ID | Specifies the identifier of a remap image processing context, previously allocated using MimAlloc with M_IM_REMAP_CONTEXT. |

SrcImageBufId (in, AIL_ID)

Specifies the identifier of the source image buffer.

DstImageBufId (out, AIL_ID)

Specifies the identifier of the destination image buffer.

ControlFlag (in, AIL_INT64)

Specifies the remapping mode. When using a custom remap image processing context, this parameter must be set to M_DEFAULT.

For specifying the remapping method to perform

ValueDescription
M_DEFAULTSpecifies the default value.

When using the default remap image processing context, the default remapping mode is M_FIT_SRC_RANGE.

When using a custom remap image processing context, this is the only possible setting. Use MimControl with M_SRC_RANGE to specify how the source range is established. | | M_FIT_SRC_DATA | Specifies to remap according to the source data. The true minimum and maximum pixel values will be calculated from the source image buffer using MimFindExtreme. | | M_FIT_SRC_RANGE | Specifies to remap according to the minimum and maximum pixel values specified for the source image buffer (MbufControl with M_MIN and M_MAX). By default, this is the full value range according to the buffer type.

If the source buffer has data below the specified M_MIN or above the specified M_MAX, this data will be mapped to unpredictable values. If the goal is to clip this data to the M_MIN and M_MAX values of the destination buffer, use MimClip with M_OUT_RANGE on the source buffer first to set the data outside the range to the specified source M_MIN and M_MAX values. |

For specifying the remapping centered to zero

ValueDescription
M_CENTEREDSpecifies to center the range to zero.
Copyright © 2026 Zebra Technologies.