Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Some Pixels are differed by 1 when taking screenshots in 32 and 64 architecture

Some Pixels are differed by 1 when taking screenshots in 32 and 64 architecture

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
4 Posts 3 Posters 423 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Disanth
    wrote on last edited by
    #1

    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.

    M 1 Reply Last reply
    0
    • D Disanth

      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.

      M Offline
      M Offline
      mvuori
      wrote on last edited by
      #2

      In case someone knows about this, you may need to provide more information:

      • Which one is correct...
      • How do you draw the screen
      • How do you get the grab
      • Device information, including screen driver
      1 Reply Last reply
      0
      • D Offline
        D Offline
        Disanth
        wrote on last edited by Disanth
        #3

        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

        1. The first one is correct i.e. 32 arch Image Pixel = [255, 255, 255]
        2. 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 &region, 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)**

        1. We are grabbing the image like below
              qobject_cast<QQuickWindow *>(QGuiApplication::focusWindow())->grabWindow().save("/tmp/screenshot.png") 
        
        1. Embedded Linux Device, Screen Driver is framebuffer in real qemu environment, but in testing environment we are using minimal plugin
        1 Reply Last reply
        0
        • Axel SpoerlA Online
          Axel SpoerlA Online
          Axel Spoerl
          Moderators
          wrote on last edited by
          #4

          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.

          Software Engineer
          The Qt Company, Oslo

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved