com.jhlabs.image

Class WholeImageFilter

Implemented Interfaces:
BufferedImageOp, Cloneable
Known Direct Subclasses:
BinaryFilter, CausticsFilter, CellularFilter, ContourFilter, DespeckleFilter, DiffusionFilter, EdgeFilter, EmbossFilter, EqualizeFilter, Flush3DFilter, LevelsFilter, LightFilter, MaximumFilter, MedianFilter, MinimumFilter, OilFilter, PlasmaFilter, QuantizeFilter, QuiltFilter, ReduceNoiseFilter, ShapeFilter, SmearFilter, WarpFilter

public abstract class WholeImageFilter
extends AbstractBufferedImageOp

A filter which acts as a superclass for filters which need to have the whole image in memory to do their stuff.

Field Summary

protected Rectangle
originalSpace
The input image bounds.
protected Rectangle
transformedSpace
The output image bounds.

Constructor Summary

WholeImageFilter()
Construct a WholeImageFilter.

Method Summary

BufferedImage
filter(BufferedImage src, BufferedImage dst)
protected abstract int[]
filterPixels(int width, int height, int[] inPixels, Rectangle transformedSpace)
Actually filter the pixels.
protected void
transformSpace(Rectangle rect)
Calculate output bounds for given input bounds.

Methods inherited from class com.jhlabs.image.AbstractBufferedImageOp

clone, createCompatibleDestImage, getBounds2D, getPoint2D, getRGB, getRenderingHints, setRGB

Field Details

originalSpace

protected Rectangle originalSpace
The input image bounds.

transformedSpace

protected Rectangle transformedSpace
The output image bounds.

Constructor Details

WholeImageFilter

public WholeImageFilter()
Construct a WholeImageFilter.

Method Details

filter

public BufferedImage filter(BufferedImage src,
                            BufferedImage dst)

filterPixels

protected abstract int[] filterPixels(int width,
                                      int height,
                                      int[] inPixels,
                                      Rectangle transformedSpace)
Actually filter the pixels.
Parameters:
width - the image width
height - the image height
inPixels - the image pixels
transformedSpace - the output bounds
Returns:
the output pixels

transformSpace

protected void transformSpace(Rectangle rect)
Calculate output bounds for given input bounds.
Parameters:
rect - input and output rectangle