From: rgooch@rp.CSIRO.AU (Richard Gooch)
Subject: Re: Animation with XPutImage()?
Organization: CSIRO Division of Radiophysics/Australia Telescope National Facility
Lines: 51

In article <1993Apr22.092830.2190@infodev.cam.ac.uk>, dcr@mail.ast.cam.ac.uk (Derek C. Richardson) writes:
> I just implemented this and it seems I can just about achieve the display
> rates (20 400x400x8 frames / sec on IPX) that I get with Sunview, though
> it's a bit "choppy" at times. Also, loading the data, making an XImage,
> then XPut'ing it into a pixmap is a bit cumbersome, so the animation is
> slower to load than with Sunview. Is there a better way to load in the
> data?
> 
> rgooch@rp.CSIRO.AU (Richard Gooch) writes:
> >  If you need speed, and your client can run on the same host as the X server,
> >  you should use the shared memory extension to the sample X server (MIT-SHM).
> >  xdpyinfo  will tell you if your server has this extension. This is certainly
> >  available with the sample MIT X server running under SunOS.
> >  A word of warning: make sure your kernel is configured to support shared
> >  memory. And another word of warning: OpenWindows is slower than the MIT
> >  server.
> >  I have written an imaging tool (using XView for the GUI, by the way) which
> >  yields over 10 frames per second for 512*512*8 bit images, running on a Sparc
> >  IPC (half the cpu grunt of an IPX). This has proved quite sufficient for
> >  animations.
> >
> >				Regards,
> >
> >					Richard Gooch....
> 
> Shared memory PutImage (also mentioned by nkissebe@delphi.beckman.uiuc.edu,
> Nick Kisseberth) looks interesting, but I need someone to point me to some
> documentation. Is this method likely to give better results than server-
> resident pixmaps? I'd also be interested in looking at the XView code
> mentioned above...
> 
> Thanks for the help so far. If I get something decent put together, I'll
> definitely post it to the Net.
> 

  The MIT tapes come with documentation written by Keith Packard on the Shared
  Memory Extension to X. Look in:  mit/doc/extensions/mit-shm.ms
  I found this invaluble. Unfortunately, there is a bit of work to set up the
  shared memory segments, making an XImage from it, etc. Also, there is an
  extension query to determine if the server supports it, but you still need to
  test if the server is running on the same host and if shared memory is enabled
  in the kernel. I have written layers of convience routines which make all this
  transparent.
  As for the XView code, well, I doubt that would be considered interesting.
  The interesting stuff is done in a C object library. People interested in this
  code can Email me.

				Regards,

					Richard Gooch,
					rgooch@atnf.csiro.au
