1 | <?php |
||
22 | class Watermark extends BaseManipulator |
||
23 | { |
||
24 | /** |
||
25 | * The watermarks file system. |
||
26 | * @var FilesystemInterface|null |
||
27 | */ |
||
28 | protected $watermarks; |
||
29 | |||
30 | /** |
||
31 | * The watermarks path prefix. |
||
32 | * @var string |
||
33 | */ |
||
34 | protected $watermarksPathPrefix; |
||
35 | |||
36 | /** |
||
37 | * Create Watermark instance. |
||
38 | * @param FilesystemInterface $watermarks The watermarks file system. |
||
39 | */ |
||
40 | public function __construct(FilesystemInterface $watermarks = null, $watermarksPathPrefix = '') |
||
45 | |||
46 | /** |
||
47 | * Set the watermarks file system. |
||
48 | * @param FilesystemInterface $watermarks The watermarks file system. |
||
49 | */ |
||
50 | public function setWatermarks(FilesystemInterface $watermarks = null) |
||
54 | |||
55 | /** |
||
56 | * Get the watermarks file system. |
||
57 | * @return FilesystemInterface The watermarks file system. |
||
58 | */ |
||
59 | public function getWatermarks() |
||
63 | |||
64 | /** |
||
65 | * Set the watermarks path prefix. |
||
66 | * @param string $watermarksPathPrefix The watermarks path prefix. |
||
67 | */ |
||
68 | public function setWatermarksPathPrefix($watermarksPathPrefix = '') |
||
72 | |||
73 | /** |
||
74 | * Get the watermarks path prefix. |
||
75 | * @return string The watermarks path prefix. |
||
76 | */ |
||
77 | public function getWatermarksPathPrefix() |
||
81 | |||
82 | /** |
||
83 | * Perform watermark image manipulation. |
||
84 | * @param Image $image The source image. |
||
85 | * @return Image The manipulated image. |
||
86 | */ |
||
87 | public function run(Image $image) |
||
120 | |||
121 | /** |
||
122 | * Get the watermark image. |
||
123 | * @param Image $image The source image. |
||
124 | * @return Image|null The watermark image. |
||
125 | */ |
||
126 | public function getImage(Image $image) |
||
158 | |||
159 | /** |
||
160 | * Get a dimension. |
||
161 | * @param Image $image The source image. |
||
162 | * @param string $field The requested field. |
||
163 | * @return double|null The dimension. |
||
164 | */ |
||
165 | public function getDimension(Image $image, $field) |
||
171 | |||
172 | /** |
||
173 | * Resolve the device pixel ratio. |
||
174 | * @return double The device pixel ratio. |
||
175 | */ |
||
176 | public function getDpr() |
||
188 | |||
189 | /** |
||
190 | * Get the fit. |
||
191 | * @return string The fit. |
||
192 | */ |
||
193 | public function getFit() |
||
215 | |||
216 | /** |
||
217 | * Get the position. |
||
218 | * @return string The position. |
||
219 | */ |
||
220 | public function getPosition() |
||
240 | |||
241 | /** |
||
242 | * Get the alpha channel. |
||
243 | * @return int The alpha. |
||
244 | */ |
||
245 | public function getAlpha() |
||
257 | } |
||
258 |