diff --git a/Doc/sphinx/conf.py b/Doc/sphinx/conf.py index d7dfee6..14cf164 100644 --- a/Doc/sphinx/conf.py +++ b/Doc/sphinx/conf.py @@ -41,7 +41,7 @@ master_doc = 'index' # General information about the project. project = u'Simba' -copyright = u'2010, Merlijn Wajer' +copyright = u'2010, Merlijn Wajer, Raymond van Venetie' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -176,7 +176,7 @@ htmlhelp_basename = 'Simbadoc' # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ ('index', 'Simba.tex', u'Simba Documentation', - u'Merlijn Wajer', 'manual'), + u'Merlijn Wajer, Raymond van Venetie', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of diff --git a/Projects/MMLBenchmark/project1.ico b/Projects/MMLBenchmark/project1.ico new file mode 100644 index 0000000..0341321 Binary files /dev/null and b/Projects/MMLBenchmark/project1.ico differ diff --git a/Projects/MMLBenchmark/project1.lpi b/Projects/MMLBenchmark/project1.lpi new file mode 100644 index 0000000..5f1b696 --- /dev/null +++ b/Projects/MMLBenchmark/project1.lpi @@ -0,0 +1,199 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Projects/MMLBenchmark/project1.lpr b/Projects/MMLBenchmark/project1.lpr new file mode 100644 index 0000000..eb23ee6 --- /dev/null +++ b/Projects/MMLBenchmark/project1.lpr @@ -0,0 +1,139 @@ +program project1; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Classes, SysUtils, CustApp, + interfaces, // to prevent linking errors. :| + + client, MufasaTypes, + + lclintf; + +type + + { TMMLBenchmark } + + TMMLBenchmark = class(TCustomApplication) + protected + procedure DoRun; override; + public + constructor Create(TheOwner: TComponent); override; + destructor Destroy; override; + procedure WriteHelp; virtual; + end; + +var + bmp: Integer; + + MMLClient: TClient; +{ TMMLBenchmark } + +procedure init; + +begin + MMLClient := TClient.Create(''); + + bmp := MMLClient.MBitmaps.CreateBMP(0, 0); + MMLClient.MBitmaps.GetBMP(bmp).LoadFromFile('/home/merlijn/Programs/simba/wall.bmp'); + MMLClient.IOManager.SetTarget(MMLClient.MBitmaps[bmp]); +end; + +procedure free; +begin + MMLClient.IOManager.SetDesktop; + MMLClient.MBitmaps.FreeBMP(bmp); + MMLClient.Free; +end; + +procedure Benchmark; + +var + t, t2, t3: PtrUInt; + i, c, w, h: integer; + col, tol: integer; + + dummytpa: TPointArray; + +begin + init; + t := gettickcount; + MMLClient.IOManager.GetDimensions(w, h); + + col := 16777215; tol := 30; + + for c := 0 to 2 do // benchmark all CTS'es + begin + MMLClient.MFinder.SetToleranceSpeed(c); + t2 := gettickcount; + for i := 0 to 100 do + begin + MMLClient.MFinder.FindColorsTolerance(dummytpa, col, 0, 0, w-1,h-1, tol); + end; + t3 := gettickcount; + writeln(format('FindColorsTolerance'+#10+ + 'Time spent: %d ms (per %f ms), matches: %d, CTS: %d, Colour: %d, Tolerance %d', + [t3-t2, (t3-t2) / 100.0, length(dummytpa), c, col, tol])); + end; + + free; +end; + +procedure TMMLBenchmark.DoRun; +var + ErrorMsg: String; +begin + // quick check parameters + ErrorMsg:=CheckOptions('h','help'); + if ErrorMsg<>'' then begin + ShowException(Exception.Create(ErrorMsg)); + Terminate; + Exit; + end; + + // parse parameters + if HasOption('h','help') then begin + WriteHelp; + Terminate; + Exit; + end; + + Benchmark; + + { add your program here } + + // stop program loop + Terminate; +end; + +constructor TMMLBenchmark.Create(TheOwner: TComponent); +begin + inherited Create(TheOwner); + StopOnException:=True; +end; + +destructor TMMLBenchmark.Destroy; +begin + inherited Destroy; +end; + +procedure TMMLBenchmark.WriteHelp; +begin + { add your help code here } + writeln('Usage: ',ExeName,' -h'); +end; + +var + Application: TMMLBenchmark; + +{$R *.res} + +begin + Application:=TMMLBenchmark.Create(nil); + Application.Run; + Application.Free; +end. + diff --git a/TODO b/TODO index 98b9a6d..ba1abf6 100644 --- a/TODO +++ b/TODO @@ -6,8 +6,25 @@ Simple stuff, not required, may not be possible/useful: - --no-extensions flag for Simba. [ ] -- CTS rewrite to add CTS 3 and others. [ ] -- CTS/finder speedups. [ ] +- CTS/finder speedups and changes [ ] + General ideas: + - everything subprocedure (lots of code) + + - jit + comparison function (per cts) generated, call in loop + + - comparison function (per cts), not generated, call in loop + + - JIT (Generate comparison functions) [ ] + - Comparison functions for HSL/XYZ/L*a*b should check for + match on each component before calculating the next. + (see FindColorsToleranceOptimised) + + - Pass color information in struct [ ] + - Precalculate screen bitmap in current cts / keep a cache + to save comparisons [ ] + - Add CTS 3 [ ] + - Add a direct RGB -> CIE L*a*b conversion [ ] + - Make sure colour conversions are inline [ ] - More documentation: - Cover all functions by at least mentioning the definition [ ] diff --git a/Units/lape b/Units/lape index 04cea47..1b8211d 160000 --- a/Units/lape +++ b/Units/lape @@ -1 +1 @@ -Subproject commit 04cea473001dd095581698a70ec1dc1d8c1aee35 +Subproject commit 1b8211db373428cd2916905980ad51be8fab1f83