Total Complexity | 6 |
Total Lines | 52 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | final class Bitmap implements Command |
||
21 | { |
||
22 | use PositionAware; |
||
23 | |||
24 | private $canvas; |
||
25 | |||
26 | /** @var bool */ |
||
27 | private $overlay; |
||
28 | |||
29 | /** @var int */ |
||
30 | private $width; |
||
31 | |||
32 | /** @var int */ |
||
33 | private $height; |
||
34 | |||
35 | public function __construct(int $x, int $y, \Imagick $canvas) |
||
36 | { |
||
37 | $this->x = $x; |
||
38 | $this->y = $y; |
||
39 | $this->canvas = clone $canvas; |
||
40 | $this->width = $this->canvas->getImageWidth(); |
||
41 | $this->height = $this->canvas->getImageHeight(); |
||
42 | |||
43 | $this->canvas->setImageType(\Imagick::IMGTYPE_TRUECOLOR); |
||
44 | $this->canvas->thresholdImage(.5 * \Imagick::getQuantumRange()['quantumRangeLong']); |
||
45 | } |
||
46 | |||
47 | public function overlay($value) |
||
48 | { |
||
49 | $this->overlay = $value; |
||
50 | |||
51 | return $this; |
||
52 | } |
||
53 | |||
54 | public function getOverlay() |
||
55 | { |
||
56 | return $this->overlay; |
||
57 | } |
||
58 | |||
59 | public function getCanvas() |
||
62 | } |
||
63 | |||
64 | public function getWidth(): int |
||
67 | } |
||
68 | |||
69 | public function getHeight(): int |
||
72 | } |
||
73 | } |
||
74 |