DIRECTORY
Cursors USING [CursorType],
ImagerPixelMap USING [DeviceRectangle],
ImagerTransformation USING [Transformation],
Intime USING [EventTime],
Rope USING [ROPE],
SampleArrayDisplay USING [Sampler],
SampleArrays USING [SampleArray],
SampleMapOps USING [CVEC, SampleMap],
SelectRegions USING [nullRectangle, Rectangle, RGB],
TIPUser USING [TIPScreenCoordsRec],
ViewerClasses USING [Viewer];
~
BEGIN
CVEC: TYPE ~ SampleMapOps.CVEC;
DeviceRectangle: TYPE ~ ImagerPixelMap.DeviceRectangle;
Rectangle: TYPE ~ SelectRegions.Rectangle;
ROPE: TYPE ~ Rope.ROPE;
SampleMap: TYPE ~ SampleMapOps.SampleMap;
Transformation: TYPE ~ ImagerTransformation.Transformation;
Viewer: TYPE ~ ViewerClasses.Viewer;
Button: TYPE ~ {left, middle, right};
State: TYPE ~ {ready, mouseDown, abort, menu};
ColorEditViewerData: TYPE ~ REF ColorEditViewerDataRec;
ColorEditViewerDataRec:
PUBLIC
TYPE ~
RECORD [
--Exported
sa: SampleArrays.SampleArray ← NIL,
sm: SampleMap ← NIL,
m, mInverse: Transformation,
fast, slow: SampleArrayDisplay.Sampler ← NIL, --How to pick the pixels
picture: DeviceRectangle, --Has bounds of picture
extent: Rectangle ← SelectRegions.nullRectangle,
referentColor: SelectRegions.RGB, --Used for thinking about a color
changeLog: ROPE ← NIL, --Changes since last saved
ts: TIPState,
clientData: REF ANY ← NIL --Whatever the client asks for...
];
TIPState:
TYPE ~
RECORD [
from, pos: TIPUser.TIPScreenCoordsRec,
rect: Rectangle,
loc: CVEC,
ignoreUntil: Intime.EventTime, --While state=menu, ignore TIP events except TIPTables.TIPTime's, which we use to return to ready mode.
state: State ← ready,
shift, ctrl, double: BOOLEAN ← FALSE, --These are set when left or right mouse button press (i.e. when Press or PressRt called), and remain in that state until Abort(?Rt) or Release(?Rt) are called.
toUndo: Operation,
button: Button ← left
];
Operation: TYPE ~ REF OperationRec;
OperationRec:
TYPE ~
RECORD [
press, drag, release, abort, undo: TIPCmdProc ← NIL,
cursor: Cursors.CursorType
];
TIPCmdProc: TYPE ~ PROC [self: Viewer, data: ColorEditViewerData];