| Total Complexity | 7 |
| Total Lines | 53 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | final class PbmCodec |
||
| 18 | { |
||
| 19 | /** @var \Imagick */ |
||
| 20 | private $image; |
||
| 21 | |||
| 22 | /** @var array */ |
||
| 23 | private $buffer; |
||
| 24 | |||
| 25 | /** @var int */ |
||
| 26 | private $bytesPerRow; |
||
| 27 | |||
| 28 | public static function create(\Imagick $image): self |
||
| 29 | { |
||
| 30 | return new self($image); |
||
| 31 | } |
||
| 32 | |||
| 33 | public function __construct(\Imagick $image) |
||
| 34 | { |
||
| 35 | $this->image = $image; |
||
| 36 | |||
| 37 | $this->bytesPerRow = \intdiv($image->getImageWidth() + 7, 8); |
||
| 38 | |||
| 39 | $this->buffer = \array_fill(0, $this->bytesPerRow * $image->getImageHeight(), 0); |
||
| 40 | } |
||
| 41 | |||
| 42 | public function encode(): string |
||
| 70 | } |
||
| 71 | } |
||
| 72 |