railo.runtime.img.filter
Class DiffusionFilter

java.lang.Object
  extended by railo.runtime.img.filter.AbstractBufferedImageOp
      extended by railo.runtime.img.filter.WholeImageFilter
          extended by railo.runtime.img.filter.DiffusionFilter
All Implemented Interfaces:
BufferedImageOp, Cloneable, DynFiltering

public class DiffusionFilter
extends WholeImageFilter
implements DynFiltering

A filter which uses Floyd-Steinberg error diffusion dithering to halftone an image.


Constructor Summary
DiffusionFilter()
          Construct a DiffusionFilter.
 
Method Summary
 BufferedImage filter(BufferedImage src, Struct parameters)
           
 boolean getColorDither()
          Get whether to use a color dither.
 int getLevels()
          Get the number of dither levels.
 int[] getMatrix()
          Get the dither matrix.
 boolean getSerpentine()
          Return the serpentine setting.
 void setColorDither(boolean colorDither)
          Set whether to use a color dither.
 void setLevels(int levels)
          Set the number of dither levels.
 void setMatrix(int[] matrix)
          Set the dither matrix.
 void setSerpentine(boolean serpentine)
          Set whether to use a serpentine pattern for return or not.
 String toString()
           
 
Methods inherited from class railo.runtime.img.filter.WholeImageFilter
filter
 
Methods inherited from class railo.runtime.img.filter.AbstractBufferedImageOp
clone, createCompatibleDestImage, getBounds2D, getPoint2D, getRenderingHints, getRGB, setRGB
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DiffusionFilter

public DiffusionFilter()
Construct a DiffusionFilter.

Method Detail

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
See Also:
getSerpentine()

getSerpentine

public boolean getSerpentine()
Return the serpentine setting.

Returns:
the current setting
See Also:
setSerpentine(boolean)

setColorDither

public void setColorDither(boolean colorDither)
Set whether to use a color dither.

Parameters:
colorDither - true to use a color dither
See Also:
getColorDither()

getColorDither

public boolean getColorDither()
Get whether to use a color dither.

Returns:
true to use a color dither
See Also:
setColorDither(boolean)

setMatrix

public void setMatrix(int[] matrix)
Set the dither matrix.

Parameters:
matrix - the dither matrix
See Also:
getMatrix()

getMatrix

public int[] getMatrix()
Get the dither matrix.

Returns:
the dither matrix
See Also:
setMatrix(int[])

setLevels

public void setLevels(int levels)
Set the number of dither levels.

Parameters:
levels - the number of levels
See Also:
getLevels()

getLevels

public int getLevels()
Get the number of dither levels.

Returns:
the number of levels
See Also:
setLevels(int)

toString

public String toString()
Overrides:
toString in class Object

filter

public BufferedImage filter(BufferedImage src,
                            Struct parameters)
                     throws PageException
Specified by:
filter in interface DynFiltering
Overrides:
filter in class WholeImageFilter
Throws:
PageException


Copyright © 2012 Railo