com.jhlabs.image
Class OpacityFilter

java.lang.Object
  extended by com.jhlabs.image.AbstractBufferedImageOp
      extended by com.jhlabs.image.PointFilter
          extended by com.jhlabs.image.OpacityFilter
All Implemented Interfaces:
ImageProcessorInterface, 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).
 
Method Summary
 int filterRGB(int x, int y, int rgb)
           
 int getOpacity()
          Get the opacity setting.
 void setOpacity(int opacity)
          Set the opacity.
 java.lang.String toString()
           
 
Methods inherited from class com.jhlabs.image.PointFilter
filter, setDimensions
 
Methods inherited from class com.jhlabs.image.AbstractBufferedImageOp
createCompatibleDestImage, getBounds2D, getPoint2D, getRenderingHints, getRGB, process, setRGB
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, 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).

Method Detail

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