Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

PLFilterContrast Class Reference

Enhances or reduces the image contrast using a linear mapping between input and output. More...

#include <plfiltercontrast.h>

Inheritance diagram for PLFilterContrast:

Inheritance graph
[legend]
Collaboration diagram for PLFilterContrast:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 PLFilterContrast (double contrast, PLBYTE offset)
 contrast is the slope of the function.
virtual ~PLFilterContrast ()
virtual void Apply (PLBmp *pBmpSource, PLBmp *pBmpDest) const
 Applies the Filter to pBmpSource and stores the result in pBmpDest.

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.

Definition at line 16 of file plfiltercontrast.cpp.

References PLBYTE.

PLFilterContrast::~PLFilterContrast  )  [virtual]
 

Definition at line 23 of file plfiltercontrast.cpp.


Member Function Documentation

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.

Definition at line 28 of file plfiltercontrast.cpp.

References PLBmp::Create(), PLBmp::GetBitsPerPixel(), PLBmp::GetHeight(), PLBmp::GetLineArray(), PLBmp::GetResolution(), PLBmp::GetWidth(), PLBmp::HasAlpha(), m_offset, PLASSERT, and PLBYTE.

Here is the call graph for this function:


Member Data Documentation

double PLFilterContrast::m_contrast [protected]
 

Definition at line 46 of file plfiltercontrast.h.

double PLFilterContrast::m_offset [protected]
 

Definition at line 47 of file plfiltercontrast.h.

Referenced by Apply().


The documentation for this class was generated from the following files:
Generated on Wed Dec 15 21:20:59 2004 for vuVolume by  doxygen 1.3.9.1