Class SharpenImageProcessor
- java.lang.Object
-
- org.openstreetmap.josm.gui.layer.imagery.SharpenImageProcessor
-
- All Implemented Interfaces:
SessionAwareReadApply,ImageProcessor
public class SharpenImageProcessor extends java.lang.Object implements ImageProcessor, SessionAwareReadApply
Sharpens or blurs the image, depending on the sharpen value.A positive sharpen level means that we sharpen the image.
A negative sharpen level let's us blur the image. -1 is the most useful value there.
- Since:
- 10547
-
-
Field Summary
Fields Modifier and Type Field Description private static float[]KERNEL_BLURprivate static float[]KERNEL_IDENTITYprivate static float[]KERNEL_SHARPENprivate java.awt.image.ConvolveOpopprivate floatsharpenLevel
-
Constructor Summary
Constructors Constructor Description SharpenImageProcessor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapplyFromPropertiesMap(java.util.Map<java.lang.String,java.lang.String> properties)Import settings from a map of properties.private static java.awt.image.ConvolveOpgenerateMixed(float aFactor, float[] a, float[] b)floatgetSharpenLevel()Gets the current sharpen level.java.awt.image.BufferedImageprocess(java.awt.image.BufferedImage image)This method should process given image according to image processors which is contained in the layervoidsetSharpenLevel(float sharpenLevel)Sets the sharpening level.java.util.Map<java.lang.String,java.lang.String>toPropertiesMap()Export settings to a map of properties.java.lang.StringtoString()
-
-
-
Field Detail
-
sharpenLevel
private float sharpenLevel
-
op
private java.awt.image.ConvolveOp op
-
KERNEL_IDENTITY
private static final float[] KERNEL_IDENTITY
-
KERNEL_BLUR
private static final float[] KERNEL_BLUR
-
KERNEL_SHARPEN
private static final float[] KERNEL_SHARPEN
-
-
Constructor Detail
-
SharpenImageProcessor
public SharpenImageProcessor()
-
-
Method Detail
-
getSharpenLevel
public float getSharpenLevel()
Gets the current sharpen level.- Returns:
- The level.
-
setSharpenLevel
public void setSharpenLevel(float sharpenLevel)
Sets the sharpening level.- Parameters:
sharpenLevel- The level. Clamped to be positive or 0.
-
generateMixed
private static java.awt.image.ConvolveOp generateMixed(float aFactor, float[] a, float[] b)
-
process
public java.awt.image.BufferedImage process(java.awt.image.BufferedImage image)
Description copied from interface:ImageProcessorThis method should process given image according to image processors which is contained in the layer- Specified by:
processin interfaceImageProcessor- Parameters:
image- that should be processed- Returns:
- processed image
-
applyFromPropertiesMap
public void applyFromPropertiesMap(java.util.Map<java.lang.String,java.lang.String> properties)
Description copied from interface:SessionAwareReadApplyImport settings from a map of properties.- Specified by:
applyFromPropertiesMapin interfaceSessionAwareReadApply- Parameters:
properties- properties map
-
toPropertiesMap
public java.util.Map<java.lang.String,java.lang.String> toPropertiesMap()
Description copied from interface:SessionAwareReadApplyExport settings to a map of properties.- Specified by:
toPropertiesMapin interfaceSessionAwareReadApply- Returns:
- map of properties
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-