G3dColorDisplaySupport.mesa
Last Edited by: Crow, August 8, 1989 1:05:36 pm PDT
DIRECTORY G3dRender, Imager, ImagerPixel, Rope, Terminal;
G3dColorDisplaySupport: CEDAR DEFINITIONS
~ BEGIN
Types
ROPE:   TYPE ~ Rope.ROPE;
Context:  TYPE ~ G3dRender.Context;
ContextProc: TYPE ~ G3dRender.ContextProc;
Pair:   TYPE ~ G3dRender.Pair;
Pixel:   TYPE ~ G3dRender.Pixel;
RGB:   TYPE ~ G3dRender.RGB;
RopeProc:  TYPE ~ G3dRender.RopeProc;
Triple:  TYPE ~ G3dRender.Triple;
Virtual:  TYPE ~ Terminal.Virtual;
PixelMap:  TYPE ~ ImagerPixel.PixelMap;
Colors
MappedRGB: PROC [context: Context, clr: Pixel] RETURNS [Pixel];
Calculates pseudocolor value from RGB and leaves in red field
LoadStd8BitClrMap: PROC [vt: Terminal.Virtual];
Sets up custom 6x6x6 color cube map for dithering
LoadColorRamp: PROC [
vt: Virtual,
clr1: RGB ← [0,0,0],
clr2: RGB ← [255,255,255],
exponent: RGB ← [.43,.43,.43]];
Load ramp running between two colors and bent by exponent, defaults give std grey map
Low-level drawing
Draw2DRope: RopeProc;
Put a string of characters on the screen.
Image File Storage and Retrieval
GetPixelsFromViewer: PROC[ context: Context, dstMap: PixelMap ];
Transfers pixels from viewer into supplied Pixel Map
GetAIS: PROC[ context: Context, fileRoot: ROPE, xOffset, yOffset: INTEGER ← 0,
     center: BOOLEANTRUE, labeled: BOOLEANFALSE ]
   RETURNS[ xSize, ySize: INTEGER];
Reads AIS file(s) to match context.display. Searches for appropriate file names,
eg. file-red.ais, file-grn.ais, file-alpha.ais, file-depth.ais, etc.
See AISAnimationImpl.standardNames.
If labeled, puts file name at bottom of screen.
     
PutAIS: PROC[ context: Context, fileRoot: ROPE,
     doEverything: BOOLEANFALSE ];
Writes current image in context.display out to ais file(s). IF doEverything THEN alpha and depth channels will be written out if they exist .
GetRGB: PROC[ context: Context, fileRoot: ROPE, xOffset, yOffset: INTEGER ← 0,
     center: BOOLEANTRUE, labeled: BOOLEANFALSE ]
   RETURNS[ xSize, ySize: INTEGER];
Reads a file in Abekas RGB format, 486 x 720 x RGB bytes
PutRGB: PROC[ context: Context, fileRoot: ROPE ];
Writes a file in Abekas RGB format, 486 x 720 x RGB bytes
GetInterpress: PROC[ context: Context, fileRoot: ROPE,
       xOffset, yOffset: INTEGER ← 0, center: BOOLEANTRUE ]
     RETURNS[ xSize, ySize: INTEGER];
Read image directly from interpress file(s). Unimplemented.
PutInterpress: PROC[ context: Context, fileRoot: ROPE ];
Write directly to interpress file alpha and depth channels ignored. Unimpelmented
Frame Generation and Animation
MakeFrame: ContextProc;
Compute image described by context
StuffBuf: G3dRender.ImagerProc;
Transfer buffered image to viewer or imager context
Load context.viewPort from viewer specification
MakeHiResFrame: PROC [context: Context, width, height: NAT, name: Rope.ROPE];
Compute image described by context at supplied size, write out to named AIS file, keeps log, Image is full color and antialiased.
DitherImage: PROC [dstContext, rgbContext: Context];
Take rgb image in rgbContext and dither into dstContext
END.