1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-12-25 00:39:04 -05:00
Simba/Tests/PS/ColourTest.mufa
Wizzup? c0132294be Added new DTM Finding. Not done yet, but getting there.
Needs a few obvious optimizations, and rotated isn't implemented yet.
Needs a stress-test script.

Added a script to test the difference between FindColorsTolerance and FindColorsToleranceOptimisation.



git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@260 3f818213-9676-44b0-a9b4-5e4c4e03d09d
2009-12-01 23:41:43 +00:00

32 lines
722 B
Plaintext

program new;
var
p1, p2: TPointArray;
w, h: integer;
i, col: integer;
bmp: integer;
begin
SetColorToleranceSpeed(2);
bmp := LoadBitmap('/home/merlijn/Pictures/Mooi/Carina_1_by_Eeitam.png');
SetTargetBitmap(bmp);
GetClientDimensions(W, H);
writeln(inttostr(w) + ' : ' + inttostr(h));
for i := 0 to 100 do
begin
col := Random(clWhite);
writeln(inttostr(col));
FindColorsTolerance(p1, col, 0, 0, W - 1, H - 1, 40);
FindColorsToleranceOptimised(p2, col, 0, 0, W - 1, H - 1, 40);
writeln(inttostr(length(p1)) + ' : ' + inttostr(length(p2)));
if(length(p1) <> length(p2)) then
writeln('wat!');
setlength(p1,0);
setlength(p2,0);
end;
FreeBitmap(bmp);
end.