I have this code:
QImage grayImage = image.convertToFormat(QImage::Format_Grayscale8); int size = grayImage.width() * grayImage.height(); QRgb *data = new QRg