Xteink-X4-crosspoint-reader/lib/Epub/Epub/Section.h
Dave Allie 2ed8017aa2
Move to SDK EInkDisplay and enable anti-aliased 2-bit text (#5)
* First pass at moving to SDK EInkDisplay library

* Add 2-bit grayscale text and anti-aliased rendering of text

* Render status bar for empty chapters

* Refresh screen every 15 pages to avoid ghosting

* Simplify boot and sleep screens

* Give FileSelectionScreen task more stack memory

* Move text around slightly on Boot and Sleep screens

* Re-use existing buffer and write to whole screen for 'partial update'
2025-12-08 19:48:49 +11:00

31 lines
692 B
C++

#pragma once
#include "Epub.h"
class Page;
class EpdRenderer;
class Section {
Epub* epub;
const int spineIndex;
EpdRenderer& renderer;
std::string cachePath;
void onPageComplete(const Page* page);
public:
int pageCount = 0;
int currentPage = 0;
explicit Section(Epub* epub, const int spineIndex, EpdRenderer& renderer)
: epub(epub), spineIndex(spineIndex), renderer(renderer) {
cachePath = epub->getCachePath() + "/" + std::to_string(spineIndex);
}
~Section() = default;
void writeCacheMetadata() const;
bool loadCacheMetadata();
void setupCacheDir() const;
void clearCache() const;
bool persistPageDataToSD();
Page* loadPageFromSD() const;
};