<> <> 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; <> 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.