1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-11-27 11:32:18 -05:00

Finder: CTS-rework fixes.

This commit is contained in:
Merlijn Wajer 2011-07-06 18:34:49 +02:00
parent 6f896b56a2
commit e6b005b61f

View File

@ -391,7 +391,7 @@ begin
g := g * g;
r := C1.R - C2^.R;
r := r * r;
Result := (b + g + r) < ToleranceSqr;
Result := (b + g + r) <= ToleranceSqr;
end;
function ColorSame_cts2(Tolerance: Integer; ctsInfo: Pointer; C2: PRGB32): boolean;
@ -425,7 +425,7 @@ begin
end;
2:
begin
Result := AllocMem(SizeOf(TRGB32));
Result := AllocMem(SizeOf(TCTS2Info));
ColorToRGB(Color, R, G, B);
RGBToHSL(R, G, B, PCTS2Info(Result)^.H, PCTS2Info(Result)^.S,
PCTS2Info(Result)^.L);
@ -1279,8 +1279,8 @@ begin
SetLength(Points, C);
Move(ClientTPA[0], Points[0], C * SizeOf(TPoint));
Result := C > 0;
Free_CTSInfo(ctsinfo);
TClient(Client).IOManager.FreeReturnData;
Free_CTSInfo(ctsinfo)
end;
function TMFinder.FindColorsToleranceOptimised(out Points: TPointArray; Color, xs, ys,