org.jaitools.media.jai.kernel
Class KernelUtil

java.lang.Object
  extended by org.jaitools.media.jai.kernel.KernelUtil

public class KernelUtil
extends Object

Static utility methods for KernelJAI objects.

Since:
1.0
Version:
$Id$
Author:
Michael Bedward

Constructor Summary
KernelUtil()
           
 
Method Summary
static String kernelToString(javax.media.jai.KernelJAI kernel, boolean multiLine)
          A utility function that returns a string representation of a KernelJAI object's data.
static javax.media.jai.KernelJAI setElement(javax.media.jai.KernelJAI kernel, int x, int y, float newValue)
          Creates a new kernel by copying the one provided and setting the element at (x, y) to value.
static javax.media.jai.KernelJAI standardize(javax.media.jai.KernelJAI kernel)
          Create a copy of the input kernel with element values standardized to sum to 1.0.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KernelUtil

public KernelUtil()
Method Detail

standardize

public static javax.media.jai.KernelJAI standardize(javax.media.jai.KernelJAI kernel)
Create a copy of the input kernel with element values standardized to sum to 1.0. The input kernel's dimensions and location of the key element are retained by the new kernel.

Parameters:
kernel - the input kernel
Returns:
a new KernelJAI object

setElement

public static javax.media.jai.KernelJAI setElement(javax.media.jai.KernelJAI kernel,
                                                   int x,
                                                   int y,
                                                   float newValue)
Creates a new kernel by copying the one provided and setting the element at (x, y) to value.

Parameters:
kernel - the existing kernel
x - element X ordinate
y - element Y ordinate
newValue - new element value
Returns:
the new kernel
Throws:
IllegalArgumentException - if kernel is null or x or y are out of bounds

kernelToString

public static String kernelToString(javax.media.jai.KernelJAI kernel,
                                    boolean multiLine)
A utility function that returns a string representation of a KernelJAI object's data.

Parameters:
kernel - the input kernel
multiLine - if true, each row of kernel data is followed by a newline; if false, the string contains no newlines
Returns:
a String


Copyright © 2009-2013. All Rights Reserved.