summaryrefslogtreecommitdiffstats
path: root/src/plugins/imageformats/dds/qddshandler.cpp
diff options
context:
space:
mode:
authorABBAPOH <ABBAPOH@nextmail.ru>2013-12-01 12:47:10 +0400
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-12-02 09:51:20 +0100
commita5f8d2544def6aaad020ac3a8c8297295eeb2407 (patch)
tree8e16f47b507eaaff307099460f957228cdbfb5c3 /src/plugins/imageformats/dds/qddshandler.cpp
parent4d1b0a0d58d90eddfe5242cb3b3b6ca68b8b2077 (diff)
Add support for QImageIOHandler::Size option in DDS handler.
Change-Id: I7c9fc452142d9827269ebf9b6b2778c2b0eb55da Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src/plugins/imageformats/dds/qddshandler.cpp')
-rw-r--r--src/plugins/imageformats/dds/qddshandler.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/plugins/imageformats/dds/qddshandler.cpp b/src/plugins/imageformats/dds/qddshandler.cpp
index 4d4d9d9..8dd5ed3 100644
--- a/src/plugins/imageformats/dds/qddshandler.cpp
+++ b/src/plugins/imageformats/dds/qddshandler.cpp
@@ -1316,6 +1316,26 @@ bool QDDSHandler::write(const QImage &outImage)
return true;
}
+QVariant QDDSHandler::option(QImageIOHandler::ImageOption option) const
+{
+ if (!supportsOption(option) || !ensureHeaderCached())
+ return QVariant();
+
+ switch (option) {
+ case QImageIOHandler::Size:
+ return QSize(m_header.width, m_header.height);
+ default:
+ break;
+ }
+
+ return QVariant();
+}
+
+bool QDDSHandler::supportsOption(QImageIOHandler::ImageOption option) const
+{
+ return option == QImageIOHandler::Size;
+}
+
int QDDSHandler::imageCount() const
{
if (!ensureHeaderCached())