Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
mcychan authored Sep 23, 2023
1 parent 48e01dd commit f94fa37
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions nQuantCpp/GilbertCurve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ namespace Peano
auto edge = hasAlpha ? 1 : exp(weight) + .25;
ditherMax = (hasAlpha || DITHER_MAX > 9) ? (BYTE)sqr(_sqrt(DITHER_MAX) + edge) : DITHER_MAX;
if (pPalette->Count / weight > 5000 && (weight > .045 || (weight > .01 && pPalette->Count <= 64)))
ditherMax = (BYTE)sqr(5 + edge);
else if (pPalette->Count > 16 && pPalette->Count < 256)
ditherMax = (pPalette->Count / weight) < 3200 ? (BYTE) sqr(5 + edge) : (BYTE) sqr(3 + edge);
ditherMax = (BYTE) sqr(5 + edge);
else if (pPalette->Count / weight < 3200 && pPalette->Count > 16 && pPalette->Count < 256)
ditherMax = (BYTE) sqr(5 + edge);
thresold = DITHER_MAX > 9 ? -112 : -64;
auto pWeights = make_unique<float[]>(DITHER_MAX);
m_weights = pWeights.get();
Expand Down

0 comments on commit f94fa37

Please sign in to comment.