Package helma.image

# Class DiffusionFilterOp

java.lang.Object
helma.image.DiffusionFilterOp

All Implemented Interfaces:
  `BufferedImageOp`

public class DiffusionFilterOp extends Object implements BufferedImageOp

## Field Summary

Fields
Modifier and Type
Field
Description
`protected static final int[]`
`diffusionMatrix`

## Constructor Summary

Constructors
Constructor
Description
`DiffusionFilterOp()`
Construct a DiffusionFilter

## Method Summary

Modifier and Type
Method
Description
`BufferedImage`
`createCompatibleDestImage(BufferedImage src, ColorModel destCM)`
`BufferedImage`
`filter(BufferedImage src, BufferedImage dst)`
Do the filter operation
`Rectangle2D`
`getBounds2D(BufferedImage src)`
`int[]`
`getMatrix()`
`Point2D`
`getPoint2D(Point2D srcPt, Point2D dstPt)`
`RenderingHints`
`getRenderingHints()`
`boolean`
`getSerpentine()`
Return the serpentine setting
`void`
`setMatrix(int[] matrix)`
`void`
`setSerpentine(boolean serpentine)`
Set whether to use a serpentine pattern for return or not.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## 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

public BufferedImage filter(BufferedImage src, BufferedImage dst)
Do the filter operation

Specified by:
  `filter` in interface `BufferedImageOp`
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

public BufferedImage createCompatibleDestImage(BufferedImage src, ColorModel destCM)

Specified by:
  `createCompatibleDestImage` in interface `BufferedImageOp`

### getRenderingHints

public RenderingHints getRenderingHints()

Specified by:
  `getRenderingHints` in interface `BufferedImageOp`

### getPoint2D

public Point2D getPoint2D(Point2D srcPt, Point2D dstPt)

Specified by:
  `getPoint2D` in interface `BufferedImageOp`

### getBounds2D

public Rectangle2D getBounds2D(BufferedImage src)

Specified by:
  `getBounds2D` in interface `BufferedImageOp`