1 | <?php |
||
14 | class Drawer |
||
15 | { |
||
16 | /** @var \SixtyNine\Cloud\Factory\FontsFactory */ |
||
17 | protected $fontsFactory; |
||
18 | |||
19 | /** @var \Imagine\Gd\Imagine */ |
||
20 | protected $imagine; |
||
21 | |||
22 | /** @var ImageInterface */ |
||
23 | protected $image; |
||
24 | |||
25 | /** @var string */ |
||
26 | protected $font; |
||
27 | |||
28 | /** |
||
29 | * @param FontsFactory $fontsFactory |
||
30 | */ |
||
31 | 4 | protected function __construct(FontsFactory $fontsFactory) |
|
36 | |||
37 | /** |
||
38 | * @return Drawer |
||
39 | */ |
||
40 | 4 | public static function create(FontsFactory $fontsFactory) |
|
44 | |||
45 | /** |
||
46 | * @param int $width |
||
47 | * @param int $height |
||
48 | * @param string $color |
||
49 | * @return Drawer |
||
50 | */ |
||
51 | 4 | public function createImage($width, $height, $color = '#FFFFFF') |
|
59 | |||
60 | /** |
||
61 | * @param string $fontName |
||
62 | * @return Drawer |
||
63 | */ |
||
64 | 4 | public function setFont($fontName) |
|
69 | |||
70 | /** |
||
71 | * @param int $x |
||
72 | * @param int $y |
||
73 | * @param string $text |
||
74 | * @param int $size |
||
75 | * @param string $color |
||
76 | * @param int $angle |
||
77 | * @throws \InvalidArgumentException |
||
78 | * @return Drawer |
||
79 | */ |
||
80 | 4 | public function drawText($x, $y, $text, $size, $color = '#000000', $angle = 0) |
|
91 | |||
92 | /** |
||
93 | * @param int $x |
||
94 | * @param int $y |
||
95 | * @param int $width |
||
96 | * @param int $height |
||
97 | * @param string $color |
||
98 | * @return Drawer |
||
99 | */ |
||
100 | 4 | public function drawBox($x, $y, $width, $height, $color = '#000000') |
|
123 | |||
124 | /** |
||
125 | * @param int $x |
||
126 | * @param int $y |
||
127 | * @param int $width |
||
128 | * @param int $height |
||
129 | * @param int $angle |
||
130 | * @param string $color |
||
131 | * @return Drawer |
||
132 | */ |
||
133 | 2 | public function drawBoxForText($x, $y, $width, $height, $angle, $color = '#000000') |
|
138 | |||
139 | /** |
||
140 | * @param int $x |
||
141 | * @param int $y |
||
142 | * @param int $width |
||
143 | * @param int $height |
||
144 | * @param int $angle |
||
145 | * @return MyBox |
||
146 | */ |
||
147 | 7 | public static function getBoxFoxText($x, $y, $width, $height, $angle) |
|
160 | |||
161 | 1 | public function drawMask(MaskInterface $mask, $color = '#ffffff') |
|
168 | |||
169 | /** |
||
170 | * @return ImageInterface |
||
171 | */ |
||
172 | 4 | public function getImage() |
|
180 | } |
||
181 |