Establish LUT cache

This commit is contained in:
jpirnay
2026-02-28 16:19:45 +01:00
parent 67fc407d63
commit 19c197e020
2 changed files with 37 additions and 20 deletions
+3 -1
View File
@@ -1,6 +1,7 @@
#pragma once
#include <functional>
#include <memory>
#include <vector>
#include "Epub.h"
@@ -13,6 +14,7 @@ class Section {
GfxRenderer& renderer;
std::string filePath;
FsFile file;
std::vector<uint32_t> lut; // Cached page byte-offsets; loaded once, avoids per-page LUT seek
void writeSectionFileHeader(int fontId, float lineCompression, bool extraParagraphSpacing, uint8_t paragraphAlignment,
uint16_t viewportWidth, uint16_t viewportHeight, bool hyphenationEnabled,
@@ -31,7 +33,7 @@ class Section {
~Section() = default;
bool loadSectionFile(int fontId, float lineCompression, bool extraParagraphSpacing, uint8_t paragraphAlignment,
uint16_t viewportWidth, uint16_t viewportHeight, bool hyphenationEnabled, bool embeddedStyle);
bool clearCache() const;
bool clearCache();
bool createSectionFile(int fontId, float lineCompression, bool extraParagraphSpacing, uint8_t paragraphAlignment,
uint16_t viewportWidth, uint16_t viewportHeight, bool hyphenationEnabled, bool embeddedStyle,
const std::function<void()>& popupFn = nullptr);