AnsiString

(cherry picked from commit 5e29835b00751178ef4ecbd85c48552bb93a369a)
This commit is contained in:
Massimo Magnano 2023-07-25 11:51:46 +02:00 committed by Pierre Muller
parent e63497386c
commit eebf27c5fc

View File

@ -137,7 +137,7 @@ type
public public
IFDStart: SizeUInt; // tiff position IFDStart: SizeUInt; // tiff position
IFDNext: SizeUInt; // tiff position IFDNext: SizeUInt; // tiff position
Artist: String; Artist: AnsiString;
BitsPerSample: SizeUInt; // tiff position of entry BitsPerSample: SizeUInt; // tiff position of entry
BitsPerSampleArray: array of Word; BitsPerSampleArray: array of Word;
CellLength: DWord; CellLength: DWord;
@ -145,30 +145,30 @@ type
ColorMap: SizeUInt;// tiff position of entry ColorMap: SizeUInt;// tiff position of entry
Compression: DWord; Compression: DWord;
Predictor: Word; Predictor: Word;
Copyright: string; Copyright: AnsiString;
DateAndTime: string; DateAndTime: AnsiString;
DocumentName: string; DocumentName: AnsiString;
ExtraSamples: SizeUInt;// tiff position of entry ExtraSamples: SizeUInt;// tiff position of entry
FillOrder: DWord; FillOrder: DWord;
HostComputer: string; HostComputer: AnsiString;
ImageDescription: string; ImageDescription: AnsiString;
ImageHeight: DWord; ImageHeight: DWord;
ImageIsMask: Boolean; ImageIsMask: Boolean;
ImageIsPage: Boolean; ImageIsPage: Boolean;
ImageIsThumbNail: Boolean; ImageIsThumbNail: Boolean;
ImageWidth: DWord; ImageWidth: DWord;
Make_ScannerManufacturer: string; Make_ScannerManufacturer: AnsiString;
Model_Scanner: string; Model_Scanner: AnsiString;
Orientation: DWord; Orientation: DWord;
PageNumber: word; // the page number starting at 0, the total number of pages is PageCount PageNumber: word; // the page number starting at 0, the total number of pages is PageCount
PageCount: word; // see PageNumber PageCount: word; // see PageNumber
PageName: string; PageName: AnsiString;
PhotoMetricInterpretation: DWord; PhotoMetricInterpretation: DWord;
PlanarConfiguration: DWord; PlanarConfiguration: DWord;
ResolutionUnit: DWord; ResolutionUnit: DWord;
RowsPerStrip: DWord; RowsPerStrip: DWord;
SamplesPerPixel: DWord; SamplesPerPixel: DWord;
Software: string; Software: AnsiString;
StripByteCounts: SizeUInt;// tiff position of entry StripByteCounts: SizeUInt;// tiff position of entry
StripOffsets: SizeUInt; // tiff position of entry StripOffsets: SizeUInt; // tiff position of entry
TileWidth: DWord; TileWidth: DWord;
@ -195,24 +195,24 @@ type
destructor Destroy; override; destructor Destroy; override;
end; end;
function TiffRationalToStr(const r: TTiffRational): string; function TiffRationalToStr(const r: TTiffRational): AnsiString;
function StrToTiffRationalDef(const s: string; const Def: TTiffRational): TTiffRational; function StrToTiffRationalDef(const s: AnsiString; const Def: TTiffRational): TTiffRational;
procedure ClearTiffExtras(Img: TFPCustomImage); procedure ClearTiffExtras(Img: TFPCustomImage);
procedure CopyTiffExtras(SrcImg, DestImg: TFPCustomImage); procedure CopyTiffExtras(SrcImg, DestImg: TFPCustomImage);
procedure WriteTiffExtras(Msg: string; Img: TFPCustomImage); procedure WriteTiffExtras(Msg: AnsiString; Img: TFPCustomImage);
function TiffCompressionName(c: Word): string; function TiffCompressionName(c: Word): AnsiString;
function TifResolutionUnitToResolutionUnit(ATifResolutionUnit: DWord): TResolutionUnit; function TifResolutionUnitToResolutionUnit(ATifResolutionUnit: DWord): TResolutionUnit;
function ResolutionUnitToTifResolutionUnit(AResolutionUnit: TResolutionUnit): DWord; function ResolutionUnitToTifResolutionUnit(AResolutionUnit: TResolutionUnit): DWord;
implementation implementation
function TiffRationalToStr(const r: TTiffRational): string; function TiffRationalToStr(const r: TTiffRational): AnsiString;
begin begin
Result:=IntToStr(r.Numerator)+'/'+IntToStr(r.Denominator); Result:=IntToStr(r.Numerator)+'/'+IntToStr(r.Denominator);
end; end;
function StrToTiffRationalDef(const s: string; const Def: TTiffRational function StrToTiffRationalDef(const s: AnsiString; const Def: TTiffRational
): TTiffRational; ): TTiffRational;
var var
p: LongInt; p: LongInt;
@ -243,7 +243,7 @@ begin
DestImg.Extra[SrcImg.ExtraKey[i]]:=SrcImg.ExtraValue[i]; DestImg.Extra[SrcImg.ExtraKey[i]]:=SrcImg.ExtraValue[i];
end; end;
procedure WriteTiffExtras(Msg: string; Img: TFPCustomImage); procedure WriteTiffExtras(Msg: AnsiString; Img: TFPCustomImage);
var var
i: Integer; i: Integer;
begin begin
@ -253,7 +253,7 @@ begin
writeln(' ',i,' ',Img.ExtraKey[i],'=',Img.ExtraValue[i]); writeln(' ',i,' ',Img.ExtraKey[i],'=',Img.ExtraValue[i]);
end; end;
function TiffCompressionName(c: Word): string; function TiffCompressionName(c: Word): AnsiString;
begin begin
case c of case c of
1: Result:='no compression'; 1: Result:='no compression';