|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.meltingice.caman.CamanFilter
public abstract class CamanFilter
Abstract class for all filters. Override only the methods you need, and the others will automatically throw an InvalidPluginException.
Constructor Summary | |
---|---|
CamanFilter()
Default constructor for the filter. |
Method Summary | |
---|---|
double[] |
getKernel()
If making a filter that requires image convolution, this returns the kernel that will be applied to the image. |
double |
getParamDouble(int num)
Retrieves the specified param and forces it to be a double. |
int |
getParamInt(int num)
Retrieves the specified param and forces it to be an integer. |
void |
precomputeParams()
Allows the filter to precompute any required values before process(int[]) is executed. |
int[] |
process(int[] rgb)
Processes the given pixel and returns the updated values. |
CamanFilter |
set(java.lang.Object param)
Set a param for this filter. |
CamanFilter |
set(java.lang.Object[] paramArr)
Set an array of params for easier readability/simplicity |
PluginType |
type()
Reports the type of plugin this filter is |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CamanFilter()
Method Detail |
---|
public CamanFilter set(java.lang.Object param)
param
- The param to set
public CamanFilter set(java.lang.Object[] paramArr)
paramArr
- An array of values to set
public double getParamDouble(int num)
num
- The index of the argument
public int getParamInt(int num)
num
- The index of the argument
public void precomputeParams() throws InvalidArgumentsException
process(int[])
is executed. This helps with speed so
that arguments don't have to be recomputed for every pixel.
InvalidArgumentsException
public PluginType type()
public int[] process(int[] rgb) throws InvalidPluginException
rgb
- The current pixel's color values
rgb[0] => red, rgb[1] => green, rgb[2] => blue
InvalidPluginException
public double[] getKernel() throws InvalidPluginException
InvalidPluginException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |