PDA

View Full Version : RealTime Images



shiranraviv
29th December 2009, 14:45
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

high_flyer
29th December 2009, 14:54
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.

shiranraviv
29th December 2009, 15:05
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) ?

soxs060389
29th December 2009, 15:24
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!!

shiranraviv
30th December 2009, 06:42
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?

franco.amato
30th December 2009, 15:47
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

wysota
30th December 2009, 21:26
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.

soxs060389
31st December 2009, 00:28
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

wysota
31st December 2009, 00:41
@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.