Dear GNUsteppers,
I am writing a scientific imaging application, which should display a
live video coming from camera with some grid and text superimposed on it.
I have achieved the basic operation using NSBitmapImageRep, filled with
camera images, displayed by a descendant of NSView.
The GNUstep GUI (application event loop) runs in one thread, while the
camera input runs in another thread (there is a blocking select). The
problem is, how to notify the GUI, that redrawing of camera image is
needed. I thought, that NSView->setNeedsDisplay: YES exists for this
purpose, however, it does not seem to work for me. The image is not
updated, until some GUI events interrupt the loop (eg. mouse input).
How can I solve this issue? It would be fine, if I could somehow propagate
the request from another thread. If this is not possible, I would
appreciate at least, if GNUstep supports external "file" events, like
XtAppAddInput in XToolkit. Does it?
And the second question is, whether I have chosen the right method of
image display: I am calling NSBitmapImageRep->draw from within
ImgView->drawRect:, where ImgView is descendant of NSView. Camera is
grabbing at few fps, 640x480x8bit, calling [imgView setNeedsDisplay: YES];
if the event queue is being refreshed by continuous mouse motion, I can
easily get CPU load 60% on my 3GHz Pentium. (Similar program under Gtk
takes 2% CPU.) So I am asking, whether, and what am I doing wrong.
And my last question, do you know about some program or a demo under
GNUstep, displaying live "webcam"?
Thank you very much for your help.
Best regards,
Marek
_______________________________________________
Gnustep-dev mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnustep-dev