ImagerOps.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Michael Plass, June 26, 1985 6:09:55 pm PDT
DIRECTORY
Imager USING [Color, Context],
ImagerPixelArray USING [PixelArray],
ImagerPixelMap USING [PixelMap],
ImagerTransformation USING [Transformation],
Terminal USING [FrameBuffer, Virtual];
~
BEGIN OPEN Imager, ImagerPixelMap, ImagerPixelArray, ImagerTransformation, Terminal;
PixelArrayFromPixelMaps:
PROC [pms:
LIST
OF PixelMap, um: Transformation]
RETURNS [PixelArray];
Caller guarantees that the contents of the PixelMaps will not be altered as long as the PixelArray is in use (because PixelArrays are immutable).
The transformation maps the (slow, fast) coords of the PixelMap to the client coords of the PixelArray.
PixelMapFromPixelArray:
PROC [pa: PixelArray, i:
NAT]
RETURNS [PixelMap];
Caller guarantees henceforth to never alter the PixelMap's bitmap.
Transformation info may be obtained directly from the PixelArray.
The sMin and fMin of the result's window are always zero.
! BoundsFault if i NOT IN[0..pa.samplesPerPixel)
Kind:
TYPE ~
ATOM;
The specific kind of raster context.
KindOf:
PROC [context: Context]
RETURNS [Kind];
ContextFromPixelMaps:
PROC [pms:
LIST
OF PixelMap, surfaceToDevice: Transformation, kind: Kind];
Makes a context with the PixelMaps as the destination, with a View corresponding to Window[pm]. Most of the time the LIST OF PixelMap will have just one element, but some context implementations may need more.
SurfaceToDevice:
PROC [context: Context]
RETURNS [Transformation];
KnownKinds:
PROC
RETURNS [
LIST
OF Kind];
The current list of known kinds of raster contexts.
TerminalFromContext:
PROC [context: Context]
RETURNS [vt: Virtual, color:
BOOL];
vt=NIL if no context is known to be associated with the context.
PixelMapFromFrameBuffer:
PROC [frameBuffer: FrameBuffer]
RETURNS [PixelMap];
PixelMapsFromContext:
PROC [context: Context]
RETURNS [
LIST
OF PixelMap];
Returns NIL if no PixelMap is known to be associated with the context.
DoWithBuffer:
PROC [context: Context, action:
PROC, x, y, w, h:
INTEGER, backgroundColor: Color ←
NIL];
Equivalent to clipping to the given rectangle [x, y, w, h] and then calling action, all under a DoSaveAll. Will buffer the output where possible. If backgroundColor#NIL, the rectangle will be filled with the color before action is called.