COMPAREDATA

Delphi Syntax:

COMPAREDATA= Packed Record
   nMinRange: L_INT;
   nMaxRange: L_INT;
   uFlags: L_UINT;
end;

C++ Builder Syntax:

struct COMPAREDATA
{
   int nMinRange;
   int nMaxRange;
   unsigned uFlags;
};

The COMPAREDATA record (structure) contains the values to be used for thresholding and redistributing the bitmap's color component values for the ColorThreshold method.

Member

Description

nMinRange

Value that represents the minimum boundary used to threshold the specific color.

nMaxRange

Value that represents the maximum boundary used to threshold the specific color.

uFlags

Flag that indicates which pixels will be modified, how the threshold pixel is handled and how rejected pixels are handled. Possible values are:

 

The following flags indicate which pixels will be modified:

 

Value

Meaning

 

CLTH_TYP_BANDPASS

[$00000000] The values falling outside the range are modified.

 

CLTH_TYP_BANDREJECT

[$00000001] The values falling inside the range are modified.

 

The following are the flags that indicate how the threshold pixel is handled:

 

Value

Meaning

 

CLTH_MOD_CHANNEL

[$00000000] Each channel component is modified independently.

 

CLTH_MOD_ALL

[$00000010] The pixel is rejected if any component is rejected.

 

The following are the flags that indicate how the rejected values are handled:

 

Value

Meaning

 

CLTH_VALUE_MIN

[$00000000] The rejected values are set to 0.

 

CLTH_VALUE_MAX

[$00000100] The rejected values are set to the maximum value

 

CLTH_VALUE_CLAMP

[$00000200] The rejected component values less that nMin go to the minimum value in the used color space component and the rejected component values greater than nMax go to the maximum value in the used color space component. This works only with the CLTH_MOD_CHANNEL flag.