FileDocCategorySizeDatePackage
IIOImage.javaAPI DocAndroid 1.5 API6541Wed May 06 22:41:54 BST 2009javax.imageio

IIOImage

public class IIOImage extends Object
The IIOImage class combines the image, image's thumbnail and image's metadata. The image can be presented as RenderedImage or Raster object.
since
Android 1.0

Fields Summary
protected RenderedImage
image
The image of this IIOImage.
protected Raster
raster
The raster of this IIOImage.
protected List
thumbnails
The list with thumbnails associated with the image.
protected IIOMetadata
metadata
The metadata associated with the image.
Constructors Summary
public IIOImage(RenderedImage image, List thumbnails, IIOMetadata metadata)
Instantiates a new IIOImage with the specified RenderedImage, list of thumbnails and metadata.

param
image the image specified by RenderedImage.
param
thumbnails the list of BufferedImage objects which represent the thumbnails of the image.
param
metadata the metadata of the image.

        if (image == null) {
            throw new IllegalArgumentException("image should not be NULL");
        }
        this.raster = null;
        this.image = image;
        this.thumbnails = thumbnails;
        this.metadata = metadata;
    
public IIOImage(Raster raster, List thumbnails, IIOMetadata metadata)
Instantiates a new IIOImage with the specified Raster, list of thumbnails and metadata.

param
raster the Raster.
param
thumbnails the list of BufferedImage objects which represent the thumbnails of Raster data.
param
metadata the metadata.

        if (raster == null) {
            throw new IllegalArgumentException("raster should not be NULL");
        }
        this.image = null;
        this.raster = raster;
        this.thumbnails = thumbnails;
        this.metadata = metadata;
    
Methods Summary
public javax.imageio.metadata.IIOMetadatagetMetadata()
Gets the metadata of this IIOImage.

return
the metadata of this IIOImage.

        return metadata;
    
public intgetNumThumbnails()
Gets the number of thumbnails for this IIOImage.

return
the number of thumbnails for this IIOImage.

        return thumbnails != null ? thumbnails.size() : 0;
    
public java.awt.image.RastergetRaster()
Gets the Raster object or returns null if this IIOImage object is associated with a RenderedImage.

return
the Raster or null if this IIOImage object is associated with a RenderedImage.

        return raster;
    
public java.awt.image.RenderedImagegetRenderedImage()
Gets the RenderedImage object or returns null if this IIOImage object is associated with a Raster.

return
the RenderedImage object or null if this IIOImage object is associated with a Raster.

        return image;
    
public java.awt.image.BufferedImagegetThumbnail(int index)
Gets the thumbnail with the specified index in the list.

param
index the index of the thumbnail in the list.
return
the thumbnail with the specified index in the list.

        if (thumbnails != null) {
            return thumbnails.get(index);
        }
        throw new IndexOutOfBoundsException("no thumbnails were set");
    
public java.util.ListgetThumbnails()
Gets the list of thumbnails.

return
the list of thumbnails.

        return thumbnails;
    
public booleanhasRaster()
Returns true if the IIOImage object associated with a Raster, or false if it's associated with a RenderedImage.

return
true, if the IIOImage object associated with a Raster, or false if it's associated with a RenderedImage.

        return raster != null;
    
public voidsetMetadata(javax.imageio.metadata.IIOMetadata metadata)
Sets the metadata to this IIOImage object.

param
metadata the IIOMetadata, or null.

        this.metadata = metadata;
    
public voidsetRaster(java.awt.image.Raster raster)
Sets the Raster to the IIOImage.

param
raster the new Raster to the IIOImage.

        if (raster == null) {
            throw new IllegalArgumentException("raster should not be NULL");
        }
        image = null;
        this.raster = raster;
    
public voidsetRenderedImage(java.awt.image.RenderedImage image)
Sets the RenderedImage to this IIOImage object.

param
image the RenderedImage to be set to this IIOImage.

        if (image == null) {
            throw new IllegalArgumentException("image should not be NULL");
        }
        raster = null;
        this.image = image;
    
public voidsetThumbnails(java.util.List thumbnails)
Sets the list of thumbnails images to this IIOImage object.

param
thumbnails the list of BufferedImage which represent thumbnails.

        this.thumbnails = thumbnails;