| @@ 217-225 (lines=9) @@ | ||
| 214 | $maskBits = $this->buildMaskBits($img); |
|
| 215 | ||
| 216 | $offset = 0; |
|
| 217 | for ($i = $img->height - 1; $i >= 0; --$i) { |
|
| 218 | for ($j = 0; $j < $img->width; ++$j) { |
|
| 219 | if ($maskBits[$offset] == 0) { |
|
| 220 | $color = ord($img->bmpData[$offset]); |
|
| 221 | imagesetpixel($gd, $j, $i, $palette[$color]); |
|
| 222 | } |
|
| 223 | ++$offset; |
|
| 224 | } |
|
| 225 | } |
|
| 226 | } |
|
| 227 | ||
| 228 | private function buildPalette(IconImage $img, $gd) |
|
| @@ 286-293 (lines=8) @@ | ||
| 283 | } |
|
| 284 | ||
| 285 | $offset = 0; |
|
| 286 | for ($i = $img->height - 1; $i >= 0; --$i) { |
|
| 287 | for ($j = 0; $j < $img->width; ++$j) { |
|
| 288 | if ($maskBits[$offset] == 0) { |
|
| 289 | imagesetpixel($gd, $j, $i, $palette[$colorbits[$offset]]); |
|
| 290 | } |
|
| 291 | ++$offset; |
|
| 292 | } |
|
| 293 | } |
|
| 294 | } |
|
| 295 | } |
|
| 296 | ||