mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Rendering tool + benchmarking tool
This commit is contained in:
@ -19,6 +19,7 @@
|
||||
#define PDFTOOLRENDER_H
|
||||
|
||||
#include "pdftoolabstractapplication.h"
|
||||
#include "pdfexception.h"
|
||||
|
||||
namespace pdftool
|
||||
{
|
||||
@ -27,6 +28,31 @@ class PDFToolRenderBase : public PDFToolAbstractApplication
|
||||
{
|
||||
public:
|
||||
virtual int execute(const PDFToolOptions& options) override;
|
||||
|
||||
protected:
|
||||
virtual void finish(const PDFToolOptions& options) = 0;
|
||||
virtual void onPageRendered(const PDFToolOptions& options, pdf::PDFRenderedPageImage& renderedPageImage) = 0;
|
||||
|
||||
void writePageInfoStatistics(const pdf::PDFRenderedPageImage& renderedPageImage);
|
||||
|
||||
void writeStatistics(PDFOutputFormatter& formatter);
|
||||
void writePageStatistics(PDFOutputFormatter& formatter);
|
||||
void writeErrors(PDFOutputFormatter& formatter);
|
||||
|
||||
struct PageInfo
|
||||
{
|
||||
bool isRendered = false;
|
||||
pdf::PDFInteger pageIndex = 0;
|
||||
qint64 pageCompileTime = 0;
|
||||
qint64 pageWaitTime = 0;
|
||||
qint64 pageRenderTime = 0;
|
||||
qint64 pageTotalTime = 0;
|
||||
qint64 pageWriteTime = 0;
|
||||
std::vector<pdf::PDFRenderError> errors;
|
||||
};
|
||||
|
||||
std::vector<PageInfo> m_pageInfo;
|
||||
qint64 m_wallTime = 0;
|
||||
};
|
||||
|
||||
class PDFToolRender : public PDFToolRenderBase
|
||||
@ -34,6 +60,10 @@ class PDFToolRender : public PDFToolRenderBase
|
||||
public:
|
||||
virtual QString getStandardString(StandardString standardString) const override;
|
||||
virtual Options getOptionsFlags() const override;
|
||||
|
||||
protected:
|
||||
virtual void finish(const PDFToolOptions& options) override;
|
||||
virtual void onPageRendered(const PDFToolOptions& options, pdf::PDFRenderedPageImage& renderedPageImage) override;
|
||||
};
|
||||
|
||||
class PDFToolBenchmark : public PDFToolRenderBase
|
||||
@ -41,6 +71,10 @@ class PDFToolBenchmark : public PDFToolRenderBase
|
||||
public:
|
||||
virtual QString getStandardString(StandardString standardString) const override;
|
||||
virtual Options getOptionsFlags() const override;
|
||||
|
||||
protected:
|
||||
virtual void finish(const PDFToolOptions& options) override;
|
||||
virtual void onPageRendered(const PDFToolOptions& options, pdf::PDFRenderedPageImage& renderedPageImage) override;
|
||||
};
|
||||
|
||||
} // namespace pdftool
|
||||
|
Reference in New Issue
Block a user