Changeset 459


Ignore:
Timestamp:
Nov 28, 2012, 8:09:38 AM (12 years ago)
Author:
chronos
Message:
  • Added: Brief description for rest of available draw methods.
  • Added: Graphics32 method conditional compilation.
Location:
GraphicTest
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • GraphicTest/GraphicTest.lpi

    r454 r459  
    1919          <SearchPaths>
    2020            <IncludeFiles Value="$(ProjOutDir)"/>
     21            <OtherUnitFiles Value="Methods"/>
    2122            <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
    2223          </SearchPaths>
     
    118119        <IsPartOfProject Value="True"/>
    119120        <ComponentName Value="DrawForm"/>
     121        <HasResources Value="True"/>
    120122        <ResourceBaseClass Value="Form"/>
    121123        <UnitName Value="UDrawForm"/>
  • GraphicTest/Methods/UBGRABitmapPaintBox.pas

    r454 r459  
    4444  BGRABitmap := TBGRABitmap.Create(0, 0);
    4545  PaintObject := poPaintBox;
     46  Description.Add('This method use graphic library BGRABitmap. ' +
     47    'PaintBox is used to display image data.');
    4648end;
    4749
  • GraphicTest/Methods/UBitmapRawImageData.pas

    r447 r459  
    2525  inherited;
    2626  Caption := 'TBitmap.RawImage.Data';
     27  Description.Add('Custom TFastBitmap data are converted to visible image bitmap raw data. ' +
     28    'Then TImage is responsible for show loaded data.');
    2729end;
    2830
  • GraphicTest/Methods/UBitmapRawImageDataMove.pas

    r447 r459  
    2525  inherited;
    2626  Caption := 'TBitmap.RawImage.Data Move';
     27  Description.Add('This is same as BitmapRawImageData but data is not converted from different format. ' +
     28   'But only moved to TImage raw data. ' +
     29    'Then TImage is responsible for show loaded data.');
    2730end;
    2831
  • GraphicTest/Methods/UBitmapRawImageDataPaintBox.pas

    r452 r459  
    66
    77uses
    8   Classes, SysUtils, UDrawMethod, UFastBitmap, Graphics, LCLType,
    9   FPimage, IntfGraphics, GraphType{$IFDEF windows}, Windows{$ENDIF};
     8  {$IFDEF windows}Windows,{$ENDIF}Classes, SysUtils, Controls, UDrawMethod, UFastBitmap, Graphics, LCLType,
     9  FPimage, IntfGraphics, GraphType;
    1010
    1111type
     
    1313
    1414  TBitmapRawImageDataPaintBox = class(TDrawMethodPaintBox)
     15    TempBitmap: TBitmap;
    1516    constructor Create; override;
     17    procedure Init(Parent: TWinControl; Size: TPoint; PixelFormat: TPixelFormat); override;
     18    procedure Done; override;
    1619    procedure Paint(Sender: TObject); override;
    1720    procedure DrawFrame(FastBitmap: TFastBitmap); override;
     
    2831  Caption := 'TBitmap.RawImage.Data PaintBox';
    2932  PaintObject := poPaintBox;
     33  Description.Add('Custom TFastBitmap data are converted to bitmap data compatible with screen. ' +
     34    'Then data is sent to PaintBox by Draw method.');
     35end;
     36
     37procedure TBitmapRawImageDataPaintBox.Init(Parent: TWinControl; Size: TPoint;
     38  PixelFormat: TPixelFormat);
     39begin
     40  inherited;
     41  TempBitmap := TBitmap.Create;
     42  TempBitmap.PixelFormat := PixelFormat;
     43  TempBitmap.SetSize(Size.X, Size.Y);
     44end;
     45
     46procedure TBitmapRawImageDataPaintBox.Done;
     47begin
     48  FreeAndNil(TempBitmap);
     49  inherited Done;
    3050end;
    3151
  • GraphicTest/Methods/UGraphics32Method.pas

    r454 r459  
    66
    77uses
    8   Classes, SysUtils, UFastBitmap, UDrawMethod, GR32, GR32_Image, Controls,
     8  Classes, SysUtils, UFastBitmap, UDrawMethod{$IFDEF gr32}, GR32, GR32_Image{$ENDIF}, Controls,
    99  Graphics;
    1010
     11{$IFDEF gr32}
    1112type
    1213  { TGraphics32Method }
     
    2021    procedure Done; override;
    2122  end;
    22 
     23{$ENDIF}
    2324
    2425implementation
    2526
     27{$IFDEF gr32}
    2628{ TGraphics32Method }
    2729
     
    9294end;
    9395
     96{$ENDIF}
     97
    9498end.
    9599
  • GraphicTest/Methods/ULazIntfImageColorsCopy.pas

    r447 r459  
    2929  Caption := 'TLazIntfImage.Colors copy';
    3030  TempIntfImage := TLazIntfImage.Create(0, 0);
     31  Description.Add('Method use TLazIntfImage class for faster access to bitmap pixels compared to simple access using TBitmap.Pixels.');
     32  Description.Add('TLazIntfImage is created from visible image.');
    3133end;
    3234
  • GraphicTest/Methods/ULazIntfImageColorsNoCopy.pas

    r454 r459  
    3535  inherited;
    3636  Caption := 'TLazIntfImage.Colors no copy';
     37  Description.Add('Method use TLazIntfImage class for faster access to bitmap pixels compared to simple access using TBitmap.Pixels.');
     38  Description.Add('Bitmap is not copied from original bitmap.');
    3739end;
    3840
  • GraphicTest/Methods/UOpenGLMethod.pas

    r451 r459  
    3131  Caption := 'OpenGL';
    3232  PaintObject := poOpenGL;
     33  Description.Add('This method use OpenGL 3D acceleration with simple one 2D orthogonal plane covering all visible area.' +
     34    'Texture data is loaded from bitmap.');
    3335end;
    3436
  • GraphicTest/Methods/UOpenGLPBOMethod.pas

    r454 r459  
    6969  Index := 0;
    7070  NextIndex := 1;
     71  Description.Add('This method use OpenGL acceleration same like other OpenGL method but ' +
     72    'use DMA(Direct Memory Access) for faster texture data transfer without use of CPU.');
    7173end;
    7274
  • GraphicTest/UDrawMethod.pas

    r454 r459  
    2727    StepDuration: TDateTime;
    2828    PaintObject: TPaintObject;
    29     TempBitmap: TBitmap;
    3029    FrameCounter: Integer;
    3130    FrameCounterStart: TDateTime;
     
    112111  Image.Parent := Parent;
    113112  Image.SetBounds(0, 0, Size.X, Size.Y);
     113  Image.Picture.Bitmap.PixelFormat := PixelFormat;
    114114  Image.Picture.Bitmap.SetSize(Size.X, Size.Y);
    115   Image.Picture.Bitmap.PixelFormat := PixelFormat;
    116115  Image.Show;
    117116end;
     
    195194procedure TDrawMethod.Init(Parent: TWinControl; Size: TPoint; PixelFormat: TPixelFormat);
    196195begin
    197   if (TempBitmap.Width <> Size.X) or (TempBitmap.Height <> Size.Y) then
    198     TempBitmap.SetSize(Size.X, Size.Y);
    199196end;
    200197
     
    206203constructor TDrawMethod.Create;
    207204begin
    208   TempBitmap := TBitmap.Create;
    209205  Description := TStringList.Create;
    210206end;
     
    213209begin
    214210  FreeAndNil(Description);
    215   FreeAndNil(TempBitmap);
    216   inherited Destroy;
     211  inherited;
    217212end;
    218213
  • GraphicTest/UMainForm.pas

    r454 r459  
    114114
    115115const
    116   DrawMethodClasses: array[0..9{$IFDEF opengl}+2{$ENDIF}] of TDrawMethodClass = (
     116  DrawMethodClasses: array[0..8{$IFDEF opengl}+2{$ENDIF}{$IFDEF gr32}+1{$ENDIF}] of TDrawMethodClass = (
    117117    TCanvasPixels, TCanvasPixelsUpdateLock, TLazIntfImageColorsCopy,
    118118    TLazIntfImageColorsNoCopy, TBitmapRawImageData, TBitmapRawImageDataPaintBox,
    119     TBitmapRawImageDataMove, TBGRABitmapPaintBox, TGraphics32Method{$IFDEF opengl}, TOpenGLMethod, TOpenGLPBOMethod{$ENDIF}
     119    TBitmapRawImageDataMove, TBGRABitmapPaintBox
     120    {$IFDEF gr32}, TGraphics32Method{$ENDIF}
     121    {$IFDEF opengl}, TOpenGLMethod, TOpenGLPBOMethod{$ENDIF}
    120122    ,TDummyMethod);
    121123
Note: See TracChangeset for help on using the changeset viewer.