|
@@ -403,20 +403,24 @@ end;
|
|
|
function TFPReaderPNG.CalcColor: TColorData;
|
|
|
var cd : longword;
|
|
|
r : word;
|
|
|
- b : byte;
|
|
|
- tmp : pbytearray;
|
|
|
+ b : pbyte;
|
|
|
begin
|
|
|
if UsingBitGroup = 0 then
|
|
|
begin
|
|
|
Databytes := 0;
|
|
|
if Header.BitDepth = 16 then
|
|
|
begin
|
|
|
- getmem(tmp, bytewidth);
|
|
|
- fillchar(tmp^, bytewidth, 0);
|
|
|
- for r:=0 to bytewidth-2 do
|
|
|
- tmp^[r+1]:=FCurrentLine^[Dataindex+r];
|
|
|
- move (tmp^[0], Databytes, bytewidth);
|
|
|
- freemem(tmp);
|
|
|
+ b := @Databytes;
|
|
|
+ b^ := 0;
|
|
|
+ r := 0;
|
|
|
+ while (r < ByteWidth-1) do
|
|
|
+ begin
|
|
|
+ b^ := FCurrentLine^[DataIndex+r+1];
|
|
|
+ inc (b);
|
|
|
+ b^ := FCurrentLine^[DataIndex+r];
|
|
|
+ inc (b);
|
|
|
+ inc (r,2);
|
|
|
+ end;
|
|
|
end
|
|
|
else move (FCurrentLine^[DataIndex], Databytes, bytewidth);
|
|
|
{$IFDEF ENDIAN_BIG}
|