Re: XForms: How to display real time images

Steve Lamont (spl@szechuan.ucsd.edu)
Wed, 20 May 98 06:27:06 PDT

# To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve Lamont) :

> As I'm fresh in using both xforms and doing image precessing stuff, I
> don't know whether xforms can display real time images.

Real time display is not really an XForms issue as much as it is a
platform and hardware issue. If your platform will allow you to blat
graphics straight to a window by more or less avoiding the X server
(direct rendering, for example, under OpenGL), then you win.
Otherwise, if you have to go through the server, then you are
dependent upon the Xlib (or perhaps XIE -- X Image Extension -- if
available on your system) routines and they can be quite slow.

> The image data are obtained from a camera, they are saved in a
> buffer like an long array with values( the structure is known), and
> in the forms there are sliders control the pan and tilt angle. I
> would like to display the images together with the sliders within
> the same form, not in a canvas object. Can xforms do that?

Again, as I said in my previous posting on this subject, if you use
Pixmap objects, then you will need to somehow convert your raw image
data to a Pixmap. If you have the X shared memory extension (MIT-SHM
or the like) then you can use shared memory to write directly to the
server's internal buffers, which may speed things up somewhat,
assuming that the server and the client are on the same platform, of
course.

A Canvas object can be on the same form as your sliders, etc., so
there's no reason not to use it. It's simply another XForms object.
The main difference between a Canvas and most other XForms objects is
that a Canvas is really a child window of the Form's window, while
most other objects are not -- they're just drawn using Xlib routines.

> If I have to change the format of the image data in buffer to
> say, xpm format before display it, it is too slow for me, since I
> have to display the real time image from camera.

If you use straight Xpm, then you're definitely going to take a
monstrous performance hit -- probably an order of magnitude's worth.
As I said, if you really feel compelled to use Pixmap objects, you
have to convert your image data to a X Pixmap. Refer to your favorite
Xlib documentation and manual pages for discussion of XImage and
Pixmap operations.

You don't say what kind of a platform you're running. Presumably if
you have live video input, you will have some capacity for live video
display in a Window. If you do and you can choose what Window that
the video goes to, then you win. Otherwise, you probably lose.

I know that there have been at one time some MPEG-type folks on this
list -- perhaps they have some words of wisdom to share.

spl
_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/