Logo Search packages:      
Sourcecode: qt4-x11 version File versions

uchar * QImage::scanLine ( int  i  ) 

Returns a pointer to the pixel data at the scanline with index i. The first scanline is at index 0.

The scanline data is aligned on a 32-bit boundary.

Warning:
If you are accessing 32-bpp image data, cast the returned pointer to {QRgb*} (QRgb has a 32-bit size) and use it to read/write the pixel value. You cannot use the {uchar*} pointer directly, because the pixel format depends on the byte order on the underlying platform. Use qRed(), qGreen(), qBlue(), and qAlpha() to access the pixels.
See also:
bytesPerLine(), bits(), {QImage::Pixel Manipulation}{Pixel Manipulation}

Definition at line 1656 of file qimage.cpp.

References detach(), and height().

Referenced by QGLWidget::convertToGLFormat(), copy(), createHeuristicMask(), QBitmap::fromData(), QBitmap::fromImage(), QCommonStyle::generatedIconPixmap(), QPixmap::mask(), operator==(), pixel(), pixelIndex(), rgbSwapped(), QPixmap::setMask(), and setPixel().

{
    detach();
    Q_ASSERT(i >= 0 && i < height());
    return d->data + i * d->bytes_per_line;
}


Generated by  Doxygen 1.6.0   Back to index