Class ImageryFilterSettings
- java.lang.Object
-
- org.openstreetmap.josm.gui.layer.imagery.ImageryFilterSettings
-
- All Implemented Interfaces:
ImageProcessor
public class ImageryFilterSettings extends Object implements ImageProcessor
This class holds the filter settings for an imagery.- Since:
- 10547
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ImageryFilterSettings.FilterChangeListener
A listener that listens to filter changes
-
Field Summary
Fields Modifier and Type Field Description protected ColorfulImageProcessor
colorfulnessImageProcessor
private List<ImageryFilterSettings.FilterChangeListener>
filterChangeListeners
protected GammaImageProcessor
gammaImageProcessor
protected SharpenImageProcessor
sharpenImageProcessor
-
Constructor Summary
Constructors Constructor Description ImageryFilterSettings()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFilterChangeListener(ImageryFilterSettings.FilterChangeListener l)
Adds a filter change listenerprivate void
fireListeners()
double
getColorfulness()
Gets the colorfulness of this image.double
getGamma()
Returns the currently set gamma value.List<ImageProcessor>
getProcessors()
Gets the image processors for this setting.double
getSharpenLevel()
Gets the current sharpen level.BufferedImage
process(BufferedImage image)
This method should process given image according to image processors which is contained in the layervoid
removeFilterChangeListener(ImageryFilterSettings.FilterChangeListener l)
Removes a filter change listenervoid
setColorfulness(double colorfulness)
Sets the colorfulness of this image.void
setGamma(double gamma)
Sets a new gamma value,1
stands for no correction.void
setSharpenLevel(double sharpenLevel)
Sets the sharpen level for the imagery.
-
-
-
Field Detail
-
gammaImageProcessor
protected GammaImageProcessor gammaImageProcessor
-
sharpenImageProcessor
protected SharpenImageProcessor sharpenImageProcessor
-
colorfulnessImageProcessor
protected ColorfulImageProcessor colorfulnessImageProcessor
-
filterChangeListeners
private final List<ImageryFilterSettings.FilterChangeListener> filterChangeListeners
-
-
Constructor Detail
-
ImageryFilterSettings
public ImageryFilterSettings()
-
-
Method Detail
-
getGamma
public double getGamma()
Returns the currently set gamma value.- Returns:
- the currently set gamma value
-
setGamma
public void setGamma(double gamma)
Sets a new gamma value,1
stands for no correction.- Parameters:
gamma
- new gamma value
-
getSharpenLevel
public double getSharpenLevel()
Gets the current sharpen level.- Returns:
- The sharpen level.
-
setSharpenLevel
public void setSharpenLevel(double sharpenLevel)
Sets the sharpen level for the imagery.1
means no change in sharpness. Values in range 0..1 blur the image. Values above 1 are used to sharpen the image.- Parameters:
sharpenLevel
- The sharpen level.
-
getColorfulness
public double getColorfulness()
Gets the colorfulness of this image.- Returns:
- The colorfulness
-
setColorfulness
public void setColorfulness(double colorfulness)
Sets the colorfulness of this image. 0 means grayscale. 1 means normal colorfulness. Values greater than 1 are allowed.- Parameters:
colorfulness
- The colorfulness.
-
getProcessors
public List<ImageProcessor> getProcessors()
Gets the image processors for this setting.- Returns:
- The processors in the order in which they should be applied.
-
process
public BufferedImage process(BufferedImage image)
Description copied from interface:ImageProcessor
This method should process given image according to image processors which is contained in the layer- Specified by:
process
in interfaceImageProcessor
- Parameters:
image
- that should be processed- Returns:
- processed image
-
addFilterChangeListener
public void addFilterChangeListener(ImageryFilterSettings.FilterChangeListener l)
Adds a filter change listener- Parameters:
l
- The listener
-
removeFilterChangeListener
public void removeFilterChangeListener(ImageryFilterSettings.FilterChangeListener l)
Removes a filter change listener- Parameters:
l
- The listener
-
fireListeners
private void fireListeners()
-
-