public class BitmapImageRenderer extends Object implements ImageRenderer
| Modifier and Type | Field and Description |
|---|---|
protected BufferedImage |
img |
| Constructor and Description |
|---|
BitmapImageRenderer() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canRender(String contentType)
Determines if this image renderer implementation supports the given contentType
|
boolean |
drawImage(Graphics2D graphics,
Rectangle2D anchor)
Render picture data into the supplied graphics
|
boolean |
drawImage(Graphics2D graphics,
Rectangle2D anchor,
Insets clip)
Render picture data into the supplied graphics
|
Rectangle2D |
getBounds() |
String |
getCachedContentType() |
byte[] |
getCachedImage() |
BufferedImage |
getImage() |
BufferedImage |
getImage(Dimension2D dim) |
Rectangle2D |
getNativeBounds() |
void |
loadImage(byte[] data,
String contentType)
Load and buffer the image
|
void |
loadImage(InputStream data,
String contentType)
Load and buffer the image
|
static BufferedImage |
setAlpha(BufferedImage image,
double alpha) |
void |
setAlpha(double alpha) |
void |
setCacheInput(boolean enable)
Dis-/Enables caching of input data for later retrieval.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDimension, getGenericRecord, setDefaultCharsetprotected BufferedImage img
public boolean canRender(String contentType)
ImageRenderercanRender in interface ImageRenderercontentType - the image content typepublic void loadImage(InputStream data, String contentType) throws IOException
ImageRendererloadImage in interface ImageRendererdata - the raw image streamcontentType - the content typeIOExceptionpublic void loadImage(byte[] data,
String contentType)
throws IOException
ImageRendererloadImage in interface ImageRendererdata - the raw image bytescontentType - the content typeIOExceptionpublic BufferedImage getImage()
getImage in interface ImageRendererpublic BufferedImage getImage(Dimension2D dim)
getImage in interface ImageRendererdim - the dimension in pixels of the returned imagepublic Rectangle2D getBounds()
getBounds in interface ImageRendererpublic void setAlpha(double alpha)
setAlpha in interface ImageRendereralpha - the alpha [0..1] to be added to the image (possibly already containing an alpha channel)public static BufferedImage setAlpha(BufferedImage image, double alpha)
public boolean drawImage(Graphics2D graphics, Rectangle2D anchor)
ImageRendererdrawImage in interface ImageRendererpublic boolean drawImage(Graphics2D graphics, Rectangle2D anchor, Insets clip)
ImageRendererdrawImage in interface ImageRendererpublic Rectangle2D getNativeBounds()
getNativeBounds in interface ImageRendererpublic void setCacheInput(boolean enable)
ImageRendererImageRenderer.getImage(), which returns a BufferedImage, the cached image can be later
used to embedded the original, unmodified datasetCacheInput in interface ImageRendererenable - dis-/enables caching - this is an optional operation. false removes already cached datapublic byte[] getCachedImage()
getCachedImage in interface ImageRendererpublic String getCachedContentType()
getCachedContentType in interface ImageRenderer