HistDIBSlide

#include "BIFILTER.H"

 

HANDLE CALLBACK HistDIBSlide(                  HANDLE         hSrcDIB,
BYTE        nBegin,
BYTE        nEnd,
WORD      wConst,
int              iShowProgress,
HWND     hParent)

Description

This function highlights a range (nBegin, nEnd) of intensities but preserves all others. It adds ‘wConst’ to pixels if the original pixel value is between ‘nBegin’ and ‘nEnd’. The result is put to a newly created DIB and the source DIB is unmodified. It works with 4, 8 or 24 bits/pixel. In case of 24 bits/pixel, the operation is made separately on the R, G, B channels. In case of 4 or 8 bits/pixel, the source DIB must contain grayscale image and the palette values in the source DIB must be monotone increasing. It makes no sense to use this function in case of 1 bits/pixel.

Parameters

HANDLE

hSrcDIB

Source DIB

BYTE

nBegin

Beginning of the range

BYTE

nEnd

End of the range

WORD

wConst

Quantity of the highlight. (slide)

int

iShowProgress

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 BiDlgs.dll installed.

HWND

hParent

Handler of the parent window.

Return values

Handle of the newly created DIB on success or NULL on failure.

Programming notes

If the result of add (pixelvalue + wConst) overflows, then the maximum pixel value is used instead of the result. Maximum pixel values: 4 bits/pixel: 15,   8 bits/pixel: 255, 24 bits/pixel: 255 for each channel. There are three channels on 24 bits/pixel (R, G, B).

Requirements

Header :    Declared in BIFilter.h; include BIFilter.h.

Library :    Use BIFilter.lib.

DLLs :       BIFilter.dll.