public final class BlurFilter extends AFilter
BlurFilter
class provides a blurring filter.
Note that this class can not be subclased!
Constructor and Description |
---|
BlurFilter()
Constructs a
BlurFilter object and initialises with a default kernel size of 3. |
Modifier and Type | Method and Description |
---|---|
AFilter |
clone()
Clones (deep copy) the current filter.
|
java.awt.image.BufferedImage |
filter(java.awt.image.BufferedImage image)
Applies the filter to a specified image and returns the result.
|
int |
getKernelSize()
Returns the size of the kernel.
|
java.lang.String |
getName()
Returns the filter's name.
|
void |
plainTextLoadParameters(org.sm.smtools.util.TextFileParser tfp)
Loads the filter's parameters from a plain-text file.
|
void |
plainTextSaveParameters(org.sm.smtools.util.TextFileWriter tfw)
Saves the filter's parameters to a plain-text file.
|
void |
setKernelSize(int kernelSize)
Sets the size of the kernel and calculates its elements.
|
void |
streamLoadParameters(java.io.DataInputStream dataInputStream)
Loads the filter's parameters from a file.
|
void |
streamSaveParameters(java.io.DataOutputStream dataOutputStream)
Saves the filter's parameters to a file as a stream.
|
public BlurFilter()
BlurFilter
object and initialises with a default kernel size of 3.public AFilter clone()
public java.awt.image.BufferedImage filter(java.awt.image.BufferedImage image)
public int getKernelSize()
public java.lang.String getName()
public void plainTextLoadParameters(org.sm.smtools.util.TextFileParser tfp) throws org.sm.smtools.exceptions.FileParseException
plainTextLoadParameters
in class AFilter
tfp
- a reference to the file parserorg.sm.smtools.exceptions.FileParseException
- in case a read error occurspublic void plainTextSaveParameters(org.sm.smtools.util.TextFileWriter tfw) throws org.sm.smtools.exceptions.FileWriteException
plainTextSaveParameters
in class AFilter
tfw
- a reference to the file writerorg.sm.smtools.exceptions.FileWriteException
- in case a write error occurspublic void setKernelSize(int kernelSize)
If necessary, the kernel is made larger than 3.
kernelSize
- the size of the kernelpublic void streamLoadParameters(java.io.DataInputStream dataInputStream) throws java.io.IOException
streamLoadParameters
in class AFilter
dataInputStream
- a data inputstreamjava.io.IOException
- in case a parse error occurspublic void streamSaveParameters(java.io.DataOutputStream dataOutputStream) throws java.io.IOException
streamSaveParameters
in class AFilter
dataOutputStream
- a data outputstreamjava.io.IOException
- in case a write error occurs