Combined brightness/contrast/gamma adjustment
| 41 | } |
| 42 | // Combined brightness/contrast/gamma adjustment |
| 43 | int 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 |
| 57 | uint8_t quantizeSimple(int gray) { |
no test coverage detected