DIRECTORY Atom, Imager, ImagerBasic, ImagerPrivate, ImagerTransform, Real; ImagerPrivateImpl: CEDAR PROGRAM IMPORTS Atom, Imager, ImagerTransform, Real EXPORTS ImagerPrivate ~ BEGIN OPEN ImagerPrivate; imagerRegistrationKey: ATOM ~ $ImagerDeviceClass; RegisterDevice: PUBLIC PROC [class: ImagerPrivate.Class] ~ { Atom.PutProp[class.deviceType, imagerRegistrationKey, class]; }; InitState: PUBLIC PROC [context: Context, mediumXSize, mediumYSize, fieldXMin, fieldYMin, fieldXMax, fieldYMax: REAL] ~ { state: State _ NEW[ImagerPrivate.StateRep _ [ cpx: 0.0, cpy: 0.0, correctMX: 0.0, correctMY: 0.0, T: ImagerTransform.Create[1,0,0,0,1,0], priorityImportant: 0, mediumXSize: mediumXSize, mediumYSize: mediumYSize, fieldXMin: fieldXMin, fieldYMin: fieldYMin, fieldXMax: fieldXMax, fieldYMax: fieldYMax, showVec: NIL, color: NIL, noImage: 0, strokeWidth: 0.0, strokeEnd: 0, underlineStart: 0.0, amplifySpace: 1.0, correctPass: 0, correctShrink: 0.5, correctTX: 0.0, correctTY: 0.0, clipper: NIL, correctMaskCount: 0, correctMaskX: 0.0, correctMaskY: 0.0, correctSumX: 0.0, correctSumY: 0.0, correctSpaceX: 0.0, correctSpaceY: 0.0, correctcpx: 0.0, correctcpy: 0.0, correctTargetX: 0.0, correctTargetY: 0.0 ]]; state.color _ Imager.black; context.state _ state; }; IGet: PUBLIC PROC [context: Context, n: Name] RETURNS [REF] ~ { WITH context.state SELECT FROM state: State => { SELECT n FROM T => RETURN [NEW[ImagerBasic.Transformation _ state.T]]; showVec => RETURN [state.showVec]; color => RETURN [state.color]; clipOutline => RETURN [state.clipper]; ENDCASE => ERROR Imager.Error[$BadSelector]; }; ENDCASE => ERROR Imager.Error[$Bug]; }; ISet: PUBLIC PROC [context: Context, n: Name, x: REF] ~ { WITH context.state SELECT FROM state: State => { SELECT n FROM T => WITH x SELECT FROM t: REF ImagerBasic.Transformation => {state.T _ t^}; ENDCASE => ERROR Imager.Error[$WrongType]; showVec => state.showVec _ x; color => WITH x SELECT FROM color: ImagerBasic.Color => {state.color _ color}; ENDCASE => ERROR Imager.Error[$WrongType]; clipOutline => state.clipper _ x; ENDCASE => ERROR Imager.Error[$BadSelector]; }; ENDCASE => ERROR Imager.Error[$Bug]; }; IGetReal: PUBLIC PROC [context: Context, n: Name] RETURNS [x: REAL] ~ { WITH context.state SELECT FROM state: State => { SELECT n FROM DCScpx => x _ state.cpx; DCScpy => x _ state.cpy; correctMX => x _ state.correctMX; correctMY => x _ state.correctMY; mediumXSize => x _ state.mediumXSize; mediumYSize => x _ state.mediumYSize; fieldXMin => x _ state.fieldXMin; fieldYMin => x _ state.fieldYMin; fieldXMax => x _ state.fieldXMax; fieldYMax => x _ state.fieldYMax; strokeWidth => x _ state.strokeWidth; underlineStart => x _ state.underlineStart; amplifySpace => x _ state.amplifySpace; correctShrink => x _ state.correctShrink; correctTX => x _ state.correctTX; correctTY => x _ state.correctTY; ENDCASE => ERROR Imager.Error[$BadSelector]; }; ENDCASE => ERROR Imager.Error[$Bug]; }; ISetReal: PUBLIC PROC [context: Context, n: Name, x: REAL] ~ { WITH context.state SELECT FROM state: State => { SELECT n FROM DCScpx => state.cpx _ x; DCScpy => state.cpy _ x; correctMX => state.correctMX _ x; correctMY => state.correctMY _ x; mediumXSize => state.mediumXSize _ x; mediumYSize => state.mediumYSize _ x; fieldXMin => state.fieldXMin _ x; fieldYMin => state.fieldYMin _ x; fieldXMax => state.fieldXMax _ x; fieldYMax => state.fieldYMax _ x; strokeWidth => state.strokeWidth _ x; underlineStart => state.underlineStart _ x; amplifySpace => state.amplifySpace _ x; correctShrink => state.correctShrink _ x; correctTX => state.correctTX _ x; correctTY => state.correctTY _ x; ENDCASE => ERROR Imager.Error[$BadSelector]; }; ENDCASE => ERROR Imager.Error[$Bug]; }; IGetInt: PUBLIC PROC [context: Context, n: Name] RETURNS [x: INT] ~ { WITH context.state SELECT FROM state: State => { SELECT n FROM priorityImportant => x _ state.priorityImportant; noImage => x _ state.noImage; strokeEnd => x _ state.strokeEnd; correctPass => x _ state.correctPass; ENDCASE => ERROR Imager.Error[$BadSelector]; }; ENDCASE => ERROR Imager.Error[$Bug]; }; ISetInt: PUBLIC PROC [context: Context, n: Name, x: INT] ~ { WITH context.state SELECT FROM state: State => { SELECT n FROM priorityImportant => state.priorityImportant _ x; noImage => state.noImage _ x; strokeEnd => state.strokeEnd _ x; correctPass => state.correctPass _ x; ENDCASE => ERROR Imager.Error[$BadSelector]; }; ENDCASE => ERROR Imager.Error[$Bug]; }; ConcatT: PUBLIC PROC [context: Context, m: Transformation] ~ { WITH context.state SELECT FROM state: State => { state.T _ ImagerTransform.Concat[m, state.T]; }; ENDCASE => ERROR Imager.Error[$Bug]; }; TranslateT: PUBLIC PROC [context: Context, x, y: REAL] ~ { WITH context.state SELECT FROM state: State => { state.T _ ImagerTransform.PreTranslate[x, y, state.T]; }; ENDCASE => ERROR Imager.Error[$Bug]; }; RotateT: PUBLIC PROC [context: Context, degrees: REAL] ~ { WITH context.state SELECT FROM state: State => { state.T _ ImagerTransform.PreRotate[degrees, state.T]; }; ENDCASE => ERROR Imager.Error[$Bug]; }; ScaleT: PUBLIC PROC [context: Context, s: REAL] ~ { WITH context.state SELECT FROM state: State => { state.T _ ImagerTransform.PreScale[s, s, state.T]; }; ENDCASE => ERROR Imager.Error[$Bug]; }; Scale2T: PUBLIC PROC [context: Context, sx, sy: REAL] ~ { WITH context.state SELECT FROM state: State => { state.T _ ImagerTransform.PreScale[sx, sy, state.T]; }; ENDCASE => ERROR Imager.Error[$Bug]; }; Move: PUBLIC PROC [context: Context] ~ { WITH context.state SELECT FROM state: State => { state.T.c _ state.cpx; state.T.f _ state.cpy; }; ENDCASE => ERROR Imager.Error[$Bug]; }; Trans: PUBLIC PROC [context: Context] ~ { WITH context.state SELECT FROM state: State => { state.T.c _ Real.RoundLI[state.cpx]; state.T.f _ Real.RoundLI[state.cpy]; }; ENDCASE => ERROR Imager.Error[$Bug]; }; SetXY: PUBLIC PROC [context: Context, p: Pair] ~ { WITH context.state SELECT FROM state: State => { [[state.cpx, state.cpy]] _ ImagerTransform.Transform[p, state.T]; }; ENDCASE => ERROR Imager.Error[$Bug]; }; IntegerSetXY: PUBLIC PROC [context: Context, x, y: INTEGER] ~ { WITH context.state SELECT FROM state: State => { [[state.cpx, state.cpy]] _ ImagerTransform.Transform[[x, y], state.T]; }; ENDCASE => ERROR Imager.Error[$Bug]; }; SetXYRel: PUBLIC PROC [context: Context, v: Pair] ~ { WITH context.state SELECT FROM state: State => { delta: Pair ~ ImagerTransform.TransformVec[v, state.T]; state.cpx _ state.cpx + delta.x; state.cpy _ state.cpy + delta.y; }; ENDCASE => ERROR Imager.Error[$Bug]; }; IntegerSetXYRel: PUBLIC PROC [context: Context, x, y: INTEGER] ~ { WITH context.state SELECT FROM state: State => { delta: Pair ~ ImagerTransform.TransformVec[[x, y], state.T]; state.cpx _ state.cpx + delta.x; state.cpy _ state.cpy + delta.y; }; ENDCASE => ERROR Imager.Error[$Bug]; }; GetCP: PUBLIC PROC [context: Context] RETURNS [cp: Pair] ~ { WITH context.state SELECT FROM state: State => { cp _ ImagerTransform.InverseTransform[[state.cpx, state.cpy], state.T]; }; ENDCASE => ERROR Imager.Error[$Bug]; }; GetCPRounded: PUBLIC PROC [context: Context] RETURNS [cp: Pair] ~ { WITH context.state SELECT FROM state: State => { cp _ ImagerTransform.InverseTransform[[Real.RoundLI[state.cpx], Real.RoundLI[state.cpy]], state.T]; }; ENDCASE => ERROR Imager.Error[$Bug]; }; StartUnderline: PUBLIC PROC [context: Context] ~ { WITH context.state SELECT FROM state: State => { ERROR Imager.Error[$NotYetImplemented]; }; ENDCASE => ERROR Imager.Error[$Bug]; }; CorrectMask: PUBLIC PROC [context: Context] ~ { WITH context.state SELECT FROM state: State => { ERROR Imager.Error[$NotYetImplemented]; }; ENDCASE => ERROR Imager.Error[$Bug]; }; CorrectSpace: PUBLIC PROC [context: Context, v: Pair] ~ { WITH context.state SELECT FROM state: State => { ERROR Imager.Error[$NotYetImplemented]; }; ENDCASE => ERROR Imager.Error[$Bug]; }; SetCorrectMeasure: PUBLIC PROC [context: Context, v: Pair] ~ { WITH context.state SELECT FROM state: State => { ERROR Imager.Error[$NotYetImplemented]; }; ENDCASE => ERROR Imager.Error[$Bug]; }; SetCorrectTolerance: PUBLIC PROC [context: Context, v: Pair] ~ { WITH context.state SELECT FROM state: State => { ERROR Imager.Error[$NotYetImplemented]; }; ENDCASE => ERROR Imager.Error[$Bug]; }; Space: PUBLIC PROC [context: Context, x: REAL] ~ { WITH context.state SELECT FROM state: State => { ERROR Imager.Error[$NotYetImplemented]; }; ENDCASE => ERROR Imager.Error[$Bug]; }; IntegerSpace: PUBLIC PROC [context: Context, x: INTEGER] ~ { WITH context.state SELECT FROM state: State => { ERROR Imager.Error[$NotYetImplemented]; }; ENDCASE => ERROR Imager.Error[$Bug]; }; Correct: PUBLIC PROC [context: Context, body: PUBLIC PROC] ~ { WITH context.state SELECT FROM state: State => { ERROR Imager.Error[$NotYetImplemented]; }; ENDCASE => ERROR Imager.Error[$Bug]; }; Reset: PUBLIC PROC [context: Context] ~ { WITH context.state SELECT FROM state: State => { ERROR Imager.Error[$NotYetImplemented]; }; ENDCASE => ERROR Imager.Error[$Bug]; }; DrawBitmap: PUBLIC PROC [context: Context, base: LONG POINTER, raster: CARDINAL, area: IntRectangle] ~ { ERROR Imager.Error[$NotYetImplemented]; }; MaskBits: PUBLIC PROC [context: Context, base: LONG POINTER, raster: CARDINAL, tile: IntRectangle, area: IntRectangle] ~ { ERROR Imager.Error[$NotYetImplemented]; }; GetSurfaceBounds: PUBLIC PROC [context: Context] RETURNS [IntRectangle] ~ { WITH context.state SELECT FROM state: State => { ERROR Imager.Error[$NotYetImplemented]; }; ENDCASE => ERROR Imager.Error[$Bug]; }; END. FImagerPrivateImpl.mesa Michael Plass, October 27, 1983 2:50 pm Ê Z˜J™J™'J˜JšÏk œA˜Jšœœ˜ Jšœ$˜+Jšœ˜—šœœœ˜J˜—Jšœœ˜1šÏnœ œ!˜šœœ˜šœ˜šœ˜ Jšœ˜Jšœ˜Jšœ!˜!Jšœ!˜!Jšœ%˜%Jšœ%˜%Jšœ!˜!Jšœ!˜!Jšœ!˜!Jšœ!˜!Jšœ%˜%Jšœ+˜+Jšœ'˜'Jšœ)˜)Jšœ!˜!Jšœ!˜!Jšœœ˜,—Jšœ˜—Jšœœ˜$—Jšœ˜J˜—š žœœœœœ˜Ešœœ˜šœ˜šœ˜ Jšœ1˜1Jšœ˜Jšœ!˜!Jšœ%˜%Jšœœ˜,—Jšœ˜—Jšœœ˜$—Jšœ˜J˜—šžœ œ œ˜<šœœ˜šœ˜šœ˜ Jšœ1˜1Jšœ˜Jšœ!˜!Jšœ%˜%Jšœœ˜,—Jšœ˜—Jšœœ˜$—Jšœ˜J˜—šžœ œ*˜>šœœ˜šœ˜Jšœ-˜-Jšœ˜—Jšœœ˜$—Jšœ˜J˜—šž œ œœ˜:šœœ˜šœ˜Jšœ6˜6Jšœ˜—Jšœœ˜$—Jšœ˜J˜—šžœ œœ˜:šœœ˜šœ˜Jšœ6˜6Jšœ˜—Jšœœ˜$—Jšœ˜J˜—šžœ œœ˜3šœœ˜šœ˜Jšœ2˜2Jšœ˜—Jšœœ˜$—Jšœ˜J˜—šžœ œœ˜9šœœ˜šœ˜Jšœ4˜4Jšœ˜—Jšœœ˜$—Jšœ˜J˜—šžœ œ˜(šœœ˜šœ˜Jšœ˜Jšœ˜Jšœ˜—Jšœœ˜$—Jšœ˜J˜—šžœ œ˜)šœœ˜šœ˜Jšœ$˜$Jšœ$˜$Jšœ˜—Jšœœ˜$—Jšœ˜J˜—šžœ œ ˜2šœœ˜šœ˜JšœA˜AJšœ˜—Jšœœ˜$—Jšœ˜J˜—šž œ œœ˜?šœœ˜šœ˜JšœF˜FJšœ˜—Jšœœ˜$—Jšœ˜J˜—šžœ œ ˜5šœœ˜šœ˜Jšœ7˜7Jšœ ˜ Jšœ ˜ Jšœ˜—Jšœœ˜$—Jšœ˜J˜—šžœ œœ˜Bšœœ˜šœ˜Jšœ<˜šœœ˜šœ˜Jšœ"˜'Jšœ˜—Jšœœ˜$—Jšœ˜J˜—šžœ œ ˜@šœœ˜šœ˜Jšœ"˜'Jšœ˜—Jšœœ˜$—Jšœ˜J˜—šžœ œœ˜2šœœ˜šœ˜Jšœ"˜'Jšœ˜—Jšœœ˜$—Jšœ˜J˜—šž œ œœ˜<šœœ˜šœ˜Jšœ"˜'Jšœ˜—Jšœœ˜$—Jšœ˜J˜—šžœ œ œ˜>šœœ˜šœ˜Jšœ"˜'Jšœ˜—Jšœœ˜$—Jšœ˜J˜—šžœ œ˜)šœœ˜šœ˜Jšœ"˜'Jšœ˜—Jšœœ˜$—Jšœ˜J˜—š ž œ œœœ œ˜hJšœ"˜'Jšœ˜J˜—š žœ œœœ œ-˜zJšœ"˜'Jšœ˜J˜—šžœ œœ˜Kšœœ˜šœ˜Jšœ"˜'Jšœ˜—Jšœœ˜$—Jšœ˜J˜—Jšœ˜—…—%h3