ImagerCharImpl.mesa
Last Edited by: Crow, May 28, 1983 3:59 pm
DIRECTORY
Real     USING [Fix, Float],
ImagerTransform USING [Transform, InverseTransform, IntTransform, InverseIntTransform],
ImagerBasic   USING [Context, Vec, IntVec],
Imager;
ImagerCharImpl: CEDAR PROGRAM
IMPORTS Real, ImagerTransform
EXPORTS Imager
= BEGIN OPEN ImagerBasic;
Client-called Procedures
SetCP: PUBLIC PROC [context: Context, cp: Vec] = {  -- cp is delivered in client space
context.currentPosition ← ImagerTransform.Transform[context.transform, cp];
context.currentIntPosition.x ← Real.Fix[context.currentPosition.x];
context.currentIntPosition.y ← Real.Fix[context.currentPosition.y];
};
GetCP: PUBLIC PROC [context: Context, cp: Vec] = { -- cp is returned in client space
cp ← ImagerTransform.InverseTransform[context.transform, context.currentPosition];
};
SetIntCP: PUBLIC PROC [context: Context, cp: IntVec] = { -- cp is delivered in client space
context.currentIntPosition ← ImagerTransform.IntTransform[context.transform, cp];
context.currentPosition.x ← Real.Float[context.currentIntPosition.x];
context.currentPosition.y ← Real.Float[context.currentIntPosition.y];
};
GetIntCP: PUBLIC PROC [context: Context, cp: IntVec] = { -- cp is returned in client space
cp ← ImagerTransform.InverseIntTransform[context.transform, context.currentIntPosition];
};
END.