QPixmap::fromImage segmentation with a non-null QImage
-
Here is it:
@void Sprite::putPixel(QImage &image, int x, int y, uchar red, uchar green, uchar blue, uchar alpha)
{
if (image.isNull() || !image.valid(x, y))
return;int n_channels = image.depth() / 8;
Q_ASSERT_X(n_channels == 4, "Sprite::putPixel", "Invalid image channels");Q_ASSERT_X(x >= 0 && x < image.width(), "Sprite::putPixel", "index out of range");
Q_ASSERT_X(y >= 0 && y < image.width(), "Sprite::putPixel", "index out of range");image.setPixel(x, y, qRgba(int(red), int(green), int(blue), int(alpha)));
}@
Or do you mean something else?