uk.co.silentsoftware.core.converters.image.errordiffusionstrategy
Class StuckiDitherStrategy

java.lang.Object
  extended by uk.co.silentsoftware.core.converters.image.errordiffusionstrategy.AbstractErrorDiffusionDitherStrategy
      extended by uk.co.silentsoftware.core.converters.image.errordiffusionstrategy.StuckiDitherStrategy
All Implemented Interfaces:
ErrorDiffusionDitherStrategy

public class StuckiDitherStrategy
extends AbstractErrorDiffusionDitherStrategy
implements ErrorDiffusionDitherStrategy

Implementation of the Stucki error diffusion algorithm


Field Summary
private static float FOUR_TWENTY_ONETHS
           
private static float FOURTY_TWOTH
           
private static float TWENTY_ONETH
           
private static float TWO_TWENTY_ONETHS
           
 
Constructor Summary
StuckiDitherStrategy()
           
 
Method Summary
 void distributeError(java.awt.image.BufferedImage output, int oldPixel, int newPixel, int x, int y)
          Distributes the error on the output image at the given x,y, using the difference between the original (old) pixel and the new pixel.
 java.lang.String toString()
           
 
Methods inherited from class uk.co.silentsoftware.core.converters.image.errordiffusionstrategy.AbstractErrorDiffusionDitherStrategy
calculateAdjustedRGB, isInBounds
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TWENTY_ONETH

private static final float TWENTY_ONETH
See Also:
Constant Field Values

TWO_TWENTY_ONETHS

private static final float TWO_TWENTY_ONETHS
See Also:
Constant Field Values

FOUR_TWENTY_ONETHS

private static final float FOUR_TWENTY_ONETHS
See Also:
Constant Field Values

FOURTY_TWOTH

private static final float FOURTY_TWOTH
See Also:
Constant Field Values
Constructor Detail

StuckiDitherStrategy

public StuckiDitherStrategy()
Method Detail

distributeError

public void distributeError(java.awt.image.BufferedImage output,
                            int oldPixel,
                            int newPixel,
                            int x,
                            int y)
Description copied from interface: ErrorDiffusionDitherStrategy
Distributes the error on the output image at the given x,y, using the difference between the original (old) pixel and the new pixel.

Specified by:
distributeError in interface ErrorDiffusionDitherStrategy

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object