ConvColorDIBtoGrayscale

#include "BIDIB.H"

 

int CALLBACK ConvColorDIBtoGrayscale( HANDLE   hDIB1,
UINT          nMethode,
BOOL        bPsychovisual)

Description

This function converts a DIB to grayscale. If the input DIB is 1 bit/pixel format, the resampling method can be chosen by caller. The more effective antialiasing filtering (nMethode = 1 or 2) works with slower speed of execution.

The output is 4 bits/pixel format, if the input has 4 bits/pixel, and 8 bits/pixel in other cases.

Parameters

HANDLE

hDIB1

Handle of the DIB to convert.

UINT

nMethode

If the input DIB is 1 bit per pixel format, this parameter is specifies the antialiasing method.

0 - no antialiasing

1 - antialiasing with 3x3 resampling area

2 - antialiasing with 5x5 resampling area

BOOL

bPsychovisual

TRUE:   the resulted (gray) pixel value is the weighted sum of 'red', 'green' and 'blue' components.

FALSE:  the resulted (gray) pixel value is the simple average of colour components.

Return values

Handle of output grayscale DIB, NULL on error.

Requirements

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

Library :    Use BiDIB.lib.

DLLs :       BiDIB.dll.