ArithmeticDIBConst

#include "BIFILTER.H"

 

HDIB CALLBACK ArithmeticDIBConst( OPERATION  oper,
HDIB               hSrcDIB,
WORD             wConst
int                     iShowProgress
HWND             hParent)

Description

This function makes an arithmetic operation on a device independent bitmap and a constant value. The result is put to a newly created DIB and the source DIB is unmodified. It works with 1, 4, 8 or 24 bits/pixel. In case of 24 bits/pixel, the arithmetic 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.

Parameters

OPERATION

oper

Specify the operation. (See below)

HDIB

hSrcDIB

Source DIB

WORD

wConst

Second argument of the operation

int

iShowProgress

This parameter specifies the progressbar and the preview dialog displaying.

Available values:

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

DISPLAY_PROGRESS (1) - The progressbar will display during red eye removal procedure.

DISPAY_DIALOG (2)   -     The preview dialog will display before removing red eye. This dialog shows the part of the selected area of the image before and after the conversion.

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

IMPORTANT: The preview dialog only displays if BiDlgs.dll is installed.

HWND

hParent

Handler of the parent window.

 

Possible values of the oper parameter:

 

0                              OPER_ADD                  PixelResult = PixelSource         +              wConst

1                              OPER_SUB                   PixelResult = PixelSource         -               wConst

2                              OPER_MUL                 PixelResult = PixelSource         *              wConst

3                              OPER_DIV                   PixelResult = PixelSource         /               wConst

4                              OPER_AND                  PixelResult = PixelSource         &             wConst

5                              OPER_NAND               PixelResult = ~(PixelSource      &             wConst)

6                              OPER_OR                     PixelResult = PixelSource         |               wConst

7                              OPER_NOR                  PixelResult = ~(PixelSource      |               wConst)

8                              OPER_XOR                  PixelResult = PixelSource         ^              wConst

9                              OPER_MIN                  PixelResult = MIN      (PixelSource,         wConst)

10                           OPER_MAX                 PixelResult = MAX    (PixelSource,         wConst)

11                           OPER_EXP                   PixelResult = EXP      (PixelSource)

12                           OPER_LOG                  PixelResult = LOG      (PixelSource)

Return values

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

Programming notes

If the ‘PixelResult’ overflows or underflows, then the maximum or minimum pixel value is used instead of the result. Minimum pixel value is always zero. Maximum pixel values: 1 bits/pixel: 1,   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). The OPER_EXP and OPER_LOG arithmetic operations do not use the wConst parameter.

Requirements

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

Library :    Use BIFilter.lib.

DLLs :       BIFilter.dll.