» Metadata | » Status |
---|---|
|
|
» Description | |
Image_CanvasThe 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. JustificationAs 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-FunctionsThe current implementation/version supports the following drawing functions (I'm sure somebody has input for more!!!):
Supported styles are (also depending on output format):
Possibility to output to file or browser. Example usageThis is but a short example: $Canvas =& Image_Canvas::factory('png', array('width' => 400, 'height' => 300, 'transparent' => true)); $Canvas =& Image_Canvas::factory('svg', array('width' => 600, 'height' => 400)); As mentioned this is the implementation/code as adopted by Image_Graph. |
|
» Dependencies | » Links |
|
|
» Timeline | » Changelog |
|
|