diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 23a8b2580..b0771e361 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -62,7 +62,7 @@ QImageData::QImageData() detach_no(0), dpmx(QX11Info::appDpiX() * 100 / qreal(2.54)), dpmy(QX11Info::appDpiY() * 100 / qreal(2.54)), - offset(0, 0), own_data(true), ro_data(false), has_alpha_clut(false), + own_data(true), ro_data(false), has_alpha_clut(false), paintEngine(0) { } @@ -256,10 +256,7 @@ bool QImageData::checkForAlphaPixels() const The rect() function returns the image's enclosing rectangle. The valid() function tells if a given pair of coordinates is within - this rectangle. The offset() function returns the number of pixels - by which the image is intended to be offset by when positioned - relative to other images, which also can be manipulated using the - setOffset() function. + this rectangle. \row \o Colors @@ -1002,7 +999,6 @@ QImage QImage::copy(const QRect& r) const image.d->colortable = d->colortable; image.d->dpmx = d->dpmx; image.d->dpmy = d->dpmy; - image.d->offset = d->offset; image.d->has_alpha_clut = d->has_alpha_clut; return image; } @@ -1090,7 +1086,6 @@ QImage QImage::copy(const QRect& r) const image.d->colortable = d->colortable; image.d->dpmx = d->dpmx; image.d->dpmy = d->dpmy; - image.d->offset = d->offset; image.d->has_alpha_clut = d->has_alpha_clut; return image; } @@ -3946,37 +3941,6 @@ void QImage::setDotsPerMeterY(int y) d->dpmy = y; } -/*! - \fn QPoint QImage::offset() const - - Returns the number of pixels by which the image is intended to be - offset by when positioning relative to other images. - - \sa setOffset(), {QImage#Image Information}{Image Information} -*/ -QPoint QImage::offset() const -{ - return d ? d->offset : QPoint(); -} - - -/*! - \fn void QImage::setOffset(const QPoint& offset) - - Sets the number of pixels by which the image is intended to be - offset by when positioning relative to other images, to \a offset. - - \sa offset(), {QImage#Image Information}{Image Information} -*/ -void QImage::setOffset(const QPoint& p) -{ - if (!d) - return; - detach(); - - d->offset = p; -} - /* Sets the image bits to the \a pixmap contents and returns a reference to the image. diff --git a/src/gui/image/qimage.h b/src/gui/image/qimage.h index 2712b85f8..53b2610ce 100644 --- a/src/gui/image/qimage.h +++ b/src/gui/image/qimage.h @@ -199,8 +199,6 @@ public: int dotsPerMeterY() const; void setDotsPerMeterX(int); void setDotsPerMeterY(int); - QPoint offset() const; - void setOffset(const QPoint&); protected: virtual int metric(PaintDeviceMetric metric) const; diff --git a/src/gui/image/qimage_p.h b/src/gui/image/qimage_p.h index 8afdf7e07..1cfff72b8 100644 --- a/src/gui/image/qimage_p.h +++ b/src/gui/image/qimage_p.h @@ -60,7 +60,6 @@ struct Q_GUI_EXPORT QImageData { // internal image data qreal dpmx; // dots per meter X (or 0) qreal dpmy; // dots per meter Y (or 0) - QPoint offset; // offset in pixels bool own_data; bool ro_data; diff --git a/src/gui/image/qpnghandler.cpp b/src/gui/image/qpnghandler.cpp index f52c1f362..efd702c36 100644 --- a/src/gui/image/qpnghandler.cpp +++ b/src/gui/image/qpnghandler.cpp @@ -411,9 +411,6 @@ bool QPngHandlerPrivate::readPngImage(QImage *outImage) outImage->setDotsPerMeterX(png_get_x_pixels_per_meter(png_ptr,info_ptr)); outImage->setDotsPerMeterY(png_get_y_pixels_per_meter(png_ptr,info_ptr)); - if (unit_type == PNG_OFFSET_PIXEL) - outImage->setOffset(QPoint(offset_x, offset_y)); - state = ReadingEnd; png_read_end(png_ptr, end_info); @@ -585,13 +582,6 @@ bool QPNGImageWriter::writeImage(const QImage& image, int quality_in) png_set_bgr(png_ptr); #endif - QPoint offset = image.offset(); - int off_x = offset.x(); - int off_y = offset.y(); - if (off_x || off_y) { - png_set_oFFs(png_ptr, info_ptr, off_x, off_y, PNG_OFFSET_PIXEL); - } - if (frames_written > 0) png_set_sig_bytes(png_ptr, 8);