Package net.sourceforge.jiu.filters
Class ConvolutionKernelData
java.lang.Object
net.sourceforge.jiu.filters.ConvolutionKernelData
- Direct Known Subclasses:
UnsharpMaskKernel
This class encapsulates the information for a specific convolution kernel filter.
An object of this class is used in combination with
ConvolutionKernelFilter.
Several kernel data objects are predefined in that class.- Author:
- Marco Schmidt
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConvolutionKernelData(String name, int[] data, int width, int height, int div, int bias) Creates a new kernel from the arguments. -
Method Summary
Modifier and TypeMethodDescriptionvoidcheck()Checks if this kernel's data is valid and throws an IllegalArgumentException if anything is wrong.intgetBias()Returns this kernel's bias value.int[]getData()Returns the kernel data.intgetDiv()Returns this kernel's div value.intReturns this kernel's height, an odd positive number.getName()Returns this kernel's name.intgetWidth()Returns this kernel's width, an odd positive number.voidsetBias(int newBias) Set new bias value.voidsetData(int[] newData) Sets the data array to be used in this kernel.voidsetDiv(int newDiv) voidsetHeight(int newHeight) voidvoidsetWidth(int newWidth)
-
Field Details
-
data
private int[] data -
width
private int width -
height
private int height -
div
private int div -
bias
private int bias -
name
-
-
Constructor Details
-
ConvolutionKernelData
Creates a new kernel from the arguments. Calls the various set methods to actually store these arguments.
-
-
Method Details
-
check
public void check()Checks if this kernel's data is valid and throws an IllegalArgumentException if anything is wrong. Otherwise, does nothing. -
getBias
public int getBias()Returns this kernel's bias value. SeeConvolutionKernelFilterfor an explanation of this and other kernel properties.- See Also:
-
getDiv
public int getDiv()Returns this kernel's div value. Must not be0. SeeConvolutionKernelFilterfor an explanation of this and other kernel properties.- See Also:
-
getData
public int[] getData()Returns the kernel data. SeeConvolutionKernelFilterfor an explanation of this and other kernel properties.- See Also:
-
getHeight
public int getHeight()Returns this kernel's height, an odd positive number. SeeConvolutionKernelFilterfor an explanation of this and other kernel properties. -
getName
Returns this kernel's name. -
getWidth
public int getWidth()Returns this kernel's width, an odd positive number. SeeConvolutionKernelFilterfor an explanation of this and other kernel properties. -
setBias
public void setBias(int newBias) Set new bias value. SeeConvolutionKernelFilterfor an explanation of this and other kernel properties. -
setData
public void setData(int[] newData) Sets the data array to be used in this kernel. Must have at least getWidth() times getHeight() elements - however, this constraint is not checked in this method (setting width and height may happen later). Callcheck()- Parameters:
newData-
-
setDiv
public void setDiv(int newDiv) -
setHeight
public void setHeight(int newHeight) -
setName
-
setWidth
public void setWidth(int newWidth)
-