javax.imageio
public class IIOImage extends Object
Modifier and Type | Field and Description |
---|---|
protected RenderedImage |
image
Image data as a RenderedImage.
|
protected IIOMetadata |
metadata
Image metadata.
|
protected Raster |
raster
Image data as a Raster.
|
protected List<? extends BufferedImage> |
thumbnails
A list of BufferedImage thumbnails of this image.
|
Constructor and Description |
---|
IIOImage(Raster raster,
List<? extends BufferedImage> thumbnails,
IIOMetadata metadata)
Construct an IIOImage containing raster image data, thumbnails
and metadata.
|
IIOImage(RenderedImage image,
List<? extends BufferedImage> thumbnails,
IIOMetadata metadata)
Construct an IIOImage containing rendered image data, thumbnails
and metadata.
|
Modifier and Type | Method and Description |
---|---|
IIOMetadata |
getMetadata()
Retrieve the image metadata or null if there is no metadata
associated with this IIOImage.
|
int |
getNumThumbnails()
Retrieve the number of thumbnails in this IIOImage.
|
Raster |
getRaster()
Retrieve the raster image data stored in this IIOImage or null if
this image stores data using the RenderedImage representation.
|
RenderedImage |
getRenderedImage()
Retrieve the rendered image data stored in this IIOImage or null
if this image stores data using the Raster representation.
|
BufferedImage |
getThumbnail(int index)
Retrieve the thumbnail stored at the specified index in the
thumbnails list.
|
List<? extends BufferedImage> |
getThumbnails()
Retrieve the list of thumbnails or null if there are no
thumbnails associated with this IIOImage.
|
boolean |
hasRaster()
Check whether this IIOImage stores its image data as a Raster or
as a RenderedImage.
|
void |
setMetadata(IIOMetadata metadata)
Set this IIOImage's metadata.
|
void |
setRaster(Raster raster)
Set the raster data for this image.
|
void |
setRenderedImage(RenderedImage image)
Set the rendered image data for this image.
|
void |
setThumbnails(List<? extends BufferedImage> thumbnails)
Set the list of thumbnails for this IIOImage to a new list of
BufferedImages or to null.
|
protected RenderedImage image
protected IIOMetadata metadata
protected Raster raster
protected List<? extends BufferedImage> thumbnails
public IIOImage(Raster raster, List<? extends BufferedImage> thumbnails, IIOMetadata metadata)
raster
- image datathumbnails
- a list of BufferedImage thumbnails or nullmetadata
- image metadata or nullIllegalArgumentException
- if raster is nullpublic IIOImage(RenderedImage image, List<? extends BufferedImage> thumbnails, IIOMetadata metadata)
image
- rendered image datathumbnails
- a list of BufferedImage thumbnails or nullmetadata
- image metadata or nullIllegalArgumentException
- if image is nullpublic IIOMetadata getMetadata()
public int getNumThumbnails()
public Raster getRaster()
public RenderedImage getRenderedImage()
public BufferedImage getThumbnail(int index)
index
- the index of the thumbnail to retrieveIndexOutOfBoundsException
- if index is out-of-boundsClassCastException
- if the object returned from the
thumbnails list is not a BufferedImagepublic List<? extends BufferedImage> getThumbnails()
public boolean hasRaster()
public void setMetadata(IIOMetadata metadata)
metadata
- the image metadatapublic void setRaster(Raster raster)
raster
- the image raster dataIllegalArgumentException
- if raster is nullpublic void setRenderedImage(RenderedImage image)
image
- the rendered image dataIllegalArgumentException
- if image is nullpublic void setThumbnails(List<? extends BufferedImage> thumbnails)
thumbnails
- a new list of thumbnails or null