<<>> <> <> <> <> <<>> <> <<>> DIRECTORY ImagerBox USING [Box, Rectangle], ImagerColor USING [Color, ColorOperator, ConstantColor, SampledColor, Structure, SpecialColor], ImagerError USING [ErrorDesc], ImagerFont USING [Font, XChar, XStringProc], ImagerPath USING [Outline, PathProc, Trajectory], ImagerPixel USING [PixelMap], ImagerPixelArray USING [PixelArray], ImagerSample USING [SampleMap], ImagerTransformation USING [ScanMode, Transformation], Prop USING [PropList], Rope USING [ROPE, XROPE], SF USING [Vec, zeroVec], Vector2 USING [VEC]; Imager: CEDAR DEFINITIONS ~ BEGIN VEC: TYPE ~ Vector2.VEC; -- RECORD [x, y: REAL] zeroVEC: VEC ~ [0.0, 0.0]; Rectangle: TYPE ~ ImagerBox.Rectangle; -- RECORD [x, y, w, h: REAL] Transformation: TYPE ~ ImagerTransformation.Transformation; PathProc: TYPE ~ ImagerPath.PathProc; Trajectory: TYPE ~ ImagerPath.Trajectory; Outline: TYPE ~ ImagerPath.Outline; PixelArray: TYPE ~ ImagerPixelArray.PixelArray; SampleMap: TYPE ~ ImagerSample.SampleMap; PixelMap: TYPE ~ ImagerPixel.PixelMap; ScanMode: TYPE ~ ImagerTransformation.ScanMode; defaultScanMode: ScanMode ~ [slow: down, fast: right]; Color: TYPE ~ ImagerColor.Color; ConstantColor: TYPE ~ ImagerColor.ConstantColor; SampledColor: TYPE ~ ImagerColor.SampledColor; SpecialColor: TYPE ~ ImagerColor.SpecialColor; Structure: TYPE ~ ImagerColor.Structure; ColorOperator: TYPE ~ ImagerColor.ColorOperator; Font: TYPE ~ ImagerFont.Font; XChar: TYPE ~ ImagerFont.XChar; XStringProc: TYPE ~ ImagerFont.XStringProc; ROPE: TYPE ~ Rope.ROPE; XROPE: TYPE ~ Rope.XROPE; <> Context: TYPE ~ REF ContextRep; ContextRep: TYPE ~ RECORD [ class: REF ClassRep, -- operations for the context class state: REF StateRep, -- context state, if standard representation data: REF, -- instance data (class-dependent type) propList: Prop.PropList ¬ NIL -- instance property list ]; ClassRep: TYPE; -- ImagerPrivate.ClassRep StateRep: TYPE; -- ImagerState.StateRep Error: VAR ERROR [error: ImagerError.ErrorDesc]; Warning: VAR SIGNAL [error: ImagerError.ErrorDesc]; SetWarn: PROC [context: Context, warn: BOOL]; <> <<>> <<>> GetClass: PROC [context: Context] RETURNS [ATOM]; <> PutProp: PROC [context: Context, key: REF, val: REF]; GetProp: PROC [context: Context, key: REF] RETURNS [val: REF]; <> <<>> DoSave: PROC [context: Context, action: PROC]; DoSaveAll: PROC [context: Context, action: PROC]; <> <> <> <<>> <> metersPerInch: REAL ~ 0.0254; metersPerPoint: REAL ~ 0.0003514598; metersPerMica: REAL ~ 0.00001; pointsPerInch: REAL ~ 72.27; pointsPerMica: REAL ~ 0.028452756; micasPerInch: REAL ~ 2540.0; micasPerPoint: REAL ~ 35.14598; inchesPerPoint: REAL ~ 0.013837; inchesPerMica: REAL ~ 0.00039370079; <> <<>> <<>> ConcatT: PROC [context: Context, m: Transformation]; <> <<>> ScaleT: PROC [context: Context, s: REAL]; <> <> <<>> Scale2T: PROC [context: Context, s: VEC]; <> <<>> RotateT: PROC [context: Context, a: REAL]; <> <> <<>> TranslateT: PROC [context: Context, t: VEC]; <> <<>> <<>> Move: PROC [context: Context]; <> <<>> Trans: PROC [context: Context]; <> <<>> SetXY: PROC [context: Context, p: VEC]; SetXYI: PROC [context: Context, x, y: INTEGER]; <> <<>> SetXYRel: PROC [context: Context, v: VEC]; SetXYRelI: PROC [context: Context, x, y: INTEGER]; <> SetXRel: PROC [context: Context, x: REAL]; SetXRelI: PROC [context: Context, x: INTEGER]; <> <<>> SetYRel: PROC [context: Context, y: REAL]; SetYRelI: PROC [context: Context, y: INTEGER]; <> <<>> <> FindFontScaled: PROC [name: ROPE, s: REAL] RETURNS [Font]; <> <<>> SetFont: PROC [context: Context, font: Font]; <> SetAmplifySpace: PROC [context: Context, amplifySpace: REAL]; <> Show: PROC [context: Context, string: XStringProc, xrel: BOOL ¬ FALSE]; <> <> ShowAndFixedXRel: PROC [context: Context, string: XStringProc, x: REAL]; <> ShowBackward: PROC [context: Context, string: XStringProc]; <> ShowChar: PROC [context: Context, char: CHAR]; <> <<>> ShowXChar: PROC [context: Context, char: XChar]; <> <<>> ShowXRope: PROC [context: Context, rope: XROPE, start: INT ¬ 0, len: INT ¬ INT.LAST, xrel: BOOL ¬ FALSE]; <> <<>> ShowRope: PROC [context: Context, rope: ROPE, start: INT ¬ 0, len: INT ¬ INT.LAST, xrel: BOOL ¬ FALSE]; <> <<>> ShowText: PROC [context: Context, text: REF READONLY TEXT, start: NAT ¬ 0, len: NAT ¬ NAT.LAST, xrel: BOOL ¬ FALSE]; <> <<>> <<>> StartUnderline: PROC [context: Context]; <> <<>> MaskUnderline: PROC [context: Context, dy, h: REAL]; MaskUnderlineI: PROC [context: Context, dy, h: INTEGER]; <> <> <> <<>> CorrectMask: PROC [context: Context]; CorrectSpace: PROC [context: Context, v: VEC]; <> <> Space: PROC [context: Context, x: REAL]; SpaceI: PROC [context: Context, x: INTEGER]; <> <> <<>> SetCorrectMeasure: PROC [context: Context, v: VEC]; <> <<>> SetCorrectTolerance: PROC [context: Context, v: VEC]; <> <<>> SetCorrectShrink: PROC [context: Context, correctShrink: REAL]; <> <<>> <<>> Correct: PROC [context: Context, action: PROC]; <> <> <> <> <<>> DontCorrect: PROC [context: Context, action: PROC, saveCP: BOOL ¬ FALSE]; <> <> <> <> SetColor: PROC [context: Context, color: Color]; <> MakeGray: PROC [f: REAL] RETURNS [ConstantColor]; <> <<>> black: READONLY ConstantColor; -- MakeGray[1] white: READONLY ConstantColor; -- MakeGray[0] SetGray: PROC [context: Context, f: REAL]; <> <<>> SetSampledColor: PROC [context: Context, pa: PixelArray, m: Transformation ¬ NIL, colorOperator: ColorOperator]; <> <> <<>> SetSampledBlack: PROC [context: Context, pa: PixelArray, m: Transformation ¬ NIL, clear: BOOL ¬ FALSE]; <> <> <<>> DrawSampledColor: PROC [context: Context, pa: PixelArray, colorOperator: ColorOperator, m: Transformation ¬ NIL, position: VEC ¬ zeroVEC]; <> <> <> <<>> DrawPixels: PROC [context: Context, pixelMap: PixelMap, colorOperator: ColorOperator, referencePoint: SF.Vec ¬ SF.zeroVec, scanMode: ScanMode ¬ defaultScanMode, position: VEC ¬ zeroVEC]; <> <<>> DrawBitmap: PROC [context: Context, bitmap: SampleMap, referencePoint: SF.Vec ¬ SF.zeroVec, scanMode: ScanMode ¬ defaultScanMode, position: VEC ¬ zeroVEC]; <> <<>> <> MaskFill: PROC [context: Context, path: PathProc, oddWrap: BOOL ¬ FALSE]; <> <> <> <> <<>> MaskFillTrajectory: PROC [context: Context, trajectory: Trajectory, oddWrap: BOOL ¬ FALSE]; <> <<>> MaskFillOutline: PROC [context: Context, outline: Outline]; <> <<>> MaskRectangle: PROC [context: Context, r: Rectangle]; MaskRectangleI: PROC [context: Context, x, y, w, h: INTEGER]; <> <<>> Box: TYPE ~ ImagerBox.Box; -- RECORD [xmin, ymin, xmax, ymax: REAL] MaskBox: PROC [context: Context, box: Box]; <> <> <<>> SetStrokeWidth: PROC [context: Context, strokeWidth: REAL]; <> StrokeEnd: TYPE ~ MACHINE DEPENDENT { square, butt, round, (15) }; <> <> <> SetStrokeEnd: PROC [context: Context, strokeEnd: StrokeEnd]; <> StrokeJoint: TYPE ~ MACHINE DEPENDENT { miter, bevel, round, (15) }; <> <> <> SetStrokeJoint: PROC [context: Context, strokeJoint: StrokeJoint]; <> MaskStroke: PROC [context: Context, path: PathProc, closed: BOOL ¬ FALSE]; <> <> <> <> <<>> MaskStrokeTrajectory: PROC [context: Context, trajectory: Trajectory, closed: BOOL ¬ FALSE]; <> <<>> MaskVector: PROC [context: Context, p1, p2: VEC]; MaskVectorI: PROC [context: Context, x1, y1, x2, y2: INTEGER]; <> <<>> MaskDashedStroke: PROC [context: Context, path: PathProc, patternLen: NAT, pattern: PROC [NAT] RETURNS [REAL], offset, length: REAL]; <<>> MaskDashedStrokeTrajectory: PROC [context: Context, trajectory: Trajectory, patternLen: NAT, pattern: PROC [NAT] RETURNS [REAL], offset, length: REAL]; <<>> <<>> MaskPixel: PROC [context: Context, pa: PixelArray]; <> MaskBitmap: PROC [context: Context, bitmap: SampleMap, referencePoint: SF.Vec ¬ SF.zeroVec, scanMode: ScanMode ¬ defaultScanMode, position: VEC ¬ zeroVEC]; <> SetPriorityImportant: PROC [context: Context, priorityImportant: BOOL]; <> <<>> SetNoImage: PROC [context: Context, noImage: BOOL]; <> <<>> Clip: PROC [context: Context, path: PathProc, oddWrap, exclude: BOOL ¬ FALSE]; <> <> <> ClipOutline: PROC [context: Context, outline: Outline, exclude: BOOL ¬ FALSE]; <> ClipRectangle: PROC [context: Context, r: Rectangle, exclude: BOOL ¬ FALSE]; ClipRectangleI: PROC [context: Context, x, y, w, h: INTEGER, exclude: BOOL ¬ FALSE]; <> <> DoIfVisible: PROC [context: Context, r: Rectangle, action: PROC]; <> <<>> DoWithBuffer: PROC [context: Context, action: PROC, x, y, w, h: INTEGER, backgroundColor: Color ¬ NIL]; <> <> <<>> Object: TYPE ~ REF ObjectRep; ObjectRep: TYPE ~ RECORD [draw: PROC [self: Object, context: Context], clip: Rectangle, data: REF]; <> DrawObject: PROC [context: Context, object: Object, position: VEC ¬ zeroVEC, interactive: BOOL ¬ FALSE]; <> <> END.