<> <> <> <> <<>> <> DIRECTORY Font USING [FONT], ImagerColor USING [Color, ConstantColor, SampledColor], ImagerPath USING [Path, PathProc], ImagerPixelArray USING [PixelArray], ImagerTransformation USING [Transformation], Prop USING [PropList], Rope USING [ROPE], Vector2 USING [VEC]; Imager: CEDAR DEFINITIONS ~ BEGIN <> <> <> Context: TYPE ~ REF ContextRep; ContextRep: TYPE ~ RECORD[ class: Class, -- procedures for the context class data: REF, -- instance data (type depends on the class) props: Prop.PropList -- instance property list ]; <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <<>> DoSave: PROC[context: Context, body: PROC]; DoSaveAll: PROC[context: Context, body: PROC]; <> <> <> PutProp: PROC[context: Context, key: REF, value: REF]; <> <<>> GetProp: PROC[context: Context, key: REF] RETURNS[value: REF]; <> <<>> RemProp: PROC[context: Context, key: REF]; <> <> Error: ERROR[errorCode: ErrorCode]; ErrorCode: TYPE ~ { Bug, -- detected an internal inconsistency Unimplemented, -- operation not provided for this context NotYetImplemented, -- part of the Imager implementation is incomplete ZeroDivideInCorrectSpace, -- CorrectSpace calculation tried to divide by zero UnableToProperlyAdjustMaskPositions, -- Correct failed to achieve target measure UnknownSpecialColor, -- unrecognized atom for a special Color UnknownColorModel, -- unrecognized colorOperator for a sampled color MustBeRopeOrRefText, -- characters argument is not ROPE or REF TEXT UnimplementedSpecialOp, -- unrecognized op for SpecialOp NonexistentFont, -- could not find requested font InvalidOutline, -- outline is wrong type or NIL InvalidStroke, -- stroke is wrong type or NIL GrayParameterOutOfRange, -- for SetGray or MakeGray, f<0 or f>1 WrongType -- variable value has wrong type for Set* or Get* }; <> <> <<>> Transformation: TYPE ~ ImagerTransformation.Transformation; ConcatT: PROC[context: Context, m: Transformation]; <> <<>> <<>> micasToMeters: REAL ~ 0.00001; inchesToMeters: REAL ~ micasToMeters*2540; pointsToMeters: REAL ~ inchesToMeters/72.27; <> <<>> ScaleT: PROC[context: Context, s: REAL]; <> <<>> Scale2T: PROC[context: Context, sx, sy: REAL]; <> <<>> RotateT: PROC[context: Context, a: REAL]; <> <> <<>> TranslateT: PROC[context: Context, x, y: REAL]; <> <<>> <<>> Move: PROC[context: Context]; <> <<>> Trans: PROC[context: Context]; <> <<>> <> <> <<>> Color: TYPE ~ ImagerBasic.Color; <> ConstantColor: TYPE ~ ImagerBasic.ConstantColor; MakeGray: PROC[f: REAL] RETURNS[ConstantColor]; <> <<>> black, white: READONLY ConstantColor; -- MakeGray[1] and MakeGray[0] <> SampledColor: TYPE ~ ImagerBasic.SampledColor; SetSampledColor: PROC[context: Context, pa: PixelArray, pixelT: Transformation, colorOperator: ATOM _ $Intensity]; SetSampledBlack: PROC[context: Context, pa: PixelArray, pixelT: Transformation, transparent: BOOLEAN _ FALSE]; <> <> <> <> <> <> <> <<>> <> SetColor: PROC[context: Context, color: Color]; <> SetGray: PROC[context: Context, f: REAL]; <> <<>> <> <> <<>> <> << 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.>> <<>> <> <<>> <<>> Pair: TYPE ~ Vector2.VEC; <> PathProc: TYPE ~ ImagerPath.PathProc; <> <> <> <> <> <> <> <<];>> <> <<>> <> <> <> <<};>> <<>> <> <> <> <> <> <> <<};>> <> <> <<};>> <<>> MaskFill: PROC[context: Context, pathProc: PathProc, pathData: REF _ NIL]; <> <> <<>> MaskRectangle: PROC[context: Context, x, y, w, h: REAL]; MaskRectangleI: PROC[context: Context, x, y, w, h: INTEGER] ~ INLINE { context.class.MaskRectangleI[context, x, y, w, h] }; <> <> <> <> <> <<>> Box: TYPE ~ RECORD[xmin, ymin, xmax, ymax: REAL]; MaskBox: PROC[context: Context, box: Box]; <> <> <> <> <<>> SetStrokeWidth: PROC[context: Context, strokeWidth: REAL]; <> <<>> StrokeEnd: TYPE ~ {square, butt, round}; <> <> <> SetStrokeEnd: PROC[context: Context, strokeEnd: StrokeEnd]; <> MaskStroke: PROC[context: Context, pathProc: PathProc, pathData: REF _ NIL]; <> <> <> <<>> MaskStrokeClosed: PROC[context: Context, pathProc: PathProc, pathData: REF _ NIL]; <> <<>> MaskVector: PROC[context: Context, p1, p2: Pair]; <> <> <> <> <<>> PixelArray: TYPE ~ ImagerPixelArrays.PixelArray; MaskPixel: PROC[context: Context, pa: PixelArray]; Bitmap: TYPE ~ RECORD[ base: LONG POINTER, wpl: NAT, -- starting address, words per line w, h: NAT, -- width and height, in bits x, y: NAT, ox, oy: INTEGER ]; MaskBitmap: PROC[context: Context, x, y: INTEGER, bitmap: Bitmap]; SetPriorityImportant: PROC[context: Context, priorityImportant: BOOL]; <> <> <<>> SetNoImage: PROC[context: Context, noImage: BOOL]; <> <<>> <> <> <> <<>> SetXY: PROC[context: Context, p: Pair]; SetXYI: PROC[context: Context, x, y: INTEGER] ~ INLINE { context.class.SetXYI[context, x, y] }; <> <<>> SetXYRel: PROC[context: Context, v: Pair]; SetXYRelI: PROC[context: Context, x, y: INTEGER] ~ INLINE { context.class.SetXYRelI[context, x, y] }; <> SetXRel: PROC[context: Context, x: REAL]; SetXRelI: PROC[context: Context, x: INTEGER] ~ INLINE { context.class.SetXYRelI[context, x, 0] }; <> <<>> SetYRel: PROC[context: Context, y: REAL]; SetYRelI: PROC[context: Context, y: INTEGER] ~ INLINE { context.class.SetXYRelI[context, 0, y] }; <> <> <<>> <> <<>> FONT: TYPE ~ Font.FONT; ROPE: TYPE ~ Rope.ROPE; MakeFont: PROC[name: ROPE, size: REAL] RETURNS[FONT]; <> SetFont: PROC[context: Context, font: FONT]; ShowRope: PROC[context: Context, rope: ROPE, start: INT _ 0, len: INT _ INT.LAST]; ShowText: PROC[context: Context, text: REF READONLY TEXT, start: NAT _ 0, len: NAT _ NAT.LAST]; <> <<>> ShowChar: PROC[context: Context, char: CHAR]; ShowCharCode: PROC[context: Context, charCode: CARDINAL]; SetAmplifySpace: PROC[context: Context, amplifySpace: REAL]; <> <> <<>> StartUnderline: PROC[context: Context]; <> <<>> MaskUnderline: PROC[context: Context, dy, h: REAL]; MaskUnderlineI: PROC[context: Context, dy, h: INTEGER] ~ INLINE { context.class.MaskUnderlineI[context, dy, h] }; <> <> <<>> <> CorrectMask: PROC[context: Context]; CorrectSpace: PROC[context: Context, v: Pair]; CorrectSpaceXY: PROC[context: Context, x, y: REAL]; Correct: PROC[context: Context, body: PROC]; SetCorrectMeasure: PROC[context: Context, v: Pair]; SetCorrectMeasureXY: PROC[context: Context, x, y: REAL]; SetCorrectTolerance: PROC[context: Context, v: Pair]; SetCorrectToleranceXY: PROC[context: Context, x, y: REAL]; SetCorrectShrink: PROC[context: Context, correctShrink: REAL]; Space: PROC[context: Context, x: REAL]; SpaceI: PROC[context: Context, x: INTEGER] ~ INLINE { context.class.SpaceI[context, x] }; <> <> <<>> ClipOutline: PROC[context: Context, pathProc: PathProc, pathData: REF _ NIL]; ClipOutlinePath: PROC[context: Context, path: Path]; ExcludeOutline: PROC[context: Context, pathProc: PathProc, pathData: REF _ NIL]; ExcludeOutlinePath: PROC[context: Context, path: Path]; ClipRectangle: PROC[context: Context, x, y, w, h: REAL]; ClipRectangleI: PROC[context: Context, x, y, w, h: INTEGER]; ExcludeRectangle: PROC[context: Context, x, y, w, h: REAL]; ExcludeRectangleI: PROC[context: Context, x, y, w, h: INTEGER]; <<>> <> Key: TYPE ~ { DCScpx, DCScpy, correctMX, correctMY, T, priorityImportant, font, color, noImage, strokeWidth, strokeEnd, underlineStart, amplifySpace, correctPass, correctShrink, correctTX, correctTY, clipper, spare1, spare2, spare3}; Class: TYPE ~ REF ClassRep; ClassRep: TYPE ~ RECORD[ type: ATOM, DoSave: PROC[context: Context, body: PROC] _, DoSaveAll: PROC[context: Context, body: PROC] _, SetRef: PROC[context: Context, key: Key, value: REF] _, SetReal: PROC[context: Context, key: Key, value: REAL] _, SetInt: PROC[context: Context, key: Key, value: INT] _, GetRef: PROC[context: Context, key: Key] RETURNS[REF] _, GetReal: PROC[context: Context, key: Key] RETURNS[REAL] _, GetInt: PROC[context: Context, key: Key] RETURNS[INT] _, ConcatT: PROC[context: Context, m: Transformation] _, Scale2T: PROC[context: Context, sx, sy: REAL] _, RotateT: PROC[context: Context, a: REAL] _, TranslateT: PROC[context: Context, x, y: REAL] _, Move: PROC[context: Context] _, Trans: PROC[context: Context] _, SetFont: PROC[context: Context, font: FONT] _, ShowRope: PROC[context: Context, rope: ROPE, start, len: INT] _, ShowText: PROC[context: Context, text: REF READONLY TEXT, start, len: NAT] _, ShowCharCode: PROC[context: Context, charCode: CARDINAL] _, SetXY: PROC[context: Context, p: Pair] _, SetXYI: PROC[context: Context, x, y: INTEGER] _, SetXYRel: PROC[context: Context, v: Pair] _, SetXYRelI: PROC[context: Context, x, y: INTEGER] _, GetCP: PROC[context: Context] RETURNS[Pair] _, MaskFill: PROC[context: Context, pathProc: PathProc, pathData: REF] _, MaskStroke: PROC[context: Context, pathProc: PathProc, pathData: REF, closed: BOOL] _, MaskRectangle: PROC[context: Context, x, y, w, h: REAL] _, MaskRectangleI: PROC[context: Context, x, y, w, h: INTEGER] _, MaskVector: PROC[context: Context, p1, p2: Pair] _, MaskVectorI: PROC[context: Context, x1, y1, x2, y2: INTEGER] _, StartUnderline: PROC[context: Context] _, MaskUnderline: PROC[context: Context, dy, h: REAL] _, MaskUnderlineI: PROC[context: Context, dy, h: INTEGER] _, MaskPixel: PROC[context: Context, pa: PixelArray] _, SetColor: PROC[context: Context, color: Color] _, SetGray: PROC[context: Context, f: REAL] _, SetSampledColor: PROC[context: Context, pa: PixelArray, pixelT: Transformation, colorOperator: ATOM] _, SetSampledBlack: PROC[context: Context, pa: PixelArray, pixelT: Transformation, transparent: BOOL] _, ClipOutline: PROC[context: Context, pathProc: PathProc, pathData: REF, exclude: BOOL] _, ClipRectangle: PROC[context: Context, x, y, w, h: REAL, exclude: BOOL] _, ClipRectangleI: PROC[context: Context, x, y, w, h: INTEGER, exclude: BOOL] _, 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] _, Space: PROC[context: Context, x: REAL] _, SpaceI: PROC[context: Context, x: INTEGER] _, props: Prop.PropList _ NIL ]; <<>> END.