1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-11-22 09:12:19 -05:00

Added DTM NOT points, made DTM algorithm more dynamic.

Added CTS support for DTM. (May remove later if it becomes slow)



git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@371 3f818213-9676-44b0-a9b4-5e4c4e03d09d
This commit is contained in:
Wizzup? 2010-01-04 19:08:06 +00:00
parent c5d4624df2
commit b2f5a9f77a
8 changed files with 244 additions and 317 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="4"/> <ActiveEditorIndexAtStart Value="2"/>
</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="34"> <Units Count="27">
<Unit0> <Unit0>
<Filename Value="project1.lpr"/> <Filename Value="project1.lpr"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="project1"/> <UnitName Value="project1"/>
<CursorPos X="7" Y="124"/> <CursorPos X="29" Y="51"/>
<TopLine Value="99"/> <TopLine Value="33"/>
<EditorIndex Value="0"/> <EditorIndex Value="0"/>
<UsageCount Value="121"/> <UsageCount Value="74"/>
<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="3"/> <UsageCount Value="7"/>
</Unit1> </Unit1>
<Unit2> <Unit2>
<Filename Value="../../Units/MMLCore/client.pas"/> <Filename Value="../../Units/MMLCore/client.pas"/>
<UnitName Value="Client"/> <UnitName Value="Client"/>
<CursorPos X="20" Y="33"/> <CursorPos X="21" Y="51"/>
<TopLine Value="1"/> <TopLine Value="35"/>
<EditorIndex Value="11"/> <EditorIndex Value="9"/>
<UsageCount Value="52"/> <UsageCount Value="31"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit2> </Unit2>
<Unit3> <Unit3>
@ -62,370 +62,318 @@
<UnitName Value="windowutil"/> <UnitName Value="windowutil"/>
<CursorPos X="110" Y="30"/> <CursorPos X="110" Y="30"/>
<TopLine Value="3"/> <TopLine Value="3"/>
<UsageCount Value="3"/> <UsageCount Value="7"/>
</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="15"/> <EditorIndex Value="12"/>
<UsageCount Value="51"/> <UsageCount Value="30"/>
<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="307"/> <TopLine Value="309"/>
<EditorIndex Value="7"/> <EditorIndex Value="4"/>
<UsageCount Value="32"/> <UsageCount Value="11"/>
<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="1" Y="1728"/> <CursorPos X="69" Y="1901"/>
<TopLine Value="1701"/> <TopLine Value="1890"/>
<EditorIndex Value="6"/> <EditorIndex Value="2"/>
<UsageCount Value="55"/> <UsageCount Value="34"/>
<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="72" Y="47"/> <CursorPos X="56" Y="49"/>
<TopLine Value="36"/> <TopLine Value="24"/>
<EditorIndex Value="10"/> <EditorIndex Value="8"/>
<UsageCount Value="51"/> <UsageCount Value="30"/>
<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="98" Y="92"/> <CursorPos X="1" Y="1"/>
<TopLine Value="76"/> <TopLine Value="34"/>
<EditorIndex Value="16"/> <EditorIndex Value="3"/>
<UsageCount Value="53"/> <UsageCount Value="32"/>
<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="1" Y="133"/> <CursorPos X="53" Y="31"/>
<TopLine Value="108"/> <TopLine Value="24"/>
<EditorIndex Value="13"/> <EditorIndex Value="10"/>
<UsageCount Value="52"/> <UsageCount Value="31"/>
<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="4"/> <UsageCount Value="8"/>
</Unit10> </Unit10>
<Unit11> <Unit11>
<Filename Value="../../Units/MMLCore/files.pas"/> <Filename Value="../../Units/MMLCore/files.pas"/>
<UnitName Value="files"/> <UnitName Value="files"/>
<CursorPos X="22" Y="36"/> <CursorPos X="5" Y="42"/>
<TopLine Value="18"/> <TopLine Value="27"/>
<EditorIndex Value="12"/> <UsageCount Value="8"/>
<UsageCount Value="13"/>
<Loaded Value="True"/>
</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="243"/> <CursorPos X="3" Y="1426"/>
<TopLine Value="223"/> <TopLine Value="1411"/>
<UsageCount Value="6"/> <UsageCount Value="8"/>
</Unit12> </Unit12>
<Unit13> <Unit13>
<Filename Value="../../Units/MMLCore/bitmaps.pas"/> <Filename Value="../../Units/MMLCore/bitmaps.pas"/>
<UnitName Value="bitmaps"/> <UnitName Value="bitmaps"/>
<CursorPos X="56" Y="477"/> <CursorPos X="32" Y="835"/>
<TopLine Value="435"/> <TopLine Value="850"/>
<EditorIndex Value="1"/> <EditorIndex Value="1"/>
<UsageCount Value="50"/> <UsageCount Value="29"/>
<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="4"/> <UsageCount Value="8"/>
</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="4"/> <UsageCount Value="8"/>
</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="4"/> <UsageCount Value="8"/>
</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="4"/> <UsageCount Value="8"/>
</Unit17> </Unit17>
<Unit18> <Unit18>
<Filename Value="../../Units/MMLAddon/PSInc/Wrappers/ocr.inc"/> <Filename Value="../../Units/MMLAddon/PSInc/Wrappers/ocr.inc"/>
<CursorPos X="20" Y="4"/> <CursorPos X="20" Y="4"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<EditorIndex Value="14"/> <EditorIndex Value="11"/>
<UsageCount Value="48"/> <UsageCount Value="27"/>
<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="89" Y="33"/> <CursorPos X="29" Y="31"/>
<TopLine Value="1"/> <TopLine Value="411"/>
<EditorIndex Value="2"/> <EditorIndex Value="6"/>
<UsageCount Value="48"/> <UsageCount Value="27"/>
<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="1" Y="89"/>
<TopLine Value="49"/> <TopLine Value="1"/>
<EditorIndex Value="8"/> <EditorIndex Value="5"/>
<UsageCount Value="44"/> <UsageCount Value="23"/>
<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="274"/> <CursorPos X="59" Y="48"/>
<TopLine Value="274"/> <TopLine Value="18"/>
<EditorIndex Value="5"/> <UsageCount Value="9"/>
<UsageCount Value="24"/>
<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="22" Y="470"/> <CursorPos X="48" Y="417"/>
<TopLine Value="445"/> <TopLine Value="395"/>
<EditorIndex Value="9"/> <EditorIndex Value="7"/>
<UsageCount Value="32"/> <UsageCount Value="11"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit22> </Unit22>
<Unit23> <Unit23>
<Filename Value="../../Units/Linux/xtest.pas"/> <Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<UnitName Value="XTest"/> <UnitName Value="colourpicker"/>
<CursorPos X="56" Y="22"/> <CursorPos X="49" Y="288"/>
<TopLine Value="1"/> <TopLine Value="265"/>
<UsageCount Value="6"/> <UsageCount Value="10"/>
</Unit23> </Unit23>
<Unit24> <Unit24>
<Filename Value="../../../../Documents/fpc/rtl/inc/mathh.inc"/> <Filename Value="../../Units/MMLAddon/PSInc/pscompile.inc"/>
<CursorPos X="58" Y="78"/> <CursorPos X="116" Y="38"/>
<TopLine Value="57"/> <TopLine Value="12"/>
<UsageCount Value="6"/> <UsageCount Value="10"/>
</Unit24> </Unit24>
<Unit25> <Unit25>
<Filename Value="../../../../Documents/fpc/rtl/inc/innr.inc"/> <Filename Value="../../Units/MMLAddon/PSInc/psdefines.inc"/>
<CursorPos X="4" Y="98"/> <CursorPos X="1" Y="1"/>
<TopLine Value="78"/> <TopLine Value="2"/>
<UsageCount Value="6"/> <UsageCount Value="10"/>
</Unit25> </Unit25>
<Unit26> <Unit26>
<Filename Value="../../../../Documents/lazarus/lcl/graphtype.pp"/> <Filename Value="../../Units/MMLAddon/PSInc/psexportedmethods.inc"/>
<UnitName Value="GraphType"/> <CursorPos X="1" Y="1"/>
<CursorPos X="72" Y="96"/> <TopLine Value="1"/>
<TopLine Value="72"/> <UsageCount Value="10"/>
<UsageCount Value="12"/>
</Unit26> </Unit26>
<Unit27>
<Filename Value="../../Units/Synapse/httpsend.pas"/>
<UnitName Value="httpsend"/>
<CursorPos X="64" Y="365"/>
<TopLine Value="379"/>
<UsageCount Value="14"/>
</Unit27>
<Unit28>
<Filename Value="../../Units/MMLAddon/internets.pas"/>
<UnitName Value="internets"/>
<CursorPos X="9" Y="21"/>
<TopLine Value="1"/>
<EditorIndex Value="3"/>
<UsageCount Value="15"/>
<Loaded Value="True"/>
</Unit28>
<Unit29>
<Filename Value="../../../../Documents/fpc/rtl/objpas/classes/classesh.inc"/>
<CursorPos X="14" Y="712"/>
<TopLine Value="696"/>
<UsageCount Value="9"/>
</Unit29>
<Unit30>
<Filename Value="../../Units/MMLAddon/updater.pas"/>
<UnitName Value="updater"/>
<CursorPos X="18" Y="199"/>
<TopLine Value="174"/>
<EditorIndex Value="4"/>
<UsageCount Value="15"/>
<Loaded Value="True"/>
</Unit30>
<Unit31>
<Filename Value="../../Units/Synapse/blcksock.pas"/>
<UnitName Value="blcksock"/>
<CursorPos X="3" Y="198"/>
<TopLine Value="180"/>
<UsageCount Value="15"/>
</Unit31>
<Unit32>
<Filename Value="../../Units/Synapse/ssfpc.pas"/>
<UnitName Value="ssfpc"/>
<CursorPos X="3" Y="94"/>
<TopLine Value="1"/>
<UsageCount Value="9"/>
</Unit32>
<Unit33>
<Filename Value="../../Units/Synapse/sslinux.pas"/>
<UnitName Value="sslinux"/>
<CursorPos X="1" Y="62"/>
<TopLine Value="32"/>
<UsageCount Value="9"/>
</Unit33>
</Units> </Units>
<JumpHistory Count="29" HistoryIndex="28"> <JumpHistory Count="30" HistoryIndex="29">
<Position1> <Position1>
<Filename Value="../../Units/MMLAddon/updater.pas"/> <Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="75" Column="23" TopLine="62"/> <Caret Line="1618" Column="22" TopLine="1607"/>
</Position1> </Position1>
<Position2> <Position2>
<Filename Value="../../Units/MMLAddon/updater.pas"/> <Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="115" Column="13" TopLine="84"/> <Caret Line="1637" Column="18" TopLine="1621"/>
</Position2> </Position2>
<Position3> <Position3>
<Filename Value="../../Units/MMLAddon/updater.pas"/> <Filename Value="../../Units/MMLCore/ocr.pas"/>
<Caret Line="70" Column="60" TopLine="45"/> <Caret Line="31" Column="54" TopLine="13"/>
</Position3> </Position3>
<Position4> <Position4>
<Filename Value="../../Units/MMLAddon/updater.pas"/> <Filename Value="../../Units/MMLCore/ocrutil.pas"/>
<Caret Line="110" Column="15" TopLine="95"/> <Caret Line="8" Column="38" TopLine="1"/>
</Position4> </Position4>
<Position5> <Position5>
<Filename Value="../../Units/MMLAddon/updater.pas"/> <Filename Value="../../Units/MMLCore/colour_conv.pas"/>
<Caret Line="117" Column="44" TopLine="92"/> <Caret Line="47" Column="31" TopLine="27"/>
</Position5> </Position5>
<Position6> <Position6>
<Filename Value="../../Units/MMLAddon/updater.pas"/> <Filename Value="../../Units/MMLCore/ocr.pas"/>
<Caret Line="30" Column="30" TopLine="11"/> <Caret Line="31" Column="53" TopLine="24"/>
</Position6> </Position6>
<Position7> <Position7>
<Filename Value="../../Units/MMLAddon/updater.pas"/> <Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="126" Column="11" TopLine="95"/> <Caret Line="85" Column="74" TopLine="75"/>
</Position7> </Position7>
<Position8> <Position8>
<Filename Value="project1.lpr"/> <Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="12" Column="7" TopLine="5"/> <Caret Line="2027" Column="29" TopLine="2002"/>
</Position8> </Position8>
<Position9> <Position9>
<Filename Value="../../Units/MMLCore/client.pas"/> <Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="33" Column="20" TopLine="1"/> <Caret Line="2028" Column="37" TopLine="2009"/>
</Position9> </Position9>
<Position10> <Position10>
<Filename Value="../../Units/MMLCore/files.pas"/> <Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="123" Column="19" TopLine="111"/> <Caret Line="2021" Column="75" TopLine="2004"/>
</Position10> </Position10>
<Position11> <Position11>
<Filename Value="../../Units/MMLAddon/updater.pas"/> <Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="140" Column="18" TopLine="117"/> <Caret Line="1832" Column="28" TopLine="1827"/>
</Position11> </Position11>
<Position12> <Position12>
<Filename Value="../../Units/MMLAddon/updater.pas"/> <Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="35" Column="59" TopLine="17"/> <Caret Line="1822" Column="1" TopLine="1808"/>
</Position12> </Position12>
<Position13> <Position13>
<Filename Value="../../Units/MMLAddon/updater.pas"/> <Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="131" Column="13" TopLine="113"/> <Caret Line="1877" Column="23" TopLine="1867"/>
</Position13> </Position13>
<Position14> <Position14>
<Filename Value="../../Units/MMLAddon/updater.pas"/> <Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="130" Column="19" TopLine="113"/> <Caret Line="62" Column="31" TopLine="44"/>
</Position14> </Position14>
<Position15> <Position15>
<Filename Value="../../Units/MMLAddon/updater.pas"/> <Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="131" Column="13" TopLine="112"/> <Caret Line="1893" Column="88" TopLine="1867"/>
</Position15> </Position15>
<Position16> <Position16>
<Filename Value="../../Units/MMLAddon/updater.pas"/> <Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="120" Column="54" TopLine="102"/> <Caret Line="2033" Column="30" TopLine="2002"/>
</Position16> </Position16>
<Position17> <Position17>
<Filename Value="../../Units/MMLAddon/updater.pas"/> <Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="40" Column="33" TopLine="12"/> <Caret Line="1934" Column="32" TopLine="1916"/>
</Position17> </Position17>
<Position18> <Position18>
<Filename Value="../../Units/MMLAddon/updater.pas"/> <Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="38" Column="41" TopLine="20"/> <Caret Line="2007" Column="29" TopLine="1989"/>
</Position18> </Position18>
<Position19> <Position19>
<Filename Value="../../Units/MMLAddon/updater.pas"/> <Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="130" Column="18" TopLine="113"/> <Caret Line="87" Column="28" TopLine="78"/>
</Position19> </Position19>
<Position20> <Position20>
<Filename Value="../../Units/MMLAddon/updater.pas"/> <Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="8" Column="26" TopLine="1"/> <Caret Line="2010" Column="81" TopLine="1989"/>
</Position20> </Position20>
<Position21> <Position21>
<Filename Value="../../Units/MMLAddon/updater.pas"/> <Filename Value="project1.lpr"/>
<Caret Line="130" Column="18" TopLine="113"/> <Caret Line="111" Column="22" TopLine="101"/>
</Position21> </Position21>
<Position22> <Position22>
<Filename Value="../../Units/MMLAddon/updater.pas"/> <Filename Value="../../Units/MMLCore/dtmutil.pas"/>
<Caret Line="23" Column="27" TopLine="5"/> <Caret Line="31" Column="24" TopLine="12"/>
</Position22> </Position22>
<Position23> <Position23>
<Filename Value="../../Units/MMLAddon/updater.pas"/> <Filename Value="../../Units/MMLCore/dtmutil.pas"/>
<Caret Line="16" Column="1" TopLine="5"/> <Caret Line="158" Column="46" TopLine="133"/>
</Position23> </Position23>
<Position24> <Position24>
<Filename Value="../../Units/MMLAddon/updater.pas"/> <Filename Value="../../Units/MMLCore/dtmutil.pas"/>
<Caret Line="28" Column="39" TopLine="16"/> <Caret Line="148" Column="33" TopLine="119"/>
</Position24> </Position24>
<Position25> <Position25>
<Filename Value="project1.lpr"/> <Filename Value="../../Units/MMLCore/dtmutil.pas"/>
<Caret Line="117" Column="13" TopLine="98"/> <Caret Line="31" Column="30" TopLine="1"/>
</Position25> </Position25>
<Position26> <Position26>
<Filename Value="../../Units/MMLAddon/updater.pas"/> <Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="129" Column="25" TopLine="111"/> <Caret Line="1898" Column="99" TopLine="1878"/>
</Position26> </Position26>
<Position27> <Position27>
<Filename Value="../../Units/MMLAddon/updater.pas"/> <Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="95" Column="56" TopLine="67"/> <Caret Line="1902" Column="65" TopLine="1884"/>
</Position27> </Position27>
<Position28> <Position28>
<Filename Value="../../Units/MMLAddon/updater.pas"/> <Filename Value="project1.lpr"/>
<Caret Line="157" Column="1" TopLine="132"/> <Caret Line="51" Column="35" TopLine="34"/>
</Position28> </Position28>
<Position29> <Position29>
<Filename Value="../../Units/MMLAddon/updater.pas"/> <Filename Value="../../Units/MMLCore/dtmutil.pas"/>
<Caret Line="156" Column="50" TopLine="139"/> <Caret Line="77" Column="5" TopLine="49"/>
</Position29> </Position29>
<Position30>
<Filename Value="../../Units/MMLCore/dtm.pas"/>
<Caret Line="31" Column="29" TopLine="1"/>
</Position30>
</JumpHistory> </JumpHistory>
</ProjectOptions> </ProjectOptions>
<CompilerOptions> <CompilerOptions>
<Version Value="8"/> <Version Value="8"/>
<SearchPaths> <SearchPaths>
<IncludeFiles Value="$(ProjOutDir)/"/> <IncludeFiles Value="$(ProjOutDir)/"/>
<OtherUnitFiles Value="$(ProjPath)/../../Units/MMLCore/;$(ProjPath)/../../Units/Misc/;$(ProjPath)/../../Units/MMLAddon/;$(LazarusDir)/lcl/units/$(TargetCPU)-$(TargetOS)/$(LCLWidgetType)/;$(LazarusDir)/lcl/units/$(TargetCPU)-$(TargetOS)/;$(ProjPath)/../../Units/Linux/;$(ProjPath)/../../Units/Synapse/;$(LazarusDir)/components/mouseandkeyinput/"/> <OtherUnitFiles Value="$(ProjPath)/../../Units/MMLCore/;$(ProjPath)/../../Units/Misc/;$(ProjPath)/../../Units/MMLAddon/;$(LazarusDir)/lcl/units/$(TargetCPU)-$(TargetOS)/$(LCLWidgetType)/;$(LazarusDir)/lcl/units/$(TargetCPU)-$(TargetOS)/;$(ProjPath)/../../Units/Linux/;$(LazarusDir)/components/mouseandkeyinput/"/>
</SearchPaths> </SearchPaths>
<CodeGeneration> <CodeGeneration>
<Optimizations> <Optimizations>
<VariablesInRegisters Value="True"/>
<OptimizationLevel Value="3"/> <OptimizationLevel Value="3"/>
</Optimizations> </Optimizations>
</CodeGeneration> </CodeGeneration>

