| 1 | // Copyright (C) 2016 The Qt Company Ltd. |
|---|---|
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QTIFFHANDLER_P_H |
| 5 | #define QTIFFHANDLER_P_H |
| 6 | |
| 7 | #include <QtCore/QScopedPointer> |
| 8 | #include <QtGui/QImageIOHandler> |
| 9 | |
| 10 | QT_BEGIN_NAMESPACE |
| 11 | |
| 12 | class QTiffHandlerPrivate; |
| 13 | class QTiffHandler : public QImageIOHandler |
| 14 | { |
| 15 | public: |
| 16 | QTiffHandler(); |
| 17 | |
| 18 | bool canRead() const override; |
| 19 | bool read(QImage *image) override; |
| 20 | bool write(const QImage &image) override; |
| 21 | |
| 22 | static bool canRead(QIODevice *device); |
| 23 | |
| 24 | QVariant option(ImageOption option) const override; |
| 25 | void setOption(ImageOption option, const QVariant &value) override; |
| 26 | bool supportsOption(ImageOption option) const override; |
| 27 | |
| 28 | bool jumpToNextImage() override; |
| 29 | bool jumpToImage(int imageNumber) override; |
| 30 | int imageCount() const override; |
| 31 | int currentImageNumber() const override; |
| 32 | |
| 33 | enum Compression { |
| 34 | NoCompression = 0, |
| 35 | LzwCompression = 1 |
| 36 | }; |
| 37 | private: |
| 38 | void convert32BitOrder(void *buffer, int width); |
| 39 | void rgb48fixup(QImage *image, bool floatingPoint); |
| 40 | void rgb96fixup(QImage *image); |
| 41 | void rgbFixup(QImage *image); |
| 42 | const QScopedPointer<QTiffHandlerPrivate> d; |
| 43 | bool ensureHaveDirectoryCount() const; |
| 44 | }; |
| 45 | |
| 46 | QT_END_NAMESPACE |
| 47 | |
| 48 | #endif // QTIFFHANDLER_P_H |
| 49 |
