🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.sgi.graphics
Article #88

Re: can you make readdisplay() read back buffer

#88
From: Robert Keller
Date: Thu, 07 Jan 1993 22:31
43 lines
2385 bytes
rjanzen@alias.com (Ron Janzen) writes:
>Does anybody know of a way to read the back buffer in the same way as
>readdisplay() can read what is displayed on the screen? 

from the man page:

    readdisplay(3G) reads a rectangular screen region, returning displayed
    pixel colors in a packed RGB format
    :
    readdisplay generates the displayed value of each addressed pixel, taking
    into account all display bitplanes and modes except those of the cursor.

What this means is that readdisplay returns a packed RGB format stream
of data the EXACTLY matches what is being displayed on the glass of your
monitor (except for the cursor).

No matter if you have colour index windows with seperate colourmaps, RGB 
windows, overlay/pup/underlay drawing, etc...  readdisplay() figures it
all out and returns a single packed RGB format stream.  Figuring this 
stuff out is non-trivial, since much of what is being displayed is controlled
on a per pixel basis by hardware, readdisplay needs an intimate knowledge of 
the backend of the graphics subsytem.  

A simple example is for colour index windows, readdisplay must read the 
colourindex value from the framebuffer, determine which hardware colourmap is 
transforming it, lookup the colourindex in that colourmap, read out the RGB 
triple from the colourmap.  Things can get complicated when you have overlay
or underlay framebuffers, multiple colourmaps, etc...

Programs like scrsave and snapshot use readdisplay() to grab an .rgb 
file of what you see on your screen.  What you see on the screen depends
on more that just what is in the framebuffer.

Since readdisplay gives you what you currently see on your screen, and
you can't (by definition) see the backbuffer, readdisplay will not read
the backbuffer.

>It must be
>possible since snoop (a demo program supplied by SGI) can do it.

snoop uses lrectread(3G) to just Rambo-out the pixels.

...robert
Technical Details
Message-ID: <1iiavsINN8p4@fangio.asd.sgi.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!olivea!sgigate!odin!fido!not-for-mail
References: <1993Jan7.170216.1065@alias.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!olivea!sgigate!odin!fido!not-for-mail
From: rck@fangio.asd.sgi.com (Robert Keller)
Newsgroups: comp.sys.sgi.graphics
Subject: Re: can you make readdisplay() read back buffer
Message-ID: <1iiavsINN8p4@fangio.asd.sgi.com>
Date: 7 Jan 93 22:31:24 GMT
References: <1993Jan7.170216.1065@alias.com>
Organization: Silicon Graphics, Inc., Mountain View, CA
Lines: 43
NNTP-Posting-Host: fangio.asd.sgi.com