Manga rendering mode
This commit is contained in:
15 files changed
+935
-253
No files matched your search
@@ -4,6 +4,8 @@
|
||||
#include <QByteArray>
|
||||
#include <QString>
|
||||
#include <QList>
|
||||
#include <QSize>
|
||||
#include <QVector>
|
||||
|
||||
struct TocEntry {
|
||||
QString title;
|
||||
@@ -19,6 +21,8 @@ struct Chapter {
|
||||
|
||||
class FormatReader {
|
||||
public:
|
||||
enum class RenderingMode { Scroll, Manga };
|
||||
|
||||
virtual ~FormatReader() = default;
|
||||
|
||||
virtual bool open(const QString &filePath) = 0;
|
||||
@@ -37,6 +41,12 @@ public:
|
||||
// Returns the lowercase file extension this reader handles (e.g. "txt", "epub").
|
||||
virtual QString fileType() const = 0;
|
||||
|
||||
// Rendering mode this format prefers. Defaults to Scroll; image-only formats override to Manga.
|
||||
virtual RenderingMode preferredRenderingMode() const { return RenderingMode::Scroll; }
|
||||
|
||||
// Natural pixel sizes for each chunk in a chapter, parallel to loadChapter().contentChunks.
|
||||
// Empty by default; image-based readers override to provide aspect ratios for page pairing.
|
||||
virtual QVector<QSize> chapterPageSizes(int chapterIndex) const { Q_UNUSED(chapterIndex); return {}; }
|
||||
};
|
||||
|
||||
#endif // FORMATREADER_H
|
||||
Reference in new issue
Block a user