public class ColourImageFilter extends java.lang.Object implements SpatialFilter
Modifier and Type | Class and Description |
---|---|
static class |
ColourImageFilter.ColourImageFilterSpecifierPanel
A FilterSpecifierPanel for a colour image filter.
|
SpatialFilter.SpecifierPanel
Modifier and Type | Field and Description |
---|---|
static org.apache.commons.cli.Option |
BLUE_FORMULA_OPTION
A public Option to specify the formula used to calculate the new blue component values
in the output image.
|
static org.apache.commons.cli.Option |
GREEN_FORMULA_OPTION
A public Option to specify the formula used to calculate the new green component values
in the output image.
|
static org.apache.commons.cli.Option |
RED_FORMULA_OPTION
A public Option to specify the formula used to calculate the new red component values
in the image.
|
N_DOTS
Constructor and Description |
---|
ColourImageFilter(java.lang.String redFormula,
java.lang.String greenFormula,
java.lang.String blueFormula)
Creates a new ColourImageFilter based on three formulae used to compute the
red, green and blue colour components.
|
Modifier and Type | Method and Description |
---|---|
WritableImage |
filter(ReadableImage image)
Filter a ReadableImage, returning a new image which is a filtered version of the
supplied image.
|
WritableImage |
filter(ReadableImage image,
MonitorWorker worker,
boolean verbose)
Filter a ReadableImage, returning a new image which is a filtered version of the
supplied image.
|
void |
filterInPlace(java.lang.Object pixels,
PixelDataType dataType,
int nCols,
int nRows,
int nSlices)
Filter an array of pixel values "in place".
|
void |
filterInPlace(java.lang.Object pixels,
PixelDataType dataType,
int nCols,
int nRows,
int nSlices,
MonitorWorker worker,
boolean verbose)
Filter an array of pixel values "in place".
|
void |
filterInPlace(WritableImage image)
Filter a WritableImage "in place".
|
void |
filterInPlace(WritableImage image,
MonitorWorker worker,
boolean verbose)
Filter a WritableImage "in place".
|
static java.lang.String |
getName()
Returns the human-readable name of this filter.
|
static java.lang.String |
getOptionName()
Returns the name of this type of filter when specifying it in program optional arguments.
|
static org.apache.commons.cli.Options |
getOptions()
Returns the options for this type of filter.
|
static SpatialFilter.SpecifierPanel |
getSpecifierPanel(java.lang.String preferencesNodeName)
Returns a SpatialFilter.SpecifierPanel that can be used to set the parameters for
a ColourImageFilter.
|
static void |
main(java.lang.String[] args)
Runs a self-test of this class.
|
static ColourImageFilter |
newInstance(org.apache.commons.cli.CommandLine commandLine,
ReadableImage image)
Creates a new ColourImageFilter using the supplied command line arguments,
suitable for filtering the supplied image.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
removeNaNs, removeNaNs
public static final org.apache.commons.cli.Option RED_FORMULA_OPTION
public static final org.apache.commons.cli.Option GREEN_FORMULA_OPTION
public static final org.apache.commons.cli.Option BLUE_FORMULA_OPTION
public ColourImageFilter(java.lang.String redFormula, java.lang.String greenFormula, java.lang.String blueFormula) throws InvalidArgumentException
redFormula
- the formula to calculate the new red colour component.greenFormula
- the formula to calculate the new green colour component.blueFormula
- the formula to calculate the new blue colour component.InvalidArgumentException
- if any of the formulae is invalid.public static ColourImageFilter newInstance(org.apache.commons.cli.CommandLine commandLine, ReadableImage image) throws InvalidArgumentException
commandLine
- the command line from which a program is invoked.image
- the image to which this filter is designed to apply.InvalidArgumentException
- if the ColourImageFilter cannot be created
using the supplied command line arguments.public static java.lang.String getOptionName()
public static org.apache.commons.cli.Options getOptions()
public static SpatialFilter.SpecifierPanel getSpecifierPanel(java.lang.String preferencesNodeName)
preferencesNodeName
- the preferences node name from which the initial settings
will be taken.public static java.lang.String getName()
public WritableImage filter(ReadableImage image) throws InvalidImageException, java.io.IOException
SpatialFilter
filter
in interface SpatialFilter
image
- the image to be filtered.InvalidImageException
- if the supplied image cannot be filtered with this filter.java.io.IOException
- if an I/O error occurs.public WritableImage filter(ReadableImage image, MonitorWorker worker, boolean verbose) throws InvalidImageException, java.io.IOException, CancelledException
SpatialFilter
filter
in interface SpatialFilter
image
- the image to be filtered.worker
- the MonitorWorker that may be used to cancel the filter operation.verbose
- whether verbose reporting to System.out is turned on.InvalidImageException
- if the supplied image cannot be filtered with this filter.java.io.IOException
- if an I/O error occurs.CancelledException
- if the filter operation is cancelled by the user or
programmatically.public void filterInPlace(WritableImage image) throws InvalidImageException, java.io.IOException
SpatialFilter
filterInPlace
in interface SpatialFilter
image
- the image to be filtered.InvalidImageException
- if the supplied image cannot be filtered with this filter.java.io.IOException
- if an I/O error occurs.public void filterInPlace(WritableImage image, MonitorWorker worker, boolean verbose) throws InvalidImageException, java.io.IOException, CancelledException
SpatialFilter
filterInPlace
in interface SpatialFilter
image
- the image to be filtered.worker
- the MonitorWorker that may be used to cancel the filter operation.verbose
- whether verbose reporting to System.out is turned on.InvalidImageException
- if the supplied image cannot be filtered with this filter.java.io.IOException
- if an I/O error occurs.CancelledException
- if the filter operation is cancelled by the user or
programmatically.public void filterInPlace(java.lang.Object pixels, PixelDataType dataType, int nCols, int nRows, int nSlices)
SpatialFilter
filterInPlace
in interface SpatialFilter
pixels
- the array of image pixel values.dataType
- the PixelDataType of the pixels.nCols
- the number of image columns.nRows
- the number of image rows.nSlices
- the number of image slices.public void filterInPlace(java.lang.Object pixels, PixelDataType dataType, int nCols, int nRows, int nSlices, MonitorWorker worker, boolean verbose) throws CancelledException
SpatialFilter
filterInPlace
in interface SpatialFilter
pixels
- the array of image pixel values.dataType
- the PixelDataType of the pixels.nCols
- the number of image columns.nRows
- the number of image rows.nSlices
- the number of image slices.worker
- the MonitorWorker that may be used to cancel the filter operation.verbose
- whether verbose reporting to System.out is turned on.CancelledException
- if the filter operation is cancelled by the user or
programmatically.public static void main(java.lang.String[] args)
args
- the program aguments (ignored).Copyright 2017 Xinapse Systems Limited. All Rights Reserved.