Enhance Xtc class with page and chapter methods

Add methods for loading page batches and retrieving chapter information.
This commit is contained in:
icannotttt 2026-01-29 19:05:39 +08:00 committed by GitHub
parent da4d3b5ea5
commit 24afc3be03
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -73,6 +73,43 @@ class Xtc {
uint16_t getPageHeight() const;
uint8_t getBitDepth() const; // 1 = XTC (1-bit), 2 = XTCH (2-bit)
/**
*
*/
xtc::XtcError loadNextPageBatch() const {
return parser ? parser->loadNextPageBatch() : xtc::XtcError::FILE_NOT_FOUND;
}
xtc::XtcError loadPageBatchByStart(uint16_t startPage) const {
return parser ? parser->loadPageBatchByStart(startPage): xtc::XtcError::FILE_NOT_FOUND;
}
/**
*
*/
uint16_t getLoadedMaxPage() const {
return parser ? parser->getLoadedMaxPage() : 0;
}
/**
*
*/
uint16_t getPageBatchSize() const {
return parser ? parser->getPageBatchSize() : 10;
}
xtc::XtcError readChapters_gd(uint16_t chapterStart) const {
return parser ? parser->readChapters_gd(chapterStart) : xtc::XtcError::FILE_NOT_FOUND;
}
uint32_t getChapterstartpage(int chapterIndex) {
return parser ? parser->getChapterstartpage(chapterIndex) : 0;
}
std::string getChapterTitleByIndex(int chapterIndex) {
return parser ? parser->getChapterTitleByIndex(chapterIndex) : "";
}
/**
* Load page bitmap data
* @param pageIndex Page index (0-based)