infpp.fractal
Class DiscreteColorizer

java.lang.Object
  extended by infpp.fractal.DiscreteColorizer
All Implemented Interfaces:
Colorizer

public final class DiscreteColorizer
extends java.lang.Object
implements Colorizer

The DiscreteColorizer class is the simplest implementation of the Colorizer interface.

Author:
both

Constructor Summary
DiscreteColorizer(int maxIterations)
          Constructs a new DiscreteColorizer using the colors black and white.
DiscreteColorizer(int maxIterations, java.awt.Color convergenceColor, java.awt.Color divergenceColor)
          Constructs a new DiscreteColorizer using the specified colors.
 
Method Summary
 java.awt.Color calculateColor(int numberOfIterations)
          Returns convergenceColor or divergenceColor depending on the given number of required iterations.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DiscreteColorizer

public DiscreteColorizer(int maxIterations)
Constructs a new DiscreteColorizer using the colors black and white.

Parameters:
maxIterations - the specified maximum number of iterations

DiscreteColorizer

public DiscreteColorizer(int maxIterations,
                         java.awt.Color convergenceColor,
                         java.awt.Color divergenceColor)
Constructs a new DiscreteColorizer using the specified colors.

Parameters:
maxIterations - the specified maximum number of iterations
convergenceColor - the color to be used whenever the number of required iterations indicates convergence
divergenceColor - the color to be used whenever the number of required iterations indicates divergence
Method Detail

calculateColor

public java.awt.Color calculateColor(int numberOfIterations)
Returns convergenceColor or divergenceColor depending on the given number of required iterations.

Specified by:
calculateColor in interface Colorizer
Parameters:
numberOfIterations - the given number of required iterations
Returns:
the calculated Color
See Also:
Colorizer.calculateColor(int)