summaryrefslogtreecommitdiffstats
path: root/src/gui/image
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/image')
-rw-r--r--src/gui/image/qbmphandler.cpp8
-rw-r--r--src/gui/image/qimage.cpp6
-rw-r--r--src/gui/image/qimage_p.h6
-rw-r--r--src/gui/image/qimagereader.cpp7
-rw-r--r--src/gui/image/qimagewriter.cpp2
-rw-r--r--src/gui/image/qpicture.cpp1
-rw-r--r--src/gui/image/qpictureformatplugin.cpp1
-rw-r--r--src/gui/image/qpixmap.cpp2
-rw-r--r--src/gui/image/qpixmapcache.cpp16
9 files changed, 27 insertions, 22 deletions
diff --git a/src/gui/image/qbmphandler.cpp b/src/gui/image/qbmphandler.cpp
index 062714c769..6abde5e420 100644
--- a/src/gui/image/qbmphandler.cpp
+++ b/src/gui/image/qbmphandler.cpp
@@ -143,7 +143,7 @@ static QDataStream &operator<<(QDataStream &s, const BMP_INFOHDR &bi)
return s;
}
-static int calc_shift(int mask)
+static int calc_shift(uint mask)
{
int result = 0;
while (mask && !(mask & 1)) {
@@ -207,9 +207,9 @@ static bool read_dib_body(QDataStream &s, const BMP_INFOHDR &bi, int offset, int
#endif
int w = bi.biWidth, h = bi.biHeight, nbits = bi.biBitCount;
int t = bi.biSize, comp = bi.biCompression;
- int red_mask = 0;
- int green_mask = 0;
- int blue_mask = 0;
+ uint red_mask = 0;
+ uint green_mask = 0;
+ uint blue_mask = 0;
int red_shift = 0;
int green_shift = 0;
int blue_shift = 0;
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index de1e555771..975ef54d6b 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -99,8 +99,6 @@ QImageData::QImageData()
format(QImage::Format_ARGB32), bytes_per_line(0),
ser_no(qimage_serial_number.fetchAndAddRelaxed(1)),
detach_no(0),
- ldpmx(qt_defaultDpiX() * 100 / qreal(2.54)),
- ldpmy(qt_defaultDpiY() * 100 / qreal(2.54)),
dpmx(qt_defaultDpiX() * 100 / qreal(2.54)),
dpmy(qt_defaultDpiY() * 100 / qreal(2.54)),
offset(0, 0), own_data(true), ro_data(false), has_alpha_clut(false),
@@ -4984,11 +4982,11 @@ int QImage::metric(PaintDeviceMetric metric) const
return d->depth;
case PdmDpiX:
- return qRound(d->ldpmx * 0.0254);
+ return qRound(d->dpmx * 0.0254);
break;
case PdmDpiY:
- return qRound(d->ldpmy * 0.0254);
+ return qRound(d->dpmy * 0.0254);
break;
case PdmPhysicalDpiX:
diff --git a/src/gui/image/qimage_p.h b/src/gui/image/qimage_p.h
index e79eb9d562..18c686e917 100644
--- a/src/gui/image/qimage_p.h
+++ b/src/gui/image/qimage_p.h
@@ -82,10 +82,8 @@ struct Q_GUI_EXPORT QImageData { // internal image data
int ser_no; // serial number
int detach_no;
- qreal ldpmx; // logical dots per meter X (or 0)
- qreal ldpmy; // logical dots per meter Y (or 0)
- qreal dpmx; // device dots per meter X (or 0)
- qreal dpmy; // device dots per meter Y (or 0)
+ qreal dpmx; // dots per meter X (or 0)
+ qreal dpmy; // dots per meter Y (or 0)
QPoint offset; // offset in pixels
uint own_data : 1;
diff --git a/src/gui/image/qimagereader.cpp b/src/gui/image/qimagereader.cpp
index 286169426e..89930f3b20 100644
--- a/src/gui/image/qimagereader.cpp
+++ b/src/gui/image/qimagereader.cpp
@@ -162,11 +162,14 @@ enum _qt_BuiltInFormatType {
#endif
#ifndef QT_NO_IMAGEFORMAT_JPEG
_qt_JpgFormat,
+ _qt_JpegFormat,
#endif
#ifdef QT_BUILTIN_GIF_READER
_qt_GifFormat,
#endif
+#ifndef QT_NO_IMAGEFORMAT_BMP
_qt_BmpFormat,
+#endif
#ifndef QT_NO_IMAGEFORMAT_PPM
_qt_PpmFormat,
_qt_PgmFormat,
@@ -195,11 +198,14 @@ static const _qt_BuiltInFormatStruct _qt_BuiltInFormats[] = {
#endif
#ifndef QT_NO_IMAGEFORMAT_JPEG
{_qt_JpgFormat, "jpg", "image/jpeg"},
+ {_qt_JpegFormat, "jpeg"},
#endif
#ifdef QT_BUILTIN_GIF_READER
{_qt_GifFormat, "gif", "image/gif"},
#endif
+#ifndef QT_NO_IMAGEFORMAT_BMP
{_qt_BmpFormat, "bmp", "image/bmp"},
+#endif
#ifndef QT_NO_IMAGEFORMAT_PPM
{_qt_PpmFormat, "ppm", "image/x-portable-pixmap"},
{_qt_PgmFormat, "pgm", "image/x-portable-graymap"},
@@ -423,6 +429,7 @@ static QImageIOHandler *createReadHandlerHelper(QIODevice *device,
#endif
#ifndef QT_NO_IMAGEFORMAT_JPEG
case _qt_JpgFormat:
+ case _qt_JpegFormat:
if (QJpegHandler::canRead(device))
handler = new QJpegHandler;
break;
diff --git a/src/gui/image/qimagewriter.cpp b/src/gui/image/qimagewriter.cpp
index 9ce3a774ed..8823f9293d 100644
--- a/src/gui/image/qimagewriter.cpp
+++ b/src/gui/image/qimagewriter.cpp
@@ -728,7 +728,9 @@ void supportedImageHandlerMimeTypes(QFactoryLoader *loader,
QList<QByteArray> QImageWriter::supportedImageFormats()
{
QSet<QByteArray> formats;
+#ifndef QT_NO_IMAGEFORMAT_BMP
formats << "bmp";
+#endif
#ifndef QT_NO_IMAGEFORMAT_PPM
formats << "pbm" << "pgm" << "ppm";
#endif
diff --git a/src/gui/image/qpicture.cpp b/src/gui/image/qpicture.cpp
index bfc31930dd..f6de22851d 100644
--- a/src/gui/image/qpicture.cpp
+++ b/src/gui/image/qpicture.cpp
@@ -1278,6 +1278,7 @@ QList<QByteArray> QPicture::outputFormats()
\ingroup painting
\ingroup io
+ \inmodule QtGui
QPictureIO contains a QIODevice object that is used for picture data
I/O. The programmer can install new picture file formats in addition
diff --git a/src/gui/image/qpictureformatplugin.cpp b/src/gui/image/qpictureformatplugin.cpp
index bef72595ad..29d6912201 100644
--- a/src/gui/image/qpictureformatplugin.cpp
+++ b/src/gui/image/qpictureformatplugin.cpp
@@ -53,6 +53,7 @@ QT_BEGIN_NAMESPACE
for custom picture format plugins.
\ingroup plugins
+ \inmodule QtGui
The picture format plugin is a simple plugin interface that makes
it easy to create custom picture formats that can be used
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index ed477e767b..85f0dc2d92 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -763,6 +763,8 @@ bool QPixmap::load(const QString &fileName, const char *format, Qt::ImageConvers
return false;
}
+ detach();
+
QFileInfo info(fileName);
QString key = QLatin1String("qt_pixmap")
% info.absoluteFilePath()
diff --git a/src/gui/image/qpixmapcache.cpp b/src/gui/image/qpixmapcache.cpp
index 47d6f33634..f4d2afed7a 100644
--- a/src/gui/image/qpixmapcache.cpp
+++ b/src/gui/image/qpixmapcache.cpp
@@ -75,22 +75,20 @@ QT_BEGIN_NAMESPACE
behavior of the QHash and QCache classes.
The cache becomes full when the total size of all pixmaps in the
- cache exceeds cacheLimit(). The initial cache limit is
- 2048 KB (2 MB) on embedded platforms, 10240 KB (10 MB) on desktop
- platforms; you can change this by calling setCacheLimit() with the
- required value.
+ cache exceeds cacheLimit(). The initial cache limit is 10240 KB (10 MB);
+ you can change this by calling setCacheLimit() with the required value.
A pixmap takes roughly (\e{width} * \e{height} * \e{depth})/8 bytes of
memory.
The \e{Qt Quarterly} article
- \l{http://qt.nokia.com/doc/qq/qq12-qpixmapcache.html}{Optimizing
+ \l{http://doc.qt.digia.com/qq/qq12-qpixmapcache.html}{Optimizing
with QPixmapCache} explains how to use QPixmapCache to speed up
applications by caching the results of painting.
\sa QCache, QPixmap
*/
-static int cache_limit = 10240; // 10 MB cache limit for desktop
+static int cache_limit = 10240; // 10 MB cache limit
/*!
\class QPixmapCache::Key
@@ -596,8 +594,7 @@ bool QPixmapCache::replace(const Key &key, const QPixmap &pixmap)
/*!
Returns the cache limit (in kilobytes).
- The default cache limit is 2048 KB on embedded platforms, 10240 KB on
- desktop platforms.
+ The default cache limit is 10240 KB.
\sa setCacheLimit()
*/
@@ -610,8 +607,7 @@ int QPixmapCache::cacheLimit()
/*!
Sets the cache limit to \a n kilobytes.
- The default setting is 2048 KB on embedded platforms, 10240 KB on
- desktop platforms.
+ The default setting is 10240 KB.
\sa cacheLimit()
*/