Eunchurn Park 9aa305700c
Add Bayer 4x4 ordered dithering for EPUB cover images
Replace simple threshold-based grayscale quantization with ordered
dithering using a 4x4 Bayer matrix. This eliminates color banding
artifacts and produces smoother gradients on e-ink display.

- Add 4x4 Bayer dithering matrix for 16-level threshold patterns
- Modify grayscaleTo2Bit() to use pixel position for dithering
- Simulates smooth grayscale transitions in BW mode without flicker
2025-12-24 03:45:34 +09:00

16 lines
473 B
C++

#pragma once
#include <FS.h>
class ZipFile;
class JpegToBmpConverter {
static void writeBmpHeader(Print& bmpOut, int width, int height);
static uint8_t grayscaleTo2Bit(uint8_t grayscale, int x, int y);
static unsigned char jpegReadCallback(unsigned char* pBuf, unsigned char buf_size,
unsigned char* pBytes_actually_read, void* pCallback_data);
public:
static bool jpegFileToBmpStream(File& jpegFile, Print& bmpOut);
};