com.jhlabs.image
Class WholeImageFilter

java.lang.Object
  extended by com.jhlabs.image.AbstractBufferedImageOp
      extended by com.jhlabs.image.WholeImageFilter
All Implemented Interfaces:
java.awt.image.BufferedImageOp, java.lang.Cloneable
Direct Known Subclasses:
BinaryFilter, CausticsFilter, CellularFilter, ContourFilter, DespeckleFilter, DiffusionFilter, EdgeFilter, EmbossFilter, EqualizeFilter, Flush3DFilter, LevelsFilter, LightFilter, MaximumFilter, MedianFilter, MinimumFilter, OilFilter, PlasmaFilter, QuantizeFilter, QuiltFilter, ReduceNoiseFilter, ShadeFilter, 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  java.awt.Rectangle originalSpace
          The input image bounds.
protected  java.awt.Rectangle transformedSpace
          The output image bounds.
 
Constructor Summary
WholeImageFilter()
          Construct a WholeImageFilter.
 
Method Summary
 java.awt.image.BufferedImage filter(java.awt.image.BufferedImage src, java.awt.image.BufferedImage dst)
           
protected abstract  int[] filterPixels(int width, int height, int[] inPixels, java.awt.Rectangle transformedSpace)
          Actually filter the pixels.
protected  void transformSpace(java.awt.Rectangle rect)
          Calculate output bounds for given input bounds.
 
Methods inherited from class com.jhlabs.image.AbstractBufferedImageOp
clone, createCompatibleDestImage, getBounds2D, getPoint2D, getRenderingHints, getRGB, setRGB
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

transformedSpace

protected java.awt.Rectangle transformedSpace
The output image bounds.


originalSpace

protected java.awt.Rectangle originalSpace
The input image bounds.

Constructor Detail

WholeImageFilter

public WholeImageFilter()
Construct a WholeImageFilter.

Method Detail

filter

public java.awt.image.BufferedImage filter(java.awt.image.BufferedImage src,
                                           java.awt.image.BufferedImage dst)

transformSpace

protected void transformSpace(java.awt.Rectangle rect)
Calculate output bounds for given input bounds.

Parameters:
rect - input and output rectangle

filterPixels

protected abstract int[] filterPixels(int width,
                                      int height,
                                      int[] inPixels,
                                      java.awt.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