Click here to show toolbars of the Web Online Help System: show toolbars |
MIL_ID SrcImageBufId, | //in |
MIL_ID DstImageBufId, | //in |
MIL_ID ArrayBufIdOrConversionType | //in |
This function performs a color conversion on the source image and places the result in the destination buffer.
If necessary, you can perform a mathematically optimal color-to-grayscale conversion using McolProject() with M_PRINCIPAL_COMPONENT_PROJECTION.
When converting from sRGB (M_SRGB_...), your color data must adhere to standard RGB specifications (sRGB), as defined by the International Electrotechnical Commission (IEC) Project Team 61966-2-1. Conversions to sRGB (M_...SRGB) will also adhere to these standards. If converting from linear sRGB (M_SRGB_LINEAR_...), your color data must not be corrected (gamma corrected). Conversions to linear sRGB (M_...SRGB_LINEAR) will also not be corrected.
Specifies the identifier of the source image buffer.
This image buffer must not have a region of interest (ROI) associated with it. Using an image buffer with an ROI will cause an error.
Source buffer values must typically be positive, including the values in a signed source buffer. For LAB and LCH conversions, the full range of integer buffers is taken into account, including the negative values of signed buffers.
If specifying a floating-point buffer, the values of the buffer must be normalized between 0 and 1 before calling this function.
Specifies the identifier of the destination image buffer.
This image buffer must not have a region of interest (ROI) associated with it. Using an image buffer with an ROI will cause an error.
The values generated will typically be normalized to the possible range of values in the destination buffer. For example, the hue values from 0 to 360° will generate the values from 0 to 255 in an 8-bit destination buffer.
For a floating-point destination buffer, the values generated will typically be normalized between 0 and 1. This normalization does not apply to the MIL array buffer identifier conversion type.
For LAB conversions with a floating-point destination buffer, the L band values fall between 0 and 100 (inclusive), while the A and B band values are unbounded. However for most applications, A and B values fall between -150 and 150 (exclusive). When converting to LAB with an integer destination buffer, A and B values are saturated to fall within -128 and 127 (inclusive). MIL then scales the L, A, and B band values to fall within the range of the destination buffer. The L band is therefore subject to a larger scaling than the two other bands.
For LCH conversions with a floating-point destination buffer, the H band value is an angle, in degrees; otherwise, MIL rescales the angle to fall within the range of the destination buffer. When converting to LCH with an integer destination buffer, MIL clips the C value to the lower value between the maximum allowed in the destination buffer and 255. MIL then rescales the value to fit within the full range of the destination buffer.
Specifies the type of conversion to perform. The conversion can be specified with either a predefined or custom transformation matrix. This parameter can be set to one of the following.
![]() |
|||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Description |
MIL system-specific tooltip (‡) |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
||||||||||||||||
![]() ![]() |
Specifies an HSL to RGB conversion. |
‡ | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | ||||||||||||||||
MIL system specific | |||||||||||||||||||||||||||||||||||||||
Only supports conversion from M_BGR32 packed to M_BGR32 packed buffers. |
‡ | d | |||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies a LAB (CIELAB) to sRGB conversion. |
‡ | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | ||||||||||||||||
![]() ![]() |
Specifies a LAB (CIELAB) to linear sRGB conversion. |
‡ | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | ||||||||||||||||
![]() ![]() |
Specifies an L (luminance) to RGB conversion. |
‡ | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | ||||||||||||||||
MIL system specific | |||||||||||||||||||||||||||||||||||||||
Only supports conversion from M_BGR32 packed to unsigned monochrome 8- or 16-bit buffers. |
‡ | d | |||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies an LCH to sRGB conversion. |
‡ | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | ||||||||||||||||
![]() ![]() |
Specifies an LCH to linear sRGB conversion. |
‡ | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | ||||||||||||||||
![]() ![]() |
Specifies an RGB-to-normalized-RGB conversion. |
‡ | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | ||||||||||||||||
![]() ![]() |
Specifies an RGB to H conversion, where H represents the hue of the HSL color space. |
‡ | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | ||||||||||||||||
MIL system specific | |||||||||||||||||||||||||||||||||||||||
Only supports conversion from M_BGR32 packed to unsigned monochrome 8- or 16-bit buffers. |
‡ | d | |||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies an RGB to HSL (hue, luminance (intensity), and saturation) conversion. |
‡ | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | ||||||||||||||||
MIL system specific | |||||||||||||||||||||||||||||||||||||||
Only supports conversion from M_BGR32 packed to M_BGR32 packed buffers. |
‡ | d | |||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies an RGB to L conversion, where L represents the luminance (intensity) of the HSL color space. |
‡ | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | ||||||||||||||||
MIL system specific | |||||||||||||||||||||||||||||||||||||||
Only supports conversion from M_BGR32 packed to unsigned monochrome 8- or 16-bit buffers. |
‡ | d | |||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies an RGB to Y conversion, where Y represents the luminance of the YUV color space. |
‡ | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | ||||||||||||||||
MIL system specific | |||||||||||||||||||||||||||||||||||||||
Only supports conversion from M_BGR32 packed to unsigned monochrome 8- or 16-bit buffers or from M_BGR32 packed to the first band of M_BGR32 packed buffers. |
‡ | d | |||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies a linear sRGB to LAB (CIELAB) conversion. |
‡ | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | ||||||||||||||||
![]() ![]() |
Specifies a linear sRGB to LCH conversion. |
‡ | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | ||||||||||||||||
![]() ![]() |
Specifies an sRGB to LAB (CIELAB) conversion. |
‡ | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | ||||||||||||||||
![]() ![]() |
Specifies an sRGB to LCH conversion. |
‡ | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | ||||||||||||||||
![]() ![]() |
Specifies a general matrix multiplication transform will be used to modify the source image's color information. |
‡ | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | ||||||||||||||||
MIL system specific | |||||||||||||||||||||||||||||||||||||||
Supports conversion from M_BGR32 packed to unsigned monochrome 8- or 16-bit buffers for 3x1 matrices. Supports conversion from M_BGR32 packed to the first band of M_BGR32 packed buffers for 3x3 matrices. |
‡ | d |
Header | Include mil.h. |
Library | Use mil.lib; milim.lib. |
DLL | Requires mil.dll; milim.dll. |