1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-11-24 18:22:25 -05:00

Check out MufasaTests for ocr filter v1

git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@282 3f818213-9676-44b0-a9b4-5e4c4e03d09d
This commit is contained in:
Wizzup? 2009-12-17 14:54:21 +00:00
parent 7ae50bbc4b
commit 1c025af420
6 changed files with 362 additions and 286 deletions

View File

@ -11,7 +11,7 @@
<TargetFileExt Value=""/> <TargetFileExt Value=""/>
<Icon Value="0"/> <Icon Value="0"/>
<UseXPManifest Value="True"/> <UseXPManifest Value="True"/>
<ActiveEditorIndexAtStart Value="6"/> <ActiveEditorIndexAtStart Value="0"/>
</General> </General>
<VersionInfo> <VersionInfo>
<ProjectVersion Value=""/> <ProjectVersion Value=""/>
@ -30,15 +30,15 @@
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
</local> </local>
</RunParams> </RunParams>
<Units Count="23"> <Units Count="26">
<Unit0> <Unit0>
<Filename Value="project1.lpr"/> <Filename Value="project1.lpr"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="project1"/> <UnitName Value="project1"/>
<CursorPos X="61" Y="82"/> <CursorPos X="34" Y="143"/>
<TopLine Value="63"/> <TopLine Value="118"/>
<EditorIndex Value="0"/> <EditorIndex Value="0"/>
<UsageCount Value="72"/> <UsageCount Value="96"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit0> </Unit0>
<Unit1> <Unit1>
@ -46,15 +46,15 @@
<UnitName Value="CustApp"/> <UnitName Value="CustApp"/>
<CursorPos X="15" Y="51"/> <CursorPos X="15" Y="51"/>
<TopLine Value="32"/> <TopLine Value="32"/>
<UsageCount Value="7"/> <UsageCount Value="4"/>
</Unit1> </Unit1>
<Unit2> <Unit2>
<Filename Value="../../Units/MMLCore/client.pas"/> <Filename Value="../../Units/MMLCore/client.pas"/>
<UnitName Value="Client"/> <UnitName Value="Client"/>
<CursorPos X="21" Y="51"/> <CursorPos X="28" Y="50"/>
<TopLine Value="35"/> <TopLine Value="30"/>
<EditorIndex Value="8"/> <EditorIndex Value="9"/>
<UsageCount Value="30"/> <UsageCount Value="42"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit2> </Unit2>
<Unit3> <Unit3>
@ -62,281 +62,302 @@
<UnitName Value="windowutil"/> <UnitName Value="windowutil"/>
<CursorPos X="110" Y="30"/> <CursorPos X="110" Y="30"/>
<TopLine Value="3"/> <TopLine Value="3"/>
<UsageCount Value="7"/> <UsageCount Value="4"/>
</Unit3> </Unit3>
<Unit4> <Unit4>
<Filename Value="../../Units/MMLCore/window.pas"/> <Filename Value="../../Units/MMLCore/window.pas"/>
<UnitName Value="Window"/> <UnitName Value="Window"/>
<CursorPos X="55" Y="251"/> <CursorPos X="55" Y="251"/>
<TopLine Value="236"/> <TopLine Value="236"/>
<EditorIndex Value="11"/> <EditorIndex Value="12"/>
<UsageCount Value="29"/> <UsageCount Value="41"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit4> </Unit4>
<Unit5> <Unit5>
<Filename Value="../../Units/MMLCore/colour_conv.pas"/> <Filename Value="../../Units/MMLCore/colour_conv.pas"/>
<UnitName Value="colour_conv"/> <UnitName Value="colour_conv"/>
<CursorPos X="18" Y="346"/> <CursorPos X="18" Y="346"/>
<TopLine Value="309"/> <TopLine Value="307"/>
<EditorIndex Value="3"/> <EditorIndex Value="4"/>
<UsageCount Value="10"/> <UsageCount Value="22"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit5> </Unit5>
<Unit6> <Unit6>
<Filename Value="../../Units/MMLCore/finder.pas"/> <Filename Value="../../Units/MMLCore/finder.pas"/>
<UnitName Value="finder"/> <UnitName Value="finder"/>
<CursorPos X="41" Y="1637"/> <CursorPos X="1" Y="1728"/>
<TopLine Value="1631"/> <TopLine Value="1701"/>
<EditorIndex Value="2"/> <EditorIndex Value="3"/>
<UsageCount Value="33"/> <UsageCount Value="45"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit6> </Unit6>
<Unit7> <Unit7>
<Filename Value="../../Units/MMLCore/input.pas"/> <Filename Value="../../Units/MMLCore/input.pas"/>
<UnitName Value="Input"/> <UnitName Value="Input"/>
<CursorPos X="56" Y="49"/> <CursorPos X="72" Y="47"/>
<TopLine Value="24"/> <TopLine Value="36"/>
<EditorIndex Value="7"/> <EditorIndex Value="8"/>
<UsageCount Value="29"/> <UsageCount Value="41"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit7> </Unit7>
<Unit8> <Unit8>
<Filename Value="../../Units/MMLCore/mufasatypes.pas"/> <Filename Value="../../Units/MMLCore/mufasatypes.pas"/>
<UnitName Value="MufasaTypes"/> <UnitName Value="MufasaTypes"/>
<CursorPos X="1" Y="88"/> <CursorPos X="98" Y="92"/>
<TopLine Value="76"/> <TopLine Value="76"/>
<EditorIndex Value="12"/> <EditorIndex Value="13"/>
<UsageCount Value="31"/> <UsageCount Value="43"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit8> </Unit8>
<Unit9> <Unit9>
<Filename Value="../../Units/MMLCore/ocr.pas"/> <Filename Value="../../Units/MMLCore/ocr.pas"/>
<UnitName Value="ocr"/> <UnitName Value="ocr"/>
<CursorPos X="53" Y="31"/> <CursorPos X="69" Y="116"/>
<TopLine Value="24"/> <TopLine Value="84"/>
<EditorIndex Value="9"/> <EditorIndex Value="10"/>
<UsageCount Value="30"/> <UsageCount Value="42"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit9> </Unit9>
<Unit10> <Unit10>
<Filename Value="../../../../Documents/fpc/rtl/objpas/sysutils/diskh.inc"/> <Filename Value="../../../../Documents/fpc/rtl/objpas/sysutils/diskh.inc"/>
<CursorPos X="10" Y="18"/> <CursorPos X="10" Y="18"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<UsageCount Value="8"/> <UsageCount Value="5"/>
</Unit10> </Unit10>
<Unit11> <Unit11>
<Filename Value="../../Units/MMLCore/files.pas"/> <Filename Value="../../Units/MMLCore/files.pas"/>
<UnitName Value="files"/> <UnitName Value="files"/>
<CursorPos X="5" Y="42"/> <CursorPos X="5" Y="42"/>
<TopLine Value="27"/> <TopLine Value="27"/>
<UsageCount Value="8"/> <UsageCount Value="5"/>
</Unit11> </Unit11>
<Unit12> <Unit12>
<Filename Value="../../../../Documents/lazarus/lcl/graphics.pp"/> <Filename Value="../../../../Documents/lazarus/lcl/graphics.pp"/>
<UnitName Value="Graphics"/> <UnitName Value="Graphics"/>
<CursorPos X="3" Y="1426"/> <CursorPos X="3" Y="243"/>
<TopLine Value="1411"/> <TopLine Value="223"/>
<UsageCount Value="8"/> <UsageCount Value="7"/>
</Unit12> </Unit12>
<Unit13> <Unit13>
<Filename Value="../../Units/MMLCore/bitmaps.pas"/> <Filename Value="../../Units/MMLCore/bitmaps.pas"/>
<UnitName Value="bitmaps"/> <UnitName Value="bitmaps"/>
<CursorPos X="32" Y="835"/> <CursorPos X="34" Y="768"/>
<TopLine Value="850"/> <TopLine Value="749"/>
<EditorIndex Value="1"/> <EditorIndex Value="1"/>
<UsageCount Value="28"/> <UsageCount Value="40"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit13> </Unit13>
<Unit14> <Unit14>
<Filename Value="../../../../Documents/fpc/rtl/inc/objpash.inc"/> <Filename Value="../../../../Documents/fpc/rtl/inc/objpash.inc"/>
<CursorPos X="22" Y="177"/> <CursorPos X="22" Y="177"/>
<TopLine Value="162"/> <TopLine Value="162"/>
<UsageCount Value="8"/> <UsageCount Value="5"/>
</Unit14> </Unit14>
<Unit15> <Unit15>
<Filename Value="../../../../Documents/lazarus/lcl/intfgraphics.pas"/> <Filename Value="../../../../Documents/lazarus/lcl/intfgraphics.pas"/>
<UnitName Value="IntfGraphics"/> <UnitName Value="IntfGraphics"/>
<CursorPos X="30" Y="2975"/> <CursorPos X="30" Y="2975"/>
<TopLine Value="2959"/> <TopLine Value="2959"/>
<UsageCount Value="8"/> <UsageCount Value="5"/>
</Unit15> </Unit15>
<Unit16> <Unit16>
<Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/> <Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<UnitName Value="mmlpsthread"/> <UnitName Value="mmlpsthread"/>
<CursorPos X="3" Y="154"/> <CursorPos X="3" Y="154"/>
<TopLine Value="235"/> <TopLine Value="235"/>
<UsageCount Value="8"/> <UsageCount Value="5"/>
</Unit16> </Unit16>
<Unit17> <Unit17>
<Filename Value="../../../../Documents/fpc/rtl/i386/mmx.pp"/> <Filename Value="../../../../Documents/fpc/rtl/i386/mmx.pp"/>
<UnitName Value="mmx"/> <UnitName Value="mmx"/>
<CursorPos X="80" Y="15"/> <CursorPos X="80" Y="15"/>
<TopLine Value="71"/> <TopLine Value="71"/>
<UsageCount Value="8"/> <UsageCount Value="5"/>
</Unit17> </Unit17>
<Unit18> <Unit18>
<Filename Value="../../Units/MMLAddon/PSInc/Wrappers/ocr.inc"/> <Filename Value="../../Units/MMLAddon/PSInc/Wrappers/ocr.inc"/>
<CursorPos X="20" Y="5"/> <CursorPos X="20" Y="5"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<EditorIndex Value="10"/> <EditorIndex Value="11"/>
<UsageCount Value="26"/> <UsageCount Value="38"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit18> </Unit18>
<Unit19> <Unit19>
<Filename Value="../../Units/MMLCore/dtm.pas"/> <Filename Value="../../Units/MMLCore/dtm.pas"/>
<UnitName Value="dtm"/> <UnitName Value="dtm"/>
<CursorPos X="92" Y="287"/> <CursorPos X="92" Y="287"/>
<TopLine Value="267"/> <TopLine Value="99"/>
<EditorIndex Value="5"/> <EditorIndex Value="6"/>
<UsageCount Value="26"/> <UsageCount Value="38"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit19> </Unit19>
<Unit20> <Unit20>
<Filename Value="../../Units/MMLCore/dtmutil.pas"/> <Filename Value="../../Units/MMLCore/dtmutil.pas"/>
<UnitName Value="dtmutil"/> <UnitName Value="dtmutil"/>
<CursorPos X="43" Y="218"/> <CursorPos X="43" Y="218"/>
<TopLine Value="88"/> <TopLine Value="49"/>
<EditorIndex Value="4"/> <EditorIndex Value="5"/>
<UsageCount Value="22"/> <UsageCount Value="34"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit20> </Unit20>
<Unit21> <Unit21>
<Filename Value="../../../../Documents/fpc/packages/fcl-base/src/custapp.pp"/> <Filename Value="../../../../Documents/fpc/packages/fcl-base/src/custapp.pp"/>
<UnitName Value="CustApp"/> <UnitName Value="CustApp"/>
<CursorPos X="59" Y="48"/> <CursorPos X="43" Y="287"/>
<TopLine Value="18"/> <TopLine Value="274"/>
<UsageCount Value="9"/> <EditorIndex Value="2"/>
<UsageCount Value="14"/>
<Loaded Value="True"/>
</Unit21> </Unit21>
<Unit22> <Unit22>
<Filename Value="../../Units/MMLCore/ocrutil.pas"/> <Filename Value="../../Units/MMLCore/ocrutil.pas"/>
<UnitName Value="ocrutil"/> <UnitName Value="ocrutil"/>
<CursorPos X="68" Y="420"/> <CursorPos X="22" Y="470"/>
<TopLine Value="395"/> <TopLine Value="445"/>
<EditorIndex Value="6"/> <EditorIndex Value="7"/>
<UsageCount Value="10"/> <UsageCount Value="22"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit22> </Unit22>
<Unit23>
<Filename Value="../../Units/Linux/xtest.pas"/>
<UnitName Value="XTest"/>
<CursorPos X="56" Y="22"/>
<TopLine Value="1"/>
<UsageCount Value="7"/>
</Unit23>
<Unit24>
<Filename Value="../../../../Documents/fpc/rtl/inc/mathh.inc"/>
<CursorPos X="58" Y="78"/>
<TopLine Value="57"/>
<UsageCount Value="7"/>
</Unit24>
<Unit25>
<Filename Value="../../../../Documents/fpc/rtl/inc/innr.inc"/>
<CursorPos X="4" Y="98"/>
<TopLine Value="78"/>
<UsageCount Value="7"/>
</Unit25>
</Units> </Units>
<JumpHistory Count="30" HistoryIndex="29"> <JumpHistory Count="30" HistoryIndex="29">
<Position1> <Position1>
<Filename Value="../../Units/MMLCore/finder.pas"/> <Filename Value="project1.lpr"/>
<Caret Line="1893" Column="47" TopLine="1868"/> <Caret Line="65" Column="16" TopLine="37"/>
</Position1> </Position1>
<Position2> <Position2>
<Filename Value="../../Units/MMLCore/finder.pas"/> <Filename Value="../../Units/MMLCore/ocrutil.pas"/>
<Caret Line="1892" Column="27" TopLine="1877"/> <Caret Line="566" Column="30" TopLine="545"/>
</Position2> </Position2>
<Position3> <Position3>
<Filename Value="../../Units/MMLCore/finder.pas"/> <Filename Value="project1.lpr"/>
<Caret Line="1884" Column="45" TopLine="1877"/> <Caret Line="93" Column="88" TopLine="86"/>
</Position3> </Position3>
<Position4> <Position4>
<Filename Value="../../Units/MMLCore/finder.pas"/> <Filename Value="../../Units/MMLCore/bitmaps.pas"/>
<Caret Line="1680" Column="83" TopLine="1669"/> <Caret Line="762" Column="18" TopLine="748"/>
</Position4> </Position4>
<Position5> <Position5>
<Filename Value="../../Units/MMLCore/finder.pas"/> <Filename Value="../../Units/MMLCore/bitmaps.pas"/>
<Caret Line="1892" Column="35" TopLine="1877"/> <Caret Line="762" Column="38" TopLine="732"/>
</Position5> </Position5>
<Position6> <Position6>
<Filename Value="../../Units/MMLCore/finder.pas"/> <Filename Value="../../Units/MMLCore/bitmaps.pas"/>
<Caret Line="1884" Column="19" TopLine="1869"/> <Caret Line="765" Column="7" TopLine="732"/>
</Position6> </Position6>
<Position7> <Position7>
<Filename Value="project1.lpr"/> <Filename Value="project1.lpr"/>
<Caret Line="66" Column="18" TopLine="55"/> <Caret Line="95" Column="4" TopLine="72"/>
</Position7> </Position7>
<Position8> <Position8>
<Filename Value="project1.lpr"/> <Filename Value="project1.lpr"/>
<Caret Line="88" Column="43" TopLine="61"/> <Caret Line="114" Column="54" TopLine="85"/>
</Position8> </Position8>
<Position9> <Position9>
<Filename Value="../../Units/MMLCore/finder.pas"/> <Filename Value="project1.lpr"/>
<Caret Line="82" Column="26" TopLine="62"/> <Caret Line="108" Column="37" TopLine="82"/>
</Position9> </Position9>
<Position10> <Position10>
<Filename Value="../../Units/MMLCore/finder.pas"/> <Filename Value="project1.lpr"/>
<Caret Line="84" Column="26" TopLine="62"/> <Caret Line="106" Column="18" TopLine="82"/>
</Position10> </Position10>
<Position11> <Position11>
<Filename Value="../../Units/MMLCore/finder.pas"/> <Filename Value="../../Units/MMLCore/bitmaps.pas"/>
<Caret Line="1586" Column="16" TopLine="1571"/> <Caret Line="54" Column="26" TopLine="34"/>
</Position11> </Position11>
<Position12> <Position12>
<Filename Value="../../Units/MMLCore/finder.pas"/> <Filename Value="../../Units/MMLCore/bitmaps.pas"/>
<Caret Line="1794" Column="10" TopLine="1781"/> <Caret Line="55" Column="26" TopLine="34"/>
</Position12> </Position12>
<Position13> <Position13>
<Filename Value="../../Units/MMLCore/finder.pas"/> <Filename Value="../../Units/MMLCore/bitmaps.pas"/>
<Caret Line="82" Column="88" TopLine="63"/> <Caret Line="397" Column="17" TopLine="374"/>
</Position13> </Position13>
<Position14> <Position14>
<Filename Value="project1.lpr"/> <Filename Value="../../Units/MMLCore/bitmaps.pas"/>
<Caret Line="81" Column="16" TopLine="60"/> <Caret Line="368" Column="30" TopLine="1"/>
</Position14> </Position14>
<Position15> <Position15>
<Filename Value="project1.lpr"/> <Filename Value="../../Units/MMLCore/bitmaps.pas"/>
<Caret Line="85" Column="17" TopLine="73"/> <Caret Line="766" Column="22" TopLine="743"/>
</Position15> </Position15>
<Position16> <Position16>
<Filename Value="project1.lpr"/> <Filename Value="project1.lpr"/>
<Caret Line="69" Column="57" TopLine="54"/> <Caret Line="110" Column="7" TopLine="70"/>
</Position16> </Position16>
<Position17> <Position17>
<Filename Value="../../Units/MMLCore/finder.pas"/> <Filename Value="project1.lpr"/>
<Caret Line="1674" Column="10" TopLine="1656"/> <Caret Line="86" Column="11" TopLine="73"/>
</Position17> </Position17>
<Position18> <Position18>
<Filename Value="../../Units/MMLCore/colour_conv.pas"/> <Filename Value="project1.lpr"/>
<Caret Line="39" Column="21" TopLine="24"/> <Caret Line="93" Column="25" TopLine="85"/>
</Position18> </Position18>
<Position19> <Position19>
<Filename Value="../../Units/MMLCore/finder.pas"/> <Filename Value="../../../../Documents/fpc/packages/fcl-base/src/custapp.pp"/>
<Caret Line="1693" Column="131" TopLine="1676"/> <Caret Line="57" Column="28" TopLine="37"/>
</Position19> </Position19>
<Position20> <Position20>
<Filename Value="../../Units/MMLCore/finder.pas"/> <Filename Value="../../../../Documents/fpc/packages/fcl-base/src/custapp.pp"/>
<Caret Line="1613" Column="26" TopLine="1608"/> <Caret Line="284" Column="16" TopLine="262"/>
</Position20> </Position20>
<Position21> <Position21>
<Filename Value="../../Units/MMLCore/finder.pas"/> <Filename Value="../../../../Documents/fpc/packages/fcl-base/src/custapp.pp"/>
<Caret Line="1696" Column="1" TopLine="1669"/> <Caret Line="57" Column="28" TopLine="37"/>
</Position21> </Position21>
<Position22> <Position22>
<Filename Value="../../Units/MMLCore/finder.pas"/> <Filename Value="../../../../Documents/fpc/packages/fcl-base/src/custapp.pp"/>
<Caret Line="1675" Column="25" TopLine="1660"/> <Caret Line="282" Column="43" TopLine="262"/>
</Position22> </Position22>
<Position23> <Position23>
<Filename Value="../../Units/MMLCore/finder.pas"/> <Filename Value="../../../../Documents/fpc/packages/fcl-base/src/custapp.pp"/>
<Caret Line="1696" Column="127" TopLine="1681"/> <Caret Line="284" Column="25" TopLine="262"/>
</Position23> </Position23>
<Position24> <Position24>
<Filename Value="../../Units/MMLCore/finder.pas"/> <Filename Value="project1.lpr"/>
<Caret Line="1682" Column="1" TopLine="1671"/> <Caret Line="93" Column="45" TopLine="85"/>
</Position24> </Position24>
<Position25> <Position25>
<Filename Value="../../Units/MMLCore/finder.pas"/> <Filename Value="project1.lpr"/>
<Caret Line="1618" Column="22" TopLine="1607"/> <Caret Line="100" Column="21" TopLine="90"/>
</Position25> </Position25>
<Position26> <Position26>
<Filename Value="../../Units/MMLCore/finder.pas"/> <Filename Value="project1.lpr"/>
<Caret Line="1637" Column="18" TopLine="1621"/> <Caret Line="85" Column="33" TopLine="54"/>
</Position26> </Position26>
<Position27> <Position27>
<Filename Value="../../Units/MMLCore/ocr.pas"/> <Filename Value="project1.lpr"/>
<Caret Line="31" Column="54" TopLine="13"/> <Caret Line="118" Column="50" TopLine="89"/>
</Position27> </Position27>
<Position28> <Position28>
<Filename Value="../../Units/MMLCore/ocrutil.pas"/> <Filename Value="project1.lpr"/>
<Caret Line="8" Column="38" TopLine="1"/> <Caret Line="119" Column="28" TopLine="98"/>
</Position28> </Position28>
<Position29> <Position29>
<Filename Value="../../Units/MMLCore/colour_conv.pas"/> <Filename Value="project1.lpr"/>
<Caret Line="47" Column="31" TopLine="27"/> <Caret Line="107" Column="62" TopLine="72"/>
</Position29> </Position29>
<Position30> <Position30>
<Filename Value="../../Units/MMLCore/ocr.pas"/> <Filename Value="project1.lpr"/>
<Caret Line="31" Column="53" TopLine="24"/> <Caret Line="143" Column="40" TopLine="120"/>
</Position30> </Position30>
</JumpHistory> </JumpHistory>
</ProjectOptions> </ProjectOptions>

