DIRECTORY PS, PSGraphics; PSGraphicsPrimitivesImpl: CEDAR PROGRAM IMPORTS PS, PSGraphics EXPORTS PS ~ BEGIN OPEN PSGraphics, PS; Scratch: TYPE ~ REF ScratchRep; ScratchRep: PUBLIC TYPE ~ RECORD [matrix1, matrix2, matrix3: Matrix]; PopVec: PROC [self: Root] RETURNS [vec: VEC] ~ { vec.y _ PopReal[self]; vec.x _ PopReal[self]; }; PushVec: PROC [self: Root, vec: VEC] ~ { PushReal[self, vec.x]; PushReal[self, vec.y]; }; PopMatrix: PUBLIC PROC [self: Root, result: Matrix] RETURNS [Matrix] ~ { array: Array ~ PopArray[self]; IF ArrayLength[array]#6 THEN ERROR Error[typecheck]; result^ _ [ a: RealFromAny[ArrayGet[array, 0]], b: RealFromAny[ArrayGet[array, 1]], c: RealFromAny[ArrayGet[array, 2]], d: RealFromAny[ArrayGet[array, 3]], tx: RealFromAny[ArrayGet[array, 4]], ty: RealFromAny[ArrayGet[array, 5]] ]; RETURN [result]; }; PushMatrix: PUBLIC PROC [self: Root, array: Array, matrix: Matrix] ~ { IF ArrayLength[array]#6 THEN ERROR Error[typecheck]; ArrayPut[array, 0, AnyFromReal[matrix.a]]; ArrayPut[array, 1, AnyFromReal[matrix.b]]; ArrayPut[array, 2, AnyFromReal[matrix.c]]; ArrayPut[array, 3, AnyFromReal[matrix.d]]; ArrayPut[array, 4, AnyFromReal[matrix.tx]]; ArrayPut[array, 5, AnyFromReal[matrix.ty]]; PushArray[self, array]; }; gsave: PROC [self: Root] ~ { GSave[self.graphics]; }; grestore: PROC [self: Root] ~ { GRestore[self.graphics]; }; grestoreall: PROC [self: Root] ~ { GRestoreAll[self.graphics]; }; initgraphics: PROC [self: Root] ~ { InitGraphics[self.graphics]; }; setlinewidth: PROC [self: Root] ~ { lineWidth: REAL ~ PopReal[self]; SetLineWidth[self.graphics, lineWidth]; }; currentlinewidth: PROC [self: Root] ~ { lineWidth: REAL ~ CurrentLineWidth[self.graphics]; PushReal[self, lineWidth]; }; setlinecap: PROC [self: Root] ~ { int: INT ~ PopInt[self]; cap: LineCap ~ SELECT int FROM 0 => butt, 1 => round, 2 => square, ENDCASE => ERROR Error[rangecheck]; SetLineCap[self.graphics, cap]; }; currentlinecap: PROC [self: Root] ~ { cap: LineCap ~ CurrentLineCap[self.graphics]; PushInt[self, SELECT cap FROM butt => 0, round => 1, square => 2, ENDCASE => ERROR Bug]; }; setlinejoin: PROC [self: Root] ~ { int: INT ~ PopInt[self]; join: LineJoin ~ SELECT int FROM 0 => miter, 1 => round, 2 => bevel, ENDCASE => ERROR Error[rangecheck]; SetLineJoin[self.graphics, join]; }; currentlinejoin: PROC [self: Root] ~ { join: LineJoin ~ CurrentLineJoin[self.graphics]; PushInt[self, SELECT join FROM miter => 0, round => 1, bevel => 2, ENDCASE => ERROR Bug]; }; setmiterlimit: PROC [self: Root] ~ { miterLimit: REAL ~ PopReal[self]; SetMiterLimit[self.graphics, miterLimit]; }; currentmiterlimit: PROC [self: Root] ~ { miterLimit: REAL ~ CurrentMiterLimit[self.graphics]; PushReal[self, miterLimit]; }; setdash: PROC [self: Root] ~ { dash: Dash; dash.offset _ PopReal[self]; dash.array _ PopArray[self]; SetDash[self.graphics, dash]; }; currentdash: PROC [self: Root] ~ { dash: Dash ~ CurrentDash[self.graphics]; PushArray[self, dash.array]; PushReal[self, dash.offset]; }; setflat: PROC [self: Root] ~ { flatness: REAL ~ PopReal[self]; SetFlat[self.graphics, flatness]; }; currentflat: PROC [self: Root] ~ { flatness: REAL ~ CurrentFlat[self.graphics]; PushReal[self, flatness]; }; setgray: PROC [self: Root] ~ { gray: REAL ~ PopReal[self]; SetGray[self.graphics, gray]; }; currentgray: PROC [self: Root] ~ { gray: REAL ~ CurrentGray[self.graphics]; PushReal[self, gray]; }; sethsbcolor: PROC [self: Root] ~ { hsbColor: HSBColor; hsbColor.brt _ PopReal[self]; hsbColor.sat _ PopReal[self]; hsbColor.hue _ PopReal[self]; SetHSBColor[self.graphics, hsbColor]; }; currenthsbcolor: PROC [self: Root] ~ { hsbColor: HSBColor ~ CurrentHSBColor[self.graphics]; PushReal[self, hsbColor.hue]; PushReal[self, hsbColor.sat]; PushReal[self, hsbColor.brt]; }; setrgbcolor: PROC [self: Root] ~ { rgbColor: RGBColor; rgbColor.blue _ PopReal[self]; rgbColor.green _ PopReal[self]; rgbColor.red _ PopReal[self]; SetRGBColor[self.graphics, rgbColor]; }; currentrgbcolor: PROC [self: Root] ~ { rgbColor: RGBColor ~ CurrentRGBColor[self.graphics]; PushReal[self, rgbColor.red]; PushReal[self, rgbColor.green]; PushReal[self, rgbColor.blue]; }; setscreen: PROC [self: Root] ~ { screen: Screen; screen.proc _ PopProc[self]; screen.angle _ PopReal[self]; screen.freq _ PopReal[self]; SetScreen[self.graphics, screen]; }; currentscreen: PROC [self: Root] ~ { screen: Screen ~ CurrentScreen[self.graphics]; PushReal[self, screen.freq]; PushReal[self, screen.angle]; PushAny[self, screen.proc]; }; settransfer: PROC [self: Root] ~ { transfer: Transfer; transfer.proc _ PopProc[self]; SetTransfer[self.graphics, transfer]; }; currenttransfer: PROC [self: Root] ~ { transfer: Transfer ~ CurrentTransfer[self.graphics]; PushAny[self, transfer.proc]; }; matrix: PROC [self: Root] ~ { array: Array ~ ArrayCreate[6]; PushMatrix[self, array, IdentMatrix[self.scratch.matrix1]]; }; initmatrix: PROC [self: Root] ~ { SetMatrix[self.graphics, DefaultMatrix[self.graphics, self.scratch.matrix1]]; }; identmatrix: PROC [self: Root] ~ { array: Array ~ PopArray[self]; PushMatrix[self, array, IdentMatrix[self.scratch.matrix1]]; }; defaultmatrix: PROC [self: Root] ~ { array: Array ~ PopArray[self]; PushMatrix[self, array, DefaultMatrix[self.graphics, self.scratch.matrix1]]; }; currentmatrix: PROC [self: Root] ~ { array: Array ~ PopArray[self]; PushMatrix[self, array, CurrentMatrix[self.graphics, self.scratch.matrix1]]; }; setmatrix: PROC [self: Root] ~ { matrix: Matrix ~ PopMatrix[self, self.scratch.matrix1]; SetMatrix[self.graphics, matrix]; }; translate: PROC [self: Root] ~ { matrix: Matrix ~ self.scratch.matrix1; IF TopType[self]=array THEN { array: Array ~ PopArray[self]; t: VEC ~ PopVec[self]; PushMatrix[self, array, Translate[t, matrix]]; } ELSE { t: VEC ~ PopVec[self]; Concat[self.graphics, Translate[t, matrix]]; }; }; scale: PROC [self: Root] ~ { matrix: Matrix ~ self.scratch.matrix1; IF TopType[self]=array THEN { array: Array ~ PopArray[self]; s: VEC ~ PopVec[self]; PushMatrix[self, array, Scale[s, matrix]]; } ELSE { s: VEC ~ PopVec[self]; Concat[self.graphics, Scale[s, matrix]]; }; }; rotate: PROC [self: Root] ~ { matrix: Matrix ~ self.scratch.matrix1; IF TopType[self]=array THEN { array: Array ~ PopArray[self]; angle: REAL ~ PopReal[self]; PushMatrix[self, array, Rotate[angle, matrix]]; } ELSE { angle: REAL ~ PopReal[self]; Concat[self.graphics, Rotate[angle, matrix]]; }; }; concat: PROC [self: Root] ~ { matrix: Matrix ~ PopMatrix[self, self.scratch.matrix1]; Concat[self.graphics, matrix]; }; concatmatrix: PROC [self: Root] ~ { array3: Array ~ PopArray[self]; matrix2: Matrix ~ PopMatrix[self, self.scratch.matrix2]; matrix1: Matrix ~ PopMatrix[self, self.scratch.matrix1]; PushMatrix[self, array3, ConcatMatrix[matrix1, matrix2, self.scratch.matrix3]]; }; TransformOp: PROC [self: Root, op: PROC [VEC, Matrix] RETURNS [VEC]] ~ { matrix: Matrix ~ IF TopType[self]=array THEN PopMatrix[self, self.scratch.matrix1] ELSE CurrentMatrix[self.graphics, self.scratch.matrix1]; p: VEC ~ PopVec[self]; PushVec[self, op[p, matrix]]; }; transform: PROC [self: Root] ~ { TransformOp[self, Transform] }; dtransform: PROC [self: Root] ~ { TransformOp[self, DTransform] }; itransform: PROC [self: Root] ~ { TransformOp[self, ITransform] }; idtransform: PROC [self: Root] ~ { TransformOp[self, IDTransform] }; invertmatrix: PROC [self: Root] ~ { array2: Array ~ PopArray[self]; matrix1: Matrix ~ PopMatrix[self, self.scratch.matrix1]; PushMatrix[self, array2, InvertMatrix[matrix1, self.scratch.matrix2]]; }; newpath: PROC [self: Root] ~ { NewPath[self.graphics]; }; currentpoint: PROC [self: Root] ~ { PushVec[self, CurrentPoint[self.graphics]]; }; moveto: PROC [self: Root] ~ { p: VEC ~ PopVec[self]; MoveTo[self.graphics, p]; }; rmoveto: PROC [self: Root] ~ { d: VEC ~ PopVec[self]; RMoveTo[self.graphics, d]; }; lineto: PROC [self: Root] ~ { p: VEC ~ PopVec[self]; LineTo[self.graphics, p]; }; rlineto: PROC [self: Root] ~ { d: VEC ~ PopVec[self]; RLineTo[self.graphics, d]; }; arc: PROC [self: Root] ~ { ang2: REAL ~ PopReal[self]; ang1: REAL ~ PopReal[self]; r: REAL ~ PopReal[self]; p: VEC ~ PopVec[self]; Arc[self.graphics, p, r, ang1, ang2, counterclockwise]; }; arcn: PROC [self: Root] ~ { ang2: REAL ~ PopReal[self]; ang1: REAL ~ PopReal[self]; r: REAL ~ PopReal[self]; p: VEC ~ PopVec[self]; Arc[self.graphics, p, r, ang1, ang2, clockwise]; }; arcto: PROC [self: Root] ~ { r: REAL ~ PopReal[self]; p2: VEC ~ PopVec[self]; p1: VEC ~ PopVec[self]; t1, t2: VEC; [t1, t2] _ ArcTo[self.graphics, p1, p2, r]; PushVec[self, t1]; PushVec[self, t2]; }; curveto: PROC [self: Root] ~ { p3: VEC ~ PopVec[self]; p2: VEC ~ PopVec[self]; p1: VEC ~ PopVec[self]; CurveTo[self.graphics, p1, p2, p3]; }; rcurveto: PROC [self: Root] ~ { d3: VEC ~ PopVec[self]; d2: VEC ~ PopVec[self]; d1: VEC ~ PopVec[self]; RCurveTo[self.graphics, d1, d2, d3]; }; closepath: PROC [self: Root] ~ { ClosePath[self.graphics]; }; flattenpath: PROC [self: Root] ~ { FlattenPath[self.graphics]; }; reversepath: PROC [self: Root] ~ { ReversePath[self.graphics]; }; strokepath: PROC [self: Root] ~ { StrokePath[self.graphics]; }; charpath: PROC [self: Root] ~ { bool: BOOL ~ PopBool[self]; string: String ~ PopString[self]; CharPath[self.graphics, string, bool]; }; clippath: PROC [self: Root] ~ { ClipPath[self.graphics]; }; pathbbox: PROC [self: Root] ~ { box: Box ~ PathBBox[self.graphics]; PushVec[self, box.ll]; PushVec[self, box.ur]; }; pathforall: PROC [self: Root] ~ { closeProc: Any ~ PopProc[self]; curveProc: Any ~ PopProc[self]; lineProc: Any ~ PopProc[self]; moveProc: Any ~ PopProc[self]; move: PROC [p: VEC] ~ { PushVec[self, p]; Execute[self, moveProc]; }; line: PROC [p: VEC] ~ { PushVec[self, p]; Execute[self, lineProc]; }; curve: PROC [p1, p2, p3: VEC] ~ { PushVec[self, p1]; PushVec[self, p2]; PushVec[self, p3]; Execute[self, curveProc]; }; close: PROC ~ { Execute[self, closeProc]; }; PathForAll[self.graphics, move, line, curve, close ! Exit => CONTINUE]; }; initclip: PROC [self: Root] ~ { InitClip[self.graphics]; }; clip: PROC [self: Root] ~ { Clip[self.graphics]; }; eoclip: PROC [self: Root] ~ { Clip[self.graphics, TRUE]; }; erasepage: PROC [self: Root] ~ { ErasePage[self.graphics]; }; fill: PROC [self: Root] ~ { Fill[self.graphics]; }; eofill: PROC [self: Root] ~ { Fill[self.graphics, TRUE]; }; stroke: PROC [self: Root] ~ { Stroke[self.graphics]; }; image: PROC [self: Root] ~ { proc: Any ~ PopProc[self]; matrix: Matrix ~ PopMatrix[self, self.scratch.matrix1]; bitsPerSample: INT ~ PopInt[self]; height: INT ~ PopInt[self]; width: INT ~ PopInt[self]; stringProc: PROC RETURNS [String] ~ { Execute[self, proc]; RETURN [PopString[self]]; }; Image[self.graphics, width, height, bitsPerSample, matrix, stringProc]; }; imagemask: PROC [self: Root] ~ { proc: Any ~ PopProc[self]; matrix: Matrix ~ PopMatrix[self, self.scratch.matrix1]; invert: BOOL ~ PopBool[self]; height: INT ~ PopInt[self]; width: INT ~ PopInt[self]; stringProc: PROC RETURNS [String] ~ { Execute[self, proc]; RETURN [PopString[self]]; }; ImageMask[self.graphics, width, height, invert, matrix, stringProc]; }; showpage: PROC [self: Root] ~ { CopyPage[self.graphics]; ErasePage[self.graphics]; }; copypage: PROC [self: Root] ~ { CopyPage[self.graphics]; }; framedevice: PROC [self: Root] ~ { proc: Any ~ PopProc[self]; height: INT ~ PopInt[self]; width: INT ~ PopInt[self]; matrix: Matrix ~ PopMatrix[self, self.scratch.matrix1]; FrameDevice[self.graphics, matrix, width, height, proc]; }; nulldevice: PROC [self: Root] ~ { NullDevice[self.graphics]; }; definefont: PROC [self: Root] ~ { font: Dict ~ PopDict[self]; key: Any ~ PopAny[self]; PushDict[self, DefineFont[self.graphics, key, font]]; }; scalefont: PROC [self: Root] ~ { scale: REAL ~ PopReal[self]; font: Dict ~ PopDict[self]; matrix: Matrix ~ Scale[[scale, scale], self.scratch.matrix1]; PushDict[self, MakeFont[font, matrix]]; }; makefont: PROC [self: Root] ~ { matrix: Matrix ~ PopMatrix[self, self.scratch.matrix1]; font: Dict ~ PopDict[self]; PushDict[self, MakeFont[font, matrix]]; }; setfont: PROC [self: Root] ~ { font: Dict ~ PopDict[self]; SetFont[self.graphics, font]; }; currentfont: PROC [self: Root] ~ { font: Dict ~ CurrentFont[self.graphics]; PushDict[self, font]; }; show: PROC [self: Root] ~ { string: String ~ PopString[self]; Show[self.graphics, string]; }; ashow: PROC [self: Root] ~ { string: String ~ PopString[self]; a: VEC ~ PopVec[self]; AShow[self.graphics, a, string]; }; widthshow: PROC [self: Root] ~ { string: String ~ PopString[self]; char: CHAR ~ CharFromInt[PopInt[self]]; c: VEC ~ PopVec[self]; WidthShow[self.graphics, c, char, string]; }; awidthshow: PROC [self: Root] ~ { string: String ~ PopString[self]; a: VEC ~ PopVec[self]; char: CHAR ~ CharFromInt[PopInt[self]]; c: VEC ~ PopVec[self]; AWidthShow[self.graphics, c, char, a, string]; }; kshow: PROC [self: Root] ~ { string: String ~ PopString[self]; proc: Any ~ PopProc[self]; action: PROC [c1, c2: CHAR] ~ { PushInt[self, IntFromChar[c1]]; PushInt[self, IntFromChar[c2]]; Execute[self, proc]; }; KShow[self.graphics, action, string]; }; stringwidth: PROC [self: Root] ~ { string: String ~ PopString[self]; PushVec[self, StringWidth[self.graphics, string]]; }; cachestatus: PROC [self: Root] ~ { info: CacheInfo ~ CacheStatus[self.graphics]; PushInt[self, info.bsize]; PushInt[self, info.bmax]; PushInt[self, info.msize]; PushInt[self, info.mmax]; PushInt[self, info.csize]; PushInt[self, info.cmax]; PushInt[self, info.blimit]; }; setcachedevice: PROC [self: Root] ~ { ur: VEC ~ PopVec[self]; ll: VEC ~ PopVec[self]; w: VEC ~ PopVec[self]; SetCacheDevice[self.graphics, w, [ll, ur]]; }; setcharwidth: PROC [self: Root] ~ { w: VEC ~ PopVec[self]; SetCharWidth[self.graphics, w]; }; setcachelimit: PROC [self: Root] ~ { blimit: INT ~ PopInt[self]; SetCacheLimit[self.graphics, blimit]; }; GraphicsPrimitives: PROC [primitive: PrimitiveProc] ~ { primitive["gsave", gsave]; primitive["grestore", grestore]; primitive["grestoreall", grestoreall]; primitive["initgraphics", initgraphics]; primitive["setlinewidth", setlinewidth]; primitive["currentlinewidth", currentlinewidth]; primitive["setlinecap", setlinecap]; primitive["currentlinecap", currentlinecap]; primitive["setlinejoin", setlinejoin]; primitive["currentlinejoin", currentlinejoin]; primitive["setmiterlimit", setmiterlimit]; primitive["currentmiterlimit", currentmiterlimit]; primitive["setdash", setdash]; primitive["currentdash", currentdash]; primitive["setflat", setflat]; primitive["currentflat", currentflat]; primitive["setgray", setgray]; primitive["currentgray", currentgray]; primitive["sethsbcolor", sethsbcolor]; primitive["currenthsbcolor", currenthsbcolor]; primitive["setrgbcolor", setrgbcolor]; primitive["currentrgbcolor", currentrgbcolor]; primitive["setscreen", setscreen]; primitive["currentscreen", currentscreen]; primitive["settransfer", settransfer]; primitive["currenttransfer", currenttransfer]; primitive["matrix", matrix]; primitive["initmatrix", initmatrix]; primitive["identmatrix", identmatrix]; primitive["defaultmatrix", defaultmatrix]; primitive["currentmatrix", currentmatrix]; primitive["setmatrix", setmatrix]; primitive["translate", translate]; primitive["scale", scale]; primitive["rotate", rotate]; primitive["concat", concat]; primitive["concatmatrix", concatmatrix]; primitive["transform", transform]; primitive["dtransform", dtransform]; primitive["itransform", itransform]; primitive["idtransform", idtransform]; primitive["invertmatrix", invertmatrix]; primitive["newpath", newpath]; primitive["currentpoint", currentpoint]; primitive["moveto", moveto]; primitive["rmoveto", rmoveto]; primitive["lineto", lineto]; primitive["rlineto", rlineto]; primitive["arc", arc]; primitive["arcn", arcn]; primitive["arcto", arcto]; primitive["curveto", curveto]; primitive["rcurveto", rcurveto]; primitive["closepath", closepath]; primitive["flattenpath", flattenpath]; primitive["reversepath", reversepath]; primitive["strokepath", strokepath]; primitive["charpath", charpath]; primitive["clippath", clippath]; primitive["pathbbox", pathbbox]; primitive["pathforall", pathforall]; primitive["initclip", initclip]; primitive["clip", clip]; primitive["eoclip", eoclip]; primitive["erasepage", erasepage]; primitive["fill", fill]; primitive["eofill", eofill]; primitive["stroke", stroke]; primitive["image", image]; primitive["imagemask", imagemask]; primitive["showpage", showpage]; primitive["copypage", copypage]; primitive["framedevice", framedevice]; primitive["nulldevice", nulldevice]; primitive["definefont", definefont]; primitive["scalefont", scalefont]; primitive["makefont", makefont]; primitive["setfont", setfont]; primitive["currentfont", currentfont]; primitive["show", show]; primitive["ashow", ashow]; primitive["widthshow", widthshow]; primitive["awidthshow", awidthshow]; primitive["kshow", kshow]; primitive["stringwidth", stringwidth]; primitive["cachestatus", cachestatus]; primitive["setcachedevice", setcachedevice]; primitive["setcharwidth", setcharwidth]; primitive["setcachelimit", setcachelimit]; }; RegisterPrimitives[GraphicsPrimitives]; END. HPSGraphicsPrimitivesImpl.mesa Copyright Σ 1986, 1987 by Xerox Corporation. All rights reserved. Doug Wyatt, August 6, 1987 5:04:48 pm PDT PostScript graphics primitives. Utilities Graphics state operators Coordinate system and matrix operators PopMatrix: PROC [self: Root, scratch: Matrix _ NIL] RETURNS [Matrix] ~ { array: Array ~ PopArray[self]; matrix: Matrix _ scratch; IF ArrayLength[array]#6 THEN ERROR Error[typecheck]; IF matrix=NIL THEN matrix _ NEW[MatrixRep]; matrix^ _ [ a: RealFromAny[ArrayGet[array, 0]], b: RealFromAny[ArrayGet[array, 1]], c: RealFromAny[ArrayGet[array, 2]], d: RealFromAny[ArrayGet[array, 3]], tx: RealFromAny[ArrayGet[array, 4]], ty: RealFromAny[ArrayGet[array, 5]] ]; RETURN [matrix]; }; PushMatrix: PROC [self: Root, array: Array, matrix: Matrix] ~ { IF ArrayLength[array]#6 THEN ERROR Error[typecheck]; ArrayPut[array, 0, AnyFromReal[matrix.a]]; ArrayPut[array, 1, AnyFromReal[matrix.b]]; ArrayPut[array, 2, AnyFromReal[matrix.c]]; ArrayPut[array, 3, AnyFromReal[matrix.d]]; ArrayPut[array, 4, AnyFromReal[matrix.tx]]; ArrayPut[array, 5, AnyFromReal[matrix.ty]]; PushArray[self, array]; }; identity: Matrix ~ ImagerTransformation.Scale[1]; matrix: PROC [self: Root] ~ { array: Array ~ ArrayCreate[6]; PushMatrix[self, array, identity]; }; initmatrix: PROC [self: Root] ~ { ImagerBackdoor.SetT[self.imager, DefaultMatrix[self.imager]]; }; identmatrix: PROC [self: Root] ~ { array: Array ~ PopArray[self]; PushMatrix[self, array, identity]; }; defaultmatrix: PROC [self: Root] ~ { array: Array ~ PopArray[self]; PushMatrix[self, array, DefaultMatrix[self.imager]]; }; currentmatrix: PROC [self: Root] ~ { array: Array ~ PopArray[self]; matrix: Matrix ~ ImagerBackdoor.GetT[self.imager]; PushMatrix[self, array, matrix]; ImagerTransformation.Destroy[matrix]; }; setmatrix: PROC [self: Root] ~ { matrix: Matrix ~ PopMatrix[self]; SetMatrix[self.graphics, matrix]; }; translate: PROC [self: Root] ~ { IF TopType[self]=array THEN { array: Array ~ PopArray[self]; t: VEC ~ PopVec[self]; PushMatrix[self, array, Translate[t, self.scratch.matrix1]]; } ELSE { t: VEC ~ PopVec[self]; Concat[self.graphics, Translate[t, self.scratch.matrix1]]; }; }; scale: PROC [self: Root] ~ { IF TopType[self]=array THEN { array: Array ~ PopArray[self]; s: VEC ~ PopVec[self]; matrix: Matrix ~ ImagerTransformation.Scale[s]; PushMatrix[self, array, matrix]; ImagerTransformation.Destroy[matrix]; } ELSE { s: VEC ~ PopVec[self]; Imager.Scale2T[self.imager, s]; }; }; rotate: PROC [self: Root] ~ { IF TopType[self]=array THEN { array: Array ~ PopArray[self]; angle: REAL ~ PopReal[self]; matrix: Matrix ~ ImagerTransformation.Rotate[angle]; PushMatrix[self, array, matrix]; ImagerTransformation.Destroy[matrix]; } ELSE { angle: REAL ~ PopReal[self]; Imager.RotateT[self.imager, angle]; }; }; concat: PROC [self: Root] ~ { matrix: Matrix ~ PopMatrix[self]; Imager.ConcatT[self.imager, matrix]; ImagerTransformation.Destroy[matrix]; }; concatmatrix: PROC [self: Root] ~ { array3: Array ~ PopArray[self]; matrix2: Matrix ~ PopMatrix[self]; matrix1: Matrix ~ PopMatrix[self]; matrix3: Matrix ~ ImagerTransformation.Concat[matrix1, matrix2]; PushMatrix[self, array3, matrix3]; ImagerTransformation.Destroy[matrix1]; ImagerTransformation.Destroy[matrix2]; ImagerTransformation.Destroy[matrix3]; }; DoTransform: PROC [self: Root, proc: PROC [p: VEC, matrix: Matrix] RETURNS [VEC]] ~ { matrix: Matrix ~ IF TopType[self]=array THEN PopMatrix[self] ELSE ImagerBackdoor.GetT[self.imager]; p: VEC ~ PopVec[self]; PushVec[self, proc[p, matrix]]; ImagerTransformation.Destroy[matrix]; }; transform: PROC [self: Root] ~ { DoTransform[self, Transform] }; dtransform: PROC [self: Root] ~ { DoTransform[self, DTransform] }; itransform: PROC [self: Root] ~ { DoTransform[self, ITransform] }; idtransform: PROC [self: Root] ~ { DoTransform[self, IDTransform] }; invertmatrix: PROC [self: Root] ~ { array2: Array ~ PopArray[self]; matrix1: Matrix ~ PopMatrix[self]; matrix2: Matrix ~ ImagerTransformation.Invert[matrix1]; PushMatrix[self, array2, matrix2]; ImagerTransformation.Destroy[matrix1]; ImagerTransformation.Destroy[matrix2]; }; Path construction operators Painting operators Device setup and output operators Character and font operators Font cache operators Registration RegisterAny[self, "findfont", xxx]; RegisterAny[self, "FontDirectory", xxx]; RegisterAny[self, "StandardEncoding", xxx]; Κ™˜codešœ™KšœB™BK™)—K˜K™K™šΟk ˜ Kšœ˜K˜ —K˜KšΟnœœ˜'Kšœœ ˜Kšœ˜ Kšœœœ œ˜head™ Kšœ œœ ˜šœ œœœ%˜EK˜—šžœœœœ˜0K˜K˜K˜K™—šžœœœ˜(K˜K˜K˜K˜—šž œœœœ ˜HK˜Kšœœœ˜4šœ ˜ K˜#K˜#K˜#K˜#K˜$K˜#K˜—Kšœ ˜K˜K™—šž œœœ/˜FKšœœœ˜4K˜*K˜*K˜*K˜*K˜+K˜+K˜K˜K™——™šžœœ˜Kšœ˜Kšœ˜K˜—šžœœ˜Kšœ˜Kšœ˜K˜—šž œœ˜"Kšœ˜K˜K˜—šž œœ˜#Kšœ˜Kšœ˜K˜—šž œœ˜#Kšœ œ˜ Kšœ'˜'K˜K˜—šžœœ˜'Kšœ œ#˜2Kšœ˜K˜K˜—šž œœ˜!Kšœœ˜šœœœ$˜BKšœœ˜#—Kšœ˜K˜K˜—šžœœ˜%Kšœ-˜-šœœœ$˜AKšœœ˜—K˜K˜—šž œœ˜"Kšœœ˜šœœœ$˜DKšœœ˜#—Kšœ!˜!K˜K˜—šžœœ˜&Kšœ0˜0šœœœ$˜BKšœœ˜—K˜K˜—šž œœ˜$Kšœ œ˜!Kšœ)˜)K˜K˜—šžœœ˜(Kšœ œ$˜4Kšœ˜K˜K˜—šžœœ˜K˜ Kšœ˜K˜K˜K˜K˜—šž œœ˜"K˜(K˜K˜K˜K˜—šžœœ˜Kšœ œ˜Kšœ!˜!K˜K˜—šž œœ˜"Kšœ œ˜,Kšœ˜K˜K˜—šžœœ˜Kšœœ˜Kšœ˜K˜K˜—šž œœ˜"Kšœœ˜(Kšœ˜K˜K˜—šž œœ˜"Kšœ˜Kšœ˜Kšœ˜Kšœ˜K˜%K˜K˜—šžœœ˜&Kšœ4˜4Kšœ˜Kšœ˜Kšœ˜K˜K˜—šž œœ˜"Kšœ˜Kšœ˜Kšœ˜Kšœ˜Kšœ%˜%K˜K˜—šžœœ˜&Kšœ4˜4Kšœ˜Kšœ˜Kšœ˜K˜K˜—šž œœ˜ K˜Kšœ˜Kšœ˜Kšœ˜K˜!K˜K˜—šž œœ˜$K˜.Kšœ˜Kšœ˜Kšœ˜K˜K˜—šž œœ˜"Kšœ˜Kšœ˜K˜%K˜K˜—šžœœ˜&Kšœ4˜4Kšœ˜K˜K˜——™&šžœœ˜Kšœ˜Kšœ;˜;K˜K˜—šž œœ˜!KšœM˜MK˜K˜—šž œœ˜"K˜Kšœ;˜;K˜K˜—šž œœ˜$K˜KšœL˜LK˜K˜—šž œœ˜$K˜KšœL˜LK˜K˜—šž œœ˜ Kšœ7˜7Kšœ!˜!K˜K˜—šž œœ˜ K˜&šœœ˜K˜Kšœœ˜Kšœ.˜.K˜—šœ˜Kšœœ˜Kšœ,˜,K˜—K˜K˜—šžœœ˜K˜&šœœ˜K˜Kšœœ˜Kšœ*˜*K˜—šœ˜Kšœœ˜Kšœ(˜(K˜—K˜K˜—šžœœ˜K˜&šœœ˜K˜Kšœœ˜Kšœ/˜/K˜—šœ˜Kšœœ˜Kšœ-˜-K˜—K˜K˜—šžœœ˜Kšœ7˜7Kšœ˜K˜K˜—šž œœ˜#K˜Kšœ8˜8Kšœ8˜8KšœO˜OK˜K˜—š ž œœœœ œœ˜Hšœœ˜'Kšœ&˜*Kšœ4˜8—Kšœœ˜Kšœ˜K˜K˜—šž œœ1˜@K˜—šž œœ2˜BK˜—šž œœ2˜BK˜—šž œœ3˜DK˜—šž œœ˜#Kšœ˜Kšœ8˜8KšœF˜FK˜K˜—K™šž œœ œœ ™HK™K™Kšœœœ™4Kšœœœ œ ™+šœ ™ K™#K™#K™#K™#K™$K™#K™—Kšœ ™K™K™—šž œœ/™?Kšœœœ™4K™*K™*K™*K™*K™+K™+K™K™K™—™1K™—šžœœ™Kšœ™Kšœ"™"K™K™—šž œœ™!Kšœ=™=K™K™—šž œœ™"K™Kšœ"™"K™K™—šž œœ™$K™Kšœ4™4K™K™—šž œœ™$K™K™2Kšœ ™ K™%K™K™—šž œœ™ Kšœ!™!Kšœ!™!K™K™—šž œœ™ šœœ™K™Kšœœ™Kšœ<™