Java Platform 1.2

java.awt.image
Class Kernel

java.lang.Object
  |
  +--java.awt.image.Kernel

public class Kernel
extends Object
implements Cloneable

This class defines a Kernel object. A kernel is a matrix describing how a given pixel and its surrounding pixels affect the value computed for the given pixel's position in the output image of a filtering operation. The X origin and Y origin indicate the kernel matrix element which corresponds to the pixel position for which an output value is being computed.

See Also:
ConvolveOp

Constructor Summary
Kernel(int width, int height, float[] data)
          Constructs a Kernel object from an array of floats.
 
Method Summary
 Object clone()
          Clones this object.
 int getHeight()
          Returns the height.
 float[] getKernelData(float[] data)
          Returns the kernel data in row major order.
 int getWidth()
          Returns the width.
 int getXOrigin()
          Returns the X origin.
 int getYOrigin()
          Returns the Y origin.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Kernel

public Kernel(int width,
              int height,
              float[] data)
Constructs a Kernel object from an array of floats. The first width*height elements of the data array are copied. If the length of the data array is less than width*height, an IllegalArgumentException is thrown. The X origin will be (width-1)/2 and the Y origin will be (height-1)/2.
Parameters:
width - Width of the kernel.
height - Height of the kernel.
data - Kernel data in row major order.
Method Detail

getXOrigin

public final int getXOrigin()
Returns the X origin.

getYOrigin

public final int getYOrigin()
Returns the Y origin.

getWidth

public final int getWidth()
Returns the width.

getHeight

public final int getHeight()
Returns the height.

getKernelData

public final float[] getKernelData(float[] data)
Returns the kernel data in row major order. The data array is returned. If data is null, a new array will be allocated.
Parameters:
data - If non-null, will contain the returned kernel data.

clone

public Object clone()
Clones this object.
Overrides:
clone in class Object

Java Platform 1.2

Submit a bug or feature Version 1.2 of Java Platform API Specification
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.