36 Q_UNUSED(configuration);
37 QRect rc = document->savingImage()->bounds();
41 s.setByteOrder(QDataStream::LittleEndian);
43 const QImage& img = image;
44 const bool hasAlpha = (img.format() == QImage::Format_ARGB32);
46 static constexpr quint8 alphaChannel8Bits = 0x08;
48 for (
int i = 0; i < 12; i++)
52 s << quint16(img.width());
53 s << quint16(img.height());
54 s << quint8(hasAlpha ? 32 : 24);
55 s << quint8(hasAlpha ? originTopLeft + alphaChannel8Bits : originTopLeft);
57 for (
int y = 0; y < img.height(); y++) {
58 for (
int x = 0; x < img.width(); x++) {
59 const QRgb color = img.pixel(x, y);
60 s << quint8(qBlue(color));
61 s << quint8(qGreen(color));
62 s << quint8(qRed(color));
64 s << quint8(qAlpha(color));