Package com.jhlabs.image
Class SaturationFilter
- java.lang.Object
-
- com.jhlabs.image.AbstractBufferedImageOp
-
- com.jhlabs.image.PointFilter
-
- com.jhlabs.image.SaturationFilter
-
- All Implemented Interfaces:
java.awt.image.BufferedImageOp
,java.lang.Cloneable
public class SaturationFilter extends PointFilter
A filter to change the saturation of an image. This works by calculating a grayscale version of the image and then extrapolating away from it.
-
-
Field Summary
Fields Modifier and Type Field Description float
amount
-
Fields inherited from class com.jhlabs.image.PointFilter
canFilterIndexColorModel
-
-
Constructor Summary
Constructors Constructor Description SaturationFilter()
Construct a SaturationFilter.SaturationFilter(float amount)
Construct a SaturationFilter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
filterRGB(int x, int y, int rgb)
float
getAmount()
Set the amount of saturation change.void
setAmount(float amount)
Set the amount of saturation change.java.lang.String
toString()
-
Methods inherited from class com.jhlabs.image.PointFilter
filter, setDimensions
-
Methods inherited from class com.jhlabs.image.AbstractBufferedImageOp
clone, createCompatibleDestImage, getBounds2D, getPoint2D, getRenderingHints, getRGB, setRGB, stringToColor
-
-
-
-
Method Detail
-
setAmount
public void setAmount(float amount)
Set the amount of saturation change. 1 leaves the image unchanged, values between 0 and 1 desaturate, 0 completely desaturates it and values above 1 increase the saturation.- Parameters:
amount
- the amount- See Also:
getAmount()
-
getAmount
public float getAmount()
Set the amount of saturation change.- Returns:
- the amount
- See Also:
setAmount(float)
-
filterRGB
public int filterRGB(int x, int y, int rgb)
- Specified by:
filterRGB
in classPointFilter
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-