public class EncodedImage
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
extension |
private ByteBuffer |
image |
private boolean |
isStatic |
Constructor and Description |
---|
EncodedImage(AnimationGIF sourceImage,
boolean isStatic)
set an encoded image from an animated GIF.
|
EncodedImage(java.awt.image.BufferedImage bi,
java.lang.String targetExt,
boolean isStatic)
set an encoded image from a buffered image.
|
EncodedImage(byte[] imageData,
java.lang.String format,
boolean isStatic)
Instanciates an encoded image with raw image data.
|
EncodedImage(java.awt.Image i,
java.lang.String targetExt,
boolean isStatic)
set an encoded image from a buffered image.
|
EncodedImage(RasterPlotter sourceImage,
java.lang.String targetExt,
boolean isStatic)
set an encoded image; prefer this over methods with Image-source objects because png generation is faster when done from RasterPlotter sources.
|
Modifier and Type | Method and Description |
---|---|
static java.awt.image.BufferedImage |
convertToRGB(java.awt.image.BufferedImage image)
If source source image colorspace is not RGB or ARGB, convert it to RGB or ARGB when alpha channel is present.
|
java.lang.String |
getExtension()
get the extension of the image
|
ByteBuffer |
getImage()
get the encoded image data (empty when encoding format is not supported)
|
boolean |
isStatic()
get information if the information changes in the future or not if it does not change, it is static
|
private ByteBuffer image
private java.lang.String extension
private boolean isStatic
public EncodedImage(byte[] imageData, java.lang.String format, boolean isStatic)
imageData
- the image data encode in format specified. Must not be null.format
- the image format of imageData. Must not be null.isStatic
- shall be true if the image will never change, false if notjava.lang.IllegalArgumentException
- when imageData or format parameter is nullpublic EncodedImage(RasterPlotter sourceImage, java.lang.String targetExt, boolean isStatic)
sourceImage
- the imagetargetExt
- the target extension of the image when converted into a fileisStatic
- shall be true if the image will never change, false if notpublic EncodedImage(java.awt.image.BufferedImage bi, java.lang.String targetExt, boolean isStatic)
sourceImage
- the imagetargetExt
- the target extension of the image when converted into a fileisStatic
- shall be true if the image will never change, false if notpublic EncodedImage(java.awt.Image i, java.lang.String targetExt, boolean isStatic)
sourceImage
- the imagetargetExt
- the target extension of the image when converted into a fileisStatic
- shall be true if the image will never change, false if notpublic EncodedImage(AnimationGIF sourceImage, boolean isStatic)
sourceImage
- the imageisStatic
- shall be true if the image will never change, false if notpublic ByteBuffer getImage()
public java.lang.String getExtension()
public boolean isStatic()
public static java.awt.image.BufferedImage convertToRGB(java.awt.image.BufferedImage image)
image
- source image. Must not be null.