com.jhlabs.image
Class OpacityFilter
java.lang.Object
com.jhlabs.image.AbstractBufferedImageOp
com.jhlabs.image.PointFilter
com.jhlabs.image.OpacityFilter
- All Implemented Interfaces:
- java.awt.image.BufferedImageOp, java.io.Serializable, java.lang.Cloneable
public class OpacityFilter
- extends PointFilter
- implements java.io.Serializable
Sets the opacity (alpha) of every pixel in an image to a constant value.
- See Also:
- Serialized Form
Constructor Summary |
OpacityFilter()
Construct an OpacityFilter with 50% opacity. |
OpacityFilter(int opacity)
Construct an OpacityFilter with the given opacity (alpha). |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
OpacityFilter
public OpacityFilter()
- Construct an OpacityFilter with 50% opacity.
OpacityFilter
public OpacityFilter(int opacity)
- Construct an OpacityFilter with the given opacity (alpha).
setOpacity
public void setOpacity(int opacity)
- Set the opacity.
- Parameters:
opacity
- the opacity (alpha) in the range 0..255
getOpacity
public int getOpacity()
- Get the opacity setting.
- Returns:
- the opacity
filterRGB
public int filterRGB(int x,
int y,
int rgb)
- Specified by:
filterRGB
in class PointFilter
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object