Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

halftoner::ErrorDiffusionHalftoner Class Reference

#include <ErrorDiffusionHalftoner.h>

Inheritance diagram for halftoner::ErrorDiffusionHalftoner:

Inheritance graph
[legend]
Collaboration diagram for halftoner::ErrorDiffusionHalftoner:

Collaboration graph
[legend]
List of all members.

Detailed Description

Class ErrorDiffusionHalftoner is the superclass of all halftoning techniques that uses error diffusion on neighboring pixels.

Todo:
put more work in this class, only requesting the pattern from the child classes.

Definition at line 44 of file ErrorDiffusionHalftoner.h.

Class variables

Public Methods

Implemented method from class Halftoner

Protected Methods

Abstract methods

Private Methods

Instance methods

Friends


Constructor & Destructor Documentation

halftoner::ErrorDiffusionHalftoner::ErrorDiffusionHalftoner   throw () [protected]
 

Constructor.

Definition at line 110 of file ErrorDiffusionHalftoner.cxx.

halftoner::ErrorDiffusionHalftoner::~ErrorDiffusionHalftoner   throw () [virtual]
 

Destructor.

Definition at line 120 of file ErrorDiffusionHalftoner.cxx.


Member Function Documentation

Image * halftoner::ErrorDiffusionHalftoner::halftone const Image   source,
const HalftonerSpec   spec
throw (std::invalid_argument) [virtual]
 

Halftones the given image according to the given specifications.

Parameters:
source  the source image.
spec  the specifications of the algorithm.
Returns :
the halftoned image, which must be manually deleted.
Exceptions:
std::invalid_argument  if 0 == specs.
std::invalid_argument  if specs is not of a ErrorDiffusionSpec.

Implements halftoner::Halftoner.

Definition at line 130 of file ErrorDiffusionHalftoner.cxx.

References halftoner::ErrorDiffusionSpec::getStrategy(), and halftoner::ErrorDiffusionSpec::getThreshold().

virtual int halftoner::ErrorDiffusionHalftoner::halftoneToLeft float *    source,
int    i,
int    j,
int    offset,
int    width,
int    height,
int    threshold
throw () [protected, pure virtual]
 

Perform the algorithm for one pixel and transfering the error on the left.

Parameters:
source  the source for pixel intensity.
i  the column position of the current pixel.
j  the row position of the current pixel.
offset  the index of the pixel in source.
width  the width of the image.
height  the height of the image.
threshold  the threshold of the algorithm.
Returns :
the intensity value of the new pixel.

Implemented in halftoner::FloydSteinberg, halftoner::JarvisJudiceNinke, and halftoner::Stucki.

Referenced by serpentine().

virtual int halftoner::ErrorDiffusionHalftoner::halftoneToRight float *    source,
int    i,
int    j,
int    offset,
int    width,
int    height,
int    threshold
throw () [protected, pure virtual]
 

Perform the algorithm for one pixel and transfering the error on the right.

Parameters:
source  the source for pixel intensity.
i  the column position of the current pixel.
j  the row position of the current pixel.
offset  the index of the pixel in source.
width  the width of the image.
height  the height of the image.
threshold  the threshold of the algorithm.
Returns :
the intensity value of the new pixel.

Implemented in halftoner::FloydSteinberg, halftoner::JarvisJudiceNinke, and halftoner::Stucki.

Referenced by scanline(), and serpentine().

Image * halftoner::ErrorDiffusionHalftoner::scanline const Image   source,
int    threshold
[private]
 

Scans the given image with standard scan lines.

Parameters:
source  the image to halftone.
threshold  the threshold value.
Returns :
the halftoned image.
Todo:
use setLine() instead of setColorAt.

Definition at line 164 of file ErrorDiffusionHalftoner.cxx.

References halftoner::Image::getCopy(), halftoner::Image::getHeight(), halftoner::Image::getWidth(), halftoneToRight(), and halftoner::Image::setColorAt().

Image * halftoner::ErrorDiffusionHalftoner::serpentine const Image   source,
int    threshold
[private]
 

Scans the given image with serpentine scan lines.

Parameters:
source  the image to halftone.
threshold  the threshold value.
Returns :
the halftoned image.

Definition at line 198 of file ErrorDiffusionHalftoner.cxx.

References halftoner::Image::getCopy(), halftoner::Image::getHeight(), halftoner::Image::getWidth(), halftoneToLeft(), halftoneToRight(), and halftoner::Image::setLine().


Friends And Related Function Documentation

friend class ErrorDiffusionHalftoner::ScanlinePathStrategy [friend]
 

Definition at line 96 of file ErrorDiffusionHalftoner.h.

friend class ErrorDiffusionHalftoner::SerpentinePathStrategy [friend]
 

Definition at line 115 of file ErrorDiffusionHalftoner.h.


Member Data Documentation

ErrorDiffusionHalftoner::ScanlinePathStrategy halftoner::ErrorDiffusionHalftoner::scan_line_strategy [static, private]
 

An instance of ScanlinePathStrategy.

Definition at line 99 of file ErrorDiffusionHalftoner.cxx.

ErrorDiffusionHalftoner::PathStrategy & halftoner::ErrorDiffusionHalftoner::SCANLINE [static]
 

A polymorphic view of ErrorDiffusionHalftoner::scan_line_strategy.

Definition at line 102 of file ErrorDiffusionHalftoner.cxx.

ErrorDiffusionHalftoner::PathStrategy & halftoner::ErrorDiffusionHalftoner::SERPENTINE [static]
 

A polymorphic view of ErrorDiffusionHalftoner::serpentine_strategy.

Definition at line 103 of file ErrorDiffusionHalftoner.cxx.

ErrorDiffusionHalftoner::SerpentinePathStrategy halftoner::ErrorDiffusionHalftoner::serpentine_strategy [static, private]
 

An instance of SerpentinePathStrategy.

Definition at line 100 of file ErrorDiffusionHalftoner.cxx.


The documentation for this class was generated from the following files:
Generated on Sat Sep 7 16:35:15 2002 for Halftoning Library by doxygen1.2.17