Package com.jhlabs.image
Class OpacityFilter
java.lang.Object
com.jhlabs.image.AbstractBufferedImageOp
com.jhlabs.image.PointFilter
com.jhlabs.image.OpacityFilter
- All Implemented Interfaces:
BufferedImageOp
,Serializable
,Cloneable
Sets the opacity (alpha) of every pixel in an image to a constant value.
- See Also:
-
Field Summary
Fields inherited from class com.jhlabs.image.PointFilter
canFilterIndexColorModel
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct an OpacityFilter with 50% opacity.OpacityFilter
(int opacity) Construct an OpacityFilter with the given opacity (alpha). -
Method Summary
Modifier and TypeMethodDescriptionint
filterRGB
(int x, int y, int rgb) int
Get the opacity setting.void
setOpacity
(int opacity) Set the opacity.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
-
Constructor Details
-
OpacityFilter
public OpacityFilter()Construct an OpacityFilter with 50% opacity. -
OpacityFilter
public OpacityFilter(int opacity) Construct an OpacityFilter with the given opacity (alpha).
-
-
Method Details
-
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 classPointFilter
-
toString
-