Changeset 206 for GraphicTest


Ignore:
Timestamp:
Mar 18, 2011, 9:34:42 AM (13 years ago)
Author:
george
Message:
  • Fixed: Red and Blue color components swaping.
  • Fixed: PageControl tabs auto switching.
  • Modified: TFastBitmap class replaced by similar one which use pixels data as one memory block instead of array of arrays. With only one memory block optimization using FillChar and Move can be used.
Location:
GraphicTest
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • GraphicTest/GraphicTest.lpi

    r203 r206  
    3939      </Item2>
    4040    </RequiredPackages>
    41     <Units Count="27">
     41    <Units Count="36">
    4242      <Unit0>
    4343        <Filename Value="GraphicTest.lpr"/>
     
    4747        <TopLine Value="1"/>
    4848        <CursorPos X="17" Y="3"/>
    49         <UsageCount Value="32"/>
     49        <UsageCount Value="37"/>
    5050      </Unit0>
    5151      <Unit1>
     
    5757        <EditorIndex Value="0"/>
    5858        <WindowIndex Value="0"/>
    59         <TopLine Value="1"/>
    60         <CursorPos X="27" Y="38"/>
    61         <UsageCount Value="32"/>
     59        <TopLine Value="109"/>
     60        <CursorPos X="23" Y="126"/>
     61        <UsageCount Value="37"/>
    6262        <Loaded Value="True"/>
    6363        <LoadedDesigner Value="True"/>
     
    6969        <TopLine Value="1"/>
    7070        <CursorPos X="42" Y="22"/>
    71         <UsageCount Value="18"/>
     71        <UsageCount Value="17"/>
    7272      </Unit2>
    7373      <Unit3>
     
    7575        <IsPartOfProject Value="True"/>
    7676        <UnitName Value="UPlatform"/>
    77         <EditorIndex Value="11"/>
     77        <EditorIndex Value="16"/>
    7878        <WindowIndex Value="0"/>
    7979        <TopLine Value="43"/>
    8080        <CursorPos X="1" Y="1"/>
    81         <UsageCount Value="32"/>
     81        <UsageCount Value="37"/>
    8282        <Loaded Value="True"/>
    8383      </Unit3>
     
    8888        <TopLine Value="244"/>
    8989        <CursorPos X="49" Y="262"/>
    90         <UsageCount Value="12"/>
     90        <UsageCount Value="11"/>
    9191      </Unit4>
    9292      <Unit5>
     
    9696        <TopLine Value="121"/>
    9797        <CursorPos X="57" Y="142"/>
    98         <UsageCount Value="12"/>
     98        <UsageCount Value="11"/>
    9999      </Unit5>
    100100      <Unit6>
     
    103103        <TopLine Value="85"/>
    104104        <CursorPos X="10" Y="102"/>
    105         <UsageCount Value="12"/>
     105        <UsageCount Value="11"/>
    106106      </Unit6>
    107107      <Unit7>
     
    110110        <TopLine Value="153"/>
    111111        <CursorPos X="1" Y="160"/>
    112         <UsageCount Value="12"/>
     112        <UsageCount Value="11"/>
    113113      </Unit7>
    114114      <Unit8>
     
    118118        <TopLine Value="1282"/>
    119119        <CursorPos X="15" Y="1299"/>
    120         <UsageCount Value="12"/>
     120        <UsageCount Value="11"/>
    121121      </Unit8>
    122122      <Unit9>
     
    125125        <TopLine Value="546"/>
    126126        <CursorPos X="11" Y="553"/>
    127         <UsageCount Value="12"/>
     127        <UsageCount Value="11"/>
    128128      </Unit9>
    129129      <Unit10>
     
    132132        <TopLine Value="389"/>
    133133        <CursorPos X="1" Y="411"/>
    134         <UsageCount Value="9"/>
     134        <UsageCount Value="8"/>
    135135      </Unit10>
    136136      <Unit11>
     
    139139        <TopLine Value="444"/>
    140140        <CursorPos X="1" Y="461"/>
    141         <UsageCount Value="12"/>
     141        <UsageCount Value="11"/>
    142142      </Unit11>
    143143      <Unit12>
     
    146146        <TopLine Value="14"/>
    147147        <CursorPos X="24" Y="21"/>
    148         <UsageCount Value="12"/>
     148        <UsageCount Value="11"/>
    149149      </Unit12>
    150150      <Unit13>
     
    153153        <TopLine Value="313"/>
    154154        <CursorPos X="24" Y="316"/>
    155         <UsageCount Value="12"/>
     155        <UsageCount Value="11"/>
    156156      </Unit13>
    157157      <Unit14>
     
    160160        <TopLine Value="149"/>
    161161        <CursorPos X="3" Y="151"/>
    162         <UsageCount Value="12"/>
     162        <UsageCount Value="11"/>
    163163      </Unit14>
    164164      <Unit15>
     
    168168        <TopLine Value="171"/>
    169169        <CursorPos X="3" Y="188"/>
    170         <UsageCount Value="11"/>
     170        <UsageCount Value="10"/>
    171171      </Unit15>
    172172      <Unit16>
     
    175175        <TopLine Value="300"/>
    176176        <CursorPos X="3" Y="317"/>
    177         <UsageCount Value="9"/>
     177        <UsageCount Value="8"/>
    178178      </Unit16>
    179179      <Unit17>
     
    182182        <UnitName Value="UDrawMethod"/>
    183183        <IsVisibleTab Value="True"/>
    184         <EditorIndex Value="6"/>
    185         <WindowIndex Value="0"/>
    186         <TopLine Value="196"/>
    187         <CursorPos X="10" Y="206"/>
    188         <UsageCount Value="26"/>
     184        <EditorIndex Value="2"/>
     185        <WindowIndex Value="0"/>
     186        <TopLine Value="121"/>
     187        <CursorPos X="3" Y="145"/>
     188        <UsageCount Value="31"/>
    189189        <Loaded Value="True"/>
    190190      </Unit17>
     
    193193        <IsPartOfProject Value="True"/>
    194194        <UnitName Value="UFastBitmap"/>
    195         <EditorIndex Value="5"/>
    196         <WindowIndex Value="0"/>
    197         <TopLine Value="1"/>
    198         <CursorPos X="20" Y="20"/>
    199         <UsageCount Value="26"/>
     195        <EditorIndex Value="1"/>
     196        <WindowIndex Value="0"/>
     197        <TopLine Value="32"/>
     198        <CursorPos X="41" Y="18"/>
     199        <UsageCount Value="31"/>
    200200        <Loaded Value="True"/>
    201201      </Unit18>
    202202      <Unit19>
    203203        <Filename Value="../../../Projekty2/FreePascalManager/trunk/Instance/1/Lazarus/lcl/include/rasterimage.inc"/>
    204         <EditorIndex Value="2"/>
    205         <WindowIndex Value="0"/>
    206         <TopLine Value="504"/>
    207         <CursorPos X="1" Y="521"/>
    208         <UsageCount Value="12"/>
     204        <EditorIndex Value="8"/>
     205        <WindowIndex Value="0"/>
     206        <TopLine Value="292"/>
     207        <CursorPos X="1" Y="308"/>
     208        <UsageCount Value="14"/>
    209209        <Loaded Value="True"/>
    210210      </Unit19>
     
    214214        <EditorIndex Value="3"/>
    215215        <WindowIndex Value="0"/>
    216         <TopLine Value="224"/>
    217         <CursorPos X="15" Y="237"/>
    218         <UsageCount Value="11"/>
     216        <TopLine Value="279"/>
     217        <CursorPos X="57" Y="292"/>
     218        <UsageCount Value="12"/>
    219219        <Loaded Value="True"/>
    220220      </Unit20>
     
    222222        <Filename Value="bgrabitmap/bgrawinbitmap.pas"/>
    223223        <UnitName Value="BGRAWinBitmap"/>
    224         <EditorIndex Value="4"/>
    225         <WindowIndex Value="0"/>
    226         <TopLine Value="169"/>
    227         <CursorPos X="1" Y="190"/>
    228         <UsageCount Value="11"/>
     224        <EditorIndex Value="5"/>
     225        <WindowIndex Value="0"/>
     226        <TopLine Value="133"/>
     227        <CursorPos X="1" Y="146"/>
     228        <UsageCount Value="12"/>
    229229        <Loaded Value="True"/>
    230230      </Unit21>
     
    232232        <Filename Value="../../../Projekty2/FreePascalManager/trunk/Instance/1/Lazarus/lcl/extctrls.pp"/>
    233233        <UnitName Value="ExtCtrls"/>
    234         <EditorIndex Value="1"/>
    235234        <WindowIndex Value="0"/>
    236235        <TopLine Value="584"/>
    237236        <CursorPos X="3" Y="597"/>
    238237        <UsageCount Value="11"/>
    239         <Loaded Value="True"/>
    240238      </Unit22>
    241239      <Unit23>
    242240        <Filename Value="../../../Projekty2/FreePascalManager/trunk/Instance/1/Lazarus/lcl/include/winapih.inc"/>
    243         <EditorIndex Value="9"/>
     241        <EditorIndex Value="14"/>
    244242        <WindowIndex Value="0"/>
    245243        <TopLine Value="32"/>
    246244        <CursorPos X="10" Y="45"/>
    247         <UsageCount Value="10"/>
     245        <UsageCount Value="13"/>
    248246        <Loaded Value="True"/>
    249247      </Unit23>
    250248      <Unit24>
    251249        <Filename Value="../../../Projekty2/FreePascalManager/trunk/Instance/1/Lazarus/lcl/include/winapi.inc"/>
    252         <EditorIndex Value="10"/>
     250        <EditorIndex Value="15"/>
    253251        <WindowIndex Value="0"/>
    254252        <TopLine Value="51"/>
    255253        <CursorPos X="3" Y="53"/>
    256         <UsageCount Value="10"/>
     254        <UsageCount Value="13"/>
    257255        <Loaded Value="True"/>
    258256      </Unit24>
     
    260258        <Filename Value="../../../Projekty2/FreePascalManager/trunk/Instance/1/Lazarus/lcl/graphics.pp"/>
    261259        <UnitName Value="Graphics"/>
    262         <EditorIndex Value="8"/>
    263         <WindowIndex Value="0"/>
    264         <TopLine Value="1081"/>
    265         <CursorPos X="15" Y="1094"/>
    266         <UsageCount Value="10"/>
     260        <EditorIndex Value="11"/>
     261        <WindowIndex Value="0"/>
     262        <TopLine Value="1314"/>
     263        <CursorPos X="31" Y="1327"/>
     264        <UsageCount Value="13"/>
    267265        <Loaded Value="True"/>
    268266      </Unit25>
    269267      <Unit26>
    270268        <Filename Value="../../../Projekty2/FreePascalManager/trunk/Instance/1/FPC/rtl/objpas/classes/classesh.inc"/>
    271         <EditorIndex Value="7"/>
     269        <EditorIndex Value="10"/>
    272270        <WindowIndex Value="0"/>
    273271        <TopLine Value="1883"/>
    274272        <CursorPos X="10" Y="1896"/>
     273        <UsageCount Value="13"/>
     274        <Loaded Value="True"/>
     275      </Unit26>
     276      <Unit27>
     277        <Filename Value="../../../Projekty2/FreePascalManager/trunk/Instance/1/FPC/rtl/inc/heaph.inc"/>
     278        <WindowIndex Value="0"/>
     279        <TopLine Value="75"/>
     280        <CursorPos X="31" Y="88"/>
     281        <UsageCount Value="11"/>
     282      </Unit27>
     283      <Unit28>
     284        <Filename Value="../../../Projekty2/FreePascalManager/trunk/Instance/1/FPC/rtl/inc/heap.inc"/>
     285        <WindowIndex Value="0"/>
     286        <TopLine Value="309"/>
     287        <CursorPos X="3" Y="311"/>
    275288        <UsageCount Value="10"/>
    276         <Loaded Value="True"/>
    277       </Unit26>
     289      </Unit28>
     290      <Unit29>
     291        <Filename Value="bgrabitmap/bgrabitmaptypes.pas"/>
     292        <UnitName Value="BGRABitmapTypes"/>
     293        <EditorIndex Value="9"/>
     294        <WindowIndex Value="0"/>
     295        <TopLine Value="24"/>
     296        <CursorPos X="3" Y="37"/>
     297        <UsageCount Value="12"/>
     298        <Loaded Value="True"/>
     299      </Unit29>
     300      <Unit30>
     301        <Filename Value="../../../Projekty2/FreePascalManager/trunk/Instance/1/Lazarus/lcl/graphtype.pp"/>
     302        <UnitName Value="GraphType"/>
     303        <EditorIndex Value="7"/>
     304        <WindowIndex Value="0"/>
     305        <TopLine Value="271"/>
     306        <CursorPos X="23" Y="292"/>
     307        <UsageCount Value="11"/>
     308        <Loaded Value="True"/>
     309      </Unit30>
     310      <Unit31>
     311        <Filename Value="UBitmaps.pas"/>
     312        <UnitName Value="UBitmaps"/>
     313        <WindowIndex Value="0"/>
     314        <TopLine Value="1"/>
     315        <CursorPos X="41" Y="62"/>
     316        <UsageCount Value="20"/>
     317      </Unit31>
     318      <Unit32>
     319        <Filename Value="../../../Projekty2/FreePascalManager/trunk/Instance/1/FPC/packages/fcl-image/src/fpimage.pp"/>
     320        <UnitName Value="FPimage"/>
     321        <EditorIndex Value="13"/>
     322        <WindowIndex Value="0"/>
     323        <TopLine Value="23"/>
     324        <CursorPos X="4" Y="35"/>
     325        <UsageCount Value="10"/>
     326        <Loaded Value="True"/>
     327      </Unit32>
     328      <Unit33>
     329        <Filename Value="../../../Projekty2/FreePascalManager/trunk/Instance/1/Lazarus/lcl/include/canvas.inc"/>
     330        <EditorIndex Value="12"/>
     331        <WindowIndex Value="0"/>
     332        <TopLine Value="1456"/>
     333        <CursorPos X="1" Y="1471"/>
     334        <UsageCount Value="10"/>
     335        <Loaded Value="True"/>
     336      </Unit33>
     337      <Unit34>
     338        <Filename Value="../../../Projekty2/FreePascalManager/trunk/Instance/1/FPC/rtl/win/wininc/func.inc"/>
     339        <EditorIndex Value="6"/>
     340        <WindowIndex Value="0"/>
     341        <TopLine Value="780"/>
     342        <CursorPos X="10" Y="793"/>
     343        <UsageCount Value="10"/>
     344        <Loaded Value="True"/>
     345      </Unit34>
     346      <Unit35>
     347        <Filename Value="bgrabitmap/bgrablend.pas"/>
     348        <UnitName Value="BGRABlend"/>
     349        <EditorIndex Value="4"/>
     350        <WindowIndex Value="0"/>
     351        <TopLine Value="217"/>
     352        <CursorPos X="3" Y="219"/>
     353        <UsageCount Value="10"/>
     354        <Loaded Value="True"/>
     355      </Unit35>
    278356    </Units>
    279     <JumpHistory Count="29" HistoryIndex="28">
     357    <JumpHistory Count="30" HistoryIndex="26">
    280358      <Position1>
    281         <Filename Value="bgrabitmap/bgrawinbitmap.pas"/>
    282         <Caret Line="177" Column="1" TopLine="165"/>
     359        <Filename Value="bgrabitmap/bgradefaultbitmap.pas"/>
     360        <Caret Line="3492" Column="1" TopLine="3479"/>
    283361      </Position1>
    284362      <Position2>
    285         <Filename Value="bgrabitmap/bgrawinbitmap.pas"/>
    286         <Caret Line="179" Column="1" TopLine="165"/>
     363        <Filename Value="bgrabitmap/bgradefaultbitmap.pas"/>
     364        <Caret Line="3493" Column="1" TopLine="3479"/>
    287365      </Position2>
    288366      <Position3>
    289         <Filename Value="bgrabitmap/bgrawinbitmap.pas"/>
    290         <Caret Line="180" Column="1" TopLine="165"/>
     367        <Filename Value="bgrabitmap/bgradefaultbitmap.pas"/>
     368        <Caret Line="1061" Column="1" TopLine="1048"/>
    291369      </Position3>
    292370      <Position4>
    293371        <Filename Value="bgrabitmap/bgrawinbitmap.pas"/>
    294         <Caret Line="181" Column="1" TopLine="168"/>
     372        <Caret Line="135" Column="20" TopLine="119"/>
    295373      </Position4>
    296374      <Position5>
    297375        <Filename Value="bgrabitmap/bgrawinbitmap.pas"/>
    298         <Caret Line="183" Column="1" TopLine="168"/>
     376        <Caret Line="127" Column="1" TopLine="119"/>
    299377      </Position5>
    300378      <Position6>
    301379        <Filename Value="bgrabitmap/bgrawinbitmap.pas"/>
    302         <Caret Line="187" Column="1" TopLine="168"/>
     380        <Caret Line="128" Column="1" TopLine="119"/>
    303381      </Position6>
    304382      <Position7>
    305383        <Filename Value="bgrabitmap/bgrawinbitmap.pas"/>
    306         <Caret Line="189" Column="1" TopLine="168"/>
     384        <Caret Line="135" Column="1" TopLine="119"/>
    307385      </Position7>
    308386      <Position8>
    309         <Filename Value="bgrabitmap/bgradefaultbitmap.pas"/>
    310         <Caret Line="809" Column="1" TopLine="796"/>
     387        <Filename Value="bgrabitmap/bgrawinbitmap.pas"/>
     388        <Caret Line="136" Column="1" TopLine="128"/>
    311389      </Position8>
    312390      <Position9>
    313         <Filename Value="bgrabitmap/bgradefaultbitmap.pas"/>
    314         <Caret Line="810" Column="1" TopLine="796"/>
     391        <Filename Value="bgrabitmap/bgrawinbitmap.pas"/>
     392        <Caret Line="137" Column="1" TopLine="128"/>
    315393      </Position9>
    316394      <Position10>
    317         <Filename Value="bgrabitmap/bgrawinbitmap.pas"/>
    318         <Caret Line="190" Column="1" TopLine="169"/>
     395        <Filename Value="../../../Projekty2/FreePascalManager/trunk/Instance/1/Lazarus/lcl/include/canvas.inc"/>
     396        <Caret Line="1469" Column="1" TopLine="1456"/>
    319397      </Position10>
    320398      <Position11>
    321         <Filename Value="bgrabitmap/bgradefaultbitmap.pas"/>
    322         <Caret Line="503" Column="1" TopLine="490"/>
     399        <Filename Value="../../../Projekty2/FreePascalManager/trunk/Instance/1/Lazarus/lcl/include/canvas.inc"/>
     400        <Caret Line="1470" Column="1" TopLine="1456"/>
    323401      </Position11>
    324402      <Position12>
    325         <Filename Value="UDrawMethod.pas"/>
    326         <Caret Line="102" Column="1" TopLine="96"/>
     403        <Filename Value="../../../Projekty2/FreePascalManager/trunk/Instance/1/Lazarus/lcl/include/canvas.inc"/>
     404        <Caret Line="1471" Column="1" TopLine="1456"/>
    327405      </Position12>
    328406      <Position13>
    329         <Filename Value="UDrawMethod.pas"/>
    330         <Caret Line="133" Column="25" TopLine="111"/>
     407        <Filename Value="bgrabitmap/bgrawinbitmap.pas"/>
     408        <Caret Line="136" Column="12" TopLine="128"/>
    331409      </Position13>
    332410      <Position14>
    333         <Filename Value="UDrawMethod.pas"/>
    334         <Caret Line="134" Column="16" TopLine="111"/>
     411        <Filename Value="bgrabitmap/bgrawinbitmap.pas"/>
     412        <Caret Line="137" Column="7" TopLine="113"/>
    335413      </Position14>
    336414      <Position15>
    337         <Filename Value="UMainForm.pas"/>
    338         <Caret Line="78" Column="50" TopLine="67"/>
     415        <Filename Value="bgrabitmap/bgrawinbitmap.pas"/>
     416        <Caret Line="146" Column="1" TopLine="133"/>
    339417      </Position15>
    340418      <Position16>
    341         <Filename Value="UDrawMethod.pas"/>
    342         <Caret Line="8" Column="32" TopLine="3"/>
     419        <Filename Value="bgrabitmap/bgradefaultbitmap.pas"/>
     420        <Caret Line="1069" Column="1" TopLine="1048"/>
    343421      </Position16>
    344422      <Position17>
    345         <Filename Value="UMainForm.pas"/>
    346         <Caret Line="8" Column="20" TopLine="1"/>
     423        <Filename Value="bgrabitmap/bgradefaultbitmap.pas"/>
     424        <Caret Line="1055" Column="25" TopLine="1048"/>
    347425      </Position17>
    348426      <Position18>
    349         <Filename Value="UMainForm.pas"/>
    350         <Caret Line="33" Column="19" TopLine="12"/>
     427        <Filename Value="bgrabitmap/bgradefaultbitmap.pas"/>
     428        <Caret Line="215" Column="27" TopLine="202"/>
    351429      </Position18>
    352430      <Position19>
    353         <Filename Value="UDrawMethod.pas"/>
    354         <Caret Line="8" Column="42" TopLine="1"/>
     431        <Filename Value="bgrabitmap/bgradefaultbitmap.pas"/>
     432        <Caret Line="299" Column="31" TopLine="281"/>
    355433      </Position19>
    356434      <Position20>
    357         <Filename Value="UDrawMethod.pas"/>
    358         <Caret Line="29" Column="39" TopLine="14"/>
     435        <Filename Value="bgrabitmap/bgradefaultbitmap.pas"/>
     436        <Caret Line="290" Column="39" TopLine="287"/>
    359437      </Position20>
    360438      <Position21>
    361439        <Filename Value="UDrawMethod.pas"/>
    362         <Caret Line="138" Column="5" TopLine="120"/>
     440        <Caret Line="146" Column="19" TopLine="133"/>
    363441      </Position21>
    364442      <Position22>
    365         <Filename Value="UDrawMethod.pas"/>
    366         <Caret Line="173" Column="23" TopLine="157"/>
     443        <Filename Value="../../../Projekty2/FreePascalManager/trunk/Instance/1/Lazarus/lcl/graphics.pp"/>
     444        <Caret Line="1327" Column="31" TopLine="1314"/>
    367445      </Position22>
    368446      <Position23>
    369         <Filename Value="UDrawMethod.pas"/>
    370         <Caret Line="158" Column="12" TopLine="155"/>
     447        <Filename Value="../../../Projekty2/FreePascalManager/trunk/Instance/1/Lazarus/lcl/graphtype.pp"/>
     448        <Caret Line="189" Column="25" TopLine="187"/>
    371449      </Position23>
    372450      <Position24>
    373         <Filename Value="UDrawMethod.pas"/>
    374         <Caret Line="28" Column="34" TopLine="14"/>
     451        <Filename Value="../../../Projekty2/FreePascalManager/trunk/Instance/1/Lazarus/lcl/graphtype.pp"/>
     452        <Caret Line="5" Column="65" TopLine="1"/>
    375453      </Position24>
    376454      <Position25>
    377         <Filename Value="UDrawMethod.pas"/>
    378         <Caret Line="177" Column="48" TopLine="155"/>
     455        <Filename Value="../../../Projekty2/FreePascalManager/trunk/Instance/1/Lazarus/lcl/graphtype.pp"/>
     456        <Caret Line="274" Column="23" TopLine="253"/>
    379457      </Position25>
    380458      <Position26>
    381         <Filename Value="UDrawMethod.pas"/>
    382         <Caret Line="316" Column="26" TopLine="305"/>
     459        <Filename Value="../../../Projekty2/FreePascalManager/trunk/Instance/1/Lazarus/lcl/graphtype.pp"/>
     460        <Caret Line="289" Column="26" TopLine="268"/>
    383461      </Position26>
    384462      <Position27>
    385463        <Filename Value="UDrawMethod.pas"/>
    386         <Caret Line="329" Column="3" TopLine="327"/>
     464        <Caret Line="133" Column="33" TopLine="121"/>
    387465      </Position27>
    388466      <Position28>
    389         <Filename Value="UDrawMethod.pas"/>
    390         <Caret Line="178" Column="29" TopLine="164"/>
     467        <Filename Value="bgrabitmap/bgradefaultbitmap.pas"/>
     468        <Caret Line="292" Column="57" TopLine="279"/>
    391469      </Position28>
    392470      <Position29>
    393         <Filename Value="UDrawMethod.pas"/>
    394         <Caret Line="211" Column="28" TopLine="196"/>
     471        <Filename Value="bgrabitmap/bgradefaultbitmap.pas"/>
     472        <Caret Line="420" Column="26" TopLine="413"/>
    395473      </Position29>
     474      <Position30>
     475        <Filename Value="bgrabitmap/bgradefaultbitmap.pas"/>
     476        <Caret Line="407" Column="3" TopLine="405"/>
     477      </Position30>
    396478    </JumpHistory>
    397479  </ProjectOptions>
  • GraphicTest/GraphicTest.lpr

    r201 r206  
    88  {$ENDIF}{$ENDIF}
    99  Interfaces, // this includes the LCL widgetset
    10   Forms, UMainForm, UPlatform, UDrawMethod, UFastBitmap
    11   { you can add units after this };
     10  Forms, UMainForm, UPlatform, UDrawMethod, UFastBitmap;
    1211
    1312{$R *.res}
  • GraphicTest/UDrawMethod.pas

    r203 r206  
    1111
    1212type
     13  TPaintObject = (poImage, poPaintBox, poOpenGL);
    1314
    1415  { TDrawMethod }
     
    2526    Terminated: Boolean;
    2627    FrameDuration: TDateTime;
     28    PaintObject: TPaintObject;
    2729    constructor Create; virtual;
    2830    destructor Destroy; override;
     
    113115  Caption := 'TBGRABitmap PaintBox';
    114116  BGRABitmap := TBGRABitmap.Create(0, 0);
     117  PaintObject := poPaintBox;
    115118end;
    116119
     
    124127var
    125128  X, Y: Integer;
    126   P: PBGRAPixel;
     129  P: PInteger;
    127130begin
    128131  with FastBitmap do
    129132  for Y := 0 to Size.Y - 1 do begin
    130     P := BGRABitmap.ScanLine[Y];
     133    P := PInteger(BGRABitmap.ScanLine[Y]);
    131134    for X := 0 to Size.X - 1 do begin
    132       P^.red := Pixels[X, Y];
     135      P^ := NoSwapBRComponent(Pixels[X, Y]);
     136      (*P^.red := Pixels[X, Y];
    133137      P^.green := Pixels[X, Y];
    134138      P^.blue := Pixels[X, Y];
    135       P^.alpha := 255;
     139      P^.alpha := 255; *)
    136140      Inc(P);
    137141    end;
    138142  end;
    139   BGRABitmap.InvalidateBitmap; // changed by direct access
    140   //BGRABitmap.Draw(Bitmap.Canvas, 0, 0, False);
     143  //BGRABitmap.InvalidateBitmap; // changed by direct access
     144  //BGRABitmap.Draw(Bitmap.Canvas, 0, 0, True);
    141145  BGRABitmap.Draw(PaintBox.Canvas, 0, 0, True);
     146//  Bitmap.RawImage.Ass
    142147end;
    143148
     
    148153  inherited;
    149154  Caption := 'TBitmap.RawImage.Data PaintBox';
     155  PaintObject := poPaintBox;
    150156end;
    151157
     
    154160  Y, X: Integer;
    155161  PixelPtr: PInteger;
     162  RowPtr: PInteger;
    156163  P: TPixelFormat;
    157164  RawImage: TRawImage;
    158165  BytePerPixel: Integer;
     166  BytePerRow: Integer;
    159167  hPaint, hBmp: HDC;
    160168begin
     
    164172      TempBitmap.BeginUpdate(False);
    165173      RawImage := TempBitmap.RawImage;
    166       PixelPtr := PInteger(RawImage.Data);
     174      RowPtr := PInteger(RawImage.Data);
    167175      BytePerPixel := RawImage.Description.BitsPerPixel div 8;
    168       for X := 0 to Size.X - 1 do
    169         for Y := 0 to Size.Y - 1 do begin
    170           PixelPtr^ := Pixels[X, Y] * $010101;
     176      BytePerRow := RawImage.Description.BytesPerLine;
     177      for Y := 0 to Size.Y - 1 do begin
     178        PixelPtr := RowPtr;
     179        for X := 0 to Size.X - 1 do begin
     180          PixelPtr^ := Pixels[X, Y];
    171181          Inc(PByte(PixelPtr), BytePerPixel);
    172182        end;
     183        Inc(PByte(RowPtr), BytePerRow);
     184      end;
    173185    finally
    174186      TempBitmap.EndUpdate(False);
     
    190202
    191203procedure TBitmapRawImageData.DrawFrame(FastBitmap: TFastBitmap);
     204type
     205  TFastBitmapPixelComponents = packed record
     206  end;
    192207var
    193208  Y, X: Integer;
     
    210225        PixelPtr := RowPtr;
    211226        for X := 0 to Size.X - 1 do begin
    212           PixelPtr^ := Pixels[X, Y] * $010101;
     227          PixelPtr^ := Pixels[X, Y];
    213228          Inc(PByte(PixelPtr), BytePerPixel);
    214229        end;
     
    248263    for X := 0 to Size.X - 1 do
    249264      for Y := 0 to Size.Y - 1 do
    250         TempIntfImage.Colors[X, Y] := TColorToFPColor(Pixels[X, Y] * $010101);
     265        TempIntfImage.Colors[X, Y] := TColorToFPColor(SwapBRComponent(Pixels[X, Y]));
    251266    Bitmap.LoadFromIntfImage(TempIntfImage);
    252267  end;
     
    277292    for X := 0 to Size.X - 1 do
    278293      for Y := 0 to Size.Y - 1 do
    279         TempIntfImage.Colors[X, Y] := TColorToFPColor(Pixels[X, Y] * $010101);
     294        TempIntfImage.Colors[X, Y] := TColorToFPColor(SwapBRComponent(Pixels[X, Y]));
    280295    Bitmap.LoadFromIntfImage(TempIntfImage);
    281296  end;
     
    299314    for X := 0 to Size.X - 1 do
    300315      for Y := 0 to Size.Y - 1 do
    301         Bitmap.Canvas.Pixels[X, Y] := Pixels[X, Y] * $010101;
     316        Bitmap.Canvas.Pixels[X, Y] := SwapBRComponent(Pixels[X, Y]);
    302317  finally
    303318    Bitmap.EndUpdate(False);
     
    320335    for X := 0 to Size.X - 1 do
    321336      for Y := 0 to Size.Y - 1 do
    322         Bitmap.Canvas.Pixels[X, Y] := Pixels[X, Y] * $010101;
     337        Bitmap.Canvas.Pixels[X, Y] := SwapBRComponent(Pixels[X, Y]);
    323338  end;
    324339end;
  • GraphicTest/UFastBitmap.pas

    r201 r206  
    66
    77uses
    8   Classes, SysUtils;
     8  Classes, SysUtils, Dialogs;
    99
    1010type
     11 TFastBitmapPixel = Integer;
     12 PFastBitmapPixel = ^TFastBitmapPixel;
     13
     14 TFastBitmapPixelComponents = packed record
     15   B, G, R, A: Byte;
     16 end;
     17
    1118 { TFastBitmap }
    1219
    1320  TFastBitmap = class
    1421  private
     22    FPixelsData: PByte;
     23    FSize: TPoint;
     24    function GetPixel(X, Y: Integer): TFastBitmapPixel; inline;
     25    procedure SetPixel(X, Y: Integer; const AValue: TFastBitmapPixel); inline;
     26    procedure SetSize(const AValue: TPoint);
     27  public
     28    constructor Create;
     29    destructor Destroy; override;
     30    procedure RandomImage;
     31    property Size: TPoint read FSize write SetSize;
     32    property Pixels[X, Y: Integer]: TFastBitmapPixel read GetPixel write SetPixel;
     33  end;
     34
     35  TFastBitmap2 = class
     36  private
    1537    function GetSize: TPoint;
    1638    procedure SetSize(const AValue: TPoint);
    1739  public
    18     Pixels: array of array of Byte;
     40    Pixels: array of array of TFastBitmapPixel;
    1941    procedure RandomImage;
    2042    property Size: TPoint read GetSize write SetSize;
    2143  end;
    2244
     45function SwapBRComponent(Value: Integer): Integer; inline;
     46function NoSwapBRComponent(Value: Integer): Integer; inline;
     47
    2348implementation
    2449
    25 { TFastBitmap }
     50function SwapBRComponent(Value: Integer): Integer;
     51begin
     52//  Result := (Value and $00ff00) or ((Value shr 16) and $ff) or ((Value and $ff) shl 16);
     53  Result := Value;
     54  TFastBitmapPixelComponents(Result).R := TFastBitmapPixelComponents(Value).B;
     55  TFastBitmapPixelComponents(Result).B := TFastBitmapPixelComponents(Value).R;
     56end;
    2657
    27 function TFastBitmap.GetSize: TPoint;
     58function NoSwapBRComponent(Value: Integer): Integer;
     59begin
     60//  Result := (Value and $00ff00) or ((Value shr 16) and $ff) or ((Value and $ff) shl 16);
     61  Result := Value;
     62  TFastBitmapPixelComponents(Result).B := TFastBitmapPixelComponents(Value).B;
     63  TFastBitmapPixelComponents(Result).R := TFastBitmapPixelComponents(Value).R;
     64end;
     65
     66{ TFastBitmap2 }
     67
     68function TFastBitmap2.GetSize: TPoint;
    2869begin
    2970  Result.X := Length(Pixels);
     
    3273end;
    3374
    34 procedure TFastBitmap.SetSize(const AValue: TPoint);
     75procedure TFastBitmap2.SetSize(const AValue: TPoint);
    3576begin
    3677  SetLength(Pixels, AValue.X, AValue.Y);
    3778end;
    3879
    39 procedure TFastBitmap.RandomImage;
     80procedure TFastBitmap2.RandomImage;
    4081var
    4182  X, Y: Integer;
     
    4687end;
    4788
     89{ TFastBitmap }
     90
     91function TFastBitmap.GetPixel(X, Y: Integer): TFastBitmapPixel;
     92begin
     93  Result := PFastBitmapPixel(FPixelsData + (Y * FSize.X + X) * SizeOf(TFastBitmapPixel))^;
     94end;
     95
     96procedure TFastBitmap.SetPixel(X, Y: Integer; const AValue: TFastBitmapPixel);
     97begin
     98  PFastBitmapPixel(FPixelsData + (Y * FSize.X + X) * SizeOf(TFastBitmapPixel))^ := AValue;
     99end;
     100
     101procedure TFastBitmap.SetSize(const AValue: TPoint);
     102begin
     103  if (FSize.X = AValue.X) and (FSize.Y = AValue.X) then Exit;
     104  FSize := AValue;
     105  FPixelsData := ReAllocMem(FPixelsData, FSize.X * FSize.Y * SizeOf(TFastBitmapPixel));
     106end;
     107
     108constructor TFastBitmap.Create;
     109begin
     110  Size := Point(0, 0);
     111end;
     112
     113destructor TFastBitmap.Destroy;
     114begin
     115  FreeMem(FPixelsData);
     116  inherited Destroy;
     117end;
     118
     119procedure TFastBitmap.RandomImage;
     120var
     121  I, X, Y: Integer;
     122begin
     123  for I := 0 to 2 do
     124    for Y := 0 to (Size.Y div 2) - 1 do
     125      for X := 0 to (Size.X div 3) - 1 do
     126        Pixels[X + (I * (Size.X div 3)), Y] := 255 shl (I * 8);
     127
     128  for Y := (Size.Y div 2) to Size.Y - 1 do
     129    for X := 0 to Size.X - 1 do
     130      Pixels[X, Y] := Random(256) or (Random(256) shl 16) or (Random(256) shl 8);
     131end;
     132
    48133
    49134end.
  • GraphicTest/UMainForm.lfm

    r202 r206  
    11object MainForm: TMainForm
    22  Left = 214
    3   Height = 452
     3  Height = 338
    44  Top = 106
    5   Width = 731
     5  Width = 680
    66  Caption = 'Graphic test'
    7   ClientHeight = 452
    8   ClientWidth = 731
     7  ClientHeight = 338
     8  ClientWidth = 680
    99  OnClose = FormClose
    1010  OnCreate = FormCreate
     
    1313  object PageControl1: TPageControl
    1414    Left = 312
    15     Height = 432
     15    Height = 318
    1616    Top = 16
    17     Width = 416
     17    Width = 365
    1818    ActivePage = TabSheet1
    1919    Anchors = [akTop, akLeft, akRight, akBottom]
     
    2222    object TabSheet1: TTabSheet
    2323      Caption = 'TImage'
    24       ClientHeight = 406
    25       ClientWidth = 408
     24      ClientHeight = 292
     25      ClientWidth = 357
    2626      object Image1: TImage
    2727        Left = 6
    28         Height = 393
     28        Height = 279
    2929        Top = 7
    30         Width = 398
     30        Width = 347
    3131        Anchors = [akTop, akLeft, akRight, akBottom]
    3232      end
    3333    end
    3434    object TabSheet2: TTabSheet
    35       Caption = 'Direct Canvas'
    36       ClientHeight = 405
    37       ClientWidth = 372
     35      Caption = 'TPaintBox'
     36      ClientHeight = 406
     37      ClientWidth = 408
    3838      object PaintBox1: TPaintBox
    3939        Left = 6
    40         Height = 393
     40        Height = 394
    4141        Top = 7
    42         Width = 361
     42        Width = 397
    4343        Anchors = [akTop, akLeft, akRight, akBottom]
    4444      end
     
    9898  object ListView1: TListView
    9999    Left = 8
    100     Height = 240
    101     Top = 208
     100    Height = 166
     101    Top = 168
    102102    Width = 296
    103103    Anchors = [akTop, akLeft, akBottom]
     
    105105      item
    106106        Caption = 'Method'
    107         Width = 100
     107        Width = 140
    108108      end   
    109109      item
     
    119119  end
    120120  object ButtonBenchmark: TButton
    121     Left = 11
     121    Left = 9
    122122    Height = 25
    123     Top = 176
     123    Top = 136
    124124    Width = 75
    125125    Caption = 'Benchmark'
  • GraphicTest/UMainForm.pas

    r202 r206  
    9898  if ComboBox1.ItemIndex >= 0 then
    9999  with TDrawMethod(DrawMethods[ComboBox1.ItemIndex]) do begin
     100    PageControl1.TabIndex := Integer(PaintObject);
     101    Application.ProcessMessages;
    100102    repeat
    101103      DrawFrameTiming(TFastBitmap(Scenes[SceneIndex]));
     
    118120    for I := 0 to DrawMethods.Count - 1 do
    119121    with TDrawMethod(DrawMethods[I]) do begin
     122      PageControl1.TabIndex := Integer(PaintObject);
     123      Application.ProcessMessages;
    120124      DrawFrameTiming(TFastBitmap(Scenes[0]));
     125      Application.ProcessMessages;
    121126      DrawFrameTiming(TFastBitmap(Scenes[0]));
    122127      NewItem := Add;
Note: See TracChangeset for help on using the changeset viewer.