The Pull Model

The basic idea of the renderable layer is that the data can be pulled through as needed for rendering, This is the basis for the name pull model that is central to the JAI. This imaging model is also called render on demand or just-in-time rendering.

As the name implies, whenever a rendering is needed, the pixel data can be pulled through the Renderable layer and output in a context dependent manner. Renderable imaging will be covered extensively in Chapter 6.

The consumer-producer model used in the AWT and maintained in Java 2D was also known as a push model because the consumer (or image sink) never requests the image but rather waits for it passively. This approach was good for displaying a few simple images via a Web browser, but is obviously quite limited for image processing. In a pull model, image sources must be able to operate on arbitrary areas of the image data. An ImageProducer cannot be used as a source under this regime because it doesn't respond to such requests.

In order to perform network imaging, deferred execution, as well as to enable rendering on demand, JAI went headlong into the pull model. Although the pull model is central to JAI, it doesn't preclude using the ImageProducer interface to conform to AWT implementation. But, in general, the user of JAI will want to adapt wholeheartedly to the pull model.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset