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. Fast drawing in QT
Forum Updated to NodeBB v4.3 + New Features

Fast drawing in QT

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 3.7k Views 1 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.
  • P Offline
    P Offline
    personlin
    wrote on last edited by
    #1

    Hi,
    My case is writing a -QT- Qt application to draw four channels video.
    I use QImage to load JPEG stream from a network buffer(700Kbits each channel),
    and my widget is extending from QGLWidget.
    The speed seems not fast enough. Is any idea to speed up the performance such as drawing or converting from JPEG to pixmap?
    What is better class to do that?

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tobias.hunger
      wrote on last edited by
      #2

      Try profiling your application! It is very likely that the JPEG->QPixmap transformation is the limiting factor... but your code might also doing something completely different that slows everything down! Without profiling data you are just guessing at the reason.

      Don't guess, measure!

      1 Reply Last reply
      0
      • B Offline
        B Offline
        bms20
        wrote on last edited by
        #3

        Tobias is right.

        However, you will probably want to think about what your architecture is doing.

        My guess is that you are doing this:
        Load jpeg -> decode in ram to RGB -> upload to GPU -> paint onto buffer

        So you've copied the image into ram, DMAed the image to the GPU, then copied it into the frame buffer.

        I'd suggest one of two alternative approaches:

        1. Draw the graphics without using opengl; hence cutting out the upload, use threading on your (presumably multicore) CPU to decode the images.
        2. Use the GPU hardware to decode your jpeg, then display it.

        #2 isn't easy but will get you a long way, because you will be copying compressed data into the GPU memory; where the GPU can then be used to rapidly convert the jpeg image into RGB. You can always break the jpeg decoding down into several steps - e.g. do most of the decoding on the cpu, then the final conversion to rgb on the gpu; then attack the next stage, etc...

        Good luck.

        -bms

        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