Move options for dithering and brightness to run time, fix BMP.

This commit is contained in:
Jonas Diemer
2026-01-09 14:39:04 +01:00
parent d4ae108d9b
commit 7838660ff5
3 changed files with 23 additions and 25 deletions

View File

@@ -2,6 +2,8 @@
#include <SdFat.h>
#include <cstdint>
enum class BmpReaderError : uint8_t {
Ok = 0,
FileInvalid,
@@ -28,7 +30,8 @@ class Bitmap {
public:
static const char* errorToString(BmpReaderError err);
explicit Bitmap(FsFile& file) : file(file) {}
explicit Bitmap(FsFile& file, bool useFloydSteinberg = false, uint8_t brightnessBoost = 0)
: file(file), useFloydSteinberg(useFloydSteinberg), brightnessBoost(brightnessBoost) {}
~Bitmap();
BmpReaderError parseHeaders();
BmpReaderError readNextRow(uint8_t* data, uint8_t* rowBuffer) const;
@@ -44,6 +47,8 @@ class Bitmap {
static uint32_t readLE32(FsFile& f);
FsFile& file;
bool useFloydSteinberg = false;
uint8_t brightnessBoost = 0;
int width = 0;
int height = 0;
bool topDown = false;