Skip to content

Commit

Permalink
Update GilbertCurve.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
mcychan authored Feb 6, 2025
1 parent 3584130 commit 41d9ec3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nQuantCpp/GilbertCurve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,15 +278,15 @@ namespace Peano
m_hasAlpha = weight < 0;

errorq.clear();
sortedByYDiff = !m_hasAlpha && m_saliencies && m_nMaxColor >= 128 && weight >= .052;
weight = abs(weight);
margin = weight < .0025 ? 12 : weight < .004 ? 8 : 6;
sortedByYDiff = !m_hasAlpha && m_saliencies && m_nMaxColor >= 128 && weight >= .052;
beta = m_nMaxColor > 8 ? m_nMaxColor > 24 ? .25f : .7f : 1;
if (m_nMaxColor > 64 || weight > .02)
beta *= .4f;
DITHER_MAX = weight < .01 ? (weight > .0025) ? (BYTE)25 : 16 : 9;
auto edge = m_hasAlpha ? 1 : exp(weight) + .25;
auto deviation = weight > .002 ? .25 : 1;
auto deviation = !hasAlpha && weight > .002 ? .25 : 1;
ditherMax = (m_hasAlpha || DITHER_MAX > 9) ? (BYTE)sqr(_sqrt(DITHER_MAX) + edge * deviation) : DITHER_MAX;
int density = m_nMaxColor > 16 ? 3200 : 1500;
if (m_nMaxColor / weight > 5000 && (weight > .045 || (weight > .01 && m_nMaxColor <= 64)))
Expand Down

0 comments on commit 41d9ec3

Please sign in to comment.