com.alee.graphics.filters
Class OpacityFilter

java.lang.Object
  extended by com.alee.graphics.filters.AbstractBufferedImageOp
      extended by com.alee.graphics.filters.PointFilter
          extended by com.alee.graphics.filters.OpacityFilter
All Implemented Interfaces:
java.awt.image.BufferedImageOp

public class OpacityFilter
extends PointFilter

Sets the opacity (alpha) of every pixel in an image to a constant value.


Field Summary
 
Fields inherited from class com.alee.graphics.filters.PointFilter
canFilterIndexColorModel
 
Constructor Summary
OpacityFilter()
          Construct an OpacityFilter with 50% opacity.
OpacityFilter(int opacity)
          Construct an OpacityFilter with the given opacity (alpha).
 
Method Summary
 int filterRGB(int x, int y, int rgb)
           
 int getOpacity()
          Get the opacity setting.
 void setOpacity(int opacity)
          Set the opacity.
 
Methods inherited from class com.alee.graphics.filters.PointFilter
filter, setDimensions
 
Methods inherited from class com.alee.graphics.filters.AbstractBufferedImageOp
createCompatibleDestImage, getBounds2D, getPoint2D, getRenderingHints, getRGB, setRGB
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OpacityFilter

public OpacityFilter()
Construct an OpacityFilter with 50% opacity.


OpacityFilter

public OpacityFilter(int opacity)
Construct an OpacityFilter with the given opacity (alpha).

Parameters:
opacity - the opacity (alpha) in the range 0..255
Method Detail

setOpacity

public void setOpacity(int opacity)
Set the opacity.

Parameters:
opacity - the opacity (alpha) in the range 0..255
See Also:
getOpacity()

getOpacity

public int getOpacity()
Get the opacity setting.

Returns:
the opacity
See Also:
setOpacity(int)

filterRGB

public int filterRGB(int x,
                     int y,
                     int rgb)
Specified by:
filterRGB in class PointFilter