You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|