Brings ~55 mod-exclusive files to the upstream-based mod/master-resync branch: Activities (migrated to new ActivityManager pattern): - Clock/Time: SetTimeActivity, SetTimezoneOffsetActivity, NtpSyncActivity - Dictionary: DictionaryDefinitionActivity, DictionarySuggestionsActivity, DictionaryWordSelectActivity, LookedUpWordsActivity - Bookmark: EpubReaderBookmarkSelectionActivity - Book management: BookManageMenuActivity, EndOfBookMenuActivity - OPDS: OpdsServerListActivity, OpdsSettingsActivity - Utility: DirectoryPickerActivity, NumericStepperActivity Utilities (unchanged): - BookManager, BookSettings, BookmarkStore, BootNtpSync - Dictionary, LookupHistory, TimeSync, OpdsServerStore Libraries: PlaceholderCover, TableData, ChapterXPathIndexer Scripts: inject_mod_version, generate_book_icon, preview_placeholder_cover Docs: KOReader sync XPath mapping Migration changes: - ActivityWithSubactivity -> Activity base class - Callback constructors -> finish()/setResult() pattern - enterNewActivity() -> startActivityForResult() - Activity::RenderLock&& -> RenderLock&& These files won't compile yet - they reference mod settings and I18n strings that will be added in subsequent phases. Made-with: Cursor
1.9 KiB
1.9 KiB
Revert Letterbox Fill to Dithered / Solid / None (with edge cache)
Date: 2026-02-13
Task
Reverted letterbox fill modes from None/Solid/Extend Edges back to Dithered (default)/Solid/None per user request. Restored Bayer ordered dithering for "Dithered" mode and re-introduced edge average caching to avoid recomputing on every sleep.
Changes Made
src/CrossPointSettings.h
- Reordered enum:
LETTERBOX_DITHERED=0,LETTERBOX_SOLID=1,LETTERBOX_NONE=2 - Changed default from
LETTERBOX_NONEtoLETTERBOX_DITHERED
src/SettingsList.h
- Updated UI labels from
{"None", "Solid", "Extend Edges"}to{"Dithered", "Solid", "None"}
src/activities/boot_sleep/SleepActivity.h
- Added
#include <string> - Restored
edgeCachePathparameter torenderBitmapSleepScreen()
src/activities/boot_sleep/SleepActivity.cpp
- Removed:
getPackedPixel(),setPackedPixel(), all EXTENDED-mode logic,freeEdgeData(), per-pixel edge arrays - Simplified
LetterboxFillDatato justavgA,avgB,letterboxA,letterboxB,horizontal,valid - Restored
BAYER_4X4[4][4]matrix andquantizeBayerDither()function - Renamed
computeEdgeData()→computeEdgeAverages()(averages-only, no edge pixel capture) - Added edge average cache:
loadEdgeCache()/saveEdgeCache()(~12 byte binary file per cover) - Updated
drawLetterboxFill(): DITHERED uses Bayer dithering, SOLID uses snap-to-level - Updated
renderBitmapSleepScreen(): acceptsedgeCachePath, tries cache before computing - Updated
renderCoverSleepScreen(): derivesedgeCachePathfrom cover BMP path (_edges.bin)
Build
Compilation succeeds (ESP32-C3 target, PlatformIO).
Follow-up
- The specific "The World in a Grain" cover still has rendering issues with dithered mode — to be investigated separately
- Custom sleep BMPs (
/sleep/directory,/sleep.bmp) intentionally skip caching since the selected BMP can change each sleep