| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public class IIOImage extends Object
A simple container class to aggregate an image, a set of thumbnail (preview) images, and an object representing metadata associated with the image.
The image data may take the form of either a
RenderedImage
, or a Raster
. Reader
methods that return an IIOImage
will always return a
BufferedImage
using the RenderedImage
reference. Writer methods that accept an IIOImage
will always accept a RenderedImage
, and may optionally
accept a Raster
.
Exactly one of getRenderedImage
and
getRaster
will return a non-null
value.
Subclasses are responsible for ensuring this behavior.
Field Summary | |
---|---|
protected RenderedImage |
image
The RenderedImage being referenced. |
protected IIOMetadata |
metadata
An IIOMetadata object containing metadata
associated with the image. |
protected Raster |
raster
The Raster being referenced. |
protected List |
thumbnails
A List of BufferedImage thumbnails,
or null . |
Constructor Summary | |
---|---|
IIOImage(Raster raster, List thumbnails, IIOMetadata metadata) Constructs an IIOImage containing a
Raster , and thumbnails and metadata
associated with it.
|
|
IIOImage(RenderedImage image, List thumbnails, IIOMetadata metadata) Constructs an IIOImage containing a
RenderedImage , and thumbnails and metadata
associated with it.
|
Method Summary | |
---|---|
IIOMetadata |
Returns a reference to the current IIOMetadata
object, or null is none is set.
|
int |
Returns the number of thumbnails stored in this IIOImage .
|
Raster |
Returns the currently set Raster , or
null if only a RenderedImage is
available.
|
RenderedImage |
Returns the currently set RenderedImage , or
null if only a Raster is available.
|
BufferedImage |
getThumbnail(int index) Returns a thumbnail associated with the main image. |
List |
Returns the current List of thumbnail
BufferedImage s, or null if none is
set.
|
boolean |
Returns true if this IIOImage stores
a Raster rather than a RenderedImage .
|
void |
setMetadata(IIOMetadata metadata) Sets the IIOMetadata to a new object, or
null .
|
void |
Sets the current Raster .
|
void |
setRenderedImage(RenderedImage image) Sets the current RenderedImage .
|
void |
setThumbnails(List thumbnails) Sets the list of thumbnails to a new List of
BufferedImage s, 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
RenderedImage
being referenced.
protected IIOMetadata metadata
IIOMetadata
object containing metadata
associated with the image.
protected Raster raster
Raster
being referenced.
protected List thumbnails
List
of BufferedImage
thumbnails,
or null
. Non-BufferedImage
objects
must not be stored in this List
.
Constructor Detail |
---|
public IIOImage(Raster raster, List thumbnails, IIOMetadata metadata)
IIOImage
containing a
Raster
, and thumbnails and metadata
associated with it.
All parameters are stored by reference.
raster
- a Raster
.thumbnails
- a List
of BufferedImage
s,
or null
.metadata
- an IIOMetadata
object, or
null
.public IIOImage(RenderedImage image, List thumbnails, IIOMetadata metadata)
IIOImage
containing a
RenderedImage
, and thumbnails and metadata
associated with it.
All parameters are stored by reference.
The thumbnails
argument must either be
null
or contain only BufferedImage
objects.
image
- a RenderedImage
.thumbnails
- a List
of BufferedImage
s,
or null
.metadata
- an IIOMetadata
object, or
null
.Method Detail |
---|
public IIOMetadata getMetadata()
IIOMetadata
object, or null
is none is set.
IIOMetadata
object, or null
.public int getNumThumbnails()
IIOImage
.
int
.public Raster getRaster()
Raster
, or
null
if only a RenderedImage
is
available.
Raster
, or null
.public RenderedImage getRenderedImage()
RenderedImage
, or
null
if only a Raster
is available.
RenderedImage
, or null
.public BufferedImage getThumbnail(int index)
index
- the index of the desired thumbnail image.BufferedImage
.public List getThumbnails()
List
of thumbnail
BufferedImage
s, or null
if none is
set. A live reference is returned.
List
of
BufferedImage
thumbnails, or null
.public boolean hasRaster()
true
if this IIOImage
stores
a Raster
rather than a RenderedImage
.
true
if a Raster
is
available.public void setMetadata(IIOMetadata metadata)
IIOMetadata
to a new object, or
null
.
metadata
- an IIOMetadata
object, or
null
.public void setRaster(Raster raster)
Raster
. The value is
stored by reference. Any existing RenderedImage
is
discarded.
raster
- a Raster
.public void setRenderedImage(RenderedImage image)
RenderedImage
. The value is
stored by reference. Any existing Raster
is
discarded.
image
- a RenderedImage
.public void setThumbnails(List thumbnails)
List
of
BufferedImage
s, or to null
. The
reference to the previous List
is discarded.
The thumbnails
argument must either be
null
or contain only BufferedImage
objects.
thumbnails
- a List
of
BufferedImage
thumbnails, or null
.
| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |