ImagerInterpressFragment.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Doug Wyatt, October 18, 1985 6:21:01 pm PDT
Michael Plass, April 8, 1986 12:33:42 pm PST
Rick Beach, July 1, 1986 2:07:54 pm PDT
Imager clients can use this interface to create fragments of Interpress masters.
DIRECTORY
Imager USING [ColorOperator, Context, PixelArray, Transformation],
IO USING [STREAM],
Rope USING [ROPE];
ImagerInterpressFragment: CEDAR DEFINITIONS
~ BEGIN
Ref: TYPE ~ REF Rep;
Create:
PROC [fileName: Rope.
ROPE, header: Rope.
ROPE ←
NIL]
RETURNS [Ref];
Creates a file with the given name.
If header=NIL, a header of "Interpress/Xerox/3.0 " is supplied.
CreateFromStream:
PROC [stream:
IO.
STREAM, header: Rope.
ROPE]
RETURNS [Ref];
Returns a handle aimed at stream; header is inserted verbatim at beginning.
StreamFromRef:
PROC [self: Ref]
RETURNS [stream:
IO.
STREAM];
Returns the underlying Interpress master stream for the Interpress fragment
CAUTION: use of this procedure implies a guarantee by the client that the Interpress fragment will be well-formed. It is very easy to create an unworkable Interpress fragment.
PushInt:
PROC [self: Ref, n:
INT];
Pushes an integer on the stack.
VectorProc:
TYPE ~
PROC [
putIdentifier: PROC [ATOM],
putString: PROC [Rope.ROPE],
putInt: PROC [INT],
putReal: PROC [REAL],
putTransformation: PROC [Imager.Transformation],
putVector: PROC [vecProc: PROC],
putImageOp: PROC [action: PROC [Imager.Context]]
];
PushVector:
PROC [self: Ref, vectorProc: VectorProc];
Pushes a vector on the stack created in the preamble.
vectorProc should not call PushVector, but should use its putVector proc to create any nested vectors.
PushPixelArray:
PROC [self: Ref, pa: Imager.PixelArray];
Pushes a pixel array on the stack created in the preamble.
PushColorOperator:
PROC [self: Ref, op: Imager.ColorOperator];
Pushes a color operator on the stack created in the preamble.
Close:
PROC [self: Ref];
Finishes the master and closes the underlying stream.
Finish:
PROC [self: Ref];
Finishes the master without closing the underlying stream.
END.