ViewerBlast.Mesa
Last Edited by: Spreitzer, June 18, 1985 1:45:16 pm PDT
DIRECTORY Imager, ImagerPixelMap, ViewerClasses;
ViewerBlast: CEDAR DEFINITIONS =
BEGIN
Viewer: TYPE = ViewerClasses.Viewer;
PixelMap: TYPE = ImagerPixelMap.PixelMap;
Context: TYPE = Imager.Context;
IntPt: TYPE = RECORD [x, y: INTEGER ← 0];
IntBox: TYPE = RECORD [xmin, ymin, dx, dy: INTEGER ← 0];
Blast: PROC
[
pm: PixelMap, --windowed area is source of blasted image
lowerLeft: IntPt, --of where initial bitmap appears on screen
convergeOn: IntPt ← [], --screen point for all centers to emanate from
preSteps: INTEGER ← 3, --how many steps took from converge
speedChooser: SpeedChooser ← NIL, --NIL => emanation
initial: BOOLEANTRUE, --xor coherent version?
backwards: BOOLEANFALSE];
SpeedChooser: TYPE = PROC [row, col: INTEGER] RETURNS [speed: IntPt];
RandomSpeed: SpeedChooser;
ScreenPixelMap: PROC RETURNS [PixelMap];
CopyViewer: PROC [v: Viewer, window: IntBox ← [], windowed: BOOLEANFALSE] RETURNS [pm: PixelMap, lowerLeft: IntPt];
Slow = -y, fast = +x. lowerLeft in screen coords.
PixelMapContext: PROC [pm: PixelMap] RETURNS [context: Context];
With dx = fast, dy = -slow, (0, 0) at begin of last scan line of pm's buffer.
DrawPixelMap: PROC [context: Context, pm: PixelMap, tx, ty: INTEGER];
Slow = -y, fast = +x. Begin of first scan line of pm's window appears at (tx, ty).
DrawBitmap: PROC [context: Context, bitmap: PixelMap, fOrigin, sOrigin: INTEGER];
Context's origin appears at [s: sOrigin, f: fOrigin] relative to bitmap's window.
slow = -dy, fast = dx, 1 pixel = 1 context unit.
MaskPixelMap: PROC [context: Context, pm: PixelMap, deviceOrgS, deviceOrgF: INTEGER];
[f: deviceOrgF, s: deviceOrgS] in pm's device (NOT window) coords aligns with context's origin.
slow = -dy, fast = dx, 1 pixel = 1 context unit.
END.