Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
mcychan committed Jul 12, 2024
1 parent 211581b commit d2b5836
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nQuantCpp/GilbertCurve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,8 @@ namespace Peano
sortedByYDiff = !m_hasAlpha && m_saliencies && m_nMaxColor >= 128 && weight >= .042;
DITHER_MAX = weight < .01 ? (weight > .0025) ? (BYTE)25 : 16 : 9;
auto edge = m_hasAlpha ? 1 : exp(weight) + .25;
ditherMax = (m_hasAlpha || DITHER_MAX > 9) ? (BYTE)sqr(_sqrt(DITHER_MAX) + edge) : DITHER_MAX;
auto deviation = 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)))
ditherMax = (BYTE)sqr(5 + edge);
Expand Down

0 comments on commit d2b5836

Please sign in to comment.