- Timestamp:
- Sep 22, 2014, 11:06:27 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ColorFormats/UColorRGBA8.pas
r14 r15 6 6 7 7 uses 8 Classes, SysUtils, Graphics, UGraphic , UMemory;8 Classes, SysUtils, Graphics, UGraphic; 9 9 10 10 type -
trunk/LibrePaint.lpi
r14 r15 170 170 </CodeGeneration> 171 171 <Linking> 172 <Debugging> 173 <UseHeaptrc Value="True"/> 174 </Debugging> 172 175 <Options> 173 176 <Win32> … … 176 179 </Options> 177 180 </Linking> 181 <Other> 182 <CustomOptions Value="-dDEBUG"/> 183 </Other> 178 184 </CompilerOptions> 179 185 <Debugging> -
trunk/LibrePaint.lpr
r13 r15 8 8 {$ENDIF}{$ENDIF} 9 9 Interfaces, // this includes the LCL widgetset 10 Forms, UCore, UGraphic, UProject, UMemory, UFormNew, UFormMain,10 SysUtils, Forms, UCore, UGraphic, UProject, UMemory, UFormNew, UFormMain, 11 11 UColorRGBA8, UColorGray8, UColorGray1, UColorGray4, UColorRGB565 12 12 { you can add units after this }; … … 14 14 {$R *.res} 15 15 16 {$IFDEF DEBUG} 17 const 18 HeapTraceLog = 'heaptrclog.trc'; 19 {$ENDIF} 20 16 21 begin 22 {$IFDEF DEBUG} 23 // Heap trace 24 DeleteFile(ExtractFilePath(ParamStr(0)) + HeapTraceLog); 25 SetHeapTraceOutput(ExtractFilePath(ParamStr(0)) + HeapTraceLog); 26 {$ENDIF} 27 17 28 RequireDerivedFormResource := True; 18 29 Application.Initialize; -
trunk/UCore.lfm
r13 r15 1 1 object Core: TCore 2 2 OnCreate = DataModuleCreate 3 OnDestroy = DataModuleDestroy 3 4 OldCreateOrder = False 4 5 Height = 491 -
trunk/UCore.pas
r13 r15 57 57 procedure AZoomOutExecute(Sender: TObject); 58 58 procedure DataModuleCreate(Sender: TObject); 59 procedure DataModuleDestroy(Sender: TObject); 59 60 private 60 61 { private declarations } … … 94 95 end; 95 96 97 procedure TCore.DataModuleDestroy(Sender: TObject); 98 begin 99 Project.Free; 100 end; 101 96 102 procedure TCore.Init; 97 103 begin 98 104 // Set default 105 Project.Bitmap.ColorFormat := ColorManager.Formats[0]; 99 106 Project.Bitmap.Size := Point(200, 100); 100 107 if ColorManager.FormatCount > 0 then … … 114 121 Project.Bitmap.BackgroundColor.FromTColor(clBlack); 115 122 Project.Bitmap.DPI := FormNew.SpinEditDPI.Value; 116 AZoomAll.Execute; ;123 AZoomAll.Execute; 117 124 end; 118 125 end; -
trunk/UGraphic.pas
r14 r15 51 51 procedure Assign(Source: TGColor); virtual; 52 52 constructor Create; 53 destructor Destroy; override; 53 54 property Channels[Channel: TGColorChannel]: TGColor read GetChannel; 54 55 property Data: TBitMemory read FData; … … 339 340 if FColorFormat = AValue then Exit; 340 341 FColorFormat := AValue; 341 FData.Size := FColorFormat.BitDepth; 342 if Assigned(FColorFormat) then 343 FData.Size := FColorFormat.BitDepth 344 else FData.Size := 0; 342 345 end; 343 346 … … 406 409 begin 407 410 FData := TBitMemory.Create; 408 Format := TGColorFormat.Create; 411 Format := nil; 412 end; 413 414 destructor TGColor.Destroy; 415 begin 416 FData.Free; 417 inherited Destroy; 409 418 end; 410 419 … … 566 575 X, Y: Integer; 567 576 Color: TGColor; 577 Color2: TGColor; 568 578 begin 569 579 for Y := 0 to Size.Y div 2 - 1 do 570 580 for X := 0 to Size.X - 1 do begin 571 581 Color := Pixels[X, Y]; 572 Pixels[X, Y] := Pixels[X, Size.Y - 1 - Y]; 582 Color2 := Pixels[X, Size.Y - 1 - Y]; 583 Pixels[X, Y] := Color2; 584 Color2.Free; 573 585 Pixels[X, Size.Y - 1 - Y] := Color; 574 586 Color.Free; … … 580 592 X, Y: Integer; 581 593 Color: TGColor; 594 Color2: TGColor; 582 595 begin 583 596 for Y := 0 to Size.Y - 1 do 584 597 for X := 0 to Size.X div 2 - 1 do begin 585 598 Color := Pixels[X, Y]; 586 Pixels[X, Y] := Pixels[Size.X - 1 - X, Y]; 599 Color2 := Pixels[Size.X - 1 - X, Y]; 600 Pixels[X, Y] := Color2; 601 Color2.Free; 587 602 Pixels[Size.X - 1 - X, Y] := Color; 588 603 Color.Free; … … 608 623 FData := TBitMemory.Create; 609 624 FBackgroundColor := TGColor.Create; 610 ColorFormat := TGColorFormat.Create; 611 FBackgroundColor.Format := ColorFormat; 612 FBackgroundColor.FromTColor(clBlack); 625 ColorFormat := nil; 613 626 Canvas := TGCanvas.Create; 614 627 Canvas.Bitmap := Self; … … 617 630 destructor TGBitmap.Destroy; 618 631 begin 632 FBackgroundColor.Free; 633 Canvas.Free; 619 634 Size := Point(0, 0); 620 635 FData.Free; -
trunk/UMemory.pas
r13 r15 89 89 procedure SetItem(Index: Integer; AValue: Byte); override; 90 90 public 91 constructor Create; 92 destructor Destroy; override; 91 93 function GetInteger: Integer; override; 92 94 procedure SetInteger(Value: Integer); override; … … 203 205 end; 204 206 207 constructor TBitMemory.Create; 208 begin 209 FData := nil; 210 end; 211 212 destructor TBitMemory.Destroy; 213 begin 214 FreeMem(FData); 215 inherited Destroy; 216 end; 217 205 218 { TBitBlock } 206 219
Note:
See TracChangeset
for help on using the changeset viewer.