File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -338,8 +338,7 @@ namespace GrowingNeuralGas
338338 }
339339 }
340340 if (winner != nullptr ) {
341- // Replaces Java's synchronized(winner) block cleanly
342- #pragma omp critical(WinnerErrorAccumulation)
341+ #pragma omp critical(WinnerErrorAccumulation)
343342 {
344343 winner->error += minDist;
345344 }
@@ -626,9 +625,6 @@ namespace GrowingNeuralGas
626625 void gngquan (const vector<ARGB >& pixels, ARGB * pPalette, UINT & nMaxColors)
627626 {
628627 maxNodes = nMaxColors; // number of colours used
629- auto mDivn = min (0.9 , nMaxColors * 1.0 / pixelMap.size ());
630- if (hasSemiTransparency)
631- mDivn *= -1 ;
632628
633629 auto GetColorIndex = [&](const Color& c) -> int {
634630 return GetARGBIndex (c, hasSemiTransparency, hasAlpha ());
@@ -687,6 +683,10 @@ namespace GrowingNeuralGas
687683 return ;
688684 }
689685
686+ auto mDivn = min (0.9 , nMaxColors * 1.0 / pixelMap.size ());
687+ if (hasSemiTransparency)
688+ mDivn *= -1 ;
689+
690690 vector<shared_ptr<GNGNode>> stdDevSamples;
691691 for (const auto & [pixel, count] : histogram) {
692692 auto freq = static_cast <int >(sqrt (count));
You can’t perform that action at this time.
0 commit comments