if (format == QImage::Format_Indexed8) {
for (int y=0; y<h; ++y) {
- QRgb *src_pixels = (QRgb *) src.scanLine(y);
+ const QRgb *src_pixels = (const QRgb *) src.constScanLine(y);
uchar *dest_pixels = (uchar *) dest.scanLine(y);
for (int x=0; x<w; ++x) {
int src_pixel = src_pixels[x];
QVector<QRgb> table = clut;
table.resize(2);
for (int y=0; y<h; ++y) {
- QRgb *src_pixels = (QRgb *) src.scanLine(y);
+ const QRgb *src_pixels = (const QRgb *) src.constScanLine(y);
for (int x=0; x<w; ++x) {
int src_pixel = src_pixels[x];
int value = cache.value(src_pixel, -1);
qWarning("QImage::pixelIndex: coordinate (%d,%d) out of range", x, y);
return -12345;
}
- const uchar * s = scanLine(y);
+ const uchar *s = constScanLine(y);
switch(d->format) {
case Format_Mono:
return (*(s + (x >> 3)) >> (7- (x & 7))) & 1;
qWarning("QImage::pixel: coordinate (%d,%d) out of range", x, y);
return 12345;
}
- const uchar * s = scanLine(y);
+ const uchar *s = constScanLine(y);
switch(d->format) {
case Format_Mono:
return d->colortable.at((*(s + (x >> 3)) >> (7- (x & 7))) & 1);
return img32.createHeuristicMask(clipTight);
}
-#define PIX(x,y) (*((QRgb*)scanLine(y)+x) & 0x00ffffff)
+#define PIX(x,y) (*((const QRgb*)constScanLine(y)+x) & 0x00ffffff)
int w = width();
int h = height();
ypp = ypc;
ypc = ypn;
ypn = (y == h-1) ? 0 : m.scanLine(y+1);
- QRgb *p = (QRgb *)scanLine(y);
+ const QRgb *p = (const QRgb *)constScanLine(y);
for (x = 0; x < w; x++) {
// slowness here - it's possible to do six of these tests
// together in one go. oh well.
ypp = ypc;
ypc = ypn;
ypn = (y == h-1) ? 0 : m.scanLine(y+1);
- QRgb *p = (QRgb *)scanLine(y);
+ const QRgb *p = (const QRgb *)constScanLine(y);
for (x = 0; x < w; x++) {
if ((*p & 0x00ffffff) != background) {
if (x > 0)
if (depth() == 32) {
for (int h = 0; h < d->height; h++) {
- const uint *sl = (uint *) scanLine(h);
+ const uint *sl = (const uint *) constScanLine(h);
for (int w = 0; w < d->width; w++) {
if (sl[w] == color)
*(s + (w >> 3)) |= (1 << (w & 7));