View File

@ -10,7 +10,7 @@ uses
Forms,Interfaces, Forms,Interfaces,
LCLIntf, LCLIntf,
Client, Client,
bitmaps,x ,mufasatypes,dtm,dtmutil, ocrutil bitmaps,x ,mufasatypes,dtm,dtmutil, ocrutil ,graphics ,colour_conv,math
{ you can add units after this }; { you can add units after this };
@ -54,14 +54,21 @@ end;
procedure MufasaTests.DoRun; procedure MufasaTests.DoRun;
const
ocr_Limit_High = 192;
ocr_Limit_Low = 65;
var var
ErrorMsg: String; ErrorMsg: String;
Time: DWord; Time: DWord;
C: TClient; C: TClient;
I: Integer; I, w, h,x,y: Integer;
dtm: pdtm; dtm: pdtm;
p:tpointarray; p:tpointarray;
bmp: TMufasaBitmap; bmp, bmprs: TMufasaBitmap;
cyan, itemc:integer;
r,g,b:integer;
t:Dword;
begin begin
// quick check parameters // quick check parameters
@ -80,52 +87,92 @@ begin
end; end;
{ add your program here } { add your program here }
cyan := rgbtocolor(0,255,255);
bmprs := TMufasaBitmap.Create;
bmprs.LoadFromFile('/home/merlijn/Programs/mufasa/pics/uptext6.bmp');
C := TClient.Create; C := TClient.Create;
C.MWindow.SetTarget(bmprs);
C.MWindow.GetDimensions(w, h);
bmp := TMufasaBitmap.Create; bmp := TMufasaBitmap.Create;
bmp.SetSize(CW,CH); bmp.CopyClientToBitmap(C.MWindow, True, 0, 0, 450, 50);
Writeln(Format('Client W/H: %d, %d', [CW, CH]));
FillChar(bmp.FData[0],sizeof(trgb32)*CW*CH, 0); t:=gettickcount;
Randomize;
for i := 0 to 500 do for y := 0 to bmp.Height - 1 do
bmp.fastsetpixel(random(CW), random(CH), 255); for x := 0 to bmp.Width - 1 do
{ bmp.FastSetPixel(8,8,255); begin
bmp.FastSetPixel(9,9,255); colortorgb(bmp.fastgetpixel(x,y),r,g,b);
bmp.FastSetPixel(7,7,255); // the abs(g-b) < 15 seems to help heaps when taking out crap points
bmp.FastSetPixel(9,8,255); if (r > ocr_Limit_High) and (g > ocr_Limit_High) and (b > ocr_Limit_High) and (abs(g-b) < 15) then
bmp.FastSetPixel(8,9,255); } begin
C.MWindow.SetTarget(bmp); bmp.fastsetpixel(x,y,clwhite);
continue;
end;
if (r < ocr_Limit_Low) and (g > ocr_Limit_High) and (b > ocr_Limit_High) then
begin
bmp.fastsetpixel(x,y,cyan);
continue;
end;
if (r < ocr_Limit_Low) and (g > ocr_Limit_High) and (b < ocr_Limit_Low) then
begin
bmp.fastsetpixel(x,y,rgbtocolor(0,255,0));
continue;
end;
if(r > ocr_Limit_High) and (g > 100) and (g < ocr_Limit_High) and (b > 30) and (b < 90) then
begin
bmp.fastsetpixel(x,y,rgbtocolor(255,127,0));
continue;
end;
if(r > ocr_Limit_High) and (g > ocr_Limit_High) and (b < ocr_Limit_Low) then
begin
bmp.fastsetpixel(x,y,rgbtocolor(255,255,0));
continue;
end;
// better use g < 40 than ocr_Limit_Low imo
if (r > ocr_Limit_High) and (g < ocr_Limit_Low) and (b < ocr_Limit_Low) then
begin
bmp.fastsetpixel(x,y,rgbtocolor(255,0,0));
continue;
end;
bmp.fastsetpixel(x,y,0);
end;
writeln(inttostr(gettickcount-t));
{
bmp.Posterize(130); // ~ 3
// bmp.Contrast(3);
for y := 0 to bmp.Height - 1 do
for x := 0 to bmp.Width - 1 do
begin
if bmp.FastGetPixel(x, y) = clWhite then
continue;
//cyan
if bmp.FastGetPixel(x, y) = rgbtocolor(0,255,255) then
continue;
//green
if bmp.FastGetPixel(x, y) = rgbtocolor(0,255,0) then
continue;
//item // TODO -> 5.bmp = not OK
if bmp.FastGetPixel(x, y) = rgbtocolor(255,130,0) then
continue;
//yellow, interact
if bmp.FastGetPixel(x, y) = rgbtocolor(255,255,0) then
continue;
bmp.fastsetpixel(x,y,0);
end;
}
{ initdtm(dtm, 5);
dtm.p[0] := Point(2, 2);
dtm.p[1] := Point(-3, -3);
dtm.p[2] := Point(0, 0);
dtm.p[3] := Point(1, 1);
dtm.p[4] := Point(3, 3);
dtm.c[0] := 255;
dtm.t[0] := 0;
dtm.asz[1] := 1;
dtm.ash[1] := dtm_Rectangle; }
dtm := randomdtm(20);
// setlength(p, 1);
time := GetTickCount;
C.MFinder.FindDTMs(dtm, p, 0, 0,CW-1, CH-1, 0);
writeln(inttostr(gettickcount - time) + 'ms');
setlength(p,0);
time := GetTickCount;
C.MFinder.FindDTMs(dtm, p, 0, 0,CW-1, CH-1, 0);
//C.MFinder.FindDTM(dtm, p[0].x, p[0].y, 0, 0,CW-1, CH-1);
writeln(inttostr(gettickcount - time) + 'ms');
writeln(inttostr(length(p))+ ' points found');
{for i := 0 to high(p) do
writeln(format('%d: (%d, %d)', [i, p[i].x, p[i].y])); }
bmp.SaveToFile('/tmp/output.bmp');
//bmp.OnDestroy:=nil; //bmp.OnDestroy:=nil;
bmp.Free; bmp.Free;
C.Free; C.Free;

