home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / sgi / graphics / 108 < prev    next >
Encoding:
Internet Message Format  |  1993-01-07  |  2.3 KB

  1. Path: sparky!uunet!olivea!sgigate!odin!fido!not-for-mail
  2. From: rck@fangio.asd.sgi.com (Robert Keller)
  3. Newsgroups: comp.sys.sgi.graphics
  4. Subject: Re: can you make readdisplay() read back buffer
  5. Message-ID: <1iiavsINN8p4@fangio.asd.sgi.com>
  6. Date: 7 Jan 93 22:31:24 GMT
  7. References: <1993Jan7.170216.1065@alias.com>
  8. Organization: Silicon Graphics, Inc., Mountain View, CA
  9. Lines: 43
  10. NNTP-Posting-Host: fangio.asd.sgi.com
  11.  
  12. rjanzen@alias.com (Ron Janzen) writes:
  13. >Does anybody know of a way to read the back buffer in the same way as
  14. >readdisplay() can read what is displayed on the screen? 
  15.  
  16. from the man page:
  17.  
  18.     readdisplay(3G) reads a rectangular screen region, returning displayed
  19.     pixel colors in a packed RGB format
  20.     :
  21.     readdisplay generates the displayed value of each addressed pixel, taking
  22.     into account all display bitplanes and modes except those of the cursor.
  23.  
  24. What this means is that readdisplay returns a packed RGB format stream
  25. of data the EXACTLY matches what is being displayed on the glass of your
  26. monitor (except for the cursor).
  27.  
  28. No matter if you have colour index windows with seperate colourmaps, RGB 
  29. windows, overlay/pup/underlay drawing, etc...  readdisplay() figures it
  30. all out and returns a single packed RGB format stream.  Figuring this 
  31. stuff out is non-trivial, since much of what is being displayed is controlled
  32. on a per pixel basis by hardware, readdisplay needs an intimate knowledge of 
  33. the backend of the graphics subsytem.  
  34.  
  35. A simple example is for colour index windows, readdisplay must read the 
  36. colourindex value from the framebuffer, determine which hardware colourmap is 
  37. transforming it, lookup the colourindex in that colourmap, read out the RGB 
  38. triple from the colourmap.  Things can get complicated when you have overlay
  39. or underlay framebuffers, multiple colourmaps, etc...
  40.  
  41. Programs like scrsave and snapshot use readdisplay() to grab an .rgb 
  42. file of what you see on your screen.  What you see on the screen depends
  43. on more that just what is in the framebuffer.
  44.  
  45. Since readdisplay gives you what you currently see on your screen, and
  46. you can't (by definition) see the backbuffer, readdisplay will not read
  47. the backbuffer.
  48.  
  49. >It must be
  50. >possible since snoop (a demo program supplied by SGI) can do it.
  51.  
  52. snoop uses lrectread(3G) to just Rambo-out the pixels.
  53.  
  54. ...robert
  55.