|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.imageio.IIOImage
public class IIOImage
IIOImage is a container class for components of an image file that stores image data, image metadata and thumbnails. The image data can be either a RenderedImage or a Raster but not both. Image readers that produce IIOImages will always produce BufferedImages from the RenderedImage field. Image writers that accept IIOImages will always accept RenderedImages and may optionally accept Rasters.
Field Summary | |
---|---|
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 Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected RenderedImage image
protected IIOMetadata metadata
protected Raster raster
protected List<? extends BufferedImage> thumbnails
Constructor Detail |
---|
public IIOImage(Raster raster, List<? extends BufferedImage> thumbnails, IIOMetadata metadata)
raster
- image datathumbnails
- a list of BufferedImage thumbnails or nullmetadata
- image metadata or null
IllegalArgumentException
- 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 null
IllegalArgumentException
- if image is nullMethod Detail |
---|
public IIOMetadata getMetadata()
public int getNumThumbnails()
public Raster getRaster()
public RenderedImage getRenderedImage()
public BufferedImage getThumbnail(int index)
index
- the index of the thumbnail to retrieve
IndexOutOfBoundsException
- if index is out-of-bounds
ClassCastException
- 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 data
IllegalArgumentException
- if raster is nullpublic void setRenderedImage(RenderedImage image)
image
- the rendered image data
IllegalArgumentException
- if image is nullpublic void setThumbnails(List<? extends BufferedImage> thumbnails)
thumbnails
- a new list of thumbnails or null
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |