<> <<>> <> <> <> DIRECTORY Font USING [FONT], ImagerBasic USING [ColorRep, IntPair, IntRectangle, nullREAL, Pair, PixelArray, StrokeEnd, Transformation, Visibility], Rope USING [ROPE]; Imager: CEDAR DEFINITIONS = BEGIN <> <<>> <> <<>> <> << The page image. The page image is a two-dimensional image that accumulates results from primitive images being laid down. It plays the role of the painter's canvas.>> << The mask. The mask, specified for each primitive image to be added to the page image, determines exactly where the page image will be modified. In effect, the mask specifies an opening through which ink can be pressed onto the page image. The mask thus plays the role of the painter's brush stroke.>> << The color. The color specifies the color of the ink to be pushed through the mask onto the page image in order to add the primitive image to the page image; it may take on many colors, various shades of gray (including white and solid black), and transparent. To continue the painting analogy, the color specifies the color of paint in which to dip the brush.>> <<>> <> <<>> <> <<>> <> Color: TYPE = REF ImagerBasic.ColorRep; ConstantColor: TYPE = REF ImagerBasic.ColorRep[constant]; Pair: TYPE = ImagerBasic.Pair; PixelArray: TYPE = ImagerBasic.PixelArray; StrokeEnd: TYPE = ImagerBasic.StrokeEnd; Transformation: TYPE = ImagerBasic.Transformation; Visibility: TYPE = ImagerBasic.Visibility; nullREAL: REAL = ImagerBasic.nullREAL; FONT: TYPE = Font.FONT; ROPE: TYPE = Rope.ROPE; RopeOrRefText: TYPE = REF; <> Error: ERROR[errorCode: ErrorCode]; ErrorCode: TYPE = ATOM; <> <> Context: TYPE = REF ContextRep; ContextRep: TYPE = RECORD[class: REF ANY, data: REF ANY, state: REF ANY]; Create: PROC[deviceType: ATOM, data: REF _ NIL] RETURNS [Context]; <> <> <> <<>> <> <<>> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <<>> <> <<>> DoSave: PROC[context: Context, body: PROC]; DoSaveAll: PROC[context: Context, body: PROC]; SetPriorityImportant: PROC[context: Context, priorityImportant: BOOL]; <> <> <<>> <> pointsToMeters: Transformation; -- printer's points, 72.27 to the inch micasToMeters: Transformation; ConcatT: PROC[context: Context, m: Transformation]; <<>> TranslateT: PROC[context: Context, x, y: REAL]; <> <<>> RotateT: PROC[context: Context, a: REAL]; <> <<>> ScaleT: PROC[context: Context, s: REAL]; <> <<>> Scale2T: PROC[context: Context, sx, sy: REAL]; <> <<>> <<>> Move: PROC[context: Context]; <> <<>> Trans: PROC[context: Context]; <> <> <> <> <<>> SetXY: PROC[context: Context, p: Pair]; IntegerSetXY: PROC[context: Context, x, y: INTEGER]; <> <> <<>> SetXYRel: PROC[context: Context, v: Pair]; IntegerSetXYRel: PROC[context: Context, x, y: INTEGER]; <> <> SetXRel: PROC[context: Context, x: REAL]; IntegerSetXRel: PROC[context: Context, x: INTEGER]; <> <> <<>> SetYRel: PROC[context: Context, y: REAL]; IntegerSetYRel: PROC[context: Context, y: INTEGER]; <> <> <> <<>> <> <<>> MakeGray: PROC[f: REAL] RETURNS[ConstantColor]; <> <<>> black: ConstantColor; -- = MakeGray[1] white: ConstantColor; -- = MakeGray[0] SetColor: PROC[context: Context, color: Color]; <> <> <<>> <> <<>> <> << The current transformation, T, transforms the specified mask shape to determine the coordinates of the mask on the image.>> << The current color governs the color of the object that will be placed on the image.>> << If priorityImportant is TRUE, the priority order of objects laid down is preserved.>> << If noImage is TRUE, mask operators will have no effect on the image, although they will have the proper effect on the imager variables.>> <<>> <> <<>> Trajectory: TYPE = REF TrajectoryRep; TrajectoryRep: TYPE = PRIVATE RECORD[ prev: Trajectory, -- trajectory preceding this segment lp: Pair, -- the last point variant: SELECT tag: * FROM move => [], -- begin new trajectory at lp line => [], -- straight line segment, endpoints [prev.lp, lp] curve => [p1, p2: Pair], -- cubic curve segment, Bezier control points [prev.lp, p1, p2, lp] conic => [p1: Pair, r: REAL], -- conic section segment; see Full Interpress ENDCASE ]; <> LastPoint: PROC[t: Trajectory] RETURNS[Pair]; <> <<>> MoveTo: PROC[p: Pair] RETURNS[Trajectory]; <> <<>> LineTo: PROC[t: Trajectory, p: Pair] RETURNS[Trajectory]; <> <<>> LineToX: PROC[t: Trajectory, x: REAL] RETURNS[Trajectory]; <> <<>> LineToY: PROC[t: Trajectory, y: REAL] RETURNS[Trajectory]; <> <<>> CurveTo: PROC[t: Trajectory, p1, p2, p3: Pair] RETURNS[Trajectory]; <> <> ConicTo: PROC[t: Trajectory, p1, p2: Pair, r: REAL] RETURNS[Trajectory]; <> <> ArcTo: PROC[t: Trajectory, p1, p2: Pair] RETURNS[Trajectory]; <> Polygon: TYPE = REF PolygonRep; PolygonRep: TYPE = RECORD[length: NAT, vertices: SEQUENCE maxLength: NAT OF Pair]; Outline: TYPE = REF OutlineRep; OutlineRep: TYPE = RECORD[list: LIST OF Trajectory]; MakeOutline: PROC[LIST OF Trajectory] RETURNS[Outline]; <> <> <<>> <> <<>> MaskFill: PROC[context: Context, outline: REF]; <> <<>> SetStrokeWidth: PROC[context: Context, strokeWidth: REAL]; SetStrokeEnd: PROC[context: Context, strokeEnd: StrokeEnd]; defaultStrokeWidth: REAL = nullREAL; defaultStrokeEnd: StrokeEnd = nil; MaskStroke: PROC[context: Context, t: Trajectory, strokeWidth: REAL _ defaultStrokeWidth, strokeEnd: StrokeEnd _ defaultStrokeEnd]; <> <> <> <> <> <> <<>> MaskStrokeClosed: PROC[context: Context, t: Trajectory, strokeWidth: REAL _ defaultStrokeWidth]; <> MaskVector: PROC[context: Context, p1, p2: Pair, strokeWidth: REAL _ defaultStrokeWidth, strokeEnd: StrokeEnd _ defaultStrokeEnd]; <> <<>> MaskRectangle: PROC[context: Context, x, y, w, h: REAL]; IntegerMaskRectangle: PROC[context: Context, x, y, w, h: INTEGER]; <> <> <<>> <> <<>> StartUnderline: PROC[context: Context]; <> <<>> MaskUnderline: PROC[context: Context, dy, h: REAL]; IntegerMaskUnderline: PROC[context: Context, dy, h: INTEGER]; <> <> <<>> MaskPixel: PROC[context: Context, pa: PixelArray]; <> <<>> ClipOutline: PROC[context: Context, outline: REF]; ExcludeOutline: PROC[context: Context, outline: REF]; ClipRectangle: PROC[context: Context, x, y, w, h: REAL]; ExcludeRectangle: PROC[context: Context, x, y, w, h: REAL]; IntegerClipRectangle: PROC[context: Context, x, y, w, h: INTEGER]; IntegerExcludeRectangle: PROC[context: Context, x, y, w, h: INTEGER]; <<>> <> <<>> <> <<>> MakeFont: PROC[name: ROPE, size: REAL] RETURNS[FONT]; SetFont: PROC[context: Context, font: FONT]; ShowChar: PROC[context: Context, char: CHAR, font: FONT _ NIL]; ShowCharacters: PROC[context: Context, characters: RopeOrRefText, font: FONT _ NIL, start: INT _ 0, length: INT _ LAST[INT]]; SetAmplifySpace: PROC[context: Context, amplifySpace: REAL]; <> CorrectMask: PROC[context: Context]; CorrectSpace: PROC[context: Context, v: Pair]; Correct: PROC[context: Context, body: PROC]; SetCorrectMeasure: PROC[context: Context, v: Pair]; SetCorrectTolerance: PROC[context: Context, v: Pair]; SetCorrectShrink: PROC[context: Context, correctShrink: REAL]; Space: PROC[context: Context, x: REAL]; IntegerSpace: PROC[context: Context, x: INTEGER]; <<*** Remaining warts ***>> Reset: PROC[context: Context]; <> <<>> IntPair: TYPE = ImagerBasic.IntPair; IntRectangle: TYPE = ImagerBasic.IntRectangle; SetView: PROC[context: Context, box: IntRectangle, halftoneOrigin: IntPair _ [0, 0]]; <> <<>> ClipView: PROC[context: Context, box: IntRectangle, exclude: BOOL]; <> <<>> DrawBitmap: PROC[context: Context, base: LONG POINTER, raster: CARDINAL, area: IntRectangle]; <<>> MaskBits: PROC[context: Context, base: LONG POINTER, raster: CARDINAL, tile: IntRectangle, area: IntRectangle]; <> <> <> <> <> <> <> <> <> <<>> MoveSurfaceRectangle: PROC [context: Context, source: IntRectangle, dest: IntPair]; <> XOR: Color; MakeStipple: PROC[CARDINAL] RETURNS[Color]; TestRectangle: PROC[context: Context, x, y, w, h: REAL] RETURNS[Visibility]; GetSurfaceBounds: PROC[context: Context] RETURNS[IntRectangle]; <> <<>> GetViewBounds: PROC[context: Context] RETURNS[IntRectangle]; <> SpecialOp: PROC[context: Context, op: ATOM, data: REF] RETURNS[REF]; END.