FilterLevels  Method

Description         This function will will adjust the input image’s histogram by the specified input parameters. Level filtering is a usually nonlinear transformation mapping the original histogram from pixel value InFrom to pixel value InTo. The output histogram can be specified with the lowest and highest output pixel level, and with the pixel value from the original image that will be the middle pixel level in the output image. Pixels out of range iInFrom ... iInTo will be mapped to iOutLow or iOutHigh values. This function works for only 8 bit per bixel and 24 bit per pixel images.

Examples

Description: macska                                          Description: levels

The original 180 x 210 pixel image and the levels filtered image with iInFrom = 0, iInTo = 255, iInMidtone = 46, iOutLow = 0, iOutHigh = 255, Channel = 0 parameter values

Syntax                 RetVal = [BiFilter.]FilterLevels  hDib iInFrom iInTo iInMidtone iOutLow iOutHigh Channel iShowProgress hWnd

Returns               RetVal                    LONGLONG The handle of new filtered DIB, 0 if an error occurred, or -1 if the BIFilter.dll does not installed.

Remarks             hDib                       LONGLONG Handle of the image to filter.

                            iInFrom                  short                The lowest input pixel value of the transformation.

                            iInTo                      short                The highest input pixel value of the transformation.

                            iInMidtone             short                The input pixel value to be mapped to the middle value in the output image.

                            iOutLow                 short                The output histogram’s lowest pixel value.

                            iOutHigh                short                The output histogram’s highest pixel value.

                            Channel                 short                Color channel to be filtered. If the input image is a 8 bit per pixel grayscale image changing of Channel input parameter will have no effect.

Available values:

0-All color channels.

1-Red channel.

2-Green channel.

3-Red channel.

                            iShowProgress       short                This parameter specifies the displaying of the progressbar and the preview dialog.

Available values:

DISPLAY_NONE (0) - The progressbar and the preview dialog will not display before filtering.

DISPLAY_PROGRESS (1) - The progressbar will display during filtering procedure.

DISPLAY_DIALOG (2) - The preview dialog will display before filtering. This dialog shows the part of the image before and after filtering.

DISPLAY_BOTH (3) - The progressbar and the preview dialog will display.

IMPORTANT: The preview dialog will only display, if there is BIDlgs32.dll installed.

                            hWnd                     LONGLONG Handler of the parent window.

See Also