java.lang.Object | |
↳ | javax.imageio.IIOImage |
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.
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
image | The RenderedImage being referenced. |
||||||||||
metadata | An IIOMetadata object containing metadata
associated with the image. |
||||||||||
raster | The Raster being referenced. |
||||||||||
thumbnails | A List of BufferedImage thumbnails,
or null . |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs an
IIOImage containing a
RenderedImage , and thumbnails and metadata
associated with it. | |||||||||||
Constructs an
IIOImage containing a
Raster , and thumbnails and metadata
associated with it. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns a reference to the current
IIOMetadata
object, or null is none is set. | |||||||||||
Returns the number of thumbnails stored in this
IIOImage . | |||||||||||
Returns the currently set
Raster , or
null if only a RenderedImage is
available. | |||||||||||
Returns the currently set
RenderedImage , or
null if only a Raster is available. | |||||||||||
Returns a thumbnail associated with the main image.
| |||||||||||
Returns the current
List of thumbnail
BufferedImage s, or null if none is
set. | |||||||||||
Returns
true if this IIOImage stores
a Raster rather than a RenderedImage . | |||||||||||
Sets the
IIOMetadata to a new object, or
null . | |||||||||||
Sets the current
Raster . | |||||||||||
Sets the current
RenderedImage . | |||||||||||
Sets the list of thumbnails to a new
List of
BufferedImage s, or to null . |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
A List
of BufferedImage
thumbnails,
or null
. Non-BufferedImage
objects
must not be stored in this List
.
Constructs an 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 . |
IllegalArgumentException | if image is
null .
|
---|
Constructs an 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 . |
IllegalArgumentException | if raster is
null .
|
---|
Returns a reference to the current IIOMetadata
object, or null
is none is set.
IIOMetadata
object, or null
.Returns the number of thumbnails stored in this
IIOImage
.
int
.
Returns the currently set Raster
, or
null
if only a RenderedImage
is
available.
Raster
, or null
.Returns the currently set RenderedImage
, or
null
if only a Raster
is available.
RenderedImage
, or null
.Returns a thumbnail associated with the main image.
index | the index of the desired thumbnail image. |
---|
BufferedImage
.IndexOutOfBoundsException | if the supplied index is negative or larger than the largest valid index. |
---|---|
ClassCastException | if a
non-BufferedImage object is encountered in the
list of thumbnails at the given index. |
Returns the current List
of thumbnail
BufferedImage
s, or null
if none is
set. A live reference is returned.
List
of
BufferedImage
thumbnails, or null
.Returns true
if this IIOImage
stores
a Raster
rather than a RenderedImage
.
true
if a Raster
is
available.
Sets the IIOMetadata
to a new object, or
null
.
metadata | an IIOMetadata object, or
null . |
---|
Sets the current Raster
. The value is
stored by reference. Any existing RenderedImage
is
discarded.
raster | a Raster . |
---|
IllegalArgumentException | if raster is
null . |
---|
Sets the current RenderedImage
. The value is
stored by reference. Any existing Raster
is
discarded.
image | a RenderedImage . |
---|
IllegalArgumentException | if image is
null . |
---|
Sets the list of thumbnails to a new 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 . |
---|