1 | <?php |
||
21 | class Watermark extends BaseManipulator |
||
22 | { |
||
23 | /** |
||
24 | * The watermarks file system. |
||
25 | * @var FilesystemInterface|null |
||
26 | */ |
||
27 | protected $watermarks; |
||
28 | |||
29 | /** |
||
30 | * The watermarks path prefix. |
||
31 | * @var string |
||
32 | */ |
||
33 | protected $watermarksPathPrefix; |
||
34 | |||
35 | /** |
||
36 | * Create Watermark instance. |
||
37 | * @param FilesystemInterface $watermarks The watermarks file system. |
||
38 | */ |
||
39 | 57 | public function __construct(FilesystemInterface $watermarks = null, $watermarksPathPrefix = '') |
|
44 | |||
45 | /** |
||
46 | * Set the watermarks file system. |
||
47 | * @param FilesystemInterface $watermarks The watermarks file system. |
||
48 | */ |
||
49 | 57 | public function setWatermarks(FilesystemInterface $watermarks = null) |
|
53 | |||
54 | /** |
||
55 | * Get the watermarks file system. |
||
56 | * @return FilesystemInterface The watermarks file system. |
||
57 | */ |
||
58 | 12 | public function getWatermarks() |
|
62 | |||
63 | /** |
||
64 | * Set the watermarks path prefix. |
||
65 | * @param string $watermarksPathPrefix The watermarks path prefix. |
||
66 | */ |
||
67 | 57 | public function setWatermarksPathPrefix($watermarksPathPrefix = '') |
|
71 | |||
72 | /** |
||
73 | * Get the watermarks path prefix. |
||
74 | * @return string The watermarks path prefix. |
||
75 | */ |
||
76 | 6 | public function getWatermarksPathPrefix() |
|
80 | |||
81 | /** |
||
82 | * Perform watermark image manipulation. |
||
83 | * @param Image $image The source image. |
||
84 | * @return Image The manipulated image. |
||
85 | */ |
||
86 | 3 | public function run(Image $image) |
|
114 | |||
115 | /** |
||
116 | * Get the watermark image. |
||
117 | * @param Image $image The source image. |
||
118 | * @return Image|null The watermark image. |
||
119 | */ |
||
120 | 18 | public function getImage(Image $image) |
|
152 | |||
153 | /** |
||
154 | * Get a dimension. |
||
155 | * @param Image $image The source image. |
||
156 | * @param string $field The requested field. |
||
157 | * @return double|null The dimension. |
||
158 | */ |
||
159 | 6 | public function getDimension(Image $image, $field) |
|
165 | |||
166 | /** |
||
167 | * Resolve the device pixel ratio. |
||
168 | * @return double The device pixel ratio. |
||
169 | */ |
||
170 | 9 | public function getDpr() |
|
182 | |||
183 | /** |
||
184 | * Get the fit. |
||
185 | * @return string The fit. |
||
186 | */ |
||
187 | 6 | public function getFit() |
|
209 | |||
210 | /** |
||
211 | * Get the position. |
||
212 | * @return string The position. |
||
213 | */ |
||
214 | 6 | public function getPosition() |
|
234 | } |
||
235 |