1<?php
2
3/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
4
5/**
6 * 3d Library
7 *
8 * PHP versions 5
9 *
10 * LICENSE:
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public
13 * License as published by the Free Software Foundation; either
14 * version 2.1 of the License, or (at your option) any later version.
15 *
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19 * Lesser General Public License for more details.
20 *
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with this library; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
24 *
25 * @category  Image
26 * @package   Image_3D
27 * @author    Kore Nordmann <3d@kore-nordmann.de>
28 * @copyright 1997-2005 Kore Nordmann
29 * @license   http://www.gnu.org/licenses/lgpl.txt lgpl 2.1
30 * @version   CVS: $Id$
31 * @link      http://pear.php.net/package/PackageName
32 * @since     File available since Release 0.1.0
33 */
34
35// {{{ Image_3D_Driver
36
37/**
38 * Image_3D_Driver
39 *
40 * @category  Image
41 * @package   Image_3D
42 * @author    Kore Nordmann <3d@kore-nordmann.de>
43 * @copyright 1997-2005 Kore Nordmann
44 * @license   http://www.gnu.org/licenses/lgpl.txt lgpl 2.1
45 * @version   Release: @package_version@
46 * @link      http://pear.php.net/package/PackageName
47 * @since     Class available since Release 0.1.0
48 */
49abstract class Image_3D_Driver
50{
51
52    // {{{ properties
53
54    /**
55     * Worlds polygones
56     *
57     * @var mixed
58     */
59    protected $_image;
60
61    // }}}
62    // {{{ __construct()
63
64    /**
65     * Constructor for Image_3D_Driver
66     *
67     * Initialises the environment
68     *
69     * @return  Image_3D_Driver             Instance of Renderer
70     */
71    public function __construct()
72    {
73        $this->_image = null;
74    }
75
76    // }}}
77    // {{{ createImage()
78
79    /**
80     * Initialize image
81     *
82     * Initialize the image with given width and height
83     *
84     * @param integer $x Width
85     * @param integer $y Height
86     *
87     * @return  void
88     */
89    abstract public function createImage($x, $y);
90
91    // }}}
92    // {{{ setBackground()
93
94    /**
95     * Sets Background
96     *
97     * Set the background for the image
98     *
99     * @param Image_3D_Color $color Backgroundcolor
100     *
101     * @return  void
102     */
103    abstract public function setBackground(Image_3D_Color $color);
104
105    // }}}
106    // {{{ drawPolygon()
107
108    /**
109     * Draws a flat shaded polygon
110     *
111     * Draws a flat shaded polygon. Methd uses the polygon color
112     *
113     * @param Image_3D_Polygon $polygon Polygon
114     *
115     * @return  void
116     */
117    abstract public function drawPolygon(Image_3D_Polygon $polygon);
118
119    // }}}
120    // {{{ drawGradientPolygon()
121
122    /**
123     * Draws a gauroud shaded polygon
124     *
125     * Draws a gauroud shaded polygon. Methd uses the colors of the polygones
126     * points and tries to create a gradient filling for the polygon.
127     *
128     * @param Image_3D_Polygo $polygon Polygon
129     *
130     * @return  void
131     */
132    abstract public function drawGradientPolygon(Image_3D_Polygon $polygon);
133
134    // }}}
135    // {{{ save()
136
137    /**
138     * Save image
139     *
140     * Save image to file
141     *
142     * @param string $file File
143     *
144     * @return  void
145     */
146    abstract public function save($file);
147
148
149    // }}}
150    // {{{ getSupportedShading()
151
152    /**
153     * Return supported shadings
154     *
155     * Return an array with the shading types the driver supports
156     *
157     * @return  array           Array with supported shading types
158     */
159    public function getSupportedShading()
160    {
161        return array(Image_3D_Renderer::SHADE_NO);
162    }
163
164    // }}}
165}
166
167// }}}
168