Results 1 to 9 of 9

Thread: RealTime Images

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2009
    Posts
    25
    Thanks
    3
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default RealTime Images

    Hi,
    I'm searching for the most efficient way to show images (JEPG) as fast as possible.
    I have a client server application that exchange JPEG images and i want to show the images that
    the client get on screen but it is very important that i can have keyboard events and and mouse events.

    Thank you.

    Shiran

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: RealTime Images

    What is the question?

    And if you mean "How do I do it", is not a good question.
    Tell us what you have tried,and ask if you have problems.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Oct 2009
    Posts
    25
    Thanks
    3
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: RealTime Images

    Ok,
    I have tried using QGraphicsView and QGraphicsScene because it has almost every thing i request, keyboard and mouse event...
    But, I have trouble with performance so this is why I asked the question,
    Is there any other way to do it efficiently?

    One more thing...
    Is it possible to use QMainWindow (for tool-bars) and inside it have a Qwidget with QGrahicsScene on QGraphicsView (for mouse and key events) ?

  4. #4
    Join Date
    Sep 2009
    Posts
    36
    Thanks
    4
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: RealTime Images

    Use your GraphicsWidget as teh Center/CentralWidget in QMainWindow and you are done with that.

    About being fast, get your hands on OpenGL, it requires some work and the gain will be rather neglegable (diff<0.1ms *guess*) as QGarphicsScene has internally an OpenGL renderer aswell.

    I think the main delay comes from Server-Client-Net-Code, not from showing the picture in the UI.

    Did you do a test and messure time with a simple QTimer?
    Maybe you should try to trigger a simple update() [SLOT] in your GraphicsView/Scene.

    And beware: DO NOT COPY IMAGES!! Pass pointers or refernces to functions!!

  5. The following user says thank you to soxs060389 for this useful post:

    shiranraviv (30th December 2009)

  6. #5
    Join Date
    Oct 2009
    Posts
    25
    Thanks
    3
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: RealTime Images

    Thank you very much !!!

    1) I will check the client-server transfer speed.
    2) If i understand it right, using i have used is a good solution also?
    3) I used the QTimer in order to do the refresh but i thought there is a smarter way to do it.
    4) Is there enough functionality of positing the QGraphicsView in the main window as a single widget in it?

  7. #6
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    690
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: RealTime Images

    Quote Originally Posted by shiranraviv View Post
    Thank you very much !!!

    1) I will check the client-server transfer speed.
    2) If i understand it right, using i have used is a good solution also?
    3) I used the QTimer in order to do the refresh but i thought there is a smarter way to do it.
    4) Is there enough functionality of positing the QGraphicsView in the main window as a single widget in it?
    Hi, do the refresh when you receive a new image instead of using a QTimer.

    Best
    Franco Amato

  8. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: RealTime Images

    I wouldn't use Graphics View if all you want is to render images. It should be faster if you do it by subclassing QWidget or setting a pixmap on a QLabel object. Graphics View does some additional transformations that you don't need so it only creates overhead.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  9. #8
    Join Date
    Sep 2009
    Posts
    36
    Thanks
    4
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: RealTime Images

    to 3) connect the update() slot to a custom signal, which you emit right after you set your image in the QGraphics*

    to 2) not bad I'd say, wait for Waysotas answer

    to 3) I wanted to point you to QTimer, to actually meassure how much time takes to actually show the pic (maybe 1000x iterations if value is very small)

    to 4) It depends on what you need, any QWidget based (or even a QWidget itself) is enough, thisdepends all on your needs

    @Waysota: I am not sure which one is faster. OpenGL is hardware accelerated while QLabel will us a software renderer. But you probably know more about that subject so I'll just leave it with that.

    Yours sincerely

  10. #9
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: RealTime Images

    Quote Originally Posted by soxs060389 View Post
    @Waysota: I am not sure which one is faster. OpenGL is hardware accelerated while QLabel will us a software renderer. But you probably know more about that subject so I'll just leave it with that.
    I was merely pointing out not to use GV. If you use QGLWidget or QWidget as your base class, that's another issue.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Loading corrupt jpeg images with QImage
    By mikeee7 in forum Qt Programming
    Replies: 15
    Last Post: 3rd December 2010, 02:59
  2. Moving images and change their DIP
    By yazwas in forum Qt Programming
    Replies: 1
    Last Post: 26th October 2009, 18:46
  3. QScrollArea not displaying large number of images
    By lpkincaid in forum Qt Programming
    Replies: 1
    Last Post: 31st May 2009, 10:58
  4. Replies: 8
    Last Post: 8th May 2009, 10:14
  5. import large number of images
    By sriluyarlagadda in forum Qt Programming
    Replies: 5
    Last Post: 15th May 2008, 11:26

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.