View File

@ -10,8 +10,7 @@ uses
Forms,Interfaces, Forms,Interfaces,
LCLIntf, LCLIntf,
Client, Client,
bitmaps,{x ,}mufasatypes,dtm,dtmutil, ocrutil ,graphics ,colour_conv,math, bitmaps,x ,mufasatypes,dtm,dtmutil, ocrutil
updater
{ you can add units after this }; { you can add units after this };
@ -47,51 +46,24 @@ begin
result.t[i] := random(255); result.t[i] := random(255);
result.asz [i] := random(5); result.asz [i] := random(5);
result.ash[i] := 0; result.ash[i] := 0;
writeln(format('dtm: (%d, %d) c: %d, t: %d, asz: %d', [result.p[i].x, {writeln(format('dtm: (%d, %d) c: %d, t: %d, asz: %d', [result.p[i].x,
result.p[i].y, result.c[i], result.t[i], result.asz[i]])); result.p[i].y, result.c[i], result.t[i], result.asz[i]])); }
result.gp[i] := false;// random(10) = 1;
end; end;
result.c[0] := 255; result.c[0] := 255;
end; PrintpDTM(result);
var
aTime: dword;
function myChange: boolean;
begin
if gettickcount-atime > 1000 then
result := true
else
result := false;
end; end;
procedure MufasaTests.DoRun; procedure MufasaTests.DoRun;
{const
ocr_Limit_High = 191;
ocr_Limit_Low = 65;
ocr_White = 16777215;
ocr_Green = 65280;
ocr_Red = 255;
ocr_Yellow = 65535;
ocr_Blue = 16776960;
ocr_ItemC = 16744447;
ocr_Purple = 8388736; }
var var
ErrorMsg: String; ErrorMsg: String;
{ Time: DWord; Time: DWord;
C: TClient; C: TClient;
I, w, h,x,y: Integer; I: Integer;
dtm: pdtm; dtm: pdtm;
p:tpointarray; p:tpointarray;
bmp, bmprs: TMufasaBitmap; bmp: TMufasaBitmap;
tbmp: TBitmap;
r,g,b:integer;
t:Dword; }
up: TMMLFileDownloader;
begin begin
// quick check parameters // quick check parameters
@ -109,59 +81,57 @@ begin
Exit; Exit;
end; end;
atime:=gettickcount;
up := TMMLFileDownloader.Create;
up.FileURL:='http://www.villavu.com/pics/desktop.png';
up.ReplacementFile:='test.png';
up.OnBeat:=@myChange;
try
up.DownloadAndSave;
up.Replace;
finally
writeln(inttostr(gettickcount-atime));
up.Free;
end;
{ clOlive = false point }
{ clSilver = false shadow }
{ clLime = false shadow}
{ add your program here } { add your program here }
C := TClient.Create;
{ tbmp:=TBitmap.Create; bmp := TMufasaBitmap.Create;
tbmp.LoadFromFile('/home/merlijn/Programs/mufasa/pics/16.bmp'); bmp.SetSize(CW,CH);
Writeln(Format('Client W/H: %d, %d', [CW, CH]));
FillChar(bmp.FData[0],sizeof(trgb32)*CW*CH, 0);
Randomize;
for i := 0 to 500 do
bmp.fastsetpixel(random(CW), random(CH), 255);
{ bmp.FastSetPixel(8,8,255);
bmp.FastSetPixel(9,9,255);
bmp.FastSetPixel(7,7,255);
bmp.FastSetPixel(9,8,255);
bmp.FastSetPixel(8,9,255); }
C.MWindow.SetTarget(bmp);
bmprs := TMufasaBitmap.Create;
bmprs.SetSize(10,10);
bmprs.LoadFromRawImage(tbmp.RawImage); { initdtm(dtm, 5);
tbmp.Free; dtm.p[0] := Point(2, 2);
tbmp := bmprs.ToTBitmap; dtm.p[1] := Point(-3, -3);
} dtm.p[2] := Point(0, 0);
{ for y := 0 to tbmp.Height -1 do dtm.p[3] := Point(1, 1);
for x := 0 to tbmp.width -1 do 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(10);
// setlength(p, 1);
C.MFinder.SetToleranceSpeed(1);
time := GetTickCount;
for i := 0 to 100 do
begin begin
writeln(format('(%d, %d) = %d , %d', [x,y,tbmp.Canvas.pixels[x,y],bmprs.FastGetPixel(x,y)])); setlength(p,0);
colortorgb(tbmp.Canvas.pixels[x,y],r,g,b); C.MFinder.FindDTMs(dtm, p, 0, 0,CW-1, CH-1, 0);
writeln(format('%d,%d,%d', [r,g,b])); end;
colortorgb(bmprs.FastGetPixel(x,y),r,g,b); writeln(inttostr(gettickcount - time) + 'ms');
writeln(format('%d,%d,%d', [r,g,b])); writeln(inttostr(length(p))+ ' points found');
end; } setlength(p,0);
//bmprs.LoadFromFile('/home/merlijn/Programs/mufasa/pics/16.bmp');
{C := TClient.Create; {for i := 0 to high(p) do
C.MWindow.SetTarget(bmprs); } writeln(format('%d: (%d, %d)', [i, p[i].x, p[i].y])); }
{ bmp.SaveToFile('/tmp/output.bmp');
tbmp.SaveToFile('/tmp/output2.bmp');
//bmp.OnDestroy:=nil; //bmp.OnDestroy:=nil;
bmp.Free; bmp.Free;
tbmp.Free; } C.Free;
// C.Free;
// stop program loop // stop program loop
Terminate; Terminate;

View File

@ -32,10 +32,10 @@ Sender.Comp.AddTypeS('TBmpMirrorStyle','(MirrorWidth,MirrorHeight,MirrorLine)');
Sender.Comp.AddTypeS('TMask','record White, Black : TPointArray; WhiteHi,BlackHi : integer; W,H : integer;end;'); Sender.Comp.AddTypeS('TMask','record White, Black : TPointArray; WhiteHi,BlackHi : integer; W,H : integer;end;');
Sender.Comp.AddTypes('TDTMPointDef', 'record x, y, Color, Tolerance, AreaSize, AreaShape: integer; end;'); Sender.Comp.AddTypes('TDTMPointDef', 'record x, y, Color, Tolerance, AreaSize, AreaShape: integer; Good: Boolean; end;');
Sender.Comp.AddTypes('TDTMPointDefArray', 'Array Of TDTMPointDef;'); Sender.Comp.AddTypes('TDTMPointDefArray', 'Array Of TDTMPointDef;');
Sender.Comp.AddTypes('TDTM','record MainPoint: TDTMPointDef; SubPoints: TDTMPointDefArray; end;'); Sender.Comp.AddTypes('TDTM','record MainPoint: TDTMPointDef; SubPoints: TDTMPointDefArray; end;');
Sender.Comp.AddTypeS('pDTM','record l: Integer;p: TPointArray;c, t, asz, ash: TIntegerArray;n: String; end;'); Sender.Comp.AddTypeS('pDTM','record l: Integer;p: TPointArray;c, t, asz, ash: TIntegerArray; gp: array of boolean; n: String; end;');
Sender.Comp.AddTypeS('T2DExtendedArray', 'array of array of extended;'); Sender.Comp.AddTypeS('T2DExtendedArray', 'array of array of extended;');
Sender.Comp.AddTypeS('TStringArray','Array of string;'); Sender.Comp.AddTypeS('TStringArray','Array of string;');

View File

@ -78,24 +78,6 @@ type
FreeSpots: Array Of Integer; FreeSpots: Array Of Integer;
end; end;
{
I am not sure wether I should simply copy and paste the old DTM implementation,
or rewrite it from scratch.
The old DTM system problaby doesn't perform that well, but seems to be quite
stable and complete.
If I would rewrite it from scratch, it would probably be faster, and
hopefully more efficient.That won't be too hard, especially since I have
direct data access now. (TClient FTW!)
Rewrite from scratch it will be, I guess.
And AreaShape will be turned into a {$I }, inline simply doesn't cut it.
~Wizz
}
implementation implementation
uses uses
Client, dtmutil, paszlib, Client, dtmutil, paszlib,

View File

@ -64,6 +64,8 @@ begin
setlength(d.t, len); setlength(d.t, len);
setlength(d.ash, len); setlength(d.ash, len);
setlength(d.asz, len); setlength(d.asz, len);
setlength(d.gp, len);
FillChar(d.p[0], SizeOf(TPoint) * len, 0); FillChar(d.p[0], SizeOf(TPoint) * len, 0);
FillChar(d.c[0], SizeOf(Integer) * len, 0); FillChar(d.c[0], SizeOf(Integer) * len, 0);
FillChar(d.t[0], SizeOf(Integer) * len, 0); FillChar(d.t[0], SizeOf(Integer) * len, 0);
@ -71,8 +73,10 @@ begin
// Better set it to 1, than fill with 0. // Better set it to 1, than fill with 0.
FillChar(d.asz[0], SizeOf(Integer) * len, 0); FillChar(d.asz[0], SizeOf(Integer) * len, 0);
{for i := 0 to len - 1 do
d.asz[i] := 1; } //FillChar(d.gp[0], SizeOf(Boolean) * len, 0);
for i := 0 to len - 1 do
d.gp[i] := true;
end; end;
Procedure PrintpDTM(tDTM : pDTM); Procedure PrintpDTM(tDTM : pDTM);
@ -82,9 +86,9 @@ begin;
i := 0; i := 0;
if tdtm.n <> '' then if tdtm.n <> '' then
writeln('Name: ' + tdtm.n); writeln('Name: ' + tdtm.n);
WriteLn('MainPoint ' + inttostr(tDTM.p[i].x) + ', ' + inttostr(tDTM.p[i].y) + ' col: ' + inttostr(tDTM.c[i]) + ', tol: ' + inttostr(tDTM.t[i]) + '; ashape ' + inttostr(tdtm.ash[i]) + ' asize ' + inttostr(tdtm.asz[i])); WriteLn('MainPoint ' + inttostr(tDTM.p[i].x) + ', ' + inttostr(tDTM.p[i].y) + ' col: ' + inttostr(tDTM.c[i]) + ', tol: ' + inttostr(tDTM.t[i]) + '; ashape ' + inttostr(tdtm.ash[i]) + ' asize ' + inttostr(tdtm.asz[i])+ ', Good: ' + BoolToStr(tdtm.gp[i]));
for I := 1 to High(tDTM.p) do for I := 1 to High(tDTM.p) do
WriteLn('SubPoint['+IntToStr(I) + '] ' + inttostr(tDTM.p[i].x) + ', ' + inttostr(tDTM.p[i].y) + ' col: ' + inttostr(tDTM.c[i]) + ', tol: ' + inttostr(tDTM.t[i]) + '; ashape ' + inttostr(tdtm.ash[i]) + ' asize ' + inttostr(tdtm.asz[i])); WriteLn('SubPoint['+IntToStr(I) + '] ' + inttostr(tDTM.p[i].x) + ', ' + inttostr(tDTM.p[i].y) + ' col: ' + inttostr(tDTM.c[i]) + ', tol: ' + inttostr(tDTM.t[i]) + '; ashape ' + inttostr(tdtm.ash[i]) + ' asize ' + inttostr(tdtm.asz[i]) + ', Good: ' + BoolToStr(tdtm.gp[i]));
end; end;
Function pDTMToTDTM(Const DTM: pDTM): TDTM; Function pDTMToTDTM(Const DTM: pDTM): TDTM;
@ -102,6 +106,7 @@ Begin
Temp.AreaShape := DTM.ash[i]; Temp.AreaShape := DTM.ash[i];
Temp.Color := DTM.c[i]; Temp.Color := DTM.c[i];
Temp.Tolerance := DTM.t[i]; Temp.Tolerance := DTM.t[i];
Temp.Good:= DTM.gp[i];
End; End;
Result.MainPoint := Temp; Result.MainPoint := Temp;
SetLength(Result.SubPoints, Length(DTM.p) - 1); SetLength(Result.SubPoints, Length(DTM.p) - 1);
@ -115,6 +120,7 @@ Begin
Temp.AreaShape := DTM.ash[i]; Temp.AreaShape := DTM.ash[i];
Temp.Color := DTM.c[i]; Temp.Color := DTM.c[i];
Temp.Tolerance := DTM.t[i]; Temp.Tolerance := DTM.t[i];
Temp.Good:= DTM.gp[i];
Result.SubPoints[I - 1] := Temp; Result.SubPoints[I - 1] := Temp;
End; End;
End; End;
@ -135,6 +141,7 @@ Begin
SetLength(Result.t, Length(DTM.SubPoints) + 1); SetLength(Result.t, Length(DTM.SubPoints) + 1);
SetLength(Result.asz, Length(DTM.SubPoints) + 1); SetLength(Result.asz, Length(DTM.SubPoints) + 1);
SetLength(Result.ash, Length(DTM.SubPoints) + 1); SetLength(Result.ash, Length(DTM.SubPoints) + 1);
SetLength(Result.gp, Length(DTM.SubPoints) + 1);
Result.p[0].x := DTM.MainPoint.x; Result.p[0].x := DTM.MainPoint.x;
Result.p[0].y := DTM.MainPoint.y; Result.p[0].y := DTM.MainPoint.y;
@ -142,6 +149,7 @@ Begin
Result.t[0] := DTM.MainPoint.Tolerance; Result.t[0] := DTM.MainPoint.Tolerance;
Result.asz[0] := DTM.MainPoint.AreaSize; Result.asz[0] := DTM.MainPoint.AreaSize;
Result.ash[0] := DTM.MainPoint.AreaShape; Result.ash[0] := DTM.MainPoint.AreaShape;
Result.gp[0] := DTM.MainPoint.Good;
For I := 1 To Length(DTM.SubPoints) Do // High + 1 = Length For I := 1 To Length(DTM.SubPoints) Do // High + 1 = Length
Begin Begin
@ -151,6 +159,7 @@ Begin
Result.t[I] := DTM.SubPoints[I - 1].Tolerance; Result.t[I] := DTM.SubPoints[I - 1].Tolerance;
Result.asz[I] := DTM.SubPoints[I - 1].AreaSize; Result.asz[I] := DTM.SubPoints[I - 1].AreaSize;
Result.ash[I] := DTM.SubPoints[I - 1].AreaShape; Result.ash[I] := DTM.SubPoints[I - 1].AreaShape;
Result.gp[I] := DTM.SubPoints[I - 1].Good;
End; End;
Result.l := length(Result.p); Result.l := length(Result.p);
End; End;
@ -172,6 +181,8 @@ begin
Exit(False); Exit(False);
if dtm.l <> length(dtm.ash) then if dtm.l <> length(dtm.ash) then
Exit(False); Exit(False);
if dtm.l <> length(dtm.gp) then
Exit(False);
for i := 0 to dtm.l-1 do for i := 0 to dtm.l-1 do
if dtm.asz[i] < 0 then if dtm.asz[i] < 0 then
Exit(False); Exit(False);

View File

@ -1841,15 +1841,15 @@ begin
// Init data structure B. // Init data structure B.
W := x2 - x1; W := x2 - x1;
H := y2 - y1; H := y2 - y1;
setlength(b, W + 1); setlength(b, (W + 1) * 2);
for i := 0 to W do for i := 0 to W do
begin begin
setlength(b[i], H + 1); setlength(b[i], (H + 1) * 2);
// does setlength init already? if it doesn't, do we want to init here? // does setlength init already? if it doesn't, do we want to init here?
// or do we want to init in the loop, as we loop over every b anyway? // or do we want to init in the loop, as we loop over every b anyway?
// init // init
FillChar(b[i][0], SizeOf(Integer) * H, 0); FillChar(b[i][0], SizeOf(Integer) * H * 2, 0);
end; end;
// C = DTM.C // C = DTM.C
@ -1869,25 +1869,38 @@ begin
for yy := MA.y1 to MA.y2 do for yy := MA.y1 to MA.y2 do
for xx := MA.x1 to MA.x2 do for xx := MA.x1 to MA.x2 do
begin begin
// main point // Checking main point now; store that we have checked it.
if Sqrt(sqr(rgbs[0].r - cd[yy][xx].R) + sqr(rgbs[0].g - cd[yy][xx].G) + sqr(rgbs[0].b - cd[yy][xx].B)) > dtm.t[0] then // (Main point is point 1)
// if not SimilarColors(dtm.c[0], RGBToColor(cd[yy][xx].R, cd[yy][xx].G, cd[yy][xx].B), dtm.t[0]) then
goto AnotherLoopEnd;
b[xx][yy] := B[xx][yy] or 1; b[xx][yy] := B[xx][yy] or 1;
// if Sqrt(sqr(rgbs[0].r - cd[yy][xx].R) + sqr(rgbs[0].g - cd[yy][xx].G) + sqr(rgbs[0].b - cd[yy][xx].B)) > dtm.t[0] then
if not SimilarColors(dtm.c[0], RGBToColor(cd[yy][xx].R, cd[yy][xx].G, cd[yy][xx].B), dtm.t[0]) then
goto AnotherLoopEnd;
// Mainpoint match. (If it did not match, we would be at AnotherLoopEnd)
b[xx][yy+1] := B[xx][yy+1] or 1;
for i := 1 to dtm.l - 1 do for i := 1 to dtm.l - 1 do
begin //change to use other areashapes too. begin //change to use other areashapes too.
for xxx := xx - dtm.asz[i] + dtm.p[i].x to xx + dtm.asz[i] + dtm.p[i].x do for xxx := xx - dtm.asz[i] + dtm.p[i].x to xx + dtm.asz[i] + dtm.p[i].x do
for yyy := yy - dtm.asz[i] + dtm.p[i].y to yy + dtm.asz[i]+ dtm.p[i].y do for yyy := yy - dtm.asz[i] + dtm.p[i].y to yy + dtm.asz[i]+ dtm.p[i].y do
begin begin
// may want to remove this line, but I think it is a good optimisation. // If we have matched this point
if B[xxx][yyy] and (1 shl i) = 0 then if b[xxx][yyy+1] and (1 shl i) = 0 then
begin begin
if Sqrt(sqr(rgbs[i].r - cd[yyy][xxx].R) + sqr(rgbs[i].g - cd[yyy][xxx].G) + sqr(rgbs[i].b - cd[yyy][xxx].B)) <= dtm.t[i] then // Checking point i now. (Store that we matched it)
// if SimilarColors(dtm.c[i], RGBToColor(cd[yyy][xxx].R, cd[yyy][xxx].G, cd[yyy][xxx].B), dtm.t[i]) then b[xxx][yyy]:=b[xxx][yyy] or (1 shl i);
b[xxx][yyy] := B[xxx][yyy] or (1 shl i)
// if Sqrt(sqr(rgbs[i].r - cd[yyy][xxx].R) + sqr(rgbs[i].g - cd[yyy][xxx].G) + sqr(rgbs[i].b - cd[yyy][xxx].B)) <= dtm.t[i] then
if SimilarColors(dtm.c[i], RGBToColor(cd[yyy][xxx].R, cd[yyy][xxx].G, cd[yyy][xxx].B), dtm.t[i]) then
b[xxx][yyy+1] := B[xxx][yyy+1] or (1 shl i)
else else
goto AnotherLoopEnd; goto AnotherLoopEnd;
end; end;
if (b[xxx][yyy+1] and (1 shl i) = 0) and dtm.gp[i] then
goto AnotherLoopEnd;
end; end;
end; end;
//writeln(Format('Found point: (%d, %d)', [xx,yy])); //writeln(Format('Found point: (%d, %d)', [xx,yy]));

View File

@ -98,6 +98,7 @@ type
l: Integer; l: Integer;
p: TPointArray; p: TPointArray;
c, t, asz, ash: TIntegerArray; c, t, asz, ash: TIntegerArray;
gp: TBoolArray;
n: String; // DOEN n: String; // DOEN
end; end;
@ -105,6 +106,7 @@ type
TDTMPointDef = record TDTMPointDef = record
x, y, Color, Tolerance, AreaSize, AreaShape: integer; x, y, Color, Tolerance, AreaSize, AreaShape: integer;
Good: Boolean;
end; end;
TDTMPointDefArray = Array Of TDTMPointDef; TDTMPointDefArray = Array Of TDTMPointDef;

View File

@ -572,6 +572,7 @@ begin
H := Attrib.Height; H := Attrib.Height;
end else end else
begin begin
{ TODO: Raise Exception because the Window does not exist? }
W := -1; W := -1;
H := -1; H := -1;
end; end;