public void encodeImage(RenderedImage buf, OutputStream os)
throws SVGGraphics2DIOException {
try{
ImageEncoder encoder = new PNGImageEncoder(os, null);
encoder.encode(buf);
} catch(IOException e) {
// We are doing in-memory processing. This should not happen.
throw new SVGGraphics2DIOException(ERR_UNEXPECTED);
}
}