5- How the Display Works
The JadeDisplay component asynchronously requests tiles as they are needed for the image
display. The tiles are loaded and computed in the background using JAI worker threads, and
are painted onscreen when the computation is complete. This has the following advantages:
- User
interface remains active and responds to events even while the image is
loading... no waiting for the computer. Experience has shown that this
is a prime factor in usability.
- Viewing of enormous images is practical because the user does
not have to wait for them to load in their entirety. The display has
been tested with images larger than 2 gigabytes.
- Scrolling is instantaneous, even for slow-loading images.
- Computations of tiles which are in the queue, but become
unnecessary because of subsequent scrolling, are cancelled, thus
improving overall throughput.
- Threaded computation allows for greater throughput for
compute-intensive operations on multiprocessor machines (e.g. rotation,
filtering).
Tile Computation Sequence of Events
When
Java sends a repaint event, the affected area is saved in a "damage
list". Tiles affected by the repaint are queued with JAI for
computation (unless the tile has already been queued). When JAI sends a
tile completion notification, the part of the tile intersecting the
damage list is immediately painted, and the tile's area is subtracted
from the damage list. Multiple worker threads can be active
simultaneously (omitted from the drawing for clarity).
|