1 | <?php |
||
9 | class Paste implements FilterInterface |
||
10 | { |
||
11 | /** |
||
12 | * @var \Imagine\Image\ImageInterface |
||
13 | */ |
||
14 | protected $pasteImage; |
||
15 | |||
16 | /** |
||
17 | * @var string|integer |
||
18 | */ |
||
19 | protected $x; |
||
20 | |||
21 | /** |
||
22 | * @var string|integer |
||
23 | */ |
||
24 | protected $y; |
||
25 | |||
26 | /** |
||
27 | * @param \Imagine\Image\ImageInterface $pasteImage Image to be pasted |
||
28 | * @param string|int $x x-coordinage|position of left corner |
||
29 | * @param string|int $y y-coordinage|position of left corner |
||
30 | */ |
||
31 | 6 | public function __construct(ImageInterface $pasteImage, $x, $y) |
|
40 | |||
41 | /** |
||
42 | * {@inheritDoc} |
||
43 | */ |
||
44 | 2 | public function apply(ImageInterface $image) |
|
58 | |||
59 | /** |
||
60 | * @param string $point |
||
61 | * @param \Imagine\Image\ImageInterface $pasteImage |
||
62 | * @param \Imagine\Image\ImageInterface $image |
||
63 | * |
||
64 | * @return integer |
||
65 | */ |
||
66 | 2 | protected function stringXtoInteger($point, ImageInterface $pasteImage, ImageInterface $image) |
|
76 | |||
77 | /** |
||
78 | * @param string $point |
||
79 | * @param \Imagine\Image\ImageInterface $pasteImage |
||
80 | * @param \Imagine\Image\ImageInterface $image |
||
81 | * |
||
82 | * @return integer |
||
83 | */ |
||
84 | 2 | protected function stringYtoInteger($point, ImageInterface $pasteImage, ImageInterface $image) |
|
94 | |||
95 | /** |
||
96 | * @param integer|string $point |
||
97 | * @param string $pointName |
||
98 | * @param array $allowedStringValues |
||
99 | * |
||
100 | * @throws \InvalidArgumentException |
||
101 | */ |
||
102 | 6 | protected function throwIfPointNotValid($point, $pointName, array $allowedStringValues) |
|
118 | } |
||
119 |