[pygtk] Fastest way to go: Client image or server side drawing?

mark mark at mitre.org
Sat Mar 11 02:36:25 WST 2006


Im attempting to determine the fastest way to draw on an image with 
various line/circle annotations and then have access to the rendered 
annotation to save or further process.  This needs to run a video speeds 
(10-30 frames/sec).  From the reference and Faq it looks like I  have 
the following  choices:

A)  load the image in the client space an draw directly into the image 
space with the client library (OpenCv), then display the annotated 
combination to the X server most likely with draw_rgb_image( pixmap 
...., my img buffer).  Pros: I have the  annotated image ready to save, 
no slow retreive from the server via  'pixbuf.get_from_drawable ...' 
Cons:  the client side drawing is limited, not nearly as feature rich as 
gtk, and looks to be somewhat slower than the server side drawing.

B) Load the image, draw it to the server side immediately with 
draw_rgb_image, and then annotate it their with the nice & fast drawable 
drawing methods. When done, retrieve the whole thing with 
pixbuf.get_from_drawable...

So the question is, whats the best way to go, or am I missing a part of 
the picture?  B) gives me blazing fast drawing w/ full access to a 
graphics context, but its a major slow down if I need to save the 
annotated frame.

Mark


More information about the pygtk mailing list