1 | <?php |
||
10 | class Contrast extends BaseManipulator |
||
11 | { |
||
12 | /** |
||
13 | * Perform contrast image manipulation. |
||
14 | * @param Image $image The source image. |
||
15 | * @return Image The manipulated image. |
||
16 | */ |
||
17 | 3 | public function run(Image $image) |
|
18 | { |
||
19 | 3 | $contrast = $this->getContrast(); |
|
20 | |||
21 | 3 | if ($contrast !== null) { |
|
22 | 3 | $image->contrast($contrast); |
|
23 | } |
||
24 | |||
25 | 3 | return $image; |
|
26 | } |
||
27 | |||
28 | /** |
||
29 | * Resolve contrast amount. |
||
30 | * @return string The resolved contrast amount. |
||
31 | */ |
||
32 | 6 | public function getContrast() |
|
44 | } |
||
45 |