Saturday, 7 July 2007

Java 2D API --- the beginning

The Java 2D API extends AWT's capabilities for both two-dimensional graphics and imaging. The concepts of rendered and renderable images contained in the Java 2D API are essential to JAI.

Rendering independence for images is a poorly understood topic because it is poorly named. The more general problem is "resolution independence," the ability to describe an image as you want it to appear, but independent of any specific instance of it. Resolution is but one feature of any such rendering. Others are the physical size, output device type, color quality, tonal quality, and rendering speed. A rendering-independent description is concerned with none of these.

The Java AWT API architecture provides for two integrated imaging layers: renderable and rendered.

Structurally, the Renderable layer is lightweight. It does not directly handle pixel processing. Rather, it makes use of operator objects from the Rendered layer. This is possible because the operator classes from the Rendered layer can implement an interface (the ContextualRenderedImageFactory interface) that allows them to adapt to different contexts.Many programmers will directly employ the Rendered layer, but the Renderable layer provides advantages that greatly simplify imaging tasks.

The renderable layer allows for the construction of a chain of operators (RenderableImageOps) connected to a RenderableImage source. The end of this chain represents a new RenderableImage source. The implication of this is that RenderableImageOps must implement the same interface as sources: RenderableImageOp implements RenderableImage.

No comments: