public class SVGRasterizer
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
protected class |
SVGRasterizer.Rasterizer
An image transcoder that stores the resulting image.
|
Modifier and Type | Field and Description |
---|---|
protected org.apache.batik.transcoder.TranscodingHints |
hints
The transcoder hints.
|
protected java.awt.image.BufferedImage |
img
The image that represents the SVG document.
|
protected org.apache.batik.transcoder.TranscoderInput |
input
The transcoder input.
|
Constructor and Description |
---|
SVGRasterizer(java.io.InputStream istream)
Constructs a new SVGRasterizer converter.
|
SVGRasterizer(java.io.Reader reader)
Constructs a new SVGRasterizer converter.
|
SVGRasterizer(java.lang.String uri)
Constructs a new SVGRasterizer.
|
SVGRasterizer(java.net.URL url)
Constructs a new SVGRasterizer.
|
Modifier and Type | Method and Description |
---|---|
java.awt.image.BufferedImage |
createBufferedImage()
Returns the image that represents the SVG document.
|
void |
createJPEG(java.io.OutputStream outputStream)
Returns the image that represents the SVG document as a JPEG.
|
void |
setAlternateStylesheet(java.lang.String alternateStylesheet)
Sets the alternate stylesheet to use.
|
void |
setBackgroundColor(java.awt.Paint p)
Sets the Paint to use for the background of the image.
|
void |
setImageHeight(float height)
Sets the height of the image to rasterize.
|
void |
setImageWidth(float width)
Sets the width of the image to rasterize.
|
void |
setLanguages(java.lang.String language)
Sets the preferred language to use.
|
void |
setMedia(java.lang.String media)
Sets the media to rasterize.
|
void |
setPixelToMMFactor(float px2mm)
Sets the unit conversion factor to the specified value.
|
void |
setQuality(float quality)
Sets the quality of the image to rasterize when rasterizing to a JPEG.
|
void |
setUserStyleSheetURI(java.lang.String uri)
Sets the uri of the user stylesheet.
|
void |
setXMLParserValidating(boolean b)
Sets whether or not the XML parser used to parse SVG document should be
validating or not, depending on the specified parameter.
|
protected org.apache.batik.transcoder.TranscoderInput input
protected org.apache.batik.transcoder.TranscodingHints hints
protected java.awt.image.BufferedImage img
public SVGRasterizer(java.lang.String uri)
uri
- the uri of the document to rasterizepublic SVGRasterizer(java.net.URL url)
url
- the URL of the document to rasterizepublic SVGRasterizer(java.io.InputStream istream)
istream
- the input stream that represents the SVG document to
rasterizepublic SVGRasterizer(java.io.Reader reader)
reader
- the reader that represents the SVG document to rasterizepublic java.awt.image.BufferedImage createBufferedImage() throws org.apache.batik.transcoder.TranscoderException
org.apache.batik.transcoder.TranscoderException
public void createJPEG(java.io.OutputStream outputStream) throws org.apache.batik.transcoder.TranscoderException
outputStream
- The stream to use.org.apache.batik.transcoder.TranscoderException
public void setQuality(float quality)
quality
- the percentage qualitypublic void setImageWidth(float width)
width
- the image widthpublic void setImageHeight(float height)
height
- the image heightpublic void setLanguages(java.lang.String language)
language
- the preferred language to usepublic void setPixelToMMFactor(float px2mm)
px2mm
- the pixel to millimeter conversion factor.public void setUserStyleSheetURI(java.lang.String uri)
uri
- the uri of the user stylesheetpublic void setXMLParserValidating(boolean b)
b
- true means the XML parser will validate its inputpublic void setMedia(java.lang.String media)
media
- the media to usepublic void setAlternateStylesheet(java.lang.String alternateStylesheet)
alternateStylesheet
- the alternate stylesheet to use if possiblepublic void setBackgroundColor(java.awt.Paint p)
p
- the paint to use for the background
Version: 5.4.10-ice35-b105
Copyright © 2019 The University of Dundee & Open Microscopy Environment. All Rights Reserved.