1<?php 2 3require_once dirname(__FILE__).'/Color.php'; 4require_once dirname(__FILE__).'/Point.php'; 5require_once dirname(__FILE__).'/ShadowProperties.php'; 6 7/** 8 * @brief Interface that abstracts the implementation of drawing operations 9 * 10 * It's not clear whether this could be replaced with PEAR 11 * Image_Canvas. If it's possible to do so, this would make it a lot 12 * easier to maintain implementation independence 13 */ 14interface ICanvas { 15 function drawRectangle(Point $corner1, Point $corner2, Color $color, $lineWidth, $lineDotSize, ShadowProperties $shadowProperties); 16 17 function drawFilledRectangle(Point $corner1, Point $corner2, Color $color, 18 ShadowProperties $shadowProperties, 19 $drawBorder = false, 20 $alpha = 100, 21 $lineWidth = 1, 22 $lineDotSize = 0); 23 24 function drawRoundedRectangle(Point $corner1, Point $corner2, $radius, 25 Color $color, $lineWidth, $lineDotSize, 26 ShadowProperties $shadowProperties); 27 28 function drawFilledRoundedRectangle(Point $point1, Point $point2, $radius, 29 Color $color, $lineWidth, $lineDotSize, 30 ShadowProperties $shadowProperties); 31 32 function drawLine(Point $point1, Point $point2, Color $color, $lineWidth, $lineDotSize, ShadowProperties $shadowProperties, Point $boundingBoxMin = null, Point $boundingBoxMax = null); 33 34 function drawDottedLine(Point $point1, Point $point2, $dotSize, $lineWidth, Color $color, ShadowProperties $shadowProperties, Point $boundingBoxMin = null, Point $boundingBoxMax = null); 35 36 function drawAntialiasPixel(Point $point, Color $color, ShadowProperties $shadowProperties, $alpha = 100); 37 38 function drawText($fontSize, $angle, Point $point, Color $color, $fontName, $text, ShadowProperties $shadowProperties); 39 40 /** 41 * @todo The function's called drawCircle(), but you can make it 42 * draw an ellipse by passing in different values for width and 43 * height. This should be changed. 44 */ 45 function drawCircle(Point $center, $height, Color $color, ShadowProperties $shadowProperties, $width = null); 46 47 function drawFilledCircle(Point $center, $height, Color $color, ShadowProperties $shadowProperties, $width = null); 48 49 /** 50 * Draw a filled polygon 51 * 52 * @todo The points are passed in as an array of X, Y, X, Y 53 * consecutive coordinates. This interface sucks, and should be 54 * replaced with passing in an arry of instances of Point 55 */ 56 function drawFilledPolygon(array $points, $numPoints, Color $color, $alpha = 100); 57 58 function setAntialiasQuality($newQuality); 59}