noccylabs/painter-interface

$ git tag


$ git branch
* master

PainterInterface

This is a unified interface for drawing. It lets images be painted to several canvases at once, or while giving freedom in the choice of the graphics API to use.

ChainPainter

The ChainPainter is an implementation of PainterInterface that performs the same operation on a set of painters:

use NoccyLabs\PainterInterface\GdPainter;
use NoccyLabs\ClientCanvas\ClientCanvas;
use NoccyLabs\PainterInterface\ChainPainter;

list($width, $height) = [ 400, 300 ];

$gd = imagecreatetruecolor($width, $height);
$cc = new ClientCanvas();
$cp = $cc->getPainter();

$painter = new ChainPainter([ $gd, $cp ]);

$painter->line( ... );

Revision History