summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-07-19 13:25:20 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-01-30 11:23:50 +0100
commit2e7a28958da2be6875ab6a5329871665ca340a04 (patch)
treecf2fbb97f4446a9a28739ee60c91235408cbcd0f
parent22d0e91970b6ac53a51a715e47cae4e4209cd78b (diff)
Deprecate QImageIOHandler gamma correction
Don't do gamma correction at image decoding time, it can be a whole lot more than just a simple gamma function, so it is better to use QColorSpace and QColorTransform. Change-Id: Iebc960bad6ecdd878240be965699d2df869572ad Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
-rw-r--r--src/gui/image/qimagereader.cpp2
-rw-r--r--src/gui/image/qimagereader.h4
-rw-r--r--src/gui/image/qimagewriter.cpp2
-rw-r--r--src/gui/image/qimagewriter.h4
4 files changed, 12 insertions, 0 deletions
diff --git a/src/gui/image/qimagereader.cpp b/src/gui/image/qimagereader.cpp
index 6139cf99c9..3eb1e01863 100644
--- a/src/gui/image/qimagereader.cpp
+++ b/src/gui/image/qimagereader.cpp
@@ -1149,6 +1149,7 @@ bool QImageReader::autoTransform() const
return false;
}
+#if QT_DEPRECATED_SINCE(5, 15)
/*!
\since 5.6
@@ -1181,6 +1182,7 @@ float QImageReader::gamma() const
return d->handler->option(QImageIOHandler::Gamma).toFloat();
return 0.0;
}
+#endif
/*!
Returns \c true if an image can be read for the device (i.e., the
diff --git a/src/gui/image/qimagereader.h b/src/gui/image/qimagereader.h
index 4e9a08b6e6..7cd3b81a7d 100644
--- a/src/gui/image/qimagereader.h
+++ b/src/gui/image/qimagereader.h
@@ -117,8 +117,12 @@ public:
void setAutoTransform(bool enabled);
bool autoTransform() const;
+#if QT_DEPRECATED_SINCE(5, 15)
+ QT_DEPRECATED_VERSION_X_5_15("Use QColorSpace instead")
void setGamma(float gamma);
+ QT_DEPRECATED_VERSION_X_5_15("Use QColorSpace instead")
float gamma() const;
+#endif
QByteArray subType() const;
QList<QByteArray> supportedSubTypes() const;
diff --git a/src/gui/image/qimagewriter.cpp b/src/gui/image/qimagewriter.cpp
index 512da5c432..6e74b23f76 100644
--- a/src/gui/image/qimagewriter.cpp
+++ b/src/gui/image/qimagewriter.cpp
@@ -498,6 +498,7 @@ int QImageWriter::compression() const
return d->compression;
}
+#if QT_DEPRECATED_SINCE(5, 15)
/*!
This is an image format specific function that sets the gamma
level of the image to \a gamma. For image formats that do not
@@ -522,6 +523,7 @@ float QImageWriter::gamma() const
{
return d->gamma;
}
+#endif
/*!
\since 5.4
diff --git a/src/gui/image/qimagewriter.h b/src/gui/image/qimagewriter.h
index ef84a59b7c..5c8ed7e211 100644
--- a/src/gui/image/qimagewriter.h
+++ b/src/gui/image/qimagewriter.h
@@ -84,8 +84,12 @@ public:
void setCompression(int compression);
int compression() const;
+#if QT_DEPRECATED_SINCE(5, 15)
+ QT_DEPRECATED_VERSION_X_5_15("Use QColorSpace instead")
void setGamma(float gamma);
+ QT_DEPRECATED_VERSION_X_5_15("Use QColorSpace instead")
float gamma() const;
+#endif
void setSubType(const QByteArray &type);
QByteArray subType() const;