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