// assumes grayscale
QImage dest(source.width() / 2, source.height() / 2, srcImage.format());
- const uchar *src = reinterpret_cast<const uchar*>(const_cast<const QImage &>(srcImage).bits());
+ const uchar *src = srcImage.constBits();
int sx = srcImage.bytesPerLine();
int sx2 = sx << 1;
- uchar *dst = reinterpret_cast<uchar*>(dest.bits());
+ uchar *dst = dest.bits();
int dx = dest.bytesPerLine();
int ww = dest.width();
int hh = dest.height();
} else if (source.format() == QImage::Format_ARGB8565_Premultiplied) {
QImage dest(source.width() / 2, source.height() / 2, srcImage.format());
- const uchar *src = reinterpret_cast<const uchar*>(const_cast<const QImage &>(srcImage).bits());
+ const uchar *src = srcImage.constBits();
int sx = srcImage.bytesPerLine();
int sx2 = sx << 1;
- uchar *dst = reinterpret_cast<uchar*>(dest.bits());
+ uchar *dst = dest.bits();
int dx = dest.bytesPerLine();
int ww = dest.width();
int hh = dest.height();
QImage dest(source.width() / 2, source.height() / 2, srcImage.format());
- const quint32 *src = reinterpret_cast<const quint32*>(const_cast<const QImage &>(srcImage).bits());
+ const quint32 *src = reinterpret_cast<const quint32*>(srcImage.constBits());
int sx = srcImage.bytesPerLine() >> 2;
int sx2 = sx << 1;