Class ImageConverterSVG2G2D
java.lang.Object
org.apache.xmlgraphics.image.loader.impl.AbstractImageConverter
org.apache.fop.image.loader.batik.ImageConverterSVG2G2D
- All Implemented Interfaces:
org.apache.xmlgraphics.image.loader.spi.ImageConverter
public class ImageConverterSVG2G2D
extends org.apache.xmlgraphics.image.loader.impl.AbstractImageConverter
This ImageConverter converts SVG images to Java2D.
Note: The target flavor is "generic" Java2D. No Batik-specific bridges are hooked into the conversion process. Specialized renderers may want to provide specialized adapters to profit from target-format features (for example with PDF or PS). This converter is mainly for formats which only support bitmap images or rudimentary Java2D support.
-
Field Summary
Fields inherited from interface org.apache.xmlgraphics.image.loader.spi.ImageConverter
MEDIUM_CONVERSION_PENALTY, MINIMAL_CONVERSION_PENALTY, NO_CONVERSION_PENALTY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.xmlgraphics.image.loader.Image
protected SimpleSVGUserAgent
createBatikUserAgent
(float pxToMillimeter) Creates a user agent for Batik.protected org.apache.xmlgraphics.java2d.Graphics2DImagePainter
createPainter
(org.apache.batik.bridge.BridgeContext ctx, org.apache.batik.gvt.GraphicsNode root, Dimension imageSize) Creates a Graphics 2D image painterorg.apache.xmlgraphics.image.loader.ImageFlavor
org.apache.xmlgraphics.image.loader.ImageFlavor
Methods inherited from class org.apache.xmlgraphics.image.loader.impl.AbstractImageConverter
checkSourceFlavor, getConversionPenalty
-
Constructor Details
-
ImageConverterSVG2G2D
public ImageConverterSVG2G2D()
-
-
Method Details
-
convert
public org.apache.xmlgraphics.image.loader.Image convert(org.apache.xmlgraphics.image.loader.Image src, Map hints) throws org.apache.xmlgraphics.image.loader.ImageException - Throws:
org.apache.xmlgraphics.image.loader.ImageException
-
createBatikUserAgent
Creates a user agent for Batik. Override to provide your own user agent.- Parameters:
pxToMillimeter
- the source resolution (in px per millimeter)- Returns:
- the newly created user agent
-
createPainter
protected org.apache.xmlgraphics.java2d.Graphics2DImagePainter createPainter(org.apache.batik.bridge.BridgeContext ctx, org.apache.batik.gvt.GraphicsNode root, Dimension imageSize) Creates a Graphics 2D image painter- Parameters:
ctx
- the bridge contextroot
- the graphics node rootimageSize
- the image size- Returns:
- the newly created graphics 2d image painter
-
getSourceFlavor
public org.apache.xmlgraphics.image.loader.ImageFlavor getSourceFlavor() -
getTargetFlavor
public org.apache.xmlgraphics.image.loader.ImageFlavor getTargetFlavor()
-