DIRECTORY Imager USING [Color, ColorOperator, SpecialColor, Context, Font, Outline, PathProc, PixelMap, Rectangle, SampleMap, Transformation, VEC]; ImagerBackdoor: CEDAR DEFINITIONS ~ BEGIN OPEN Imager; IntKey: TYPE ~ { -- for SetInt, GetInt priorityImportant, noImage, strokeEnd, strokeJoint, correctPass, raiseWarnings, intA, intB, intC -- spares }; RealKey: TYPE ~ { -- for SetReal, GetReal DCScpx, DCScpy, mediumXSize, mediumYSize, fieldXMin, fieldYMin, fieldXMax, fieldYMax, strokeWidth, underlineStart, amplifySpace, correctShrink, correctMX, correctMY, correctTX, correctTY, correctStretch, -- not present in Interpress 3.1 miterLimit, -- not present in Interpress 3.1 realA, realB, realC -- spares }; Clipper: TYPE ~ LIST OF ClipperItem; -- for SetClipper, GetClipper ClipperItem: TYPE ~ RECORD [outline: Outline, oddWrap, exclude: BOOL ¬ FALSE]; SetInt: PROC [context: Context, key: IntKey, val: INT]; SetReal: PROC [context: Context, key: RealKey, val: REAL]; SetT: PROC [context: Context, m: Transformation]; SetClipper: PROC [context: Context, clipper: Clipper]; GetInt: PROC [context: Context, key: IntKey] RETURNS [INT]; GetReal: PROC [context: Context, key: RealKey] RETURNS [REAL]; GetT: PROC [context: Context] RETURNS [Transformation]; GetFont: PROC [context: Context] RETURNS [Font]; GetColor: PROC [context: Context] RETURNS [Color]; GetClipper: PROC [context: Context] RETURNS [Clipper]; GetCP: PROC [context: Context, rounded: BOOL ¬ FALSE] RETURNS [VEC]; GetBounds: PROC [context: Context] RETURNS [Rectangle]; Save: PROC [context: Context, all: BOOL ¬ FALSE] RETURNS [REF]; Restore: PROC [context: Context, ref: REF]; CoordSys: TYPE ~ {client, view, surface, device}; TransformPoint: PROC [context: Context, p: VEC, from, to: CoordSys] RETURNS [VEC]; TransformVec: PROC [context: Context, v: VEC, from, to: CoordSys] RETURNS [VEC]; GetTransformation: PROC [context: Context, from, to: CoordSys] RETURNS [Transformation]; ViewReset: PROC [context: Context]; ViewClip: PROC [context: Context, path: PathProc, oddWrap, exclude: BOOL ¬ FALSE]; ViewClipRectangleI: PROC [context: Context, x, y, w, h: INTEGER, exclude: BOOL ¬ FALSE]; ViewTranslateI: PROC [context: Context, x, y: INTEGER]; Visibility: TYPE ~ {none, part, all}; TestViewRectangle: PROC [context: Context, x, y, w, h: INTEGER] RETURNS [Visibility]; MoveViewRectangle: PROC [context: Context, width, height, fromX, fromY, toX, toY: INTEGER]; NewBitmap: PROC [width, height: NAT] RETURNS [SampleMap]; BitmapContext: PROC [bitmap: SampleMap] RETURNS [Context]; GetBufferColorOperator: PROC [context: Context] RETURNS [ColorOperator]; AccessBuffer: PROC [context: Context, action: PROC [pixelMap: PixelMap], path: PathProc, oddWrap: BOOL ¬ FALSE]; AccessBufferRectangle: PROC [context: Context, action: PROC [pixelMap: PixelMap], rectangle: Rectangle]; SaveBuffer: PROC [context: Context, id: ATOM, path: PathProc, oddWrap: BOOL ¬ FALSE]; SaveBufferRectangle: PROC [context: Context, id: ATOM, rectangle: Rectangle]; RestoreBuffer: PROC [context: Context, id: ATOM]; DiscardBuffer: PROC [context: Context, id: ATOM]; invert: READONLY SpecialColor; MakeStipple: PROC [stipple: WORD, xor: BOOL ¬ FALSE] RETURNS [SpecialColor]; MaskBits: PROC [context: Context, base: LONG POINTER, wordsPerLine: NAT, sMin, fMin, sSize, fSize: NAT, tx, ty: INTEGER ¬ 0]; DrawBits: PROC [context: Context, base: LONG POINTER, wordsPerLine: NAT, sMin, fMin, sSize, fSize: NAT, tx, ty: INTEGER ¬ 0]; ClientFromView: PROC [context: Context, p: VEC] RETURNS [VEC] ~ INLINE {RETURN [TransformPoint[context: context, p: p, from: view, to: client]]}; ViewFromClient: PROC [context: Context, p: VEC] RETURNS [VEC] ~ INLINE {RETURN [TransformPoint[context: context, p: p, from: client, to: view]]}; ViewFromDevice: PROC [context: Context, p: VEC] RETURNS [VEC] ~ INLINE {RETURN [TransformPoint[context: context, p: p, from: device, to: view]]}; DeviceFromView: PROC [context: Context, p: VEC] RETURNS [VEC] ~ INLINE {RETURN [TransformPoint[context: context, p: p, from: view, to: device]]}; ClientFromDevice: PROC [context: Context, p: VEC] RETURNS [VEC] ~ INLINE {RETURN [TransformPoint[context: context, p: p, from: device, to: client]]}; DeviceFromClient: PROC [context: Context, p: VEC] RETURNS [VEC] ~ INLINE {RETURN [TransformPoint[context: context, p: p, from: client, to: device]]}; END. v ImagerBackdoor.mesa Copyright Σ 1984, 1985, 1986, 1987, 1991 by Xerox Corporation. All rights reserved. Doug Wyatt, April 21, 1985 3:45:00 pm PST Michael Plass, August 19, 1991 10:14 am PDT Not all contexts implement the operations in this interface. To be device-independent, clients should avoid them. Access to imager variables Returns, in client coordinates, the current position. If rounded~TRUE, first rounds the position to the nearest device grid point. Returns, in client coordinates, a bounding rectangle for the composite clipping outline. Save/Restore Alternatives to DoSave, DoSaveAll for clients that can't use callbacks. Clients should ensure that Save and Restore calls are properly paired. The return value of Save should be passed to Restore, so that the proper pairing can be checked. Coordinate Systems and Transformations Note: In device coordinates, s ~ x and f ~ y. Makes a new Transformation; use ImagerTransformation.Destroy, if appropriate, to save allocations. View Operations coordinates relative to current view origin Simple Bitmap Context These are simple versions; for more control, refer to other interfaces. Buffer Access For raster contexts with an explicit image buffer, this returns a ColorOperator that describes how the pixels in the buffer are interpreted. Returns NIL if not applicable. For raster contexts with an explicit image buffer, this allows client access to the buffer. The interpretation of the pixels is according to the ColorOperator above. The path is in client coordinates. This saves the specified region of the image (subject to the current clipper) in a context-specific variable of the given name. This variable will be subject to DoSave. The path is in client coordinates. A common case of SaveBuffer. Restores a region that was saved with SaveBuffer or SaveBufferRectangle, in the same place in the device coordinate system that it was saved from, but subject to the current clipping region. Discards the saved buffer. Other Utilities Provided for compatibility with earlier Imager releases. [base, wordsPerLine, sMin, fMin, sSize, fSize] describes a raw raster; a scan mode of [slow~down, fast~right] is assumed for the raster [tx, ty] is the position in client coordinates at which to place the upper left corner of the raster Analogous to MaskBits, but zero bits become white and one bits become black, regardless of the current color. Κ¦–(cedarcode) style•NewlineDelimiter ™codešœ™Kšœ ΟeœI™TKšœ)™)K™+—˜™rK™——šΟk ˜ Kšœžœxžœ˜‰K˜—KšΠblœžœž ˜!Kšœžœžœ˜head™K™šœžœΟc˜&Kšœ˜Kšœ˜Kšœ ˜ Kšœ ˜ Kšœ ˜ Kšœ˜Kšœ  ˜Kšœ˜K˜—šœ žœ ˜)Kšœ˜Kšœ˜Kšœ+˜+Kšœ ˜ Kšœ˜Kšœ ˜ Kšœ˜Kšœ˜Kšœ˜Kšœ  ˜0Kšœ   ˜,Kšœ  ˜Kšœ˜K˜—Kšœ žœžœžœ ˜Bš œ žœžœ&žœžœ˜NK˜—K˜KšΟnœžœ&žœ˜7Kš‘œžœ'žœ˜:Kš‘œžœ'˜1Kš‘ œžœ&˜6K˜Kš‘œžœ!žœžœ˜;Kš‘œžœ"žœžœ˜>Kš‘œžœžœ˜7Kš‘œžœžœ˜0Kš‘œžœžœ ˜2Kš‘ œžœžœ ˜6K˜š ‘œžœžœžœžœžœ˜DK™5Kšœ žœ=™LK˜—š‘ œžœžœ ˜7K™XK™——šœ ™ K™GKšœ‘œ‘œ™F™`K™—š ‘œžœžœžœžœžœ˜?K˜—š‘œžœžœ˜+K˜——™&šœ žœ#˜1K™-K˜—š ‘œžœžœžœžœ˜RK˜—š ‘ œžœžœžœžœ˜PK˜—š‘œžœ(žœ˜Xšœb™bK˜———™š‘ œžœ˜#K˜—š‘œžœ6žœžœ˜RK˜—š ‘œžœ žœ žœžœ˜XKšœ+™+K™—š‘œžœžœ˜7K˜—Kšœ žœ˜%š‘œžœ žœžœ˜UK˜—Kš‘œžœ;žœ˜[K˜—™™GK™—Kš‘ œžœžœžœ ˜9Kš‘ œžœžœ ˜:—™ š‘œžœžœ˜HKšœ¬™¬K˜—š ‘ œžœžœ0žœžœ˜pšœΚ™ΚK™——Kš‘œžœžœ-˜hK˜š ‘ œžœžœžœžœ˜UKšœΝ™ΝK˜—š‘œžœžœ˜MKšœ™K˜—š‘ œžœžœ˜1KšœΎ™ΎK˜—š‘ œžœžœ˜1K™——™Kšœžœ˜K˜Kš ‘ œžœ žœžœžœžœ˜LK˜š‘œžœžœžœžœžœ žœ˜~Kšœ8™8KšœF™FK™@Kšœd™dK™—š‘œžœžœžœžœžœ žœ˜~Kšœm™m—K˜š ‘œžœžœžœžœ˜=KšœžœžœC˜S—š ‘œžœžœžœžœ˜=KšœžœžœC˜S—š ‘œžœžœžœžœ˜=KšœžœžœC˜S—š ‘œžœžœžœžœ˜=KšœžœžœC˜S—š ‘œžœžœžœžœ˜?KšœžœžœE˜U—š ‘œžœžœžœžœ˜?KšœžœžœE˜U—K˜—K˜Kšžœ˜—…—!6