ImagerOps.mesa
Copyright © 1984 Xerox Corporation. All rights reserved.
Michael Plass, February 20, 1984 9:15:15 am PST
Doug Wyatt, September 18, 1984 4:59:34 pm PDT
DIRECTORY
Font USING [FONT],
Graphics USING [Context],
GraphicsBasic USING [Color, FontRef],
Imager USING [Context],
ImagerBasic USING [IntPair, Visibility],
ImagerColor USING [Color],
ImagerPath USING [PathProc],
ImagerPixelArray USING [PixelArray],
ImagerTransformation USING [IntRectangle, Transformation],
Rope USING [ROPE],
Vector2 USING [VEC];
ImagerOps: CEDAR DEFINITIONS
= BEGIN
Context: TYPE ~ Imager.Context;
ROPE: TYPE ~ Rope.ROPE;
VEC: TYPE ~ Vector2.VEC;
Transformation: TYPE ~ ImagerTransformation.Transformation;
FONT: TYPE ~ Font.FONT;
Color: TYPE ~ ImagerColor.Color;
PathProc: TYPE ~ ImagerPath.PathProc;
PixelArray: TYPE ~ ImagerPixelArray.PixelArray;
Miscellaneous operations
DRound: PROC[v: VEC] RETURNS[VEC];
XOR: Color;
TestRectangle: PROC[context: Context, x, y, w, h: REAL] RETURNS[ImagerBasic.Visibility];
Backward compatibility with Graphics
ImagerFromGraphics: PROC[Graphics.Context] RETURNS[Context];
GraphicsFromImager: PROC[Context] RETURNS[Graphics.Context];
ColorFromStipple: PROC[CARDINAL] RETURNS[Color];
ColorFromGraphicsColor: PROC[GraphicsBasic.Color] RETURNS[Color];
FontFromGraphicsFont: PROC[GraphicsBasic.FontRef] RETURNS[FONT];
Bitmap: TYPE ~ REF BitmapRep;
BitmapRep: TYPE ~ RECORD[
ref: REF,
base: LONG POINTER,
wordsPerLine: NAT,
w, h: NAT, -- width and height, in bits
x, y: NAT,
ox, oy: INTEGER
];
MaskBitmap: PROC[context: Context, x, y: INTEGER, bitmap: Bitmap];
Window manager specials (not available on all devices)
IntPair: TYPE = ImagerBasic.IntPair;
IntRectangle: TYPE = ImagerTransformation.IntRectangle;
GetSurfaceBounds: PROC[context: Context] RETURNS[IntRectangle];
For finding out where the usable parts of the Surface are. The results are in Surface coordinates.
SetViewOrigin: PROC[context: Context, viewOrigin: IntPair];
Sets the View-to-Surface transformation to map the origin in View coordinates to viewOrigin in Surface coordinates.
GetViewOrigin: PROC[context: Context] RETURNS[viewOrigin: IntPair];
Returns the current view origin, in surface coordinates.
SetViewBox: PROC[context: Context, viewBox: IntRectangle];
Sets the View-to-Surface clipper to show the viewBox, which is specified in View coordinates.
GetViewBox: PROC[context: Context] RETURNS[viewBox: IntRectangle];
Returns the bounding box of the current View-to-Surface clipper, in View coordinates.
ClipView: PROC[context: Context, clipBox: IntRectangle, exclude: BOOL];
For setting up fancier View-to-Surface clippers; the box is in View coordinates.
MoveSurfaceRectangle: PROC [context: Context, source: IntRectangle, dest: IntPair];
Moves the source rectangle so that its new origin is at dest. Both source and dest are in Surface coordinates. Overlapping source and dest are allowed. Clippers are ignored. Beware of moving images containing halftones, because this may cause misaligned halftone screens. The halftone screens are aligned with the view origin, so the window package may move viewers around without problems.
END.