org.generation5.vision
Class ConvolutionFilter

java.lang.Object
  extended byorg.generation5.vision.Filter
      extended byorg.generation5.vision.ConvolutionFilter
Direct Known Subclasses:
GaussianFilter, MeanFilter

public class ConvolutionFilter
extends Filter

This class implements a convolution filter. This class is merely a wrapper for the Java 2D ConvolveOp, but implements the Generation5 JDK's Filter.


Field Summary
protected  java.awt.image.Kernel kernel
          The kernel to be used.
 
Constructor Summary
ConvolutionFilter()
          Creates a new instance of ConvolutionFilter
ConvolutionFilter(java.awt.image.Kernel kernel)
          Creates a new instance of a convolution filter with the given kernel.
 
Method Summary
 java.awt.image.BufferedImage filter(java.awt.image.BufferedImage image, java.awt.image.BufferedImage output)
          Convolve the image using the kernel.
 java.awt.image.Kernel getKernel()
          Return the kernel currently set.
 void setKernel(java.awt.image.Kernel kernel)
          Set the kernel to be used.
 java.lang.String toString()
           
 
Methods inherited from class org.generation5.vision.Filter
filter, verifyOutput, verifyOutput, verifyOutput
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

kernel

protected java.awt.image.Kernel kernel
The kernel to be used.

Constructor Detail

ConvolutionFilter

public ConvolutionFilter()
Creates a new instance of ConvolutionFilter


ConvolutionFilter

public ConvolutionFilter(java.awt.image.Kernel kernel)
Creates a new instance of a convolution filter with the given kernel.

Parameters:
kernel - the kernel to use.
Method Detail

setKernel

public void setKernel(java.awt.image.Kernel kernel)
Set the kernel to be used.

Parameters:
kernel - the kernel.

getKernel

public java.awt.image.Kernel getKernel()
Return the kernel currently set.

Returns:
the kernel.

filter

public java.awt.image.BufferedImage filter(java.awt.image.BufferedImage image,
                                           java.awt.image.BufferedImage output)
Convolve the image using the kernel.

Specified by:
filter in class Filter
Parameters:
output - the pre-allocated output image (optional).
image - the input image.
Returns:
the output image.
See Also:
Filter.verifyOutput(BufferedImage, BufferedImage)

toString

public java.lang.String toString()

This documentation is part of the Generation5 JDK.