Proposal for "Image_Canvas"

Image_Canvas

The idea with this package is to provide a common interface to different image formats. This is achieved by using a strategy pattern in the form of a driver with a set of primitives. These primitives are selected to provide as much functionality for each format as possible, while still retaining a simple and common interface.

The code is based upon the driver mechanism as implemented in Image_Graph. However there is no doubt that this implementation has to be refined.

Justification

As mentioned this idea is already in use by Image_Graph and could be used with advantage by other packages (for example the proposed & accepted but not yet released Image_Isometric and the new cool package proposal Image_3D).

This not only provides more functionality it also makes the packages (i.e. Image_Graph/Image_Isometric) being independent upon the actual graph library API. The packages will have a common interface to _all_ the supported output formats. The proposed solution is not a method to replace these libraries, i.e. the possibility to output in PNG without GD or SWF without Ming (fx).

Introducing such a mechanism also makes it possible for these packages to "interact", i.e. Image_Graph can use Image_Isometric to create 3D graphs, simply y using a common canvas!

Currently Supported Drawing-Functions

The current implementation/version supports the following drawing functions (I'm sure somebody has input for more!!!):