|
JavaTM 2 Platform Std. Ed. v1.4.2 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.image.Kernel
The Kernel
class defines a matrix that describes how a
specified pixel and its surrounding pixels affect the value
computed for the pixel's position in the output image of a filtering
operation. The X origin and Y origin indicate the kernel matrix element
that corresponds to the pixel position for which an output value is
being computed.
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 of this Kernel . |
float[] |
getKernelData(float[] data)
Returns the kernel data in row major order. |
int |
getWidth()
Returns the width of this Kernel . |
int |
getXOrigin()
Returns the X origin of this Kernel . |
int |
getYOrigin()
Returns the Y origin of this Kernel . |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Kernel(int width, int height, float[] data)
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 is (width-1)/2 and the Y origin is (height-1)/2.
width
- width of the kernelheight
- height of the kerneldata
- kernel data in row major order
IllegalArgumentException
- if the length of data
is less than the product of width
and
height
Method Detail |
public final int getXOrigin()
Kernel
.
public final int getYOrigin()
Kernel
.
public final int getWidth()
Kernel
.
Kernel
.public final int getHeight()
Kernel
.
Kernel
.public final float[] getKernelData(float[] data)
data
array is returned. If data
is null
, a new array is allocated.
data
- if non-null, contains the returned kernel data
data
array containing the kernel data
in row major order or, if data
is
null
, a newly allocated array containing
the kernel data in row major order
IllegalArgumentException
- if data
is less
than the size of this Kernel
public Object clone()
clone
in class Object
Cloneable
|
JavaTM 2 Platform Std. Ed. v1.4.2 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 2003 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.