From 464b90d42bccf931451054b350ac53402aec4192 Mon Sep 17 00:00:00 2001 From: Merlijn Wajer Date: Mon, 1 Aug 2011 13:58:49 +0200 Subject: [PATCH] MMLCore/finder: Small cleanup. --- Units/MMLCore/finder.pas | 53 ++++++++++++---------------------------- 1 file changed, 15 insertions(+), 38 deletions(-) diff --git a/Units/MMLCore/finder.pas b/Units/MMLCore/finder.pas index 9a01486..87b16a8 100644 --- a/Units/MMLCore/finder.pas +++ b/Units/MMLCore/finder.pas @@ -431,28 +431,28 @@ begin case cts of 0: begin - Result := AllocMem(SizeOf(TCTS0Info)); - ColorToRGB(Color, PCTS0Info(Result)^.R, PCTS0Info(Result)^.G, - PCTS0Info(Result)^.B); - PCTS0Info(Result)^.Tol := Tol; + Result := AllocMem(SizeOf(TCTS0Info)); + ColorToRGB(Color, PCTS0Info(Result)^.R, PCTS0Info(Result)^.G, + PCTS0Info(Result)^.B); + PCTS0Info(Result)^.Tol := Tol; end; 1: begin - Result := AllocMem(SizeOf(TCTS1Info)); - ColorToRGB(Color, PCTS1Info(Result)^.R, PCTS1Info(Result)^.G, - PCTS1Info(Result)^.B); + Result := AllocMem(SizeOf(TCTS1Info)); + ColorToRGB(Color, PCTS1Info(Result)^.R, PCTS1Info(Result)^.G, + PCTS1Info(Result)^.B); - PCTS1Info(Result)^.Tol := Tol * Tol; + PCTS1Info(Result)^.Tol := Tol * Tol; end; 2: begin - Result := AllocMem(SizeOf(TCTS2Info)); - ColorToRGB(Color, R, G, B); - RGBToHSL(R, G, B, PCTS2Info(Result)^.H, PCTS2Info(Result)^.S, - PCTS2Info(Result)^.L); - PCTS2Info(Result)^.hueMod := Tol * hueMod; - PCTS2Info(Result)^.satMod := Tol * satMod; - PCTS2Info(Result)^.Tol := Tol; + Result := AllocMem(SizeOf(TCTS2Info)); + ColorToRGB(Color, R, G, B); + RGBToHSL(R, G, B, PCTS2Info(Result)^.H, PCTS2Info(Result)^.S, + PCTS2Info(Result)^.L); + PCTS2Info(Result)^.hueMod := Tol * hueMod; + PCTS2Info(Result)^.satMod := Tol * satMod; + PCTS2Info(Result)^.Tol := Tol; end; end; end; @@ -1192,29 +1192,6 @@ var compare: TCTSCompareFunction; 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 Result := false; DefaultOperations(xs,ys,xe,ye);