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