View File

@ -10,7 +10,7 @@
<TargetFileExt Value=""/> <TargetFileExt Value=""/>
<Title Value="Mufasa Stand Alone"/> <Title Value="Mufasa Stand Alone"/>
<UseXPManifest Value="True"/> <UseXPManifest Value="True"/>
<ActiveEditorIndexAtStart Value="5"/> <ActiveEditorIndexAtStart Value="11"/>
</General> </General>
<VersionInfo> <VersionInfo>
<ProjectVersion Value=""/> <ProjectVersion Value=""/>
@ -42,7 +42,7 @@
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="project1"/> <UnitName Value="project1"/>
<CursorPos X="100" Y="21"/> <CursorPos X="100" Y="21"/>
<TopLine Value="19"/> <TopLine Value="6"/>
<EditorIndex Value="10"/> <EditorIndex Value="10"/>
<UsageCount Value="205"/> <UsageCount Value="205"/>
<Loaded Value="True"/> <Loaded Value="True"/>
@ -259,8 +259,8 @@
<Filename Value="../../Units/MMLCore/window.pas"/> <Filename Value="../../Units/MMLCore/window.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="Window"/> <UnitName Value="Window"/>
<CursorPos X="32" Y="6"/> <CursorPos X="59" Y="635"/>
<TopLine Value="1"/> <TopLine Value="605"/>
<EditorIndex Value="3"/> <EditorIndex Value="3"/>
<UsageCount Value="201"/> <UsageCount Value="201"/>
<Loaded Value="True"/> <Loaded Value="True"/>
@ -278,7 +278,7 @@
<CursorPos X="23" Y="8"/> <CursorPos X="23" Y="8"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<EditorIndex Value="14"/> <EditorIndex Value="14"/>
<UsageCount Value="59"/> <UsageCount Value="61"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit31> </Unit31>
<Unit32> <Unit32>
@ -292,8 +292,8 @@
<Filename Value="../../Units/MMLCore/finder.pas"/> <Filename Value="../../Units/MMLCore/finder.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="finder"/> <UnitName Value="finder"/>
<CursorPos X="97" Y="1681"/> <CursorPos X="75" Y="1710"/>
<TopLine Value="1666"/> <TopLine Value="1653"/>
<EditorIndex Value="7"/> <EditorIndex Value="7"/>
<UsageCount Value="201"/> <UsageCount Value="201"/>
<Loaded Value="True"/> <Loaded Value="True"/>
@ -386,7 +386,7 @@
<Unit46> <Unit46>
<Filename Value="../../Units/MMLAddon/PSInc/pscompile.inc"/> <Filename Value="../../Units/MMLAddon/PSInc/pscompile.inc"/>
<CursorPos X="117" Y="32"/> <CursorPos X="117" Y="32"/>
<TopLine Value="22"/> <TopLine Value="4"/>
<EditorIndex Value="12"/> <EditorIndex Value="12"/>
<UsageCount Value="100"/> <UsageCount Value="100"/>
<Loaded Value="True"/> <Loaded Value="True"/>
@ -407,8 +407,8 @@
<Filename Value="../../Units/MMLCore/bitmaps.pas"/> <Filename Value="../../Units/MMLCore/bitmaps.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="bitmaps"/> <UnitName Value="bitmaps"/>
<CursorPos X="6" Y="611"/> <CursorPos X="70" Y="896"/>
<TopLine Value="598"/> <TopLine Value="882"/>
<EditorIndex Value="2"/> <EditorIndex Value="2"/>
<UsageCount Value="200"/> <UsageCount Value="200"/>
<Loaded Value="True"/> <Loaded Value="True"/>
@ -712,8 +712,8 @@
<Filename Value="../../Units/MMLCore/dtm.pas"/> <Filename Value="../../Units/MMLCore/dtm.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="dtm"/> <UnitName Value="dtm"/>
<CursorPos X="112" Y="86"/> <CursorPos X="7" Y="139"/>
<TopLine Value="1"/> <TopLine Value="109"/>
<EditorIndex Value="11"/> <EditorIndex Value="11"/>
<UsageCount Value="200"/> <UsageCount Value="200"/>
<Loaded Value="True"/> <Loaded Value="True"/>
@ -729,8 +729,8 @@
<Filename Value="../../Units/MMLAddon/colourpicker.pas"/> <Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="colourpicker"/> <UnitName Value="colourpicker"/>
<CursorPos X="1" Y="148"/> <CursorPos X="65" Y="243"/>
<TopLine Value="1"/> <TopLine Value="86"/>
<EditorIndex Value="8"/> <EditorIndex Value="8"/>
<UsageCount Value="201"/> <UsageCount Value="201"/>
<Loaded Value="True"/> <Loaded Value="True"/>
@ -808,7 +808,7 @@
<CursorPos X="33" Y="34"/> <CursorPos X="33" Y="34"/>
<TopLine Value="30"/> <TopLine Value="30"/>
<EditorIndex Value="13"/> <EditorIndex Value="13"/>
<UsageCount Value="18"/> <UsageCount Value="20"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit107> </Unit107>
<Unit108> <Unit108>
@ -1002,7 +1002,7 @@
<UnitName Value="web"/> <UnitName Value="web"/>
<CursorPos X="1" Y="1"/> <CursorPos X="1" Y="1"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<UsageCount Value="163"/> <UsageCount Value="167"/>
</Unit136> </Unit136>
<Unit137> <Unit137>
<Filename Value="../../../lazarus/lcl/lazhelphtml.pas"/> <Filename Value="../../../lazarus/lcl/lazhelphtml.pas"/>
@ -1201,7 +1201,7 @@
<UnitName Value="framescript"/> <UnitName Value="framescript"/>
<CursorPos X="106" Y="190"/> <CursorPos X="106" Y="190"/>
<TopLine Value="180"/> <TopLine Value="180"/>
<UsageCount Value="156"/> <UsageCount Value="160"/>
</Unit161> </Unit161>
<Unit162> <Unit162>
<Filename Value="framesynedit.lrs"/> <Filename Value="framesynedit.lrs"/>
@ -1513,10 +1513,10 @@
<ComponentName Value="ColourHistoryForm"/> <ComponentName Value="ColourHistoryForm"/>
<ResourceBaseClass Value="Form"/> <ResourceBaseClass Value="Form"/>
<UnitName Value="colourhistory"/> <UnitName Value="colourhistory"/>
<CursorPos X="45" Y="141"/> <CursorPos X="36" Y="135"/>
<TopLine Value="115"/> <TopLine Value="13"/>
<EditorIndex Value="5"/> <EditorIndex Value="5"/>
<UsageCount Value="93"/> <UsageCount Value="97"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit208> </Unit208>
<Unit209> <Unit209>
@ -1767,7 +1767,7 @@
<UnitName Value="about"/> <UnitName Value="about"/>
<CursorPos X="44" Y="21"/> <CursorPos X="44" Y="21"/>
<TopLine Value="4"/> <TopLine Value="4"/>
<UsageCount Value="56"/> <UsageCount Value="60"/>
</Unit245> </Unit245>
<Unit246> <Unit246>
<Filename Value="../../Units/MMLAddon/PSInc/Wrappers/file.inc"/> <Filename Value="../../Units/MMLAddon/PSInc/Wrappers/file.inc"/>
@ -1781,7 +1781,7 @@
<UnitName Value="internets"/> <UnitName Value="internets"/>
<CursorPos X="87" Y="3"/> <CursorPos X="87" Y="3"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<UsageCount Value="50"/> <UsageCount Value="54"/>
</Unit247> </Unit247>
<Unit248> <Unit248>
<Filename Value="debugimageform.pas"/> <Filename Value="debugimageform.pas"/>
@ -1790,7 +1790,7 @@
<UnitName Value="debugimageform"/> <UnitName Value="debugimageform"/>
<CursorPos X="20" Y="1"/> <CursorPos X="20" Y="1"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<UsageCount Value="37"/> <UsageCount Value="41"/>
</Unit248> </Unit248>
<Unit249> <Unit249>
<Filename Value="debugimage.pas"/> <Filename Value="debugimage.pas"/>
@ -1800,9 +1800,9 @@
<UnitName Value="debugimage"/> <UnitName Value="debugimage"/>
<ComponentState Value="1"/> <ComponentState Value="1"/>
<CursorPos X="62" Y="62"/> <CursorPos X="62" Y="62"/>
<TopLine Value="54"/> <TopLine Value="1"/>
<EditorIndex Value="6"/> <EditorIndex Value="6"/>
<UsageCount Value="36"/> <UsageCount Value="40"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit249> </Unit249>
<Unit250> <Unit250>
@ -1872,123 +1872,127 @@
<SyntaxHighlighter Value="XML"/> <SyntaxHighlighter Value="XML"/>
</Unit259> </Unit259>
</Units> </Units>
<JumpHistory Count="29" HistoryIndex="28"> <JumpHistory Count="30" HistoryIndex="29">
<Position1> <Position1>
<Filename Value="../../Units/MMLCore/finder.pas"/> <Filename Value="debugimage.pas"/>
<Caret Line="1616" Column="14" TopLine="1601"/> <Caret Line="115" Column="99" TopLine="94"/>
</Position1> </Position1>
<Position2> <Position2>
<Filename Value="../../Units/MMLCore/finder.pas"/> <Filename Value="testunit.pas"/>
<Caret Line="104" Column="31" TopLine="89"/> <Caret Line="1053" Column="33" TopLine="1049"/>
</Position2> </Position2>
<Position3> <Position3>
<Filename Value="../../Units/MMLCore/finder.pas"/> <Filename Value="debugimage.pas"/>
<Caret Line="1681" Column="96" TopLine="1662"/> <Caret Line="81" Column="35" TopLine="78"/>
</Position3> </Position3>
<Position4> <Position4>
<Filename Value="../../Units/MMLAddon/colourpicker.pas"/> <Filename Value="debugimage.pas"/>
<Caret Line="137" Column="23" TopLine="121"/> <Caret Line="71" Column="47" TopLine="59"/>
</Position4> </Position4>
<Position5> <Position5>
<Filename Value="testunit.pas"/> <Filename Value="testunit.pas"/>
<Caret Line="40" Column="51" TopLine="40"/> <Caret Line="1052" Column="53" TopLine="1049"/>
</Position5> </Position5>
<Position6> <Position6>
<Filename Value="testunit.pas"/> <Filename Value="testunit.pas"/>
<Caret Line="45" Column="51" TopLine="1"/> <Caret Line="993" Column="49" TopLine="736"/>
</Position6> </Position6>
<Position7> <Position7>
<Filename Value="testunit.pas"/> <Filename Value="testunit.pas"/>
<Caret Line="379" Column="26" TopLine="359"/> <Caret Line="817" Column="39" TopLine="23"/>
</Position7> </Position7>
<Position8> <Position8>
<Filename Value="testunit.pas"/> <Filename Value="testunit.pas"/>
<Caret Line="362" Column="32" TopLine="359"/> <Caret Line="24" Column="53" TopLine="1"/>
</Position8> </Position8>
<Position9> <Position9>
<Filename Value="testunit.pas"/>
<Caret Line="1311" Column="57" TopLine="1291"/>
</Position9>
<Position10>
<Filename Value="testunit.pas"/>
<Caret Line="1316" Column="57" TopLine="1291"/>
</Position10>
<Position11>
<Filename Value="testunit.pas"/>
<Caret Line="10" Column="75" TopLine="1"/>
</Position11>
<Position12>
<Filename Value="testunit.pas"/>
<Caret Line="1311" Column="65" TopLine="1291"/>
</Position12>
<Position13>
<Filename Value="testunit.pas"/>
<Caret Line="8" Column="103" TopLine="3"/>
</Position13>
<Position14>
<Filename Value="testunit.pas"/>
<Caret Line="180" Column="25" TopLine="160"/>
</Position14>
<Position15>
<Filename Value="testunit.pas"/>
<Caret Line="1311" Column="57" TopLine="1291"/>
</Position15>
<Position16>
<Filename Value="testunit.pas"/>
<Caret Line="10" Column="108" TopLine="1"/>
</Position16>
<Position17>
<Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<Caret Line="104" Column="73" TopLine="73"/>
</Position17>
<Position18>
<Filename Value="testunit.pas"/>
<Caret Line="165" Column="119" TopLine="160"/>
</Position18>
<Position19>
<Filename Value="project1.lpr"/>
<Caret Line="38" Column="79" TopLine="5"/>
</Position19>
<Position20>
<Filename Value="testunit.pas"/>
<Caret Line="1129" Column="75" TopLine="1105"/>
</Position20>
<Position21>
<Filename Value="debugimage.pas"/>
<Caret Line="115" Column="99" TopLine="94"/>
</Position21>
<Position22>
<Filename Value="testunit.pas"/>
<Caret Line="1053" Column="33" TopLine="1049"/>
</Position22>
<Position23>
<Filename Value="debugimage.pas"/>
<Caret Line="81" Column="35" TopLine="78"/>
</Position23>
<Position24>
<Filename Value="debugimage.pas"/>
<Caret Line="71" Column="47" TopLine="59"/>
</Position24>
<Position25>
<Filename Value="testunit.pas"/>
<Caret Line="1052" Column="53" TopLine="1049"/>
</Position25>
<Position26>
<Filename Value="testunit.pas"/>
<Caret Line="993" Column="49" TopLine="736"/>
</Position26>
<Position27>
<Filename Value="testunit.pas"/>
<Caret Line="817" Column="39" TopLine="23"/>
</Position27>
<Position28>
<Filename Value="testunit.pas"/>
<Caret Line="24" Column="53" TopLine="1"/>
</Position28>
<Position29>
<Filename Value="colourhistory.pas"/> <Filename Value="colourhistory.pas"/>
<Caret Line="7" Column="88" TopLine="1"/> <Caret Line="7" Column="88" TopLine="1"/>
</Position9>
<Position10>
<Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<Caret Line="162" Column="14" TopLine="132"/>
</Position10>
<Position11>
<Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<Caret Line="47" Column="69" TopLine="36"/>
</Position11>
<Position12>
<Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<Caret Line="51" Column="33" TopLine="36"/>
</Position12>
<Position13>
<Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<Caret Line="153" Column="37" TopLine="133"/>
</Position13>
<Position14>
<Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<Caret Line="111" Column="51" TopLine="92"/>
</Position14>
<Position15>
<Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<Caret Line="180" Column="19" TopLine="160"/>
</Position15>
<Position16>
<Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<Caret Line="182" Column="30" TopLine="160"/>
</Position16>
<Position17>
<Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<Caret Line="179" Column="65" TopLine="152"/>
</Position17>
<Position18>
<Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<Caret Line="180" Column="9" TopLine="152"/>
</Position18>
<Position19>
<Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<Caret Line="182" Column="25" TopLine="152"/>
</Position19>
<Position20>
<Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<Caret Line="183" Column="8" TopLine="152"/>
</Position20>
<Position21>
<Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<Caret Line="184" Column="8" TopLine="152"/>
</Position21>
<Position22>
<Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<Caret Line="202" Column="10" TopLine="182"/>
</Position22>
<Position23>
<Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<Caret Line="240" Column="10" TopLine="220"/>
</Position23>
<Position24>
<Filename Value="../../Units/MMLCore/bitmaps.pas"/>
<Caret Line="376" Column="10" TopLine="358"/>
</Position24>
<Position25>
<Filename Value="../../Units/MMLCore/bitmaps.pas"/>
<Caret Line="49" Column="28" TopLine="29"/>
</Position25>
<Position26>
<Filename Value="../../Units/MMLCore/bitmaps.pas"/>
<Caret Line="376" Column="16" TopLine="356"/>
</Position26>
<Position27>
<Filename Value="../../Units/MMLCore/bitmaps.pas"/>
<Caret Line="389" Column="18" TopLine="356"/>
</Position27>
<Position28>
<Filename Value="../../Units/MMLCore/bitmaps.pas"/>
<Caret Line="396" Column="16" TopLine="376"/>
</Position28>
<Position29>
<Filename Value="../../Units/MMLCore/bitmaps.pas"/>
<Caret Line="408" Column="18" TopLine="376"/>
</Position29> </Position29>
<Position30>
<Filename Value="../../Units/MMLCore/bitmaps.pas"/>
<Caret Line="448" Column="16" TopLine="428"/>
</Position30>
</JumpHistory> </JumpHistory>
</ProjectOptions> </ProjectOptions>
<CompilerOptions> <CompilerOptions>

View File

@ -121,13 +121,10 @@ end;
{$DEFINE DTM_DEBUG} {$DEFINE DTM_DEBUG}
destructor TMDTM.Destroy; destructor TMDTM.Destroy;
{$IFDEF DTM_DEBUG}
var var
i, j: integer; i, j: integer;
b:boolean; b:boolean;
{$ENDIF}
begin begin
{$IFDEF DTM_DEBUG}
for i := 0 to high(DTMList) do for i := 0 to high(DTMList) do
begin begin
b := false; b := false;
@ -140,7 +137,6 @@ begin
if not b then if not b then
writeln('DTM Number ' + inttostr(i) + ' was not freed'); writeln('DTM Number ' + inttostr(i) + ' was not freed');
end; end;
{$ENDIF}
SetLength(DTMList, 0); SetLength(DTMList, 0);
SetLength(FreeSpots, 0); SetLength(FreeSpots, 0);
SetLength(BufferString, 0); SetLength(BufferString, 0);

View File

@ -89,6 +89,11 @@ type
{ TODO: add cts per colour/tolerance? } { TODO: add cts per colour/tolerance? }
// TODO DTM-Not points. Not very hard really. // TODO DTM-Not points. Not very hard really.
{ not points -
add seperate tpa or boolean array for every point that is to be matched ?
}
pDTM = record pDTM = record
l: Integer; l: Integer;
p: TPointArray; p: TPointArray;

View File

@ -432,10 +432,7 @@ begin
Self.FreezeState:=False; Self.FreezeState:=False;
end; end;
// Bugged. For params other than 0, 0, ClientWidth, ClientHeight //Remove?
// if other type than w_XImage
// Also possibly thread bugged
function TMWindow.CopyClientToBitmap(xs, ys, xe, ye: integer): TBitmap; function TMWindow.CopyClientToBitmap(xs, ys, xe, ye: integer): TBitmap;
var var
w,h: Integer; w,h: Integer;
@ -518,6 +515,8 @@ begin
end; end;
end; end;
// Set's input focus on Linux, does not mean the window will look `active', but
// it surely is. Try typing something after ActivateClient.
procedure TMWindow.ActivateClient; procedure TMWindow.ActivateClient;
{$IFDEF LINUX} {$IFDEF LINUX}
var var
@ -539,7 +538,7 @@ begin
{$ENDIF} {$ENDIF}
end; end;
{$IFDEF MSWINDOWS} //Probably need one for Linux as well {$IFDEF MSWINDOWS}
function TMWindow.UpdateDrawBitmap :boolean; function TMWindow.UpdateDrawBitmap :boolean;
var var
w,h : integer; w,h : integer;
@ -555,6 +554,7 @@ begin
end; end;
{$ENDIF} {$ENDIF}
// Returns dimensions of the Window
procedure TMWindow.GetDimensions(out W, H: Integer); procedure TMWindow.GetDimensions(out W, H: Integer);
{$IFDEF LINUX} {$IFDEF LINUX}
var var
@ -616,6 +616,7 @@ begin
end; end;
end; end;
// Make this use GetDimensions, ray...?
function TMWindow.GetDimensionBox(out Box : TBox) : boolean; function TMWindow.GetDimensionBox(out Box : TBox) : boolean;
function IntToTBox(x1,y1,x2,y2 : integer) : TBox;inline; function IntToTBox(x1,y1,x2,y2 : integer) : TBox;inline;
begin; begin;
@ -668,6 +669,7 @@ begin
end; end;
end; end;
// Set target to X-Window
{$IFDEF LINUX} {$IFDEF LINUX}
function TMWindow.SetTarget(XWindow: x.TWindow): integer; overload; function TMWindow.SetTarget(XWindow: x.TWindow): integer; overload;
var var
@ -682,6 +684,7 @@ begin
end; end;
{$ENDIF} {$ENDIF}
// Set target to Windows Window
function TMWindow.SetTarget(Window: THandle; NewType: TTargetWindowMode): integer; overload; function TMWindow.SetTarget(Window: THandle; NewType: TTargetWindowMode): integer; overload;
begin begin
if Self.Frozen then if Self.Frozen then
@ -735,9 +738,9 @@ begin
{$IFDEF WINDOWS} {$IFDEF WINDOWS}
Self.TargetHandle:= windows.GetDesktopWindow; Self.TargetHandle:= windows.GetDesktopWindow;
{$ENDIF} {$ENDIF}
end; end;
// Set target to Bitmap
function TMWindow.SetTarget(Bitmap: TMufasaBitmap): integer; function TMWindow.SetTarget(Bitmap: TMufasaBitmap): integer;
begin begin
if Self.Frozen then if Self.Frozen then