mirror of
https://github.com/moparisthebest/Simba
synced 2025-02-25 16:01:48 -05:00
Finder: CTS-rework fixes.
This commit is contained in:
parent
6f896b56a2
commit
e6b005b61f
@ -391,7 +391,7 @@ begin
|
|||||||
g := g * g;
|
g := g * g;
|
||||||
r := C1.R - C2^.R;
|
r := C1.R - C2^.R;
|
||||||
r := r * r;
|
r := r * r;
|
||||||
Result := (b + g + r) < ToleranceSqr;
|
Result := (b + g + r) <= ToleranceSqr;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function ColorSame_cts2(Tolerance: Integer; ctsInfo: Pointer; C2: PRGB32): boolean;
|
function ColorSame_cts2(Tolerance: Integer; ctsInfo: Pointer; C2: PRGB32): boolean;
|
||||||
@ -425,7 +425,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
2:
|
2:
|
||||||
begin
|
begin
|
||||||
Result := AllocMem(SizeOf(TRGB32));
|
Result := AllocMem(SizeOf(TCTS2Info));
|
||||||
ColorToRGB(Color, R, G, B);
|
ColorToRGB(Color, R, G, B);
|
||||||
RGBToHSL(R, G, B, PCTS2Info(Result)^.H, PCTS2Info(Result)^.S,
|
RGBToHSL(R, G, B, PCTS2Info(Result)^.H, PCTS2Info(Result)^.S,
|
||||||
PCTS2Info(Result)^.L);
|
PCTS2Info(Result)^.L);
|
||||||
@ -1279,8 +1279,8 @@ begin
|
|||||||
SetLength(Points, C);
|
SetLength(Points, C);
|
||||||
Move(ClientTPA[0], Points[0], C * SizeOf(TPoint));
|
Move(ClientTPA[0], Points[0], C * SizeOf(TPoint));
|
||||||
Result := C > 0;
|
Result := C > 0;
|
||||||
|
Free_CTSInfo(ctsinfo);
|
||||||
TClient(Client).IOManager.FreeReturnData;
|
TClient(Client).IOManager.FreeReturnData;
|
||||||
Free_CTSInfo(ctsinfo)
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TMFinder.FindColorsToleranceOptimised(out Points: TPointArray; Color, xs, ys,
|
function TMFinder.FindColorsToleranceOptimised(out Points: TPointArray; Color, xs, ys,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user