ImagerGray.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Last edited by: Mik Lamming - June 9, 1986 1:40:00 pm PDT
Vanilla grey Imager context.
DIRECTORY
Imager USING [Context],
ImagerPixelArrayDefs USING [PixelArray],
ImagerPixelMap USING [DeviceRectangle, PixelMap],
ImagerTransformation USING [Transformation];
~
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:
REF ←
NIL, cacheFonts:
BOOL ←
TRUE]
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:
BOOL ←
TRUE, blackBackground:
BOOL ←
FALSE]
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.