org.apache.batik.ext.awt.image.renderable

Class FilterChainRable8Bit

public class FilterChainRable8Bit extends AbstractRable implements 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:
Constructor Summary
FilterChainRable8Bit(Filter source, Rectangle2D filterRegion)
Default constructor.
Method Summary
RenderedImagecreateRendering(RenderContext context)
Rectangle2DgetBounds2D()
Returns this filter's bounds
Rectangle2DgetFilterRegion()
Returns the filter output area, in user space
intgetFilterResolutionX()
Returns the resolution along the X axis.
intgetFilterResolutionY()
Returns the resolution along the Y axis.
FiltergetSource()
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.
voidsetSource(Filter chainSource)
Sets the source to be src.

Constructor Detail

FilterChainRable8Bit

public FilterChainRable8Bit(Filter source, Rectangle2D filterRegion)
Default constructor.

Method Detail

createRendering

public RenderedImage createRendering(RenderContext context)

getBounds2D

public Rectangle2D getBounds2D()
Returns this filter's bounds

getFilterRegion

public Rectangle2D getFilterRegion()
Returns the filter output area, in user space

getFilterResolutionX

public int getFilterResolutionX()
Returns the resolution along the X axis.

getFilterResolutionY

public int getFilterResolutionY()
Returns the resolution along the Y axis.

getSource

public Filter 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.

paintRable

public boolean paintRable(Graphics2D g2d)
Should perform the equivilent action as createRendering followed by drawing the RenderedImage to Graphics2D, or return false.

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).

setFilterRegion

public void setFilterRegion(Rectangle2D filterRegion)
Sets the filter output area, in user space. A null value is illegal.

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.

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.

setSource

public void setSource(Filter chainSource)
Sets the source to be src.

Parameters: chainSource image to the chain.

Copyright B) 2008 Apache Software Foundation. All Rights Reserved.