Some Pixels are differed by 1 when taking screenshots in 32 and 64 architecture
-
We are using Qt Minimal plugin for our testing environment.
qputenv("QT_QPA_PLATFORM", "minimal");
When taking screenshot of current screen and the some of the pixels are differed by 1 (One) in 32 and 64 architecture.
32 arch Image Pixel = [255, 255, 255],
64 arch Image2 Pixel = [254, 254, 254]What could be the possible reason for this issue?
Thanks in Advanced.
-
Hi @mvuori , thanks for the reply. I suspecting it would be because of floating point conversions in image processing but not having an idea on how to triage it. Here is the info that you asked
- The first one is correct i.e. 32 arch Image Pixel = [255, 255, 255]
- Qt is taking care of the screen drawing from minimal plugin (QMinimalBackingStore and QMinimalintegration Plugin files are the responsible classes here)
QMinimalintegration.cpp implementation
m_primaryScreen = new QMinimalScreen(); m_primaryScreen->mGeometry = QRect(0, 0, width, height); m_primaryScreen->mDepth = 32; m_primaryScreen->mFormat = QImage::Format_ARGB32_Premultiplied QWindowSystemInterface::handleScreenAdded(m_primaryScreen);
QMinimalBackingStore flush() & paintDevice() method implementation
void QMinimalBackingStore::flush(QWindow *window, const QRegion ®ion, const QPoint &offset) { Q_UNUSED(window); Q_UNUSED(region); Q_UNUSED(offset); if (mDebug) { static int c = 0; QString filename = QString("/tmp/output%1.png").arg(c++, 4, 10, QLatin1Char('0')); bool saved = mImage.save(filename); } }
QPaintDevice *QMinimalBackingStore::paintDevice() { return &mImage; }
Note: here mImage is class level instance with QImage::Format_RGB32. ( but m_primaryScreen's Format is QImage::Format_ARGB32_Premultiplied)**
- We are grabbing the image like below
qobject_cast<QQuickWindow *>(QGuiApplication::focusWindow())->grabWindow().save("/tmp/screenshot.png")
- Embedded Linux Device, Screen Driver is framebuffer in real qemu environment, but in testing environment we are using minimal plugin
-
That’s a bug in the minimal backing store implementation.
It’s got nothing to do with 32 bit, which just exposes the bug.
Please file a ticket at https://bugreports.qt.io.