• R/O
  • SSH
  • HTTPS

dpsdxme: Commit


Commit MetaInfo

Revision10 (tree)
Time2018-03-23 03:07:52
Authorderekwildstar

Log Message

- Compatibilização com Delphis modernos (2009+)

Change Summary

Incremental Difference

--- trunk/src/pngimage.pas (revision 9)
+++ trunk/src/pngimage.pas (revision 10)
@@ -62,7 +62,7 @@
6262 BUG 2 - There was a bug were compressed text chunks no keyword
6363 name could not be read
6464 IMPROVE 1 - Add classes and methods to work with the pHYs chunk
65- (including TPNGImage.DrawUsingPixelInformation)
65+ (including TPngImage.DrawUsingPixelInformation)
6666 IMPROVE 3 - Included a property Version to return the library
6767 version
6868 IMPROVE 4 - New polish translation (thanks to Piotr Domanski)
@@ -99,7 +99,7 @@
9999
100100 Version 1.436
101101 2003-03-04 - * NEW * Property Pixels for direct access to pixels
102- * IMPROVED * Palette property (TPNGImage) (read only)
102+ * IMPROVED * Palette property (TPngImage) (read only)
103103 Slovenian traslation for the component (Miha Petelin)
104104 Help file update (scanline article/png->jpg example)
105105
@@ -203,7 +203,7 @@
203203 {$DEFINE UseDelphi} //Disable fat vcl units(perfect for small apps)
204204 {$DEFINE ErrorOnUnknownCritical} //Error when finds an unknown critical chunk
205205 {$DEFINE CheckCRC} //Enables CRC checking
206-{$DEFINE RegisterGraphic} //Registers TPNGImage to use with TPicture
206+{$DEFINE RegisterGraphic} //Registers TPngImage to use with TPicture
207207 {$DEFINE PartialTransparentDraw} //Draws partial transparent images
208208 {$DEFINE Store16bits} //Stores the extra 8 bits from 16bits/sample
209209 {$RANGECHECKS OFF} {$J+}
@@ -310,7 +310,7 @@
310310 pByteArray = ^TByteArray;
311311
312312 {Forward}
313- TPNGImage = class;
313+ TPngImage = class;
314314 pPointerArray = ^TPointerArray;
315315 TPointerArray = Array[Word] of Pointer;
316316
@@ -317,7 +317,7 @@
317317 {Contains a list of objects}
318318 TPNGPointerList = class
319319 private
320- fOwner: TPNGImage;
320+ fOwner: TPngImage;
321321 fCount : Cardinal;
322322 fMemory: pPointerArray;
323323 function GetItem(Index: Cardinal): Pointer;
@@ -334,12 +334,12 @@
334334 {Set the size of the list}
335335 procedure SetSize(const Size: Cardinal);
336336 {Returns owner}
337- property Owner: TPNGImage read fOwner;
337+ property Owner: TPngImage read fOwner;
338338 public
339339 {Returns number of items}
340340 property Count: Cardinal read fCount write SetSize;
341341 {Object being either created or destroyed}
342- constructor Create(AOwner: TPNGImage);
342+ constructor Create(AOwner: TPngImage);
343343 destructor Destroy; override;
344344 end;
345345
@@ -454,7 +454,7 @@
454454 TFilters = set of TFilter;
455455
456456 {Png implementation object}
457- TPNGImage = class{$IFDEF UseDelphi}(TGraphic){$ENDIF}
457+ TPngImage = class{$IFDEF UseDelphi}(TGraphic){$ENDIF}
458458 protected
459459 {Inverse gamma table values}
460460 InverseGamma: Array[Byte] of Byte;
@@ -502,8 +502,8 @@
502502 function GetHeight: Integer; {$IFDEF UseDelphi}override; {$ENDIF}
503503 procedure SetWidth(Value: Integer); {$IFDEF UseDelphi}override; {$ENDIF}
504504 procedure SetHeight(Value: Integer); {$IFDEF UseDelphi}override;{$ENDIF}
505- {Assigns from another TPNGImage}
506- procedure AssignPNG(Source: TPNGImage);
505+ {Assigns from another TPngImage}
506+ procedure AssignPNG(Source: TPngImage);
507507 {Returns if the image is empty}
508508 function GetEmpty: Boolean; {$IFDEF UseDelphi}override; {$ENDIF}
509509 {Used with property Header}
@@ -617,7 +617,7 @@
617617 fData: Pointer;
618618 fDataSize: Cardinal;
619619 {Stores owner}
620- fOwner: TPNGImage;
620+ fOwner: TPngImage;
621621 {Stores the chunk name}
622622 fName: TChunkName;
623623 {Returns pointer to the TChunkIHDR}
@@ -641,9 +641,9 @@
641641 {Assigns from another TChunk}
642642 procedure Assign(Source: TChunk); virtual;
643643 {Returns owner}
644- property Owner: TPNGImage read fOwner;
644+ property Owner: TPngImage read fOwner;
645645 {Being destroyed/created}
646- constructor Create(Owner: TPNGImage); virtual;
646+ constructor Create(Owner: TPngImage); virtual;
647647 destructor Destroy; override;
648648 {Returns chunk class/name}
649649 property Name: String read GetChunkName;
@@ -717,7 +717,7 @@
717717 {Saves the chunk to a stream}
718718 function SaveToStream(Stream: TStream): Boolean; override;
719719 {Destructor/constructor}
720- constructor Create(Owner: TPNGImage); override;
720+ constructor Create(Owner: TPngImage); override;
721721 destructor Destroy; override;
722722 {Assigns from another TChunk}
723723 procedure Assign(Source: TChunk); override;
@@ -757,7 +757,7 @@
757757 function LoadFromStream(Stream: TStream; const ChunkName: TChunkName;
758758 Size: Integer): Boolean; override;
759759 {Being created}
760- constructor Create(Owner: TPNGImage); override;
760+ constructor Create(Owner: TPngImage); override;
761761 {Assigns from another TChunk}
762762 procedure Assign(Source: TChunk); override;
763763 end;
@@ -1278,7 +1278,7 @@
12781278 end;
12791279
12801280 {Creates a new chunk of this class}
1281-function CreateClassChunk(Owner: TPNGImage; Name: TChunkName): TChunk;
1281+function CreateClassChunk(Owner: TPngImage; Name: TChunkName): TChunk;
12821282 var
12831283 i : Integer;
12841284 NewChunk: TChunkClass;
@@ -1484,7 +1484,7 @@
14841484 {TPngPointerList implementation}
14851485
14861486 {Object being created}
1487-constructor TPngPointerList.Create(AOwner: TPNGImage);
1487+constructor TPngPointerList.Create(AOwner: TPngImage);
14881488 begin
14891489 inherited Create; {Let ancestor work}
14901490 {Holds owner}
@@ -1918,7 +1918,7 @@
19181918 end;
19191919
19201920 {Chunk being created}
1921-constructor TChunk.Create(Owner: TPNGImage);
1921+constructor TChunk.Create(Owner: TPngImage);
19221922 var
19231923 ChunkName: String;
19241924 begin
@@ -2183,7 +2183,7 @@
21832183 {TChunkIHDR implementation}
21842184
21852185 {Chunk being created}
2186-constructor TChunkIHDR.Create(Owner: TPNGImage);
2186+constructor TChunkIHDR.Create(Owner: TPngImage);
21872187 begin
21882188 {Prepare pointers}
21892189 ImageHandle := 0;
@@ -4115,7 +4115,7 @@
41154115 Run, LongestRun, ii, jj: Cardinal;
41164116 Last, Above, LastAbove: Byte;
41174117 begin
4118- {Selecting more filters using the Filters property from TPNGImage}
4118+ {Selecting more filters using the Filters property from TPngImage}
41194119 {increases the chances to the file be much smaller, but decreases}
41204120 {the performace}
41214121
@@ -4338,7 +4338,7 @@
43384338 end;
43394339
43404340 {Gamma chunk being created}
4341-constructor TChunkgAMA.Create(Owner: TPNGImage);
4341+constructor TChunkgAMA.Create(Owner: TPngImage);
43424342 begin
43434343 {Call ancestor}
43444344 inherited Create(Owner);
@@ -4400,17 +4400,17 @@
44004400 pCardinal(Data)^ := ByteSwap(Value);
44014401 end;
44024402
4403-{TPNGImage implementation}
4403+{TPngImage implementation}
44044404
44054405 {Assigns from another object}
4406-procedure TPNGImage.Assign(Source: TPersistent);
4406+procedure TPngImage.Assign(Source: TPersistent);
44074407 begin
44084408 {Being cleared}
44094409 if Source = nil then
44104410 ClearChunks
4411- {Assigns contents from another TPNGImage}
4412- else if Source is TPNGImage then
4413- AssignPNG(Source as TPNGImage)
4411+ {Assigns contents from another TPngImage}
4412+ else if Source is TPngImage then
4413+ AssignPNG(Source as TPngImage)
44144414 {Copy contents from a TBitmap}
44154415 {$IFDEF UseDelphi}else if Source is TBitmap then
44164416 with Source as TBitmap do
@@ -4422,7 +4422,7 @@
44224422 end;
44234423
44244424 {Clear all the chunks in the list}
4425-procedure TPNGImage.ClearChunks;
4425+procedure TPngImage.ClearChunks;
44264426 var
44274427 i: Integer;
44284428 begin
@@ -4435,7 +4435,7 @@
44354435 end;
44364436
44374437 {Portable Network Graphics object being created as a blank image}
4438-constructor TPNGImage.CreateBlank(ColorType, BitDepth: Cardinal;
4438+constructor TPngImage.CreateBlank(ColorType, BitDepth: Cardinal;
44394439 cx, cy: Integer);
44404440 var NewIHDR: TChunkIHDR;
44414441 begin
@@ -4469,7 +4469,7 @@
44694469 end;
44704470
44714471 {Portable Network Graphics object being created}
4472-constructor TPNGImage.Create;
4472+constructor TPngImage.Create;
44734473 begin
44744474 {Let it be created}
44754475 inherited Create;
@@ -4486,7 +4486,7 @@
44864486 end;
44874487
44884488 {Portable Network Graphics object being destroyed}
4489-destructor TPNGImage.Destroy;
4489+destructor TPngImage.Destroy;
44904490 begin
44914491 {Free object list}
44924492 ClearChunks;
@@ -4499,7 +4499,7 @@
44994499 end;
45004500
45014501 {Returns linesize and byte offset for pixels}
4502-procedure TPNGImage.GetPixelInfo(var LineSize, Offset: Cardinal);
4502+procedure TPngImage.GetPixelInfo(var LineSize, Offset: Cardinal);
45034503 begin
45044504 {There must be an Header chunk to calculate size}
45054505 if HeaderPresent then
@@ -4542,7 +4542,7 @@
45424542 end;
45434543
45444544 {Returns image height}
4545-function TPNGImage.GetHeight: Integer;
4545+function TPngImage.GetHeight: Integer;
45464546 begin
45474547 {There must be a Header chunk to get the size, otherwise returns 0}
45484548 if HeaderPresent then
@@ -4551,7 +4551,7 @@
45514551 end;
45524552
45534553 {Returns image width}
4554-function TPNGImage.GetWidth: Integer;
4554+function TPngImage.GetWidth: Integer;
45554555 begin
45564556 {There must be a Header chunk to get the size, otherwise returns 0}
45574557 if HeaderPresent then
@@ -4560,19 +4560,19 @@
45604560 end;
45614561
45624562 {Returns if the image is empty}
4563-function TPNGImage.GetEmpty: Boolean;
4563+function TPngImage.GetEmpty: Boolean;
45644564 begin
45654565 Result := (Chunks.Count = 0);
45664566 end;
45674567
45684568 {Raises an error}
4569-procedure TPNGImage.RaiseError(ExceptionClass: ExceptClass; Text: String);
4569+procedure TPngImage.RaiseError(ExceptionClass: ExceptClass; Text: String);
45704570 begin
45714571 raise ExceptionClass.Create(Text);
45724572 end;
45734573
45744574 {Set the maximum size for IDAT chunk}
4575-procedure TPNGImage.SetMaxIdatSize(const Value: Integer);
4575+procedure TPngImage.SetMaxIdatSize(const Value: Integer);
45764576 begin
45774577 {Make sure the size is at least 65535}
45784578 if Value < High(Word) then
@@ -4580,7 +4580,7 @@
45804580 end;
45814581
45824582 {Draws the image using pixel information from TChunkpHYs}
4583-procedure TPNGImage.DrawUsingPixelInformation(Canvas: TCanvas; Point: TPoint);
4583+procedure TPngImage.DrawUsingPixelInformation(Canvas: TCanvas; Point: TPoint);
45844584 function Rect(Left, Top, Right, Bottom: Integer): TRect;
45854585 begin
45864586 Result.Left := Left;
@@ -4615,7 +4615,7 @@
46154615
46164616 {$IFNDEF UseDelphi}
46174617 {Creates a file stream reading from the filename in the parameter and load}
4618- procedure TPNGImage.LoadFromFile(const Filename: String);
4618+ procedure TPngImage.LoadFromFile(const Filename: String);
46194619 var
46204620 FileStream: TFileStream;
46214621 begin
@@ -4634,7 +4634,7 @@
46344634 end;
46354635
46364636 {Saves the current png image to a file}
4637- procedure TPNGImage.SaveToFile(const Filename: String);
4637+ procedure TPngImage.SaveToFile(const Filename: String);
46384638 var
46394639 FileStream: TFileStream;
46404640 begin
@@ -4647,13 +4647,13 @@
46474647 {$ENDIF}
46484648
46494649 {Returns if it has the pixel information chunk}
4650-function TPNGImage.HasPixelInformation: Boolean;
4650+function TPngImage.HasPixelInformation: Boolean;
46514651 begin
46524652 Result := (Chunks.ItemFromClass(TChunkpHYs) as tChunkpHYs) <> nil;
46534653 end;
46544654
46554655 {Returns the pixel information chunk}
4656-function TPNGImage.GetPixelInformation: TChunkpHYs;
4656+function TPngImage.GetPixelInformation: TChunkpHYs;
46574657 begin
46584658 Result := Chunks.ItemFromClass(TChunkpHYs) as tChunkpHYs;
46594659 if not Assigned(Result) then
@@ -4664,7 +4664,7 @@
46644664 end;
46654665
46664666 {Returns pointer to the chunk TChunkIHDR which should be the first}
4667-function TPNGImage.GetHeader: TChunkIHDR;
4667+function TPngImage.GetHeader: TChunkIHDR;
46684668 begin
46694669 {If there is a TChunkIHDR returns it, otherwise returns nil}
46704670 if (Chunks.Count <> 0) and (Chunks.Item[0] is TChunkIHDR) then
@@ -4678,7 +4678,7 @@
46784678 end;
46794679
46804680 {Draws using partial transparency}
4681-procedure TPNGImage.DrawPartialTrans(DC: HDC; Rect: TRect);
4681+procedure TPngImage.DrawPartialTrans(DC: HDC; Rect: TRect);
46824682 {Adjust the rectangle structure}
46834683 procedure AdjustRect(var Rect: TRect);
46844684 var
@@ -4913,7 +4913,7 @@
49134913 end;
49144914
49154915 {Draws the image into a canvas}
4916-procedure TPNGImage.Draw(ACanvas: TCanvas; const Rect: TRect);
4916+procedure TPngImage.Draw(ACanvas: TCanvas; const Rect: TRect);
49174917 var
49184918 Header: TChunkIHDR;
49194919 begin
@@ -4948,7 +4948,7 @@
49484948 PngHeader: Array[0..7] of Char = (#137, #80, #78, #71, #13, #10, #26, #10);
49494949
49504950 {Loads the image from a stream of data}
4951-procedure TPNGImage.LoadFromStream(Stream: TStream);
4951+procedure TPngImage.LoadFromStream(Stream: TStream);
49524952 var
49534953 Header : Array[0..7] of Char;
49544954 HasIDAT : Boolean;
@@ -5048,13 +5048,13 @@
50485048 end;
50495049
50505050 {Changing height is not supported}
5051-procedure TPNGImage.SetHeight(Value: Integer);
5051+procedure TPngImage.SetHeight(Value: Integer);
50525052 begin
50535053 Resize(Width, Value)
50545054 end;
50555055
50565056 {Changing width is not supported}
5057-procedure TPNGImage.SetWidth(Value: Integer);
5057+procedure TPngImage.SetWidth(Value: Integer);
50585058 begin
50595059 Resize(Value, Height)
50605060 end;
@@ -5061,7 +5061,7 @@
50615061
50625062 {$IFDEF UseDelphi}
50635063 {Saves to clipboard format (thanks to Antoine Pottern)}
5064-procedure TPNGImage.SaveToClipboardFormat(var AFormat: Word;
5064+procedure TPngImage.SaveToClipboardFormat(var AFormat: Word;
50655065 var AData: THandle; var APalette: HPalette);
50665066 begin
50675067 with TBitmap.Create do
@@ -5076,7 +5076,7 @@
50765076 end;
50775077
50785078 {Loads data from clipboard}
5079-procedure TPNGImage.LoadFromClipboardFormat(AFormat: Word;
5079+procedure TPngImage.LoadFromClipboardFormat(AFormat: Word;
50805080 AData: THandle; APalette: HPalette);
50815081 begin
50825082 with TBitmap.Create do
@@ -5089,7 +5089,7 @@
50895089 end;
50905090
50915091 {Returns if the image is transparent}
5092-function TPNGImage.GetTransparent: Boolean;
5092+function TPngImage.GetTransparent: Boolean;
50935093 begin
50945094 Result := (TransparencyMode <> ptmNone);
50955095 end;
@@ -5097,7 +5097,7 @@
50975097 {$ENDIF}
50985098
50995099 {Saving the PNG image to a stream of data}
5100-procedure TPNGImage.SaveToStream(Stream: TStream);
5100+procedure TPngImage.SaveToStream(Stream: TStream);
51015101 var
51025102 j: Integer;
51035103 begin
@@ -5137,7 +5137,7 @@
51375137 end;
51385138
51395139 {Loads the image from a resource}
5140-procedure TPNGImage.LoadFromResourceName(Instance: HInst;
5140+procedure TPngImage.LoadFromResourceName(Instance: HInst;
51415141 const Name: String);
51425142 var
51435143 ResStream: TResourceStream;
@@ -5156,13 +5156,13 @@
51565156 end;
51575157
51585158 {Loads the png from a resource ID}
5159-procedure TPNGImage.LoadFromResourceID(Instance: HInst; ResID: Integer);
5159+procedure TPngImage.LoadFromResourceID(Instance: HInst; ResID: Integer);
51605160 begin
51615161 LoadFromResourceName(Instance, String(ResID));
51625162 end;
51635163
5164-{Assigns this TPNGImage to another object}
5165-procedure TPNGImage.AssignTo(Dest: TPersistent);
5164+{Assigns this TPngImage to another object}
5165+procedure TPngImage.AssignTo(Dest: TPersistent);
51665166 {$IFDEF UseDelphi}
51675167 function DetectPixelFormat: TPixelFormat;
51685168 begin
@@ -5191,10 +5191,10 @@
51915191 TRNS: TChunkTRNS;
51925192 {$ENDIF}
51935193 begin
5194- {If the destination is also a TPNGImage make it assign}
5194+ {If the destination is also a TPngImage make it assign}
51955195 {this one}
5196- if Dest is TPNGImage then
5197- TPNGImage(Dest).AssignPNG(Self)
5196+ if Dest is TPngImage then
5197+ TPngImage(Dest).AssignPNG(Self)
51985198 {$IFDEF UseDelphi}
51995199 {In case the destination is a bitmap}
52005200 else if (Dest is TBitmap) and HeaderPresent then
@@ -5221,7 +5221,7 @@
52215221 end;
52225222
52235223 {Assigns from a bitmap object}
5224-procedure TPNGImage.AssignHandle(Handle: HBitmap; Transparent: Boolean;
5224+procedure TPngImage.AssignHandle(Handle: HBitmap; Transparent: Boolean;
52255225 TransparentColor: ColorRef);
52265226 var
52275227 BitmapInfo: Windows.TBitmap;
@@ -5283,7 +5283,7 @@
52835283 end;
52845284
52855285 {Assigns from another PNG}
5286-procedure TPNGImage.AssignPNG(Source: TPNGImage);
5286+procedure TPngImage.AssignPNG(Source: TPngImage);
52875287 var
52885288 J: Integer;
52895289 begin
@@ -5306,7 +5306,7 @@
53065306 end;
53075307
53085308 {Returns a alpha data scanline}
5309-function TPNGImage.GetAlphaScanline(const LineIndex: Integer): pByteArray;
5309+function TPngImage.GetAlphaScanline(const LineIndex: Integer): pByteArray;
53105310 begin
53115311 with Header do
53125312 if (ColorType = COLOR_RGBALPHA) or (ColorType = COLOR_GRAYSCALEALPHA) then
@@ -5316,7 +5316,7 @@
53165316
53175317 {$IFDEF Store16bits}
53185318 {Returns a png data extra scanline}
5319-function TPNGImage.GetExtraScanline(const LineIndex: Integer): Pointer;
5319+function TPngImage.GetExtraScanline(const LineIndex: Integer): Pointer;
53205320 begin
53215321 with Header do
53225322 Longint(Result) := (Longint(ExtraImageData) + ((Longint(Height) - 1) *
@@ -5325,7 +5325,7 @@
53255325 {$ENDIF}
53265326
53275327 {Returns a png data scanline}
5328-function TPNGImage.GetScanline(const LineIndex: Integer): Pointer;
5328+function TPngImage.GetScanline(const LineIndex: Integer): Pointer;
53295329 begin
53305330 with Header do
53315331 Longint(Result) := (Longint(ImageData) + ((Longint(Height) - 1) *
@@ -5333,7 +5333,7 @@
53335333 end;
53345334
53355335 {Initialize gamma table}
5336-procedure TPNGImage.InitializeGamma;
5336+procedure TPngImage.InitializeGamma;
53375337 var
53385338 i: Integer;
53395339 begin
@@ -5346,7 +5346,7 @@
53465346 end;
53475347
53485348 {Returns the transparency mode used by this png}
5349-function TPNGImage.GetTransparencyMode: TPNGTransparencyMode;
5349+function TPngImage.GetTransparencyMode: TPNGTransparencyMode;
53505350 var
53515351 TRNS: TChunkTRNS;
53525352 begin
@@ -5374,7 +5374,7 @@
53745374 end;
53755375
53765376 {Add a text chunk}
5377-procedure TPNGImage.AddtEXt(const Keyword, Text: String);
5377+procedure TPngImage.AddtEXt(const Keyword, Text: String);
53785378 var
53795379 TextChunk: TChunkTEXT;
53805380 begin
@@ -5384,7 +5384,7 @@
53845384 end;
53855385
53865386 {Add a text chunk}
5387-procedure TPNGImage.AddzTXt(const Keyword, Text: String);
5387+procedure TPngImage.AddzTXt(const Keyword, Text: String);
53885388 var
53895389 TextChunk: TChunkzTXt;
53905390 begin
@@ -5394,7 +5394,7 @@
53945394 end;
53955395
53965396 {Removes the image transparency}
5397-procedure TPNGImage.RemoveTransparency;
5397+procedure TPngImage.RemoveTransparency;
53985398 var
53995399 TRNS: TChunkTRNS;
54005400 begin
@@ -5423,7 +5423,7 @@
54235423 end;
54245424
54255425 {Generates alpha information}
5426-procedure TPNGImage.CreateAlpha;
5426+procedure TPngImage.CreateAlpha;
54275427 var
54285428 TRNS: TChunkTRNS;
54295429 begin
@@ -5465,7 +5465,7 @@
54655465 end;
54665466
54675467 {Returns transparent color}
5468-function TPNGImage.GetTransparentColor: TColor;
5468+function TPngImage.GetTransparentColor: TColor;
54695469 var
54705470 TRNS: TChunkTRNS;
54715471 begin
@@ -5476,7 +5476,7 @@
54765476 end;
54775477
54785478 {$OPTIMIZATION OFF}
5479-procedure TPNGImage.SetTransparentColor(const Value: TColor);
5479+procedure TPngImage.SetTransparentColor(const Value: TColor);
54805480 var
54815481 TRNS: TChunkTRNS;
54825482 begin
@@ -5500,13 +5500,13 @@
55005500 end;
55015501
55025502 {Returns if header is present}
5503-function TPNGImage.HeaderPresent: Boolean;
5503+function TPngImage.HeaderPresent: Boolean;
55045504 begin
55055505 Result := ((Chunks.Count <> 0) and (Chunks.Item[0] is TChunkIHDR))
55065506 end;
55075507
55085508 {Returns pixel for png using palette and grayscale}
5509-function GetByteArrayPixel(const png: TPNGImage; const X, Y: Integer): TColor;
5509+function GetByteArrayPixel(const png: TPngImage; const X, Y: Integer): TColor;
55105510 var
55115511 ByteData: Byte;
55125512 DataDepth: Byte;
@@ -5552,7 +5552,7 @@
55525552 {$ENDIF}
55535553
55545554 {Sets a pixel for grayscale and palette pngs}
5555-procedure SetByteArrayPixel(const png: TPNGImage; const X, Y: Integer;
5555+procedure SetByteArrayPixel(const png: TPngImage; const X, Y: Integer;
55565556 const Value: TColor);
55575557 const
55585558 ClearFlag: Array[1..8] of Integer = (1, 3, 0, 15, 0, 0, 0, $FF);
@@ -5582,7 +5582,7 @@
55825582 end;
55835583
55845584 {Returns pixel when png uses RGB}
5585-function GetRGBLinePixel(const png: TPNGImage;
5585+function GetRGBLinePixel(const png: TPngImage;
55865586 const X, Y: Integer): TColor;
55875587 begin
55885588 with pRGBLine(png.Scanline[Y])^[X] do
@@ -5590,7 +5590,7 @@
55905590 end;
55915591
55925592 {Sets pixel when png uses RGB}
5593-procedure SetRGBLinePixel(const png: TPNGImage;
5593+procedure SetRGBLinePixel(const png: TPngImage;
55945594 const X, Y: Integer; Value: TColor);
55955595 begin
55965596 with pRGBLine(png.Scanline[Y])^[X] do
@@ -5602,7 +5602,7 @@
56025602 end;
56035603
56045604 {Returns pixel when png uses grayscale}
5605-function GetGrayLinePixel(const png: TPNGImage;
5605+function GetGrayLinePixel(const png: TPngImage;
56065606 const X, Y: Integer): TColor;
56075607 var
56085608 B: Byte;
@@ -5612,7 +5612,7 @@
56125612 end;
56135613
56145614 {Sets pixel when png uses grayscale}
5615-procedure SetGrayLinePixel(const png: TPNGImage;
5615+procedure SetGrayLinePixel(const png: TPngImage;
56165616 const X, Y: Integer; Value: TColor);
56175617 begin
56185618 PByteArray(png.Scanline[Y])^[X] := GetRValue(Value);
@@ -5619,7 +5619,7 @@
56195619 end;
56205620
56215621 {Resizes the PNG image}
5622-procedure TPNGImage.Resize(const CX, CY: Integer);
5622+procedure TPngImage.Resize(const CX, CY: Integer);
56235623 function Min(const A, B: Integer): Integer;
56245624 begin
56255625 if A < B then Result := A else Result := B;
@@ -5702,7 +5702,7 @@
57025702 end;
57035703
57045704 {Sets a pixel}
5705-procedure TPNGImage.SetPixels(const X, Y: Integer; const Value: TColor);
5705+procedure TPngImage.SetPixels(const X, Y: Integer; const Value: TColor);
57065706 begin
57075707 if ((X >= 0) and (X <= Width - 1)) and
57085708 ((Y >= 0) and (Y <= Height - 1)) then
@@ -5719,7 +5719,7 @@
57195719
57205720
57215721 {Returns a pixel}
5722-function TPNGImage.GetPixels(const X, Y: Integer): TColor;
5722+function TPngImage.GetPixels(const X, Y: Integer): TColor;
57235723 begin
57245724 if ((X >= 0) and (X <= Width - 1)) and
57255725 ((Y >= 0) and (Y <= Height - 1)) then
@@ -5736,7 +5736,7 @@
57365736 end;
57375737
57385738 {Returns the image palette}
5739-function TPNGImage.GetPalette: HPALETTE;
5739+function TPngImage.GetPalette: HPALETTE;
57405740 begin
57415741 Result := Header.ImagePalette;
57425742 end;
@@ -5776,7 +5776,7 @@
57765776 Result := inherited SaveToStream(Stream);
57775777 end;
57785778
5779-procedure TPNGImage.DoSetPalette(Value: HPALETTE; const UpdateColors: boolean);
5779+procedure TPngImage.DoSetPalette(Value: HPALETTE; const UpdateColors: boolean);
57805780 begin
57815781 if (Header.HasPalette) then
57825782 begin
@@ -5795,13 +5795,13 @@
57955795 end;
57965796
57975797 {Set palette based on a windows palette handle}
5798-procedure TPNGImage.SetPalette(Value: HPALETTE);
5798+procedure TPngImage.SetPalette(Value: HPALETTE);
57995799 begin
58005800 DoSetPalette(Value, true);
58015801 end;
58025802
58035803 {Returns the library version}
5804-function TPNGImage.GetLibraryVersion: String;
5804+function TPngImage.GetLibraryVersion: String;
58055805 begin
58065806 Result := LibraryVersion
58075807 end;
@@ -5813,13 +5813,13 @@
58135813 crc_table_computed := FALSE;
58145814 {Register the necessary chunks for png}
58155815 RegisterCommonChunks;
5816- {Registers TPNGImage to use with TPicture}
5816+ {Registers TPngImage to use with TPicture}
58175817 {$IFDEF UseDelphi}{$IFDEF RegisterGraphic}
5818- TPicture.RegisterFileFormat('PNG', 'Portable Network Graphics', TPNGImage);
5818+ TPicture.RegisterFileFormat('PNG', 'Portable Network Graphics', TPngImage);
58195819 {$ENDIF}{$ENDIF}
58205820 finalization
58215821 {$IFDEF UseDelphi}{$IFDEF RegisterGraphic}
5822- TPicture.UnregisterGraphicClass(TPNGImage);
5822+ TPicture.UnregisterGraphicClass(TPngImage);
58235823 {$ENDIF}{$ENDIF}
58245824 {Free chunk classes}
58255825 FreeChunkClassList;
Show on old repository browser