| java.lang.Object javax.media.jai.KernelJAI
KernelJAI | public class KernelJAI extends Object implements Serializable(Code) | | A kernel representing a matrix with a key position,
used by operators such as Convolve .
A KernelJAI is characterized by its width, height, and
origin, or key element. The key element is the element which is placed
over the current source pixel to perform convolution or error diffusion.
A kernel K is separable it the outer product of two one-dimensional
vectors. It can speed up computation. One can construct a kernel
from two one-dimensional vectors.
<>The symmetry can be useful (such as computation speedup). Currently
the protected instance variables isHorizonallySymmetric
and isVerticallySymmetric are set to false.
See Also: javax.media.jai.operator.ConvolveDescriptor See Also: javax.media.jai.operator.OrderedDitherDescriptor See Also: javax.media.jai.operator.ErrorDiffusionDescriptor |
Constructor Summary | |
public | KernelJAI(int width, int height, int xOrigin, int yOrigin, float[] data) Constructs a KernelJAI with the given parameters. | public | KernelJAI(int width, int height, int xOrigin, int yOrigin, float[] dataH, float[] dataV) Constructs a separable KernelJAI from two float arrays.
The data arrays are copied.
A Separable kernel K = dataH * dataV^T, the outer product of two
one dimensional vectors dataH and dataV. | public | KernelJAI(int width, int height, float[] data) Constructs a kernel with the given parameters. | public | KernelJAI(Kernel k) Constructs a KernelJAI from a java.awt.image.Kernel
object. |
Method Summary | |
public int | getBottomPadding() Returns the number of pixels required below the key element. | public float | getElement(int xIndex, int yIndex) Returns a given element of the kernel. | public int | getHeight() Returns the height of the kernel. | public float[] | getHorizontalKernelData() Returns the horizontal portion of the kernel if the
kernel is separable, or null otherwise. | public float[] | getKernelData() Returns a copy of the kernel data in row-major format. | public int | getLeftPadding() Returns the number of pixels required to the left of the key element. | public int | getRightPadding() Returns the number of pixels required to the right of the key element. | public KernelJAI | getRotatedKernel() Returns a 180 degree rotated version of the kernel. | public int | getTopPadding() Returns the number of pixels required above the key element. | public float[] | getVerticalKernelData() Returns the vertical portion of the kernel if the
kernel is separable, or null otherwise. | public int | getWidth() Returns the width of the kernel. | public int | getXOrigin() Returns the X coordinate of the key kernel element. | public int | getYOrigin() Returns the Y coordinate of the key kernel element. | public boolean | isHorizontallySymmetric() Returns true if the kernel has horizontal (Y axis) symmetry. | public boolean | isSeparable() Returns true if the kernel is separable. | public boolean | isVerticallySymmetric() Returns true if the kernel has vertical (X axis) symmetry. |
DITHER_MASK_441 | final public static KernelJAI[] DITHER_MASK_441(Code) | | 4x4x1 mask useful for dithering 8-bit grayscale images to 1-bit images.
|
DITHER_MASK_443 | final public static KernelJAI[] DITHER_MASK_443(Code) | | 4x4x3 mask useful for dithering 24-bit color images to 8-bit
pseudocolor images.
|
ERROR_FILTER_FLOYD_STEINBERG | final public static KernelJAI ERROR_FILTER_FLOYD_STEINBERG(Code) | | Floyd and Steinberg error filter (1975).
(1/16 x) [ * 7 ]
[ 3 5 1 ]
|
ERROR_FILTER_JARVIS | final public static KernelJAI ERROR_FILTER_JARVIS(Code) | | Jarvis, Judice, and Ninke error filter (1976).
[ * 7 5 ]
(1/48 x) [ 3 5 7 5 3 ]
[ 1 3 5 3 1 ]
|
ERROR_FILTER_STUCKI | final public static KernelJAI ERROR_FILTER_STUCKI(Code) | | Stucki error filter (1981).
[ * 7 5 ]
(1/42 x) [ 2 4 8 4 2 ]
[ 1 2 4 2 1 ]
|
GRADIENT_MASK_SOBEL_HORIZONTAL | final public static KernelJAI GRADIENT_MASK_SOBEL_HORIZONTAL(Code) | | Gradient Mask for SOBEL_HORIZONTAL.
|
GRADIENT_MASK_SOBEL_VERTICAL | final public static KernelJAI GRADIENT_MASK_SOBEL_VERTICAL(Code) | | Gradient Mask for SOBEL_VERTICAL.
|
data | protected float[] data(Code) | | The kernel data in row-major format.
|
dataH | protected float[] dataH(Code) | | The horizontal data for a separable kernel
|
dataV | protected float[] dataV(Code) | | The vertical data for a separable kernel
|
height | protected int height(Code) | | The height of the kernel.
|
isHorizontallySymmetric | protected boolean isHorizontallySymmetric(Code) | | True if the kernel has horizontal (Y axis) symmetry.
|
isSeparable | protected boolean isSeparable(Code) | | True if the kernel is separable.
|
isVerticallySymmetric | protected boolean isVerticallySymmetric(Code) | | True if the kernel has vertical (X axis) symmetry.
|
rotatedKernel | protected KernelJAI rotatedKernel(Code) | | Variable to cache a copy of the rotated kernel
|
width | protected int width(Code) | | The width of the kernel.
|
xOrigin | protected int xOrigin(Code) | | The X coordinate of the key element.
|
yOrigin | protected int yOrigin(Code) | | The Y coordinate of the key element.
|
KernelJAI | public KernelJAI(int width, int height, int xOrigin, int yOrigin, float[] data)(Code) | | Constructs a KernelJAI with the given parameters. The data
array is copied.
Parameters: width - the width of the kernel. Parameters: height - the height of the kernel. Parameters: xOrigin - the X coordinate of the key kernel element. Parameters: yOrigin - the Y coordinate of the key kernel element. Parameters: data - the float data in row-major format. throws: IllegalArgumentException - if data is null. throws: IllegalArgumentException - if width is not a positive number. throws: IllegalArgumentException - if height is not a positive number. throws: IllegalArgumentException - if kernel data array does not havewidth * height number of elements. |
KernelJAI | public KernelJAI(int width, int height, int xOrigin, int yOrigin, float[] dataH, float[] dataV)(Code) | | Constructs a separable KernelJAI from two float arrays.
The data arrays are copied.
A Separable kernel K = dataH * dataV^T, the outer product of two
one dimensional vectors dataH and dataV. It can often speed up
compution.
Parameters: width - the width of the kernel. Parameters: height - the height of the kernel. Parameters: xOrigin - the X coordinate of the key kernel element. Parameters: yOrigin - the Y coordinate of the key kernel element. Parameters: dataH - the float data for the horizontal direction. Parameters: dataV - the float data for the vertical direction. throws: IllegalArgumentException - if dataH is null. throws: IllegalArgumentException - if dataV is null. throws: IllegalArgumentException - if width is not a positive number. throws: IllegalArgumentException - if height is not a positive number. throws: IllegalArgumentException - if dataH does not have width elements. throws: IllegalArgumentException - if dataV does not have height elements. |
KernelJAI | public KernelJAI(int width, int height, float[] data)(Code) | | Constructs a kernel with the given parameters. The data
array is copied. The key element is set to
(trunc(width/2), trunc(height/2)).
Parameters: width - the width of the kernel. Parameters: height - the height of the kernel. Parameters: data - the float data in row-major format. throws: IllegalArgumentException - if data is null. throws: IllegalArgumentException - if width is not a positive number. throws: IllegalArgumentException - if height is not a positive number. throws: IllegalArgumentException - if data does not havewidth * height number of elements. |
getBottomPadding | public int getBottomPadding()(Code) | | Returns the number of pixels required below the key element.
|
getElement | public float getElement(int xIndex, int yIndex)(Code) | | Returns a given element of the kernel.
throws: ArrayIndexOutOfBoundsException - if either xIndex or yIndex isan invalid index. |
getHeight | public int getHeight()(Code) | | Returns the height of the kernel.
|
getHorizontalKernelData | public float[] getHorizontalKernelData()(Code) | | Returns the horizontal portion of the kernel if the
kernel is separable, or null otherwise. The kernel may
be tested for separability by calling isSeparable() .
|
getKernelData | public float[] getKernelData()(Code) | | Returns a copy of the kernel data in row-major format.
|
getLeftPadding | public int getLeftPadding()(Code) | | Returns the number of pixels required to the left of the key element.
|
getRightPadding | public int getRightPadding()(Code) | | Returns the number of pixels required to the right of the key element.
|
getRotatedKernel | public KernelJAI getRotatedKernel()(Code) | | Returns a 180 degree rotated version of the kernel. This is
needed by most convolve operations to get the correct results.
the rotated kernel. |
getTopPadding | public int getTopPadding()(Code) | | Returns the number of pixels required above the key element.
|
getVerticalKernelData | public float[] getVerticalKernelData()(Code) | | Returns the vertical portion of the kernel if the
kernel is separable, or null otherwise. The kernel may
be tested for separability by calling isSeparable() .
|
getWidth | public int getWidth()(Code) | | Returns the width of the kernel.
|
getXOrigin | public int getXOrigin()(Code) | | Returns the X coordinate of the key kernel element.
|
getYOrigin | public int getYOrigin()(Code) | | Returns the Y coordinate of the key kernel element.
|
isHorizontallySymmetric | public boolean isHorizontallySymmetric()(Code) | | Returns true if the kernel has horizontal (Y axis) symmetry.
|
isSeparable | public boolean isSeparable()(Code) | | Returns true if the kernel is separable.
|
isVerticallySymmetric | public boolean isVerticallySymmetric()(Code) | | Returns true if the kernel has vertical (X axis) symmetry.
|
|
|