Class FilterChainRable8Bit
java.lang.Object
org.apache.batik.ext.awt.image.renderable.AbstractRable
org.apache.batik.ext.awt.image.renderable.FilterChainRable8Bit
- All Implemented Interfaces:
RenderableImage, Filter, FilterChainRable, PaintRable
Implements a filter chain. A filter chain is defined by its
filter region (i.e., the bounding box of its input/output), its
filter resolution and its source. Its source cannot be null,
but its resolution can.
The filter chain decomposes as follows:
The filter chain decomposes as follows:
- A pad operation that makes the input image a big as the filter region.
- If there is a filterResolution specified along at least
one of the axis, a
AffineRable
- Version:
- $Id$
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate FilterThe chain's sourceprivate PadRableCrop operation.private Rectangle2DFilter regionprivate FilterResRableScale operation.private intResolution along the X axisprivate intResolution along the Y axisFields inherited from class AbstractRable
props, srcs, stampFields inherited from interface RenderableImage
HINTS_OBSERVED -
Constructor Summary
ConstructorsConstructorDescriptionFilterChainRable8Bit(Filter source, Rectangle2D filterRegion) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptioncreateRendering(RenderContext context) Returns this filter's boundsReturns the filter output area, in user spaceintReturns the resolution along the X axis.intReturns the resolution along the Y axis.Returns the source of the chain.booleanpaintRable(Graphics2D g2d) Should perform the equivilent action as createRendering followed by drawing the RenderedImage to Graphics2D, or return false.voidsetFilterRegion(Rectangle2D filterRegion) Sets the filter output area, in user space.voidsetFilterResolutionX(int filterResolutionX) Sets the resolution along the X axis, i.e., the maximum size for intermediate images along that axis.voidsetFilterResolutionY(int filterResolutionY) Sets the resolution along the Y axis, i.e., the maximum size for intermediate images along that axis.voidSets the source to be src.private voidImplementation.Methods inherited from class AbstractRable
createDefaultRendering, createScaledRendering, getDependencyRegion, getDirtyRegion, getHeight, getMinX, getMinY, getProperty, getPropertyNames, getSources, getTimeStamp, getWidth, init, init, init, init, isDynamic, touchMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Filter
getDependencyRegion, getDirtyRegion, getTimeStampMethods inherited from interface RenderableImage
createDefaultRendering, createScaledRendering, getHeight, getMinX, getMinY, getProperty, getPropertyNames, getSources, getWidth, isDynamic
-
Field Details
-
filterResolutionX
private int filterResolutionXResolution along the X axis -
filterResolutionY
private int filterResolutionYResolution along the Y axis -
chainSource
The chain's source -
filterRes
Scale operation. May be null -
crop
Crop operation. -
filterRegion
Filter region
-
-
Constructor Details
-
FilterChainRable8Bit
Default constructor.
-
-
Method Details
-
getFilterResolutionX
public int getFilterResolutionX()Returns the resolution along the X axis.- Specified by:
getFilterResolutionXin interfaceFilterChainRable
-
setFilterResolutionX
public void setFilterResolutionX(int filterResolutionX) Sets the resolution along the X axis, i.e., the maximum size for intermediate images along that axis. If filterResolutionX is less than zero, no filter resolution is forced on the filter chain. If filterResolutionX is zero, then the filter returns null. If filterResolutionX is positive, then the filter resolution is applied.- Specified by:
setFilterResolutionXin interfaceFilterChainRable
-
getFilterResolutionY
public int getFilterResolutionY()Returns the resolution along the Y axis.- Specified by:
getFilterResolutionYin interfaceFilterChainRable
-
setFilterResolutionY
public void setFilterResolutionY(int filterResolutionY) Sets the resolution along the Y axis, i.e., the maximum size for intermediate images along that axis. If filterResolutionY is zero or less, the value of filterResolutionX is used.- Specified by:
setFilterResolutionYin interfaceFilterChainRable
-
setupFilterRes
private void setupFilterRes()Implementation. Checks the current value of the filterResolutionX and filterResolutionY attribute and setup the filterRes operation accordingly. -
setFilterRegion
Sets the filter output area, in user space. A null value is illegal.- Specified by:
setFilterRegionin interfaceFilterChainRable
-
getFilterRegion
Returns the filter output area, in user space- Specified by:
getFilterRegionin interfaceFilterChainRable
-
getSource
Returns the source of the chain. Note that a crop and affine operation may be inserted before the source, depending on the filterRegion and filterResolution parameters.- Specified by:
getSourcein interfaceFilterChainRable
-
setSource
Sets the source to be src.- Specified by:
setSourcein interfaceFilterChainRable- Parameters:
chainSource- image to the chain.
-
getBounds2D
Returns this filter's bounds- Specified by:
getBounds2Din interfaceFilter- Overrides:
getBounds2Din classAbstractRable
-
paintRable
Should perform the equivilent action as createRendering followed by drawing the RenderedImage to Graphics2D, or return false.- Specified by:
paintRablein interfacePaintRable- Parameters:
g2d- The Graphics2D to draw to.- Returns:
- true if the paint call succeeded, false if for some reason the paint failed (in which case a createRendering should be used).
-
createRendering
- Specified by:
createRenderingin interfaceRenderableImage
-