Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QGraphicsView for full HD picture rendering
QtWS25 Last Chance

QGraphicsView for full HD picture rendering

Scheduled Pinned Locked Moved Solved General and Desktop
qgraphicsview
3 Posts 2 Posters 1.3k Views
  • 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.
  • JohanSoloJ Offline
    JohanSoloJ Offline
    JohanSolo
    wrote on last edited by JohanSolo
    #1

    Hi all,

    As explained a bit in this thread, I'm implementing a widget which:

    • displays full HD pictures from raw pgm-like data;
    • adds reticle-like objects on top of the picture, where zones of interests have been identified.

    The pictures are grayscaled 2048x1088, mostly black and the regions of interest are the white parts. Each picture comes with the meta-data needed to draw the reticle-like objects at high rate. I am using the QGraphics View Framework to do the rendering of my scene. The picture is a QGraphicsPixmapItem, which is periodically refreshed (my target is ~60 Hz). I am concerned about the fact that I am changing the whole QGraphicsPixmapItem at each update, even if the picture doesn't change much, which can impact the overall refresh rate of my application on some machines. I must again precise I'm not using OpenGL viewport.

    So my question is: since I know where are the zones of interest (typically between 3 and 16), is it worth the effort to extract those from the pixmap, and display them on a black background and not displaying the total QGraphicsPixmapItem?

    I'm targetting windows and linux platforms, both 32 and 64 bits using Qt 5.6.

    Thanks in advance

    `They did not know it was impossible, so they did it.'
    -- Mark Twain

    raven-worxR 1 Reply Last reply
    0
    • JohanSoloJ JohanSolo

      Hi all,

      As explained a bit in this thread, I'm implementing a widget which:

      • displays full HD pictures from raw pgm-like data;
      • adds reticle-like objects on top of the picture, where zones of interests have been identified.

      The pictures are grayscaled 2048x1088, mostly black and the regions of interest are the white parts. Each picture comes with the meta-data needed to draw the reticle-like objects at high rate. I am using the QGraphics View Framework to do the rendering of my scene. The picture is a QGraphicsPixmapItem, which is periodically refreshed (my target is ~60 Hz). I am concerned about the fact that I am changing the whole QGraphicsPixmapItem at each update, even if the picture doesn't change much, which can impact the overall refresh rate of my application on some machines. I must again precise I'm not using OpenGL viewport.

      So my question is: since I know where are the zones of interest (typically between 3 and 16), is it worth the effort to extract those from the pixmap, and display them on a black background and not displaying the total QGraphicsPixmapItem?

      I'm targetting windows and linux platforms, both 32 and 64 bits using Qt 5.6.

      Thanks in advance

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by raven-worx
      #2

      @JohanSolo
      Are you zooming/scaling in your graphics view?

      It's definitely worth to just extract the visible regions and render them. For this you can subclass QGraphicsPixmapItem's paint() method. In there all the transformations you made on the item itself are already applied to the passed QPainter (see QPainter::transform()).
      This approach is tricky and becomes really tricky when you start to rotate the items.

      But i am not aware of another approach to gain performance when using QGraphicsPixmapItem with large pixmaps.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • JohanSoloJ Offline
        JohanSoloJ Offline
        JohanSolo
        wrote on last edited by JohanSolo
        #3

        Thank you for your input!

        @raven-worx said:

        Are you zooming/scaling in your graphics view?

        I can zoom in my graphics view, yes.

        @raven-worx said:

        It's definitely worth to just extract the visible regions and render them. For this you can subclass QGraphicsPixmapItem's paint() method. In there all the transformations you made on the item itself are already applied to the passed QPainter (see QPainter::transform()).
        This approach is tricky and becomes really tricky when you start to rotate the items.

        Lucky me, I'm not rotating anything!

        I was more thinking about creating smaller QGraphicsPixmapItems and adding them to the scene, but your approach seems cleaner.

        `They did not know it was impossible, so they did it.'
        -- Mark Twain

        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