Changeset 450
- Timestamp:
- Nov 23, 2012, 1:11:03 PM (12 years ago)
- Location:
- GraphicTest
- Files:
-
- 364 added
- 1 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
GraphicTest/GraphicTest.lpi
r447 r450 66 66 </local> 67 67 </RunParams> 68 <RequiredPackages Count=" 4">68 <RequiredPackages Count="5"> 69 69 <Item1> 70 <PackageName Value="SynEdit"/> 70 <PackageName Value="GR32_L"/> 71 <DefaultFilename Value="Packages/Graphics32/Packages/GR32_L.lpk" Prefer="True"/> 71 72 </Item1> 72 73 <Item2> 73 <PackageName Value=" bgrabitmappack"/>74 <PackageName Value="SynEdit"/> 74 75 </Item2> 75 76 <Item3> 76 <PackageName Value="lazopenglcontext"/> 77 <PackageName Value="bgrabitmappack"/> 78 <DefaultFilename Value="Packages/BGRABitmap/bgrabitmappack.lpk" Prefer="True"/> 77 79 </Item3> 78 80 <Item4> 81 <PackageName Value="lazopenglcontext"/> 82 </Item4> 83 <Item5> 79 84 <PackageName Value="LCL"/> 80 </Item 4>85 </Item5> 81 86 </RequiredPackages> 82 <Units Count="1 7">87 <Units Count="18"> 83 88 <Unit0> 84 89 <Filename Value="GraphicTest.lpr"/> … … 171 176 <UnitName Value="UOpenGLPBOMethod"/> 172 177 </Unit16> 178 <Unit17> 179 <Filename Value="Methods/UGraphics32Method.pas"/> 180 <IsPartOfProject Value="True"/> 181 <UnitName Value="UGraphics32Method"/> 182 </Unit17> 173 183 </Units> 174 184 </ProjectOptions> -
GraphicTest/GraphicTest.lpr
r447 r450 9 9 Interfaces, // this includes the LCL widgetset 10 10 Forms, lazopenglcontext, UMainForm, UPlatform, UDrawMethod, UFastBitmap, 11 bgrabitmappack, UDrawForm, UCanvasPixels, UCanvasPixelsUpdateLock,11 bgrabitmappack, UDrawForm, GR32_L, UCanvasPixels, UCanvasPixelsUpdateLock, 12 12 ULazIntfImageColorsCopy, ULazIntfImageColorsNoCopy, UBGRABitmapPaintBox, 13 UBitmapRawImageDataPaintBox, UBitmapRawImageData, UDummyMethod, 14 UBitmapRawImageDataMove, UOpenGLMethod, UOpenGLPBOMethod;13 UBitmapRawImageDataPaintBox, UBitmapRawImageData, UDummyMethod, 14 UBitmapRawImageDataMove, UOpenGLMethod, UOpenGLPBOMethod, UGraphics32Method; 15 15 16 16 {$R *.res} -
GraphicTest/Methods/UBitmapRawImageDataPaintBox.pas
r449 r450 7 7 uses 8 8 Classes, SysUtils, UDrawMethod, UFastBitmap, Graphics, LCLType, 9 FPimage, IntfGraphics, GraphType ;9 FPimage, IntfGraphics, GraphType{$IFDEF windows}, Windows{$ENDIF}; 10 10 11 11 type … … 38 38 //PaintBox.Canvas.CopyRect(Rect(0, 0, PaintBox.Width, PaintBox.Height), TempBitmap.Canvas, 39 39 // Rect(0, 0, TempBitmap.Width, TempBitmap.Height)); 40 PaintBox.Canvas.Draw(0, 0, TempBitmap);41 //BitBlt(hPaint, 0, 0, TempBitmap.Width, TempBitmap.Height, hBmp, 0, 0, srcCopy);40 //PaintBox.Canvas.Draw(0, 0, TempBitmap); 41 BitBlt(hPaint, 0, 0, TempBitmap.Width, TempBitmap.Height, hBmp, 0, 0, srcCopy); 42 42 end; 43 43 -
GraphicTest/UFastBitmap.pas
r442 r450 38 38 constructor Create; 39 39 destructor Destroy; override; 40 procedure RandomImage ;40 procedure RandomImage(Index, Count: Integer); 41 41 property Size: TPoint read FSize write SetSize; 42 42 property Pixels[X, Y: Integer]: TFastBitmapPixel read GetPixel write SetPixel; … … 204 204 end; 205 205 206 procedure TFastBitmap.RandomImage ;206 procedure TFastBitmap.RandomImage(Index, Count: Integer); 207 207 var 208 208 I, X, Y: Integer; 209 209 begin 210 // Main three color blocks 210 211 for I := 0 to 2 do 211 for Y := 0 to (Size.Y div 2) - 1 do212 for Y := 0 to (Size.Y div 3) - 1 do 212 213 for X := 0 to (Size.X div 3) - 1 do 213 214 Pixels[X + (I * (Size.X div 3)), Y] := (255 shl (I * 8)) and $ffffff; 214 215 215 for Y := (Size.Y div 2) to Size.Y - 1 do 216 // Random noise 217 for Y := (Size.Y div 3) to (Size.Y * 2 div 3) - 1 do 216 218 for X := 0 to Size.X - 1 do 217 219 Pixels[X, Y] := (Random(256) or (Random(256) shl 16) or (Random(256) shl 8)) and $ffffff; 220 221 // Color gradient 222 for Y := (Size.Y * 2 div 3) to (Size.Y - 1) do begin 223 for X := 0 to Size.X - 1 do 224 Pixels[X, Y] := (Trunc(Sin((X + Trunc(Index / Count * Size.X)) mod Size.X 225 / Size.X * pi) * 255) * $010101) and $ffffff; 226 end; 218 227 end; 219 228 -
GraphicTest/UMainForm.lfm
r448 r450 3 3 Height = 411 4 4 Top = 117 5 Width = 8 465 Width = 857 6 6 Caption = 'Graphic test' 7 7 ClientHeight = 411 8 ClientWidth = 8 468 ClientWidth = 857 9 9 OnClose = FormClose 10 10 OnCreate = FormCreate … … 13 13 LCLVersion = '1.1' 14 14 object PageControl1: TPageControl 15 Left = 5 4415 Left = 555 16 16 Height = 411 17 17 Top = 0 … … 526 526 Height = 411 527 527 Top = 0 528 Width = 5 39528 Width = 550 529 529 Align = alClient 530 530 BevelOuter = bvNone 531 531 ClientHeight = 411 532 ClientWidth = 5 39532 ClientWidth = 550 533 533 TabOrder = 1 534 534 object ListViewMethods: TListView … … 536 536 Height = 335 537 537 Top = 8 538 Width = 5 28538 Width = 539 539 539 Anchors = [akTop, akLeft, akRight, akBottom] 540 540 Columns = < … … 690 690 TabOrder = 8 691 691 end 692 object CheckBox1: TCheckBox 693 Left = 408 694 Height = 17 695 Top = 387 696 Width = 58 697 Anchors = [akLeft, akBottom] 698 Caption = 'Opaque' 699 OnChange = CheckBox1Change 700 TabOrder = 9 701 end 692 702 end 693 703 object Splitter1: TSplitter 694 Left = 5 39704 Left = 550 695 705 Height = 411 696 706 Top = 0 -
GraphicTest/UMainForm.pas
r449 r450 22 22 ButtonSingleTest: TButton; 23 23 ButtonStop: TButton; 24 CheckBox1: TCheckBox; 24 25 CheckBoxDoubleBuffered: TCheckBox; 25 26 CheckBoxEraseBackground: TCheckBox; … … 44 45 procedure ButtonSingleTestClick(Sender: TObject); 45 46 procedure ButtonStopClick(Sender: TObject); 47 procedure CheckBox1Change(Sender: TObject); 46 48 procedure CheckBoxDoubleBufferedChange(Sender: TObject); 47 49 procedure CheckBoxEraseBackgroundChange(Sender: TObject); … … 85 87 UCanvasPixelsUpdateLock, UBGRABitmapPaintBox, UBitmapRawImageDataPaintBox, 86 88 UBitmapRawImageData, UBitmapRawImageDataMove, UDummyMethod, UOpenGLMethod, 87 UOpenGLPBOMethod ;89 UOpenGLPBOMethod, UGraphics32Method; 88 90 89 91 const 90 DrawMethodClasses: array[0.. {$IFDEF opengl}10{$ELSE}8{$ENDIF}] of TDrawMethodClass = (92 DrawMethodClasses: array[0..9{$IFDEF opengl}+2{$ENDIF}] of TDrawMethodClass = ( 91 93 TCanvasPixels, TCanvasPixelsUpdateLock, TLazIntfImageColorsCopy, 92 94 TLazIntfImageColorsNoCopy, TBitmapRawImageData, TBitmapRawImageDataPaintBox, 93 TBitmapRawImageDataMove, TBGRABitmapPaintBox {$IFDEF opengl}, TOpenGLMethod, TOpenGLPBOMethod{$ENDIF}95 TBitmapRawImageDataMove, TBGRABitmapPaintBox, TGraphics32Method{$IFDEF opengl}, TOpenGLMethod, TOpenGLPBOMethod{$ENDIF} 94 96 ,TDummyMethod); 95 97 … … 190 192 end; 191 193 194 procedure TMainForm.CheckBox1Change(Sender: TObject); 195 begin 196 if CheckBox1.Checked then 197 DrawForm.ControlStyle := DrawForm.ControlStyle + [csOpaque] 198 else DrawForm.ControlStyle := DrawForm.ControlStyle - [csOpaque]; 199 end; 200 192 201 procedure TMainForm.CheckBoxDoubleBufferedChange(Sender: TObject); 193 202 begin … … 280 289 NewScene := TFastBitmap.Create; 281 290 NewScene.Size := FrameSize; 282 NewScene.RandomImage ;291 NewScene.RandomImage(I, SceneFrameCount); 283 292 Scenes.Add(NewScene); 284 293 end; … … 300 309 CheckBoxDoubleBuffered.Checked := DrawForm.DoubleBuffered; 301 310 CheckBoxEraseBackground.Checked := DrawForm.EraseBackgroundEnabled; 311 CheckBox1.Checked := csOpaque in DrawForm.ControlStyle; 302 312 end; 303 313
Note:
See TracChangeset
for help on using the changeset viewer.