1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-11-23 17:52:16 -05:00

MMLCore/finder: Small cleanup.

This commit is contained in:
Merlijn Wajer 2011-08-01 13:58:49 +02:00
parent 2414f60c08
commit 464b90d42b

View File

@ -431,28 +431,28 @@ begin
case cts of case cts of
0: 0:
begin begin
Result := AllocMem(SizeOf(TCTS0Info)); Result := AllocMem(SizeOf(TCTS0Info));
ColorToRGB(Color, PCTS0Info(Result)^.R, PCTS0Info(Result)^.G, ColorToRGB(Color, PCTS0Info(Result)^.R, PCTS0Info(Result)^.G,
PCTS0Info(Result)^.B); PCTS0Info(Result)^.B);
PCTS0Info(Result)^.Tol := Tol; PCTS0Info(Result)^.Tol := Tol;
end; end;
1: 1:
begin begin
Result := AllocMem(SizeOf(TCTS1Info)); Result := AllocMem(SizeOf(TCTS1Info));
ColorToRGB(Color, PCTS1Info(Result)^.R, PCTS1Info(Result)^.G, ColorToRGB(Color, PCTS1Info(Result)^.R, PCTS1Info(Result)^.G,
PCTS1Info(Result)^.B); PCTS1Info(Result)^.B);
PCTS1Info(Result)^.Tol := Tol * Tol; PCTS1Info(Result)^.Tol := Tol * Tol;
end; end;
2: 2:
begin begin
Result := AllocMem(SizeOf(TCTS2Info)); 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);
PCTS2Info(Result)^.hueMod := Tol * hueMod; PCTS2Info(Result)^.hueMod := Tol * hueMod;
PCTS2Info(Result)^.satMod := Tol * satMod; PCTS2Info(Result)^.satMod := Tol * satMod;
PCTS2Info(Result)^.Tol := Tol; PCTS2Info(Result)^.Tol := Tol;
end; end;
end; end;
end; end;
@ -1192,29 +1192,6 @@ var
compare: TCTSCompareFunction; compare: TCTSCompareFunction;
ctsinfo: TCTSInfo; ctsinfo: TCTSInfo;
{ procedure cts3;
begin
RGBToXYZ(clR, clG, clB, X, Y, Z);
XYZToCieLab(X, Y, Z, L1, A1, B1);
for yy := ys to ye do
begin
for xx := xs to xe do
begin
RGBToXYZ(Ptr^.R, Ptr^.G, Ptr^.B, X, Y, Z);
XYZtoCIELab(X, Y, Z, L2, A2, B2);
if Sqrt(sqr(L1 - L2) + sqr(A1 - A2) +
sqr(B1 - B2)) <= Tol then
begin
ClientTPA[c].x := xx;
ClientTPA[c].y := yy;
Inc(c);
end;
Inc(Ptr)
end;
Inc(Ptr, PtrInc);
end;
end; }
begin begin
Result := false; Result := false;
DefaultOperations(xs,ys,xe,ye); DefaultOperations(xs,ys,xe,ye);