Class FilterResRable8Bit
java.lang.Object
org.apache.batik.ext.awt.image.renderable.AbstractRable
org.apache.batik.ext.awt.image.renderable.FilterResRable8Bit
- All Implemented Interfaces:
RenderableImage, Filter, FilterResRable, PaintRable
Interface for implementing filter resolution.
- Version:
- $Id$
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intFilter resolution along the x-axisprivate intFilter resolution along the y-axis(package private) ReferenceCached Rendered image at filterRes.(package private) floatFields inherited from class AbstractRable
props, srcs, stampFields inherited from interface RenderableImage
HINTS_OBSERVED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanThis returns true ifriand all ofri's sources implement the PaintRable interface.createRendering(RenderContext renderContext) booleandistributeAcross(RenderableImage src, Graphics2D g2d) This function attempts to distribute the filterRes operation across src.intReturns the resolution along the X axis.intReturns the resolution along the Y axis.private RenderedImagegetResRed(RenderingHints hints) private floatReturns the source to be cropped.booleanpaintRable(Graphics2D g2d) Should perform the equivilent action as createRendering followed by drawing the RenderedImage.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 croppedMethods inherited from class AbstractRable
createDefaultRendering, createScaledRendering, getBounds2D, 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
getBounds2D, getDependencyRegion, getDirtyRegion, getTimeStampMethods inherited from interface RenderableImage
createDefaultRendering, createScaledRendering, getHeight, getMinX, getMinY, getProperty, getPropertyNames, getSources, getWidth, isDynamic
-
Field Details
-
filterResolutionX
private int filterResolutionXFilter resolution along the x-axis -
filterResolutionY
private int filterResolutionYFilter resolution along the y-axis -
resRed
Reference resRedCached Rendered image at filterRes. -
resScale
float resScale
-
-
Constructor Details
-
FilterResRable8Bit
public FilterResRable8Bit() -
FilterResRable8Bit
-
-
Method Details
-
getSource
Returns the source to be cropped.- Specified by:
getSourcein interfaceFilterResRable
-
setSource
Sets the source to be cropped- Specified by:
setSourcein interfaceFilterResRable- Parameters:
src- image to offset.
-
getFilterResolutionX
public int getFilterResolutionX()Returns the resolution along the X axis.- Specified by:
getFilterResolutionXin interfaceFilterResRable
-
setFilterResolutionX
public void setFilterResolutionX(int filterResolutionX) Sets the resolution along the X axis, i.e., the maximum size for intermediate images along that axis. The value should be greater than zero to have an effect. Negative values are illegal.- Specified by:
setFilterResolutionXin interfaceFilterResRable
-
getFilterResolutionY
public int getFilterResolutionY()Returns the resolution along the Y axis.- Specified by:
getFilterResolutionYin interfaceFilterResRable
-
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 the Y-value is less than zero, the scale applied to the rendered images is computed to preserve the image's aspect ratio- Specified by:
setFilterResolutionYin interfaceFilterResRable
-
allPaintRable
This returns true ifriand all ofri's sources implement the PaintRable interface. This is used to indicate that the chain has a good potential for bypassing the filterRes operation entirely. Ideally there would be a checkPaintRable method in PaintRable that could be used to get a definate answer about a filters ability to draw directly to a Graphics2D (this can sometimes 'fail' because of the way the Graphics2D is currently configured). -
distributeAcross
This function attempts to distribute the filterRes operation across src. Right now it knows about two operations, pad and composite. It's main target is the composite but often pad operations are sprinked in the chain so it needs to know about them. This list could be extended however if it gets much longer it should probably be rolled into a new 'helper interface' like PaintRable. NOTE: This is essentially a bad hack, but it is a hack that is recomended by the SVG specification so I do it. -
paintRable
Should perform the equivilent action as createRendering followed by drawing the RenderedImage.- 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).
-
getResScale
private float getResScale() -
getResRed
-
createRendering
- Specified by:
createRenderingin interfaceRenderableImage
-