ImagerSmooth.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Michael Plass, October 7, 1985 12:43:30 pm PDT
Anti-aliased Imager contexts.
DIRECTORY
Imager USING [Context],
ImagerPixelArrayDefs USING [PixelArray],
ImagerPixelMap USING [DeviceRectangle, PixelMap],
ImagerTransformation USING [Transformation];
ImagerSmooth: CEDAR DEFINITIONS
~ BEGIN OPEN Imager, ImagerPixelArrayDefs, ImagerPixelMap, ImagerTransformation;
Create: PROC [pixelMap: PixelMap, component: ATOM, viewToPixel: Transformation ← NIL, initialScale: REAL ← 1.0, change: PROC[changeData: REF, d: DeviceRectangle, action: PROC] ← NIL, changeData: REFNIL, cacheFonts: BOOLTRUE, surfaceUnitsPerPixel: NAT ← 5] RETURNS [Context];
Creates a context that will draw into the PixelMap.
component says which component is desired, i.e., $Intensity, $Red, $Green, $Blue, $Alpha
Use LikeScreen to generate a viewToPixel of the most commonly wanted kind.
change proc may be supplied to give the client control before and after the pixelMap changes, for locking, etc. It should call action to actually alter pixelMap.
SetComponent: PUBLIC PROC [context: Context, component: ATOM];
Changes the active component of an existing context. Not subject to DoSave.
MakePixelArray: PROC [action: PROC [Context], sSize, fSize: NAT, components: LIST OF ATOM, viewToPixel: Transformation ← NIL, initialScale: REAL ← 1.0, lgBitsPerSample: NAT ← 3, cacheFonts: BOOLTRUE, surfaceUnitsPerPixel: NAT ← 5, blackBackground: BOOLFALSE] RETURNS [PixelArray];
Creates a PixelArray.
Using components = LIST[$Red, $Green, $Blue] yields a PixelArray that may be used with the RGBLinear color model.
If blackBackground, the background color is black instead of white.
LikeScreen: PROC [sSize: NAT] RETURNS [Transformation];
Convenience for making a viewToPixel transformation in the favored screen orientation.
END.