public class SVGRasterizer extends 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 BufferedImage |
img
The image that represents the SVG document.
|
protected org.apache.batik.transcoder.TranscoderInput |
input
The transcoder input.
|
Constructor and Description |
---|
SVGRasterizer(InputStream istream)
Constructs a new SVGRasterizer converter.
|
SVGRasterizer(Reader reader)
Constructs a new SVGRasterizer converter.
|
SVGRasterizer(String uri)
Constructs a new SVGRasterizer.
|
SVGRasterizer(URL url)
Constructs a new SVGRasterizer.
|
Modifier and Type | Method and Description |
---|---|
BufferedImage |
createBufferedImage()
Returns the image that represents the SVG document.
|
void |
createJPEG(OutputStream outputStream)
Returns the image that represents the SVG document as a JPEG.
|
void |
setAlternateStylesheet(String alternateStylesheet)
Sets the alternate stylesheet to use.
|
void |
setBackgroundColor(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(String language)
Sets the preferred language to use.
|
void |
setMedia(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(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 BufferedImage img
public SVGRasterizer(String uri)
uri
- the uri of the document to rasterizepublic SVGRasterizer(URL url)
url
- the URL of the document to rasterizepublic SVGRasterizer(InputStream istream)
istream
- the input stream that represents the SVG document to
rasterizepublic SVGRasterizer(Reader reader)
reader
- the reader that represents the SVG document to rasterizepublic BufferedImage createBufferedImage() throws org.apache.batik.transcoder.TranscoderException
org.apache.batik.transcoder.TranscoderException
public void createJPEG(OutputStream outputStream) throws org.apache.batik.transcoder.TranscoderException
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)
width
- the image heightpublic void setLanguages(String language)
language
- the preferred language to usepublic void setPixelToMMFactor(float px2mm)
px2mm
- the pixel to millimeter convertion factor.public void setUserStyleSheetURI(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(String media)
media
- the media to usepublic void setAlternateStylesheet(String alternateStylesheet)
alternateStylesheet
- the alternate stylesheet to use if possiblepublic void setBackgroundColor(Paint p)
p
- the paint to use for the background
Version: 5.1.4-ice35-b55
Copyright © 2015 The University of Dundee & Open Microscopy Environment. All Rights Reserved.