Main Page | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members

PLFilterContrast Class Reference

#include <plfiltercontrast.h>

Inheritance diagram for PLFilterContrast:

PLFilter List of all members.

Public Member Functions

 PLFilterContrast (double contrast, PLBYTE offset)
virtual void Apply (PLBmp *pBmpSource, PLBmp *pBmpDest) const

Protected Attributes

double m_contrast
double m_offset

Detailed Description

Enhances or reduces the image contrast using a linear mapping between input and output. The zero point (i. e., the intensity that is neither enhanced nor reduced) has to be provided. (A Contrast filter is defined in the following way: It lowers all intensity values below a given threshold, and it raises them beyond. Most applications position the threshold at 50 . This does not always yield the best results, especially if you have an unbalanced dark/light ratio of pixels. The best you can do here is play around with the threshold.) Works for 24 and 32 bpp bitmaps.

Definition at line 33 of file plfiltercontrast.h.

Constructor & Destructor Documentation

PLFilterContrast::PLFilterContrast double  contrast,
PLBYTE  offset

contrast is the slope of the function. offset is the intensity at which the color stays the same. Above this value, intensities are increased. Below it, they are reduced. With offset 128 and contrast 1, the image stays unchanged.

Member Function Documentation

virtual void PLFilterContrast::Apply PLBmp pBmpSource,
PLBmp pBmpDest
const [virtual]

Applies the Filter to pBmpSource and stores the result in pBmpDest. The base-class version copies the bitmap before calling ApplyInPlace (pBmpDest).

Reimplemented from PLFilter.

The documentation for this class was generated from the following file:
Generated on Sun Jun 6 13:42:22 2004 for paintlib by doxygen 1.3.2