ThreshHack.mesa
Copyright Ó 1987 by Xerox Corporation. All rights reserved.
Michael Plass, February 25, 1987 9:18:40 pm PST
DIRECTORY Terminal, ImagerColorMap;
ThreshHack: CEDAR PROGRAM
IMPORTS Terminal, ImagerColorMap
~ BEGIN
Run: PROC ~ {
vt: Terminal.Virtual ~ Terminal.Current[];
array: REF Terminal.ColorTripleArray ← NEW[Terminal.ColorTripleArray ← ALL [[0,0,0]]];
i: NAT ← 256;
DO
y: NAT ~ MIN[MAX[Terminal.GetMousePosition[vt].y, 0], 256];
WHILE i > y DO i ← i - 1; array[i] ← [255, 255, 255] ENDLOOP;
WHILE i < y DO array[i] ← [0, 0, 0]; i ← i + 1 ENDLOOP;
Terminal.SetColorArray[vt, 0, array];
Terminal.WaitForBWVerticalRetrace[vt];
IF Terminal.GetMousePosition[vt].y > 800 THEN EXIT;
ENDLOOP;
ImagerColorMap.SetStandardGrayMap[vt];
};
END.