private function parsePaletteImageData(IconImage $entry, $data)
    {
        $pal = substr($data, $entry->fileOffset + $entry->bmpHeaderSize, $entry->colorCount * 4);
        $idx = 0;
        for ($j = 0; $j < $entry->colorCount; ++$j) {
            $entry->addToBmpPalette(ord($pal[$idx + 2]), ord($pal[$idx + 1]), ord($pal[$idx]), ord($pal[$idx + 3]));
            $idx += 4;
        }

        $length = $entry->bmpHeaderWidth * $entry->bmpHeaderHeight * (1 + $entry->bitCount) / $entry->bitCount;
        $bmpData = substr($data, $entry->fileOffset + $entry->bmpHeaderSize + $entry->colorCount * 4, $length);
        $entry->setBitmapData($bmpData);
    }
private function parsePaletteImageData(IconImage $entry, $data)
    {
        $pal = substr($data, $entry->fileOffset + $entry->bmpHeaderSize, $entry->colorCount * 4);
        $idx = 0;
        for ($j = 0; $j < $entry->colorCount; ++$j) {
            $entry->addToBmpPalette(ord($pal[$idx + 2]), ord($pal[$idx + 1]), ord($pal[$idx]), ord($pal[$idx + 3]));
            $idx += 4;
        }

        $length = $entry->bmpHeaderWidth * $entry->bmpHeaderHeight * (1 + $entry->bitCount) / $entry->bitCount;
        $bmpData = substr($data, $entry->fileOffset + $entry->bmpHeaderSize + $entry->colorCount * 4, $length);
        $entry->setBitmapData($bmpData);
    }
private function parsePaletteImageData ( IconImage $ entry , $ data ) { $ pal = substr ( $ data , $ entry -> fileOffset + $ entry -> bmpHeaderSize , $ entry -> colorCount * 4 ) ; $ idx = 0 ; for ( $ j = 0 ; $ j < $ entry -> colorCount ; ++ $ j ) { $ entry -> addToBmpPalette ( ord ( $ pal [ $ idx + 2 ] ) , ord ( $ pal [ $ idx + 1 ] ) , ord ( $ pal [ $ idx ] ) , ord ( $ pal [ $ idx + 3 ] ) ) ; $ idx += 4 ; } $ length = $ entry -> bmpHeaderWidth * $ entry -> bmpHeaderHeight * ( 1 + $ entry -> bitCount ) / $ entry -> bitCount ; $ bmpData = substr ( $ data , $ entry -> fileOffset + $ entry -> bmpHeaderSize + $ entry -> colorCount * 4 , $ length ) ; $ entry -> setBitmapData ( $ bmpData ) ; }
Parse an image which uses a limited palette of colours
@param IconImage $entry
@param string $data
Parse an image which uses a limited palette of colours