From ec8e19ed4674ea0c55effbb526f2939b7594c0fd Mon Sep 17 00:00:00 2001 From: Jonas Diemer Date: Fri, 9 Jan 2026 17:39:58 +0100 Subject: [PATCH] Remove brightness boost parameter. --- lib/GfxRenderer/Bitmap.cpp | 15 ++------------- lib/GfxRenderer/Bitmap.h | 4 +--- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/lib/GfxRenderer/Bitmap.cpp b/lib/GfxRenderer/Bitmap.cpp index e8db53d..a57eb70 100644 --- a/lib/GfxRenderer/Bitmap.cpp +++ b/lib/GfxRenderer/Bitmap.cpp @@ -32,16 +32,6 @@ static inline int applyGamma(int gray) { return x > 255 ? 255 : x; } -// TODO: remove -static inline uint8_t boostBrightness(int gray, uint8_t boost) { - if (boost > 0) { - gray += boost; - if (gray > 255) gray = 255; - gray = applyGamma(gray); - } - return gray; -} - // Apply contrast adjustment around midpoint (128) // factor > 1.0 increases contrast, < 1.0 decreases static inline int applyContrast(int gray) { @@ -320,11 +310,10 @@ BmpReaderError Bitmap::readNextRow(uint8_t* data, uint8_t* rowBuffer) const { uint8_t color; if (useFS) { // Floyd-Steinberg error diffusion - color = quantizeFloydSteinberg(boostBrightness(lum, brightnessBoost), currentX, width, errorCurRow, errorNextRow, - false); + color = quantizeFloydSteinberg(adjustPixel(lum), currentX, width, errorCurRow, errorNextRow, false); } else { // Simple quantization or noise dithering - color = quantize(boostBrightness(lum, brightnessBoost), currentX, prevRowY); + color = quantize(adjustPixel(lum), currentX, prevRowY); } currentOutByte |= (color << bitShift); if (bitShift == 0) { diff --git a/lib/GfxRenderer/Bitmap.h b/lib/GfxRenderer/Bitmap.h index c7e0538..4c1bf09 100644 --- a/lib/GfxRenderer/Bitmap.h +++ b/lib/GfxRenderer/Bitmap.h @@ -30,8 +30,7 @@ class Bitmap { public: static const char* errorToString(BmpReaderError err); - explicit Bitmap(FsFile& file, bool useFloydSteinberg = false, uint8_t brightnessBoost = 0) - : file(file), useFloydSteinberg(useFloydSteinberg), brightnessBoost(brightnessBoost) {} + explicit Bitmap(FsFile& file, bool useFloydSteinberg = false) : file(file), useFloydSteinberg(useFloydSteinberg) {} ~Bitmap(); BmpReaderError parseHeaders(); BmpReaderError readNextRow(uint8_t* data, uint8_t* rowBuffer) const; @@ -48,7 +47,6 @@ class Bitmap { FsFile& file; bool useFloydSteinberg = false; - uint8_t brightnessBoost = 0; int width = 0; int height = 0; bool topDown = false;