Class SharpenImageProcessor
- java.lang.Object
-
- org.openstreetmap.josm.gui.layer.imagery.SharpenImageProcessor
-
- All Implemented Interfaces:
SessionAwareReadApply
,ImageProcessor
public class SharpenImageProcessor extends 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_BLUR
private static float[]
KERNEL_IDENTITY
private static float[]
KERNEL_SHARPEN
private ConvolveOp
op
private float
sharpenLevel
-
Constructor Summary
Constructors Constructor Description SharpenImageProcessor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
applyFromPropertiesMap(Map<String,String> properties)
Import settings from a map of properties.private static ConvolveOp
generateMixed(float aFactor, float[] a, float[] b)
float
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
setSharpenLevel(float sharpenLevel)
Sets the sharpening level.Map<String,String>
toPropertiesMap()
Export settings to a map of properties.String
toString()
-
-
-
Field Detail
-
sharpenLevel
private float sharpenLevel
-
op
private 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 ConvolveOp generateMixed(float aFactor, float[] a, float[] b)
-
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
-
applyFromPropertiesMap
public void applyFromPropertiesMap(Map<String,String> properties)
Description copied from interface:SessionAwareReadApply
Import settings from a map of properties.- Specified by:
applyFromPropertiesMap
in interfaceSessionAwareReadApply
- Parameters:
properties
- properties map
-
toPropertiesMap
public Map<String,String> toPropertiesMap()
Description copied from interface:SessionAwareReadApply
Export settings to a map of properties.- Specified by:
toPropertiesMap
in interfaceSessionAwareReadApply
- Returns:
- map of properties
-
-