1 | <?php |
||
4 | class Bitmap |
||
5 | { |
||
6 | const HEADER_SIZE = 0x36; |
||
7 | |||
8 | /** |
||
9 | * @var string |
||
10 | */ |
||
11 | protected $filePath; |
||
12 | |||
13 | /** Holds raw file data |
||
14 | * @var mixed |
||
15 | */ |
||
16 | protected $data; |
||
17 | |||
18 | /** |
||
19 | * @var mixed |
||
20 | */ |
||
21 | protected $header; |
||
22 | |||
23 | /** |
||
24 | * @param string $filePath |
||
25 | */ |
||
26 | public function __construct($filePath) |
||
32 | |||
33 | /** |
||
34 | * @return string |
||
35 | * @throws \Exception |
||
36 | */ |
||
37 | protected function read() |
||
48 | |||
49 | /** |
||
50 | * @throws \Exception |
||
51 | */ |
||
52 | protected function validate() |
||
74 | |||
75 | /** |
||
76 | * @return mixed |
||
77 | */ |
||
78 | protected function getIdent() |
||
84 | |||
85 | /** |
||
86 | * @return mixed |
||
87 | */ |
||
88 | public function getWidth() |
||
94 | |||
95 | /** |
||
96 | * @return mixed |
||
97 | */ |
||
98 | public function getHeight() |
||
104 | |||
105 | /** |
||
106 | * @return mixed |
||
107 | */ |
||
108 | public function getPlanesCount() |
||
114 | |||
115 | /** |
||
116 | * @return mixed |
||
117 | */ |
||
118 | public function getColorDepth() |
||
124 | |||
125 | /** |
||
126 | * @return mixed |
||
127 | */ |
||
128 | public function getCompression() |
||
134 | |||
135 | /** |
||
136 | * @return string |
||
137 | */ |
||
138 | public function getDataWithoutHeader() |
||
142 | } |
||
143 |