Total Complexity | 6 |
Total Lines | 50 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | class SevenBitChannel extends ColorChannel |
||
11 | { |
||
12 | /** |
||
13 | * @var int |
||
14 | */ |
||
15 | private $value; |
||
16 | |||
17 | /** |
||
18 | * @param int $value 0-127 |
||
19 | */ |
||
20 | public function __construct(int $value) |
||
21 | { |
||
22 | $this->value = $value; |
||
23 | } |
||
24 | |||
25 | /** |
||
26 | * @return int 0-255 |
||
27 | */ |
||
28 | public function get8Bit() : int |
||
31 | } |
||
32 | |||
33 | /** |
||
34 | * @return int 0-127 |
||
35 | */ |
||
36 | public function get7Bit() : int |
||
37 | { |
||
38 | return $this->value; |
||
39 | } |
||
40 | |||
41 | /** |
||
42 | * @return float 0-1 |
||
43 | */ |
||
44 | public function getFloat() : float |
||
45 | { |
||
46 | return UnitsConverter::intSevenBit2Float($this->value); |
||
47 | } |
||
48 | |||
49 | /** |
||
50 | * @return float 0-100 |
||
51 | */ |
||
52 | public function getPercent() : float |
||
53 | { |
||
54 | return UnitsConverter::intSevenBit2Percent($this->value); |
||
55 | } |
||
56 | |||
57 | public function invert() : SevenBitChannel |
||
60 | } |
||
61 | } |
||
62 |