|
@@ 375-381 (lines=7) @@
|
| 372 |
|
//we translate the BGRA to aRGB ourselves, which is twice as fast |
| 373 |
|
//as calling imagecolorallocatealpha |
| 374 |
|
$alpha7 = ((~ord($binary[$offset + 3])) & 0xff) >> 1; |
| 375 |
|
if ($alpha7 < 127) { |
| 376 |
|
$col = ($alpha7 << 24) | |
| 377 |
|
(ord($binary[$offset + 2]) << 16) | |
| 378 |
|
(ord($binary[$offset + 1]) << 8) | |
| 379 |
|
(ord($binary[$offset])); |
| 380 |
|
imagesetpixel($im, $j, $i, $col); |
| 381 |
|
} |
| 382 |
|
$offset += 4; |
| 383 |
|
} |
| 384 |
|
} |
|
@@ 400-404 (lines=5) @@
|
| 397 |
|
|
| 398 |
|
for ($i = $metadata['Height'] - 1; $i >= 0; --$i) { |
| 399 |
|
for ($j = 0; $j < $metadata['Width']; ++$j) { |
| 400 |
|
if ($maskBits[$bitoffset] == 0) { |
| 401 |
|
//translate BGR to RGB |
| 402 |
|
$col = (ord($binary[$offset + 2]) << 16) | |
| 403 |
|
(ord($binary[$offset + 1]) << 8) | |
| 404 |
|
(ord($binary[$offset])); |
| 405 |
|
imagesetpixel($im, $j, $i, $col); |
| 406 |
|
} |
| 407 |
|
$offset += 3; |