use of org.apache.batik.gvt.renderer.ImageRenderer in project yamcs-studio by yamcs.
the class SimpleImageTranscoder method transcode.
@Override
protected void transcode(Document document, String uri, TranscoderOutput output) throws TranscoderException {
super.transcode(document, uri, output);
int w = (int) (this.width + 0.5);
int h = (int) (this.height + 0.5);
ImageRenderer renderer = createImageRenderer();
renderer.updateOffScreen(w, h);
// curTxf.translate(0.5, 0.5);
renderer.setTransform(curTxf);
renderer.setTree(this.root);
// We're done with it...
this.root = null;
try {
Shape raoi = new Rectangle2D.Float(0, 0, width, height);
// Warning: the renderer's AOI must be in user space
renderer.repaint(curTxf.createInverse().createTransformedShape(raoi));
bufferedImage = renderer.getOffScreen();
} catch (Exception ex) {
throw new TranscoderException(ex);
}
}
use of org.apache.batik.gvt.renderer.ImageRenderer in project yamcs-studio by yamcs.
the class SVGHandler method createImageRenderer.
/**
* Creates a new renderer.
*/
protected ImageRenderer createImageRenderer() {
ImageRenderer renderer = null;
if (isDynamicDocument) {
renderer = rendererFactory.createDynamicImageRenderer();
} else {
renderer = rendererFactory.createStaticImageRenderer();
}
renderer.getRenderingHints().add(renderingHints);
return renderer;
}
Aggregations