MCPcopy Create free account
hub / github.com/crosspoint-reader/crosspoint-reader / adjustPixel

Function adjustPixel

lib/GfxRenderer/BitmapHelpers.cpp:43–54  ·  view source on GitHub ↗

Combined brightness/contrast/gamma adjustment

Source from the content-addressed store, hash-verified

41}
42// Combined brightness/contrast/gamma adjustment
43int adjustPixel(int gray) {
44 if (!USE_BRIGHTNESS) return gray;
45
46 // Order: contrast first, then brightness, then gamma
47 gray = applyContrast(gray);
48 gray += BRIGHTNESS_BOOST;
49 if (gray > 255) gray = 255;
50 if (gray < 0) gray = 0;
51 gray = applyGamma(gray);
52
53 return gray;
54}
55// Simple quantization without dithering - divide into 4 levels
56// The thresholds are fine-tuned to the X4 display
57uint8_t quantizeSimple(int gray) {

Callers 6

writeOutputRowFunction · 0.85
flushScaledRowFunction · 0.85
processPixelMethod · 0.85
readNextRowMethod · 0.85
quantize1bitFunction · 0.85

Calls 2

applyContrastFunction · 0.85
applyGammaFunction · 0.85

Tested by

no test coverage detected