riwu
2012-11-13 01:39:28
This color finding function, for some reason, is taking wayyy too long to execute (> 1min!).
EDIT: I realize it's not the color finding, but
SplitTPAWrap(TPA, 8, ATPA);
that is taking very long, anyway to make it faster?
EDIT2: Replacing SplitTPAWrap with FloodFillTPA solves the problem.
But i don't feel secure using it without a full understanding of how FloodFillTPA works. Also it doesn't have a wrapper function so would it cause memory leak?
It may be due to the extensive amount of color i'm gathering:
//HueMod, SatMod, Col, Tol
ColInfo:=[TVariantArray([0.20, 0.07, 5987935, 20]),
TVariantArray([0.39, 1.14, 6842467, 15])];
SetLength(ATPA, Length(ColInfo));
ColorToleranceSpeed(2);
for i:=0 to High(ColInfo) do
begin
SetColorSpeed2Modifiers(ColInfo[i][0], ColInfo[i][1]);
FindColorsTolerance(ATPA[i], ColInfo[i][2], MSX1,MSY1,MSX2,MSY2,ColInfo[i][3]);
end;
ColorToleranceSpeed(1);
MergeATPAWrap(ATPA, TPA);
SplitTPAWrap(TPA, 8, ATPA);
EDIT: I realize it's not the color finding, but
SplitTPAWrap(TPA, 8, ATPA);
that is taking very long, anyway to make it faster?
EDIT2: Replacing SplitTPAWrap with FloodFillTPA solves the problem.
But i don't feel secure using it without a full understanding of how FloodFillTPA works. Also it doesn't have a wrapper function so would it cause memory leak?
It may be due to the extensive amount of color i'm gathering: