Cloneable
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.
Constructors
Kernel(int width, int height, float[] data)
Constructs a Kernel
object from an array of floats.
final int
Returns the height of this Kernel
.
final float[]
Returns the kernel data in row major order.
final int
Returns the width of this Kernel
.
final int
Returns the X origin of this Kernel
.
final int
Returns the Y origin of this 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 is (width-1)/2 and the Y origin is (height-1)/2.
width
- width of the kernel
height
- height of the kernel
data
- kernel data in row major order
IllegalArgumentException
- if the length of data
is less than the product of width
and height
public final int getXOrigin()
Returns the X origin of this Kernel
.
public final int getYOrigin()
Returns the Y origin of this Kernel
.
public final int getWidth()
Returns the width of this Kernel
.
Kernel
.
public final int getHeight()
Returns the height of this Kernel
.
Kernel
.
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 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
Clones this object.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4