Tuesday, 24 July 2007

Snapshot Image

The SnapshotImage class represents the main component of the deferred execution engine. A SnapshotImage provides an arbitrary number of synchronous views of a possibly changing WritableRenderedImage. SnapshotImage is responsible for stabilizing changing sources to allow deferred execution of operations dependent on such sources.

This implementation of SnapshotImage makes use of a doubly-linked list of Snapshot objects. A new Snapshot is added to the tail of the list whenever createSnapshot() is called.

* SnapshotImage(PlanarImage source)
constructs a SnapshotImage from a PlanarImage source.

* Raster getTile(int tileX, int tileY)
returns a non-snapshotted tile from the source.

* void tileUpdate(java.awt.image.WritableRenderedImage source, int tileX, int tileY, boolean willBeWritable)
receives the information that a tile is either about to become writable, or is about to become no longer writable.

* PlanarImage createSnapshot()
creates a snapshot of this image.

* void dispose()
provides a hint that an image will no longer be accessed from a reference in user space.

No comments: