|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.media.jai.CollectionImage | +--javax.media.jai.RenderedImageList
A CollectionImage
which is also a
RenderedImage
. The underlying Collection
in this case is required to be a List
containing only
RenderedImage
s.
Instances of this class may be returned from either a
RenderedImageFactory
or from a
CollectionImageFactory
. This class would be
particularly useful for implementing operations the result of which
includes a single primary image and one or more secondary or
dependant images the data of which are less likely to be requested.
Invocations of RenderedImage
methods on an instance
of this class will be forwarded to the first RenderedImage
in the underlying List
, i.e., the image at index zero.
This should be the index assigned to the primary image in the case
alluded to above. If there are no images in the List
when a RenderedImage
method is invoked an
IllegalStateException
will be thrown.
One example of the use of this class is in generating a classmap
image using a classification algorithm. A by-product image of such an
operation is often an error image wherein the value of each pixel is
some measure of the classification error at that pixel. In this case
the classmap image would be stored at index zero in the internal list
and the error image at the unity index. The error image would be
an OpImage
that has the classmap image as its source.
The result is that a reference to the error image is always available
with the classmap image but the computation of the error image pixel
values may be deferred until such time as the data are needed, if ever.
Methods defined in the RenderedImage
and List
interfaces are not all commented in detail. The List
methods
merely forward the call in most cases directly to the underlying
List
; as previously stated, RenderedImage
method
invocations are forwarded to the RenderedImage
at position
zero in the List
.
CollectionImage
,
RenderedImage
,
List
, Serialized FormFields inherited from class javax.media.jai.CollectionImage |
eventManager,
imageCollection,
imageFactory,
properties,
sinks |
Constructor Summary | |
protected |
RenderedImageList()
Creates an empty RenderedImageList . |
|
RenderedImageList(List renderedImageList)
Creates a RenderedImageList from the supplied
List . |
Method Summary | |
void |
add(int index,
Object element)
Inserts the specified element at the specified position in this list. |
boolean |
add(Object o)
Adds the specified object to this List . |
boolean |
addAll(Collection c)
Adds to this List all elements in the specified
Collection which are RenderedImage s. |
boolean |
addAll(int index,
Collection c)
Inserts into this List at the indicated position
all elements in the specified Collection which are
RenderedImage s. |
WritableRaster |
copyData(WritableRaster dest)
Copies an arbitrary rectangular region of the primary image into a caller-supplied WritableRaster. |
Object |
get(int index)
Returns the element at the given index in imageCollection . |
ColorModel |
getColorModel()
Returns the ColorModel of the primary image. |
Raster |
getData()
Returns the entire primary image in a single Raster . |
Raster |
getData(Rectangle bounds)
Returns an arbitrary rectangular region of the primary image in a Raster . |
int |
getHeight()
Returns the height of the primary image. |
int |
getMinTileX()
Returns the horizontal index of the leftmost column of tiles of the primary image. |
int |
getMinTileY()
Returns the vertical index of the uppermost row of tiles of the primary image. |
int |
getMinX()
Returns the X coordinate of the leftmost column of the primary image. |
int |
getMinY()
Returns the X coordinate of the uppermost row of the primary image. |
int |
getNumXTiles()
Returns the number of tiles of the primary image along the tile grid in the horizontal direction. |
int |
getNumYTiles()
Returns the number of tiles of the primary image along the tile grid in the vertical direction. |
RenderedImage |
getPrimaryImage()
Returns the first image in the underlying list of RenderedImage s. |
Object |
getProperty(String name)
Gets a property from the property set of this image. |
String[] |
getPropertyNames()
Returns a list of the properties recognized by this image. |
SampleModel |
getSampleModel()
Returns the SampleModel of the primary image. |
Vector |
getSources()
Returns a Vector containing the image sources. |
Raster |
getTile(int tileX,
int tileY)
Returns tile ( tileX , tileY ) of the
primary image as a Raster . |
int |
getTileGridXOffset()
Returns the X coordinate of the upper-left pixel of tile (0, 0) of the primary image. |
int |
getTileGridYOffset()
Returns the Y coordinate of the upper-left pixel of tile (0, 0) of the primary image. |
int |
getTileHeight()
Returns the height of a tile of the primary image. |
int |
getTileWidth()
Returns the width of a tile of the primary image. |
int |
getWidth()
Returns the width of the primary image. |
int |
indexOf(Object o)
|
int |
lastIndexOf(Object o)
|
ListIterator |
listIterator()
|
ListIterator |
listIterator(int index)
|
Object |
remove(int index)
|
Object |
set(int index,
Object element)
|
List |
subList(int fromIndex,
int toIndex)
|
Methods inherited from class javax.media.jai.CollectionImage |
addPropertyChangeListener,
addPropertyChangeListener,
addSink,
clear,
contains,
containsAll,
getImageFactory,
getProperty,
getPropertyClass,
getPropertyNames,
getSinks,
isEmpty,
iterator,
remove,
removeAll,
removeProperty,
removePropertyChangeListener,
removePropertyChangeListener,
removeSink,
removeSinks,
retainAll,
setImageFactory,
setProperty,
size,
toArray,
toArray |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
protected RenderedImageList()
RenderedImageList
.public RenderedImageList(List renderedImageList)
RenderedImageList
from the supplied
List
.IllegalArgumentException
- if any objects in the
List
are not RenderedImage
s.IllegalArgumentException
- if the List
is empty.IllegalArgumentException
- if the List
parameter is null
.Method Detail |
public RenderedImage getPrimaryImage()
RenderedImage
s.
The call is forwarded to the first image in the List
.public int getMinX()
List
.public int getMinY()
List
.public int getWidth()
List
.public int getHeight()
List
.public int getTileWidth()
List
.public int getTileHeight()
List
.public int getTileGridXOffset()
List
.public int getTileGridYOffset()
List
.public int getMinTileX()
List
.public int getNumXTiles()
List
.public int getMinTileY()
List
.public int getNumYTiles()
List
.public SampleModel getSampleModel()
List
.public ColorModel getColorModel()
List
.public Object getProperty(String name)
java.awt.Image.UndefinedProperty
will be returned.
The call is forwarded to the first image in the List
.name
- the name of the property to get, as a
String
.Object
, or the value
java.awt.Image.UndefinedProperty.
name
is
null
.public String[] getPropertyNames()
null
will be
returned.
The call is forwarded to the first image in the List
.String
s representing valid
property names.public Vector getSources()
Vector
containing the image sources.
The call is forwarded to the first image in the List
.public Raster getTile(int tileX, int tileY)
tileX
, tileY
) of the
primary image as a Raster
. Note that tileX
and tileY
are indices into the tile array, not pixel
locations.
The call is forwarded to the first image in the List
.tileX
- The X index of the requested tile in the tile array.tileY
- The Y index of the requested tile in the tile array.public Raster getData()
Raster
.
For images with multiple tiles this will require making a copy.
The returned Raster
is semantically a copy.
The call is forwarded to the first image in the List
.Raster
containing a copy of this image's data.public Raster getData(Rectangle bounds)
Raster
. The returned Raster
is
semantically a copy.
The call is forwarded to the first image in the List
.bounds
- the region of the RenderedImage
to be
returned.public WritableRaster copyData(WritableRaster dest)
If the raster argument is null, the entire image will
be copied into a newly-created WritableRaster with a SampleModel
that is compatible with that of the image.
The call is forwarded to the first image in the List
.
dest
- a WritableRaster to hold the returned portion of
the image.public void add(int index, Object element)
RenderedImage
.public boolean addAll(int index, Collection c)
List
at the indicated position
all elements in the specified Collection
which are
RenderedImage
s.true
if this List
changed
as a result of the call.public Object get(int index)
imageCollection
.
If imageCollection
is a List
then the call is
forwarded to imageCollection
; otherwise an array is created
by applying toArray()
to imageCollection
and
the indicated element of that array is returned. Note that in the
latter case no guarantee as to element ordering beyond that stated in
the specification of Collection.toArray()
.index
- index of element to return.RenderedImage
object at the
specified index.public int indexOf(Object o)
public int lastIndexOf(Object o)
public ListIterator listIterator()
public ListIterator listIterator(int index)
public Object remove(int index)
public Object set(int index, Object element)
public List subList(int fromIndex, int toIndex)
public boolean add(Object o)
List
.true
if and only if the parameter is added to the
List
.o
is null
or is not an RenderedImage
.public boolean addAll(Collection c)
List
all elements in the specified
Collection
which are RenderedImage
s.true
if this List
changed
as a result of the call.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |