yacy_search_server/source/net/yacy/peers/graphics/EncodedImage.java
Michael Peter Christen f2d0418218 because the new PngEncoder had a problem with the PixelGrabber which is
caused by a JRE bug, the PixelGrabber had to be circumvented using an
own frame buffer which can be read without a PixelGrabber. This resulted
in ultra-fast and much less memory-consuming transformation. YaCy images
are now generated really fast!
2012-10-25 17:59:20 +02:00

23 lines
627 B
Java

package net.yacy.peers.graphics;
import net.yacy.kelondro.util.ByteBuffer;
import net.yacy.visualization.RasterPlotter;
public class EncodedImage {
private ByteBuffer image;
private String extension;
public EncodedImage(final RasterPlotter sourceImage, final String targetExt) {
this.image = "png".equals(targetExt) ? sourceImage.exportPng() : RasterPlotter.exportImage(sourceImage.getImage(), targetExt);
this.extension = targetExt;
}
public ByteBuffer getImage() {
return this.image;
}
public String getExtension() {
return this.extension;
}
}