diff options
author | ZackaryWelch <welch.zackary@gmail.com> | 2018-03-17 19:26:08 -0400 |
---|---|---|
committer | ZackaryWelch <welch.zackary@gmail.com> | 2018-03-17 19:26:08 -0400 |
commit | 1e2d9a567a217c5ca3374bc307038e7a65be1c55 (patch) | |
tree | a9a122724603f75e811ee937a995f059a8022d2c /src-qt5/desktop-utils/lumina-pdf/Renderer.h | |
parent | Replaced tabs with spaces and removed some unneeded comments (diff) | |
download | lumina-1e2d9a567a217c5ca3374bc307038e7a65be1c55.tar.gz lumina-1e2d9a567a217c5ca3374bc307038e7a65be1c55.tar.bz2 lumina-1e2d9a567a217c5ca3374bc307038e7a65be1c55.zip |
Moved rotation to the Backend. Fixed memory issues in MuPDF but caused other in Poppler. Poppler consumes a lot of memory already and should no long be default once all memory issuse are sorted out in MuPDF.
Diffstat (limited to 'src-qt5/desktop-utils/lumina-pdf/Renderer.h')
-rw-r--r-- | src-qt5/desktop-utils/lumina-pdf/Renderer.h | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src-qt5/desktop-utils/lumina-pdf/Renderer.h b/src-qt5/desktop-utils/lumina-pdf/Renderer.h index b983d14b..870267a8 100644 --- a/src-qt5/desktop-utils/lumina-pdf/Renderer.h +++ b/src-qt5/desktop-utils/lumina-pdf/Renderer.h @@ -1,5 +1,4 @@ -// ================================ -// Simple abstraction class between backend renderers +// ================================ // Simple abstraction class between backend renderers // ================================ // Written by Ken Moore: Feb 26, 2018 // Available under the 3-Clause BSD License @@ -22,6 +21,7 @@ private: QString docpath; //save the path for the currently-loaded document QString doctitle; QJsonObject jobj; + int degrees; public: Renderer(); @@ -33,20 +33,27 @@ public: bool needPassword(){ return needpass; } QString title(){ return doctitle; } QJsonObject properties() { return jobj; } + int hashSize(); + QImage imageHash(int pagenum); + int rotatedDegrees() { return degrees; } //Main access functions bool loadDocument(QString path, QString password); - void renderPage(int pagenum, QSize DPI); + void renderPage(int pagenum, QSize DPI, int degrees=0); QList<TextData*> searchDocument(QString text, bool matchCase); - void cleanup(); - QImage imageHash(int pagenum); - int hashSize(); - void clearHash(); + void clearHash(); + //Makes sure degrees is between 0 and 360 then rotates the matrix and + void setDegrees(int degrees) { + //Mods by 360, but adds and remods because of how C++ treats negative mods + this->degrees = ( ( ( this->degrees + degrees ) % 360 ) + 360 ) % 360; + emit reloadPages(this->degrees); + } signals: void PageLoaded(int); void OrigSize(QSizeF); + void reloadPages(int); }; #endif |