mod: Phase 2c-e — GfxRenderer, themes, SleepActivity, SettingsActivity, platformio
- Add drawPixelGray to GfxRenderer for letterbox fill rendering - Add PRERENDER_THUMB_HEIGHTS to UITheme for placeholder cover generation - Add [env:mod] build environment to platformio.ini - Implement sleep screen letterbox fill (solid/dithered) with edge caching in SleepActivity, including placeholder cover fallback - Add Clock settings category to SettingsActivity with timezone, NTP sync, and set-time actions; replace CalibreSettings with OpdsServerListActivity; add DynamicEnum rendering support - Add long-press book management to RecentBooksActivity Made-with: Cursor
This commit is contained in:
@@ -180,6 +180,16 @@ void GfxRenderer::drawPixel(const int x, const int y, const bool state) const {
|
||||
}
|
||||
}
|
||||
|
||||
void GfxRenderer::drawPixelGray(const int x, const int y, const uint8_t val2bit) const {
|
||||
if (renderMode == BW && val2bit < 3) {
|
||||
drawPixel(x, y);
|
||||
} else if (renderMode == GRAYSCALE_MSB && (val2bit == 1 || val2bit == 2)) {
|
||||
drawPixel(x, y, false);
|
||||
} else if (renderMode == GRAYSCALE_LSB && val2bit == 1) {
|
||||
drawPixel(x, y, false);
|
||||
}
|
||||
}
|
||||
|
||||
int GfxRenderer::getTextWidth(const int fontId, const char* text, const EpdFontFamily::Style style) const {
|
||||
const auto fontIt = fontMap.find(fontId);
|
||||
if (fontIt == fontMap.end()) {
|
||||
|
||||
@@ -83,6 +83,7 @@ class GfxRenderer {
|
||||
|
||||
// Drawing
|
||||
void drawPixel(int x, int y, bool state = true) const;
|
||||
void drawPixelGray(int x, int y, uint8_t val2bit) const;
|
||||
void drawLine(int x1, int y1, int x2, int y2, bool state = true) const;
|
||||
void drawLine(int x1, int y1, int x2, int y2, int lineWidth, bool state) const;
|
||||
void drawArc(int maxRadius, int cx, int cy, int xDir, int yDir, int lineWidth, bool state) const;
|
||||
|
||||
Reference in New Issue
Block a user