Class DiffusionFilter

All Implemented Interfaces:
BufferedImageOp, Serializable, Cloneable

public class DiffusionFilter extends WholeImageFilter
A filter which uses Floyd-Steinberg error diffusion dithering to halftone an image.
See Also:
  • Field Details

    • diffusionMatrix

      protected static final int[] diffusionMatrix
    • levels

      public int levels
  • Constructor Details

    • DiffusionFilter

      public DiffusionFilter()
      Construct a DiffusionFilter
  • Method Details

    • setSerpentine

      public void setSerpentine(boolean serpentine)
      Set whether to use a serpentine pattern for return or not. This can reduce 'avalanche' artifacts in the output.
      Parameters:
      serpentine - true to use serpentine pattern
    • getSerpentine

      public boolean getSerpentine()
      Return the serpentine setting
      Returns:
      the current setting
    • setColorDither

      public void setColorDither(boolean colorDither)
    • getColorDither

      public boolean getColorDither()
    • setMatrix

      public void setMatrix(int[] matrix)
    • getMatrix

      public int[] getMatrix()
    • setLevels

      public void setLevels(int levels)
    • getLevels

      public int getLevels()
    • filterPixels

      protected int[] filterPixels(int width, int height, int[] inPixels, Rectangle transformedSpace)
      Specified by:
      filterPixels in class WholeImageFilter
    • toString

      public String toString()
      Overrides:
      toString in class Object