|
@@ -34,6 +34,14 @@ type
|
|
TFPColorArray = array [0..maxint] of TFPColor;
|
|
TFPColorArray = array [0..maxint] of TFPColor;
|
|
PFPColorArray = ^TFPColorArray;
|
|
PFPColorArray = ^TFPColorArray;
|
|
|
|
|
|
|
|
+ TFPImgProgressStage = (psStarting, psRunning, psEnding);
|
|
|
|
+ TFPImgProgressEvent = procedure (Sender: TObject; Stage: TFPImgProgressStage;
|
|
|
|
+ PercentDone: Byte; RedrawNow: Boolean; const R: TRect;
|
|
|
|
+ const Msg: AnsiString; var Continue : Boolean) of object;
|
|
|
|
+ // Delphi compatibility
|
|
|
|
+ TProgressStage = TFPImgProgressStage;
|
|
|
|
+ TProgressEvent = TFPImgProgressEvent;
|
|
|
|
+
|
|
TFPPalette = class
|
|
TFPPalette = class
|
|
private
|
|
private
|
|
FData : PFPColorArray;
|
|
FData : PFPColorArray;
|
|
@@ -57,6 +65,7 @@ type
|
|
|
|
|
|
TFPCustomImage = class
|
|
TFPCustomImage = class
|
|
private
|
|
private
|
|
|
|
+ FOnProgress : TFPImgProgressEvent;
|
|
FExtra : TStringlist;
|
|
FExtra : TStringlist;
|
|
FPalette : TFPPalette;
|
|
FPalette : TFPPalette;
|
|
FHeight, FWidth : integer;
|
|
FHeight, FWidth : integer;
|
|
@@ -82,6 +91,9 @@ type
|
|
function GetInternalColor (x,y:integer) : TFPColor; virtual;
|
|
function GetInternalColor (x,y:integer) : TFPColor; virtual;
|
|
procedure SetInternalPixel (x,y:integer; Value:integer); virtual; abstract;
|
|
procedure SetInternalPixel (x,y:integer; Value:integer); virtual; abstract;
|
|
function GetInternalPixel (x,y:integer) : integer; virtual; abstract;
|
|
function GetInternalPixel (x,y:integer) : integer; virtual; abstract;
|
|
|
|
+ procedure Progress(Sender: TObject; Stage: TProgressStage;
|
|
|
|
+ PercentDone: Byte; RedrawNow: Boolean; const R: TRect;
|
|
|
|
+ const Msg: AnsiString; var Continue: Boolean); Virtual;
|
|
public
|
|
public
|
|
constructor create (AWidth,AHeight:integer); virtual;
|
|
constructor create (AWidth,AHeight:integer); virtual;
|
|
destructor destroy; override;
|
|
destructor destroy; override;
|
|
@@ -105,6 +117,7 @@ type
|
|
property ExtraKey [index:integer] : string read GetExtraKey write SetExtraKey;
|
|
property ExtraKey [index:integer] : string read GetExtraKey write SetExtraKey;
|
|
procedure RemoveExtra (const key:string);
|
|
procedure RemoveExtra (const key:string);
|
|
function ExtraCount : integer;
|
|
function ExtraCount : integer;
|
|
|
|
+ property OnProgress: TFPImgProgressEvent read FOnProgress write FOnProgress;
|
|
end;
|
|
end;
|
|
TFPCustomImageClass = class of TFPCustomImage;
|
|
TFPCustomImageClass = class of TFPCustomImage;
|
|
|
|
|
|
@@ -125,13 +138,17 @@ type
|
|
|
|
|
|
TFPCustomImageHandler = class
|
|
TFPCustomImageHandler = class
|
|
private
|
|
private
|
|
|
|
+ FOnProgress : TFPImgProgressEvent;
|
|
FStream : TStream;
|
|
FStream : TStream;
|
|
FImage : TFPCustomImage;
|
|
FImage : TFPCustomImage;
|
|
protected
|
|
protected
|
|
|
|
+ procedure Progress(Stage: TProgressStage; PercentDone: Byte; RedrawNow: Boolean; const R: TRect;
|
|
|
|
+ const Msg: AnsiString; var Continue: Boolean); Virtual;
|
|
property TheStream : TStream read FStream;
|
|
property TheStream : TStream read FStream;
|
|
property TheImage : TFPCustomImage read FImage;
|
|
property TheImage : TFPCustomImage read FImage;
|
|
public
|
|
public
|
|
constructor Create; virtual;
|
|
constructor Create; virtual;
|
|
|
|
+ Property OnProgress : TFPImgProgressEvent Read FOnProgress Write FOnProgress;
|
|
end;
|
|
end;
|
|
|
|
|
|
TFPCustomImageReader = class (TFPCustomImageHandler)
|
|
TFPCustomImageReader = class (TFPCustomImageHandler)
|