mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 22:09:28 +02:00
fcl-image: fpreadtiff: fixed inline
git-svn-id: trunk@42316 -
This commit is contained in:
parent
561fa85104
commit
bd5a81c657
@ -161,6 +161,23 @@ begin
|
|||||||
Result := FPColor(R and $ffff,G and $ffff,B and $ffff);
|
Result := FPColor(R and $ffff,G and $ffff,B and $ffff);
|
||||||
end ;
|
end ;
|
||||||
|
|
||||||
|
function TFPReaderTiff.FixEndian(w: Word): Word; inline;
|
||||||
|
begin
|
||||||
|
Result:=w;
|
||||||
|
if FReverseEndian then
|
||||||
|
Result:=((Result and $ff) shl 8) or (Result shr 8);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TFPReaderTiff.FixEndian(d: DWord): DWord; inline;
|
||||||
|
begin
|
||||||
|
Result:=d;
|
||||||
|
if FReverseEndian then
|
||||||
|
Result:=((Result and $ff) shl 24)
|
||||||
|
or ((Result and $ff00) shl 8)
|
||||||
|
or ((Result and $ff0000) shr 8)
|
||||||
|
or (Result shr 24);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TFPReaderTiff.TiffError(Msg: string);
|
procedure TFPReaderTiff.TiffError(Msg: string);
|
||||||
begin
|
begin
|
||||||
Msg:=Msg+' at position '+IntToStr(s.Position);
|
Msg:=Msg+' at position '+IntToStr(s.Position);
|
||||||
@ -1796,7 +1813,7 @@ begin
|
|||||||
ChunkCount := TilesAcross * TilesDown;
|
ChunkCount := TilesAcross * TilesDown;
|
||||||
ReadShortOrLongValues(IFD.TileOffsets,ChunkOffsets,CurCount);
|
ReadShortOrLongValues(IFD.TileOffsets,ChunkOffsets,CurCount);
|
||||||
if CurCount<ChunkCount then
|
if CurCount<ChunkCount then
|
||||||
TiffError('number of TileCounts is wrong');
|
TiffError('number of TileOffsets is wrong');
|
||||||
ReadShortOrLongValues(IFD.TileByteCounts,ChunkByteCounts,CurCount);
|
ReadShortOrLongValues(IFD.TileByteCounts,ChunkByteCounts,CurCount);
|
||||||
if CurCount<ChunkCount then
|
if CurCount<ChunkCount then
|
||||||
TiffError('number of TileByteCounts is wrong');
|
TiffError('number of TileByteCounts is wrong');
|
||||||
@ -1804,7 +1821,7 @@ begin
|
|||||||
ChunkCount:=((IFD.ImageHeight-1) div IFD.RowsPerStrip)+1;
|
ChunkCount:=((IFD.ImageHeight-1) div IFD.RowsPerStrip)+1;
|
||||||
ReadShortOrLongValues(IFD.StripOffsets,ChunkOffsets,CurCount);
|
ReadShortOrLongValues(IFD.StripOffsets,ChunkOffsets,CurCount);
|
||||||
if CurCount<ChunkCount then
|
if CurCount<ChunkCount then
|
||||||
TiffError('number of StripCounts is wrong');
|
TiffError('number of StripOffsets is wrong');
|
||||||
ReadShortOrLongValues(IFD.StripByteCounts,ChunkByteCounts,CurCount);
|
ReadShortOrLongValues(IFD.StripByteCounts,ChunkByteCounts,CurCount);
|
||||||
if CurCount<ChunkCount then
|
if CurCount<ChunkCount then
|
||||||
TiffError('number of StripByteCounts is wrong');
|
TiffError('number of StripByteCounts is wrong');
|
||||||
@ -1950,23 +1967,6 @@ begin
|
|||||||
s := nil;
|
s := nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TFPReaderTiff.FixEndian(w: Word): Word; inline;
|
|
||||||
begin
|
|
||||||
Result:=w;
|
|
||||||
if FReverseEndian then
|
|
||||||
Result:=((Result and $ff) shl 8) or (Result shr 8);
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TFPReaderTiff.FixEndian(d: DWord): DWord; inline;
|
|
||||||
begin
|
|
||||||
Result:=d;
|
|
||||||
if FReverseEndian then
|
|
||||||
Result:=((Result and $ff) shl 24)
|
|
||||||
or ((Result and $ff00) shl 8)
|
|
||||||
or ((Result and $ff0000) shr 8)
|
|
||||||
or (Result shr 24);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TFPReaderTiff.DecodePackBits(var Buffer: Pointer; var Count: PtrInt);
|
procedure TFPReaderTiff.DecodePackBits(var Buffer: Pointer; var Count: PtrInt);
|
||||||
var
|
var
|
||||||
NewBuffer: Pointer;
|
NewBuffer: Pointer;
|
||||||
|
Loading…
Reference in New Issue
Block a user