|
@@ 322-328 (lines=7) @@
|
| 319 |
|
//we translate the BGRA to aRGB ourselves, which is twice as fast |
| 320 |
|
//as calling imagecolorallocatealpha |
| 321 |
|
$alpha7 = ((~ord($binary[$offset + 3])) & 0xff) >> 1; |
| 322 |
|
if ($alpha7 < 127) { |
| 323 |
|
$col = ($alpha7 << 24) | |
| 324 |
|
(ord($binary[$offset + 2]) << 16) | |
| 325 |
|
(ord($binary[$offset + 1]) << 8) | |
| 326 |
|
(ord($binary[$offset])); |
| 327 |
|
imagesetpixel($im, $j, $i, $col); |
| 328 |
|
} |
| 329 |
|
$offset += 4; |
| 330 |
|
} |
| 331 |
|
} |
|
@@ 347-351 (lines=5) @@
|
| 344 |
|
|
| 345 |
|
for ($i = $metadata['Height'] - 1; $i >= 0; --$i) { |
| 346 |
|
for ($j = 0; $j < $metadata['Width']; ++$j) { |
| 347 |
|
if ($maskBits[$bitoffset] == 0) { |
| 348 |
|
//translate BGR to RGB |
| 349 |
|
$col = (ord($binary[$offset + 2]) << 16) | (ord($binary[$offset + 1]) << 8) | (ord($binary[$offset])); |
| 350 |
|
imagesetpixel($im, $j, $i, $col); |
| 351 |
|
} |
| 352 |
|
$offset += 3; |
| 353 |
|
++$bitoffset; |
| 354 |
|
} |