Package helma.image
Class DiffusionFilterOp
java.lang.Object
helma.image.DiffusionFilterOp
- All Implemented Interfaces:
BufferedImageOp
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateCompatibleDestImage
(BufferedImage src, ColorModel destCM) filter
(BufferedImage src, BufferedImage dst) Do the filter operationgetBounds2D
(BufferedImage src) int[]
getPoint2D
(Point2D srcPt, Point2D dstPt) boolean
Return the serpentine settingvoid
setMatrix
(int[] matrix) void
setSerpentine
(boolean serpentine) Set whether to use a serpentine pattern for return or not.
-
Field Details
-
diffusionMatrix
protected static final int[] diffusionMatrix
-
-
Constructor Details
-
DiffusionFilterOp
public DiffusionFilterOp()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
-
setMatrix
public void setMatrix(int[] matrix) -
getMatrix
public int[] getMatrix() -
filter
Do the filter operation- Specified by:
filter
in interfaceBufferedImageOp
- Parameters:
src
- The source BufferedImage. Can be any type.dst
- The destination image. If not null, must be of type TYPE_BYTE_INDEXED- Returns:
- A dithered version of src in a BufferedImage of type TYPE_BYTE_INDEXED
-
createCompatibleDestImage
- Specified by:
createCompatibleDestImage
in interfaceBufferedImageOp
-
getRenderingHints
- Specified by:
getRenderingHints
in interfaceBufferedImageOp
-
getPoint2D
- Specified by:
getPoint2D
in interfaceBufferedImageOp
-
getBounds2D
- Specified by:
getBounds2D
in interfaceBufferedImageOp
-