MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / dither

Function dither

rEFIt_UEFI/libeg/FloatLib.cpp:379–391  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

377}
378
379int dither(float x, int level)
380{
381 if (!level) {
382 return (int)x;
383 }
384 int i = (int)(x) * level; //5.1 * 4 = 20.4, 5.8 * 4 = 23.2|i=20
385 float dx = x * level - (float)(i); //0.4, 3.2
386 i /= level;
387 if (dx > rndf() * level) {
388 i += (int)((0.9999f+rndf())*level); //because rndf has mean value 0.5, but (int)rnd=0
389 }
390 return i;
391}
392//there is
393#if 0
394BOOLEAN

Callers 2

nsvg__scanlineSolidFunction · 0.85
testSVGFunction · 0.85

Calls 1

rndfFunction · 0.70

Tested by

no test coverage detected