Package org.apache.batik.gvt.filter
Class MaskRable8Bit
- java.lang.Object
-
- org.apache.batik.ext.awt.image.renderable.AbstractRable
-
- org.apache.batik.gvt.filter.MaskRable8Bit
-
public class MaskRable8Bit extends AbstractRable implements Mask
MaskRable implementation
-
-
Field Summary
Fields Modifier and Type Field Description protected java.awt.geom.Rectangle2D
filterRegion
Region to which the mask appliesprotected GraphicsNode
mask
The node who's outline specifies our mask.-
Fields inherited from class org.apache.batik.ext.awt.image.renderable.AbstractRable
props, srcs, stamp
-
-
Constructor Summary
Constructors Constructor Description MaskRable8Bit(Filter src, GraphicsNode mask, java.awt.geom.Rectangle2D filterRegion)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.image.RenderedImage
createRendering(java.awt.image.renderable.RenderContext rc)
java.awt.geom.Rectangle2D
getBounds2D()
Pass-through: returns the source's boundsjava.awt.geom.Rectangle2D
getFilterRegion()
The region to which this mask appliesGraphicsNode
getMaskNode()
Returns the Graphics node that the mask operation will use to define the masking image.Filter
getSource()
This returns the current image being masked by the mask node.void
setFilterRegion(java.awt.geom.Rectangle2D filterRegion)
Returns the filter region to which this mask appliesvoid
setMaskNode(GraphicsNode mask)
Set the masking image to that described by gn.void
setSource(Filter src)
The source to be masked by the mask node.-
Methods inherited from class org.apache.batik.ext.awt.image.renderable.AbstractRable
createDefaultRendering, createScaledRendering, getDependencyRegion, getDirtyRegion, getHeight, getMinX, getMinY, getProperty, getPropertyNames, getSources, getTimeStamp, getWidth, init, init, init, init, isDynamic, touch
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.batik.ext.awt.image.renderable.Filter
getDependencyRegion, getDirtyRegion, getTimeStamp
-
-
-
-
Field Detail
-
mask
protected GraphicsNode mask
The node who's outline specifies our mask.
-
filterRegion
protected java.awt.geom.Rectangle2D filterRegion
Region to which the mask applies
-
-
Constructor Detail
-
MaskRable8Bit
public MaskRable8Bit(Filter src, GraphicsNode mask, java.awt.geom.Rectangle2D filterRegion)
-
-
Method Detail
-
setSource
public void setSource(Filter src)
The source to be masked by the mask node.
-
getSource
public Filter getSource()
This returns the current image being masked by the mask node.
-
getFilterRegion
public java.awt.geom.Rectangle2D getFilterRegion()
The region to which this mask applies- Specified by:
getFilterRegion
in interfaceMask
-
setFilterRegion
public void setFilterRegion(java.awt.geom.Rectangle2D filterRegion)
Returns the filter region to which this mask applies- Specified by:
setFilterRegion
in interfaceMask
-
setMaskNode
public void setMaskNode(GraphicsNode mask)
Set the masking image to that described by gn. If gn is an rgba image then the alpha is premultiplied and then the rgb is converted to alpha via the standard feColorMatrix rgb to luminance conversion. In the case of an rgb only image, just the rgb to luminance conversion is performed.- Specified by:
setMaskNode
in interfaceMask
- Parameters:
mask
- The graphics node that defines the mask image.
-
getMaskNode
public GraphicsNode getMaskNode()
Returns the Graphics node that the mask operation will use to define the masking image.- Specified by:
getMaskNode
in interfaceMask
- Returns:
- The graphics node that defines the mask image.
-
getBounds2D
public java.awt.geom.Rectangle2D getBounds2D()
Pass-through: returns the source's bounds- Specified by:
getBounds2D
in interfaceFilter
- Overrides:
getBounds2D
in classAbstractRable
-
createRendering
public java.awt.image.RenderedImage createRendering(java.awt.image.renderable.RenderContext rc)
- Specified by:
createRendering
in interfacejava.awt.image.renderable.RenderableImage
-
-