File indexing completed on 2024-12-29 04:50:59

0001 /*
0002     SPDX-FileCopyrightText: 2019 Volker Krause <vkrause@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "pdfimage.h"
0010 #include "pdfvectorpicture_p.h"
0011 
0012 #include <QImage>
0013 #include <QSharedData>
0014 #include <QTransform>
0015 
0016 #include <memory>
0017 
0018 class GfxImageColorMap;
0019 class Stream;
0020 
0021 namespace KItinerary {
0022 
0023 class PdfPagePrivate;
0024 
0025 class PdfImagePrivate : public QSharedData {
0026 public:
0027     QImage load();
0028     QImage load(Stream *str, GfxImageColorMap *colorMap);
0029 
0030     // pixel data
0031     PdfImageRef m_ref;
0032     QImage::Format m_format = QImage::Format_Invalid;
0033     PdfPagePrivate *m_page = nullptr;
0034     std::unique_ptr<GfxImageColorMap> m_colorMap;
0035 
0036     constexpr inline int refNum() const { return m_ref.m_refNum; }
0037     constexpr inline int refGen() const { return m_ref.m_refGen; }
0038 
0039     // inline raster images without a refNum
0040     QImage m_inlineImageData;
0041 
0042     // vector data
0043     PdfVectorPicture m_vectorPicture;
0044 
0045     // common
0046     QTransform m_transform;
0047     int m_width = 0;
0048     int m_height = 0;
0049     int m_sourceWidth = 0;
0050     int m_sourceHeight = 0;
0051     PdfImage::LoadingHints m_loadingHints = PdfImage::NoHint;
0052 };
0053 
0054 }
0055