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>
This commit is contained in:
Allan Sandfeld Jensen 2019-07-19 13:25:20 +02:00
parent 22d0e91970
commit 2e7a28958d
4 changed files with 12 additions and 0 deletions

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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;