Commit Graph

5 Commits

Author SHA1 Message Date
Eunchurn Park
fbda7aa4f1
feat(home): Improve Continue Reading cover with 1-bit Atkinson dithering
- Add 1-bit BMP generation with Atkinson dithering for better quality thumbnails
- Replace noise dithering with error diffusion for smoother gradients
- Add fillPolygon() to GfxRenderer for proper bookmark ribbon shape
- Change bookmark from rect+triangle carve to pentagon polygon
- Fix bookmark inversion when Continue Reading card is selected
- Show selection state on first render (not just after navigation)
- Fix 1-bit BMP palette lookup in Bitmap::readRow()
- Add drawBitmap1Bit() optimized path for 1-bit BMPs
The 1-bit format eliminates gray passes on home screen for faster rendering
while Atkinson dithering maintains good image quality through error diffusion.
2026-01-05 00:47:42 +09:00
Eunchurn Park
6fbdd06101
feat(home): Add cover image thumbnail to Continue Reading card
Display book cover image as background in the Continue Reading card on
the home screen, improving visual identification of the current book.

Key changes:
- Add thumbnail generation (thumb.bmp) for EPUB and XTC/XTCH files
  - Uses same dithering/scaling algorithms as sleep screen covers
  - Target size: 240x400 (half screen) for optimal Continue Reading card fit
- Add JpegToBmpConverter::jpegFileToBmpStreamWithSize() for custom target sizes
- Add GfxRenderer::copyStoredBwBuffer() and freeStoredBwBuffer() for
  framebuffer caching to maintain fast navigation performance
- Add UTF-8 safe string truncation for Korean/CJK text in title/author display
- Draw white boxes behind title/author text for readability over cover image
- Increase HomeActivityTask stack size to 4096 for cover image rendering
- Add bounds checking in XTC thumbnail generation to prevent buffer overflow
2026-01-01 23:51:11 +09:00
Dave Allie
fb5fc32c5d
Add exFAT support (#150)
## Summary

* Swap to updated SDCardManager which uses SdFat
* Add exFAT support
  * Swap to using FsFile everywhere
* Use newly exposed `SdMan` macro to get to static instance of
SDCardManager
* Move a bunch of FsHelpers up to SDCardManager
2025-12-30 16:09:30 +11:00
Sam Davis
278b056bd0
Add chapter select support to XTC files (#145)
Some checks are pending
CI / build (push) Waiting to run
## Summary

- **What is the goal of this PR?** Add chapter selection support to the
XTC reader activity, including parsing chapter metadata from XTC files.
- **What changes are included?** Implemented XTC chapter parsing and
exposure in the XTC library, added a chapter selection activity for XTC,
integrated it into XtcReaderActivity, and normalized chapter page
indices by shifting them to 0-based.

  ## Additional Context

- The reader uses 0-based page indexing (first page = 0), but the XTC
chapter table appears to be 1-based (first page = 1), so chapter
start/end pages are shifted down by 1 during parsing.
2025-12-30 12:49:18 +11:00
Eunchurn Park
f9b604f04e
Add XTC/XTCH ebook format support (#135)
## Summary

* **What is the goal of this PR?**

Add support for XTC (XTeink X4 native) ebook format, which contains
pre-rendered 480x800 1-bit bitmap pages optimized for e-ink displays.

* **What changes are included?**

- New `lib/Xtc/` library with XtcParser for reading XTC files
- XtcReaderActivity for displaying XTC pages on e-ink display
- XTC file detection in FileSelectionActivity
- Cover BMP generation from first XTC page
- Correct XTG page header structure (22 bytes) and bit polarity handling

## Additional Context

- XTC files contain pre-rendered bitmap pages with embedded status bar
(page numbers, progress %)
- XTG page header: 22 bytes (magic + dimensions + reserved fields +
bitmap size)
- Bit polarity: 0 = black, 1 = white
- No runtime text rendering needed - pages display directly on e-ink
- Faster page display compared to EPUB since no parsing/rendering
required
- Memory efficient: loads one page at a time (48KB per page)
- Tested with XTC files generated from https://x4converter.rho.sh/
- Verified correct page alignment and color rendering
- Please report any issues if you test with XTC files from other
sources.

---------

Co-authored-by: Dave Allie <dave@daveallie.com>
2025-12-29 01:56:05 +11:00