remove unused QImage::offset() and QImage::setOffset() methods

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2021-06-07 06:11:37 +03:00
parent 24073c3a1d
commit 53d950e86c
4 changed files with 2 additions and 51 deletions

View file

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

View file

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

View file

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

View file

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