IPImageImpl.mesa
Copyright © 1984 Xerox Corporation. All rights reserved.
Doug Wyatt, November 30, 1984 3:01:42 pm PST
DIRECTORY
Basics USING [LowHalf],
Imager USING [ClipOutline, ClipRectangle, ConcatT, Correct, CorrectMask, CorrectSpace, ExcludeOutline, ExcludeRectangle, GetColor, GetCP, GetCPRounded, GetFont, GetInt, GetReal, GetT, MaskFill, MaskFillParity, MaskPixel, MaskRectangle, MaskStroke, MaskStrokeClosed, MaskUnderline, MaskVector, Move, ROPE, SetColor, SetCorrectMeasure, SetCorrectTolerance, SetFont, SetGray, SetInt, SetReal, SetT, SetXRel, SetXY, SetXYRel, SetYRel, ShowRope, Space, StartUnderline, Trans, TranslateT],
ImagerColor USING [MakeGray, MakeSampledBlack, MakeSampledColor],
ImagerFont USING [Font],
ImagerPath USING [ArcTo, ConicTo, CurveTo, LineTo, LineToX, LineToY, MapTrajectory, MoveTo, PathProc, Trajectory],
ImagerPixelArray USING [PixelArray],
ImagerTransformation USING [Concat, Create, DRound, Invert, Rotate, RoundXY, RoundXYVec, Scale, Scale2, Transform, Transformation, TransformVec, Translate],
IO USING [GetIndex, SetIndex],
IPImage USING [],
IPImager USING [ColorOperatorFromOperator, FindColor, FindColorModelOperator, FindColorOperator, FindFont, FindFontVec, FontFromVector, MakePixelArray, ModifyFont, VectorFromFont],
IPInterpreter USING [CallInlineBody, Do, DoProtected, DoSave, Error, Even, FGet, Get, GetInteger, Integer, MasterError, Operator, OperatorFromAny, Outline, OutlineRep, PopBool, PopColor, PopInteger, PopOperator, PopOutline, PopPixelArray, PopReal, PopTrajectory, PopTransformation, PopVec, PopVector, PushColor, PushInteger, PushOperator, PushOutline, PushPixelArray, PushReal, PushTrajectory, PushTransformation, PushVec, PushVector, ROPE, Shape, State, StringFromVector, TopType, VEC, Vector, VectorFromAny, VectorShape],
IPMaster USING [ImagerVariable];
IPImageImpl: CEDAR PROGRAM
IMPORTS Basics, Imager, ImagerColor, ImagerPath, ImagerTransformation, IO, IPImager, IPInterpreter
EXPORTS IPImage
~ BEGIN OPEN IPInterpreter;
Transformation: TYPE ~ ImagerTransformation.Transformation;
PixelArray: TYPE ~ ImagerPixelArray.PixelArray;
Trajectory: TYPE ~ ImagerPath.Trajectory;
SetMedium:
PROC[self: State,
m: Vector, pageNumber: Integer, duplex: BOOL, xImageShift: REAL] ~ {
self.mediumSize ← xxx;
self.fieldMin ← xxx;
self.fieldMax ← xxx;
IF duplex
AND Even[pageNumber]
THEN Imager.TranslateT[self.imager, [-xImageShift, 0]]
ELSE Imager.TranslateT[self.imager, [xImageShift, 0]];
};
ImagerVariable: TYPE ~ IPMaster.ImagerVariable;
ImagerVariableFromInteger:
PROC[i: Integer]
RETURNS[ImagerVariable] ~ {
Val: TYPE ~ [0..ORD[ImagerVariable.LAST]];
IF i IN Val THEN RETURN[VAL[Val[i]]]
ELSE {
MasterError[$boundsFault, "Imager variable index out of bounds."];
ERROR Error;
};
};
ApplyIGET:
PUBLIC
PROC[self: State] ~ {
i: Integer ~ PopInteger[self];
SELECT ImagerVariableFromInteger[i]
FROM
$DCScpx => PushReal[self, Imager.GetReal[self.imager, $DCScpx]];
$DCScpy => PushReal[self, Imager.GetReal[self.imager, $DCScpy]];
$correctMX => PushReal[self, Imager.GetReal[self.imager, $correctMX]];
$correctMY => PushReal[self, Imager.GetReal[self.imager, $correctMY]];
$T => PushTransformation[self, Imager.GetT[self.imager]];
$priorityImportant => PushInteger[self, Imager.GetInt[self.imager, $priorityImportant]];
$mediumXSize => PushReal[self, Imager.GetReal[self.imager, $mediumXSize]];
$mediumYSize => PushReal[self, Imager.GetReal[self.imager, $mediumYSize]];
$fieldXMin => PushReal[self, Imager.GetReal[self.imager, $fieldXMin]];
$fieldYMin => PushReal[self, Imager.GetReal[self.imager, $fieldYMin]];
$fieldXMax => PushReal[self, Imager.GetReal[self.imager, $fieldXMax]];
$fieldYMax => PushReal[self, Imager.GetReal[self.imager, $fieldYMax]];
$showVec => PushVector[self, GetShowVec[self]];
$color => PushColor[self, Imager.GetColor[self.imager]];
$noImage => PushInteger[self, Imager.GetInt[self.imager, $noImage]];
$strokeWidth => PushReal[self, Imager.GetReal[self.imager, $strokeWidth]];
$strokeStyle => PushInteger[self, Imager.GetInt[self.imager, $strokeStyle]];
$underlineStart => PushReal[self, Imager.GetReal[self.imager, $underlineStart]];
$amplifySpace => PushReal[self, Imager.GetReal[self.imager, $amplifySpace]];
$correctPass => PushInteger[self, Imager.GetInt[self.imager, $correctPass]];
$correctShrink => PushReal[self, Imager.GetReal[self.imager, $correctShrink]];
$correctTX => PushReal[self, Imager.GetReal[self.imager, $correctTX]];
$correctTY => PushReal[self, Imager.GetReal[self.imager, $correctTY]];
$clipOutline => Push[self, Imager.GetClipper[self.imager]];
ENDCASE => ERROR;
};
ApplyISET:
PUBLIC
PROC[self: State] ~ {
i: Integer ~ PopInteger[self];
SELECT ImagerVariableFromInteger[i]
FROM
$DCScpx => Imager.SetReal[self.imager, $DCScpx, PopReal[self]];
$DCScpy => Imager.SetReal[self.imager, $DCScpy, PopReal[self]];
$correctMX => Imager.SetReal[self.imager, $correctMX, PopReal[self]];
$correctMY => Imager.SetReal[self.imager, $correctMY, PopReal[self]];
$T => Imager.SetT[self.imager, PopTransformation[self]];
$priorityImportant => Imager.SetInt[self.imager, $priorityImportant, PopInteger[self]];
$mediumXSize => Imager.SetReal[self.imager, $mediumXSize, PopReal[self]];
$mediumYSize => Imager.SetReal[self.imager, $mediumYSize, PopReal[self]];
$fieldXMin => Imager.SetReal[self.imager, $fieldXMin, PopReal[self]];
$fieldYMin => Imager.SetReal[self.imager, $fieldYMin, PopReal[self]];
$fieldXMax => Imager.SetReal[self.imager, $fieldXMax, PopReal[self]];
$fieldYMax => Imager.SetReal[self.imager, $fieldYMax, PopReal[self]];
$showVec => SetShowVec[self, PopVector[self]];
$color => Imager.SetColor[self.imager, PopColor[self]];
$noImage => Imager.SetInt[self.imager, $noImage, PopInteger[self]];
$strokeWidth => Imager.SetReal[self.imager, $strokeWidth, PopReal[self]];
$strokeStyle => Imager.SetInt[self.imager, $strokeStyle, PopInteger[self]];
$underlineStart => Imager.SetReal[self.imager, $underlineStart, PopReal[self]];
$amplifySpace => Imager.SetReal[self.imager, $amplifySpace, PopReal[self]];
$correctPass => Imager.SetInt[self.imager, $correctPass, PopInteger[self]];
$correctShrink => Imager.SetReal[self.imager, $correctShrink, PopReal[self]];
$correctTX => Imager.SetReal[self.imager, $correctTX, PopReal[self]];
$correctTY => Imager.SetReal[self.imager, $correctTY, PopReal[self]];
$clipOutline => Imager.SetClipper[self.imager, Pop[self]];
ENDCASE => ERROR;
};
GetShowVec:
PROC[self: State]
RETURNS[Vector] ~ {
IF self.showVec=
NIL
THEN {
font: ImagerFont.Font ~ Imager.GetFont[self.imager];
RETURN[IPImager.VectorFromFont[font]];
}
ELSE RETURN[self.showVec];
};
SetShowVec:
PROC[self: State, v: Vector] ~ {
font: ImagerFont.Font ~ IPImager.FontFromVector[v];
IF font=NIL THEN self.showVec ← v
ELSE { Imager.SetFont[self.imager, font]; self.showVec ← NIL };
};
ApplyDROUND:
PUBLIC
PROC[self: State] ~ {
p: VEC ~ PopVec[self];
PushVec[self, ImagerTransformation.DRound[p]];
};
ApplyMAKET:
PUBLIC
PROC[self: State] ~ {
f: REAL ~ PopReal[self]; e: REAL ~ PopReal[self]; d: REAL ~ PopReal[self];
c: REAL ~ PopReal[self]; b: REAL ~ PopReal[self]; a: REAL ~ PopReal[self];
PushTransformation[self, ImagerTransformation.Create[a, b, c, d, e, f]];
};
ApplyOPENT:
PUBLIC
PROC[self: State] ~ {
m: Transformation ~ PopTransformation[self];
PushReal[self, m.a]; PushReal[self, m.b]; PushReal[self, m.c];
PushReal[self, m.d]; PushReal[self, m.e]; PushReal[self, m.f];
};
ApplyTRANSLATE:
PUBLIC
PROC[self: State] ~ {
t: VEC ~ PopVec[self];
PushTransformation[self, ImagerTransformation.Translate[t]];
};
ApplyROTATE:
PUBLIC
PROC[self: State] ~ {
a: REAL ~ PopReal[self];
PushTransformation[self, ImagerTransformation.Rotate[a]];
};
ApplySCALE:
PUBLIC
PROC[self: State] ~ {
s: REAL ~ PopReal[self];
PushTransformation[self, ImagerTransformation.Scale[s]];
};
ApplySCALE2:
PUBLIC
PROC[self: State] ~ {
s: VEC ~ PopVec[self];
PushTransformation[self, ImagerTransformation.Scale2[s]];
};
ApplyCONCAT:
PUBLIC
PROC[self: State] ~ {
n: Transformation ~ PopTransformation[self];
m: Transformation ~ PopTransformation[self];
PushTransformation[self, ImagerTransformation.Concat[m, n]];
};
ApplyINVERT:
PUBLIC
PROC[self: State] ~ {
m: Transformation ~ PopTransformation[self];
PushTransformation[self, ImagerTransformation.Invert[m]];
};
ApplyTRANSFORM:
PUBLIC
PROC[self: State] ~ {
m: Transformation ~ PopTransformation[self];
p: VEC ~ PopVec[self];
PushVec[self, m.Transform[p]];
};
ApplyTRANSFORMVEC:
PUBLIC
PROC[self: State] ~ {
m: Transformation ~ PopTransformation[self];
v: VEC ~ PopVec[self];
PushVec[self, m.TransformVec[v]];
};
ApplyROUNDXY:
PUBLIC
PROC[self: State] ~ {
m: Transformation ~ PopTransformation[self];
p: VEC ~ PopVec[self];
PushVec[self, m.RoundXY[p]];
};
ApplyROUNDXYVEC:
PUBLIC
PROC[self: State] ~ {
m: Transformation ~ PopTransformation[self];
v: VEC ~ PopVec[self];
PushVec[self, m.RoundXYVec[v]];
};
ApplyCONCATT:
PUBLIC
PROC[self: State] ~ {
m: Transformation ~ PopTransformation[self];
Imager.ConcatT[self.imager, m];
};
ApplyMOVE:
PUBLIC
PROC[self: State] ~ {
Imager.Move[self.imager];
};
ApplyTRANS:
PUBLIC
PROC[self: State] ~ {
Imager.Trans[self.imager];
};
ApplySHOW:
PUBLIC
PROC[self: State] ~ {
v: Vector ~ PopVector[self];
IF self.showVec=
NIL
THEN {
string: ROPE ~ StringFromVector[v];
Imager.ShowRope[self.imager, string];
}
ELSE {
showVec: Vector ~ self.showVec;
shape: VectorShape ~ Shape[showVec];
FOR i: Integer
IN[shape.l..shape.l+shape.n)
DO
action:
PROC ~ {
Imager.Trans[self.imager];
Do[self, OperatorFromAny[Get[showVec, GetInteger[v, i]]]];
};
DoSave[self, action];
ENDLOOP;
};
};
ApplySHOWANDXREL:
PUBLIC
PROC[self: State] ~ {
MasterError[$unimplemented, "SHOWANDXREL is not implemented."];
ERROR Error;
};
ApplySETXY:
PUBLIC
PROC[self: State] ~ {
Imager.SetXY[self.imager, PopVec[self]];
};
ApplySETXYREL:
PUBLIC
PROC[self: State] ~ {
Imager.SetXYRel[self.imager, PopVec[self]];
};
ApplySETXREL:
PUBLIC
PROC[self: State] ~ {
Imager.SetXRel[self.imager, PopReal[self]];
};
ApplySETYREL:
PUBLIC
PROC[self: State] ~ {
Imager.SetYRel[self.imager, PopReal[self]];
};
ApplyGETCP:
PUBLIC
PROC[self: State] ~ {
PushVec[self, Imager.GetCP[self.imager]];
};
ApplyGETCPROUNDED:
PUBLIC
PROC[self: State] ~ {
PushVec[self, Imager.GetCPRounded[self.imager]];
};
ApplyMAKEPIXELARRAY:
PUBLIC
PROC[self: State] ~ {
samples: Vector ~ PopVector[self];
m: Transformation ~ PopTransformation[self];
samplesInterleaved: BOOL ~ PopBool[self];
maxSampleValue: Vector ← IF TopType[self]=vector THEN PopVector[self] ELSE NIL;
maxSampleValueI: Integer ~ IF maxSampleValue=NIL THEN PopInteger[self] ELSE 0;
samplesPerPixel: Integer ~ PopInteger[self];
yPixels: Integer ~ PopInteger[self];
xPixels: Integer ~ PopInteger[self];
PushPixelArray[self, IPImager.MakePixelArray[
xPixels: xPixels, yPixels: yPixels, samplesPerPixel: samplesPerPixel,
maxSampleValue: maxSampleValue, maxSampleValueI: maxSampleValueI,
samplesInterleaved: samplesInterleaved, m: m, samples: samples]];
};
ApplyEXTRACTPIXELARRAY:
PUBLIC
PROC[self: State] ~ {
select: Vector ~ PopVector[self];
pa: PixelArray ~ PopPixelArray[self];
PushPixelArray[self, pa];
MasterError[$unimplemented, "EXTRACTPIXELARRAY is not implemented."];
ERROR Error;
};
ApplyJOINPIXELARRAYS:
PUBLIC
PROC[self: State] ~ {
MasterError[$unimplemented, "JOINPIXELARRAYS is not implemented."];
ERROR Error;
};
ApplyFINDDECOMPRESSOR:
PUBLIC
PROC[self: State] ~ {
v: Vector ~ PopVector[self];
PushOperator[self, FindDecompressor[self, v]];
MasterError[$unimplemented, "FINDDECOMPRESSOR is not implemented."];
ERROR Error;
};
ApplyFINDCOLOR:
PUBLIC
PROC[self: State] ~ {
v: Vector ~ PopVector[self];
PushColor[self, IPImager.FindColor[self, v]];
};
ApplyFINDCOLOROPERATOR:
PUBLIC
PROC[self: State] ~ {
v: Vector ~ PopVector[self];
PushOperator[self, IPImager.FindColorOperator[self, v]];
};
ApplyFINDCOLORMODELOPERATOR:
PUBLIC
PROC[self: State] ~ {
v: Vector ~ PopVector[self];
PushOperator[self, IPImager.FindColorModelOperator[self, v]];
};
ApplyMAKEGRAY:
PUBLIC
PROC[self: State] ~ {
f: REAL ~ PopReal[self];
PushColor[self, ImagerColor.MakeGray[f]];
};
ApplyMAKESAMPLEDCOLOR:
PUBLIC
PROC[self: State] ~ {
colorOperator: Operator ~ PopOperator[self];
um: Transformation ~ PopTransformation[self];
pa: PixelArray ~ PopPixelArray[self];
PushColor[self, ImagerColor.MakeSampledColor[pa, um, IPImager.ColorOperatorFromOperator[colorOperator]]];
};
ApplyMAKESAMPLEDBLACK:
PUBLIC
PROC[self: State] ~ {
clear: BOOL ~ PopBool[self];
um: Transformation ~ PopTransformation[self];
pa: PixelArray ~ PopPixelArray[self];
PushColor[self, ImagerColor.MakeSampledBlack[pa, um, clear]];
};
ApplySETGRAY:
PUBLIC
PROC[self: State] ~ {
f: REAL ~ PopReal[self];
Imager.SetGray[self.imager, f];
};
ApplyMOVETO:
PUBLIC
PROC[self: State] ~ {
p: VEC ~ PopVec[self];
PushTrajectory[self, ImagerPath.MoveTo[p]];
};
ApplyLINETO:
PUBLIC
PROC[self: State] ~ {
p: VEC ~ PopVec[self];
t: Trajectory ~ PopTrajectory[self];
PushTrajectory[self, t.LineTo[p]];
};
ApplyLINETOX:
PUBLIC
PROC[self: State] ~ {
x: REAL ~ PopReal[self];
t: Trajectory ~ PopTrajectory[self];
PushTrajectory[self, t.LineToX[x]];
};
ApplyLINETOY:
PUBLIC
PROC[self: State] ~ {
y: REAL ~ PopReal[self];
t: Trajectory ~ PopTrajectory[self];
PushTrajectory[self, t.LineToY[y]];
};
ApplyCURVETO:
PUBLIC
PROC[self: State] ~ {
p3: VEC ~ PopVec[self];
p2: VEC ~ PopVec[self];
p1: VEC ~ PopVec[self];
t: Trajectory ~ PopTrajectory[self];
PushTrajectory[self, t.CurveTo[p1, p2, p3]];
};
ApplyCONICTO:
PUBLIC
PROC[self: State] ~ {
r: REAL ~ PopReal[self];
p2: VEC ~ PopVec[self];
p1: VEC ~ PopVec[self];
t: Trajectory ~ PopTrajectory[self];
PushTrajectory[self, t.ConicTo[p1, p2, r]];
};
ApplyARCTO:
PUBLIC
PROC[self: State] ~ {
p2: VEC ~ PopVec[self];
p1: VEC ~ PopVec[self];
t: Trajectory ~ PopTrajectory[self];
PushTrajectory[self, t.ArcTo[p1, p2]];
};
ApplyMAKEOUTLINE:
PUBLIC
PROC[self: State] ~ {
n: Integer ~ PopInteger[self];
outline: Outline ~ NEW[OutlineRep[n]];
FOR i: NAT DECREASING IN[0..outline.size) DO outline[i] ← PopTrajectory[self] ENDLOOP;
PushOutline[self, outline];
};
MapOutline: ImagerPath.PathProc ~ {
outline: Outline ~ NARROW[pathData];
FOR i:
NAT
IN[0..outline.size)
DO
ImagerPath.MapTrajectory[outline[i], moveTo, lineTo, curveTo, conicTo, arcTo];
ENDLOOP;
};
ApplyMASKFILL:
PUBLIC
PROC[self: State] ~ {
outline: Outline ~ PopOutline[self];
Imager.MaskFill[self.imager, MapOutline, outline];
};
ApplyMASKFILLPARITY:
PUBLIC
PROC[self: State] ~ {
outline: Outline ~ PopOutline[self];
Imager.MaskFillParity[self.imager, MapOutline, outline];
};
ApplyMASKSTROKE:
PUBLIC
PROC[self: State] ~ {
t: Trajectory ~ PopTrajectory[self];
Imager.MaskStroke[self.imager, ImagerPath.MapTrajectory, t];
};
ApplyMASKSTROKECLOSED:
PUBLIC
PROC[self: State] ~ {
t: Trajectory ~ PopTrajectory[self];
Imager.MaskStrokeClosed[self.imager, ImagerPath.MapTrajectory, t];
};
ApplyMASKRECTANGLE:
PUBLIC
PROC[self: State] ~ {
h: REAL ~ PopReal[self]; w: REAL ~ PopReal[self];
y: REAL ~ PopReal[self]; x: REAL ~ PopReal[self];
Imager.MaskRectangle[self.imager, x, y, w, h];
};
ApplyMASKVECTOR:
PUBLIC
PROC[self: State] ~ {
p2: VEC ~ PopVec[self];
p1: VEC ~ PopVec[self];
Imager.MaskVector[self.imager, p1, p2];
};
ApplySTARTUNDERLINE:
PUBLIC
PROC[self: State] ~ {
Imager.StartUnderline[self.imager];
};
ApplyMASKUNDERLINE:
PUBLIC
PROC[self: State] ~ {
h: REAL ~ PopReal[self]; dy: REAL ~ PopReal[self];
Imager.MaskUnderline[self.imager, dy, h];
};
ApplyMASKTRAPEZOIDX:
PUBLIC
PROC[self: State] ~ {
x4: REAL ~ PopReal[self]; y3: REAL ~ PopReal[self]; x3: REAL ~ PopReal[self];
x2: REAL ~ PopReal[self]; y1: REAL ~ PopReal[self]; x1: REAL ~ PopReal[self];
MapTrapezoidX: ImagerPath.PathProc ~ {
moveTo[[x1, y1]]; lineTo[[x2, y1]]; lineTo[[x3, y3]]; lineTo[[x4, y3]];
};
Imager.MaskFill[self.imager, MapTrapezoidX];
};
ApplyMASKTRAPEZOIDY:
PUBLIC
PROC[self: State] ~ {
y4: REAL ~ PopReal[self]; y3: REAL ~ PopReal[self]; x3: REAL ~ PopReal[self];
y2: REAL ~ PopReal[self]; y1: REAL ~ PopReal[self]; x1: REAL ~ PopReal[self];
MapTrapezoidY: ImagerPath.PathProc ~ {
moveTo[[x1, y1]]; lineTo[[x3, y3]]; lineTo[[x3, y4]]; lineTo[[x1, y2]];
};
Imager.MaskFill[self.imager, MapTrapezoidY];
};
ApplyMASKPIXEL:
PUBLIC
PROC[self: State] ~ {
pa: PixelArray ~ PopPixelArray[self];
Imager.MaskPixel[self.imager, pa];
};
ApplyCLIPOUTLINE:
PUBLIC
PROC[self: State] ~ {
outline: Outline ~ PopOutline[self];
Imager.ClipOutline[self.imager, MapOutline, outline];
};
ApplyCLIPRECTANGLE:
PUBLIC
PROC[self: State] ~ {
h: REAL ~ PopReal[self]; w: REAL ~ PopReal[self];
y: REAL ~ PopReal[self]; x: REAL ~ PopReal[self];
Imager.ClipRectangle[self.imager, x, y, w, h];
};
ApplyEXCLUDEOUTLINE:
PUBLIC
PROC[self: State] ~ {
outline: Outline ~ PopOutline[self];
Imager.ExcludeOutline[self.imager, MapOutline, outline];
};
ApplyEXCLUDERECTANGLE:
PUBLIC
PROC[self: State] ~ {
h: REAL ~ PopReal[self]; w: REAL ~ PopReal[self];
y: REAL ~ PopReal[self]; x: REAL ~ PopReal[self];
Imager.ExcludeRectangle[self.imager, x, y, w, h];
};
ApplyFINDFONT:
PUBLIC
PROC[self: State] ~ {
v: Vector ~ PopVector[self];
PushVector[self, IPImager.FindFont[self, v]];
};
ApplyFINDFONTVEC:
PUBLIC
PROC[self: State] ~ {
v: Vector ~ PopVector[self];
PushVector[self, IPImager.FindFontVec[self, v]];
};
ApplyMODIFYFONT:
PUBLIC
PROC[self: State] ~ {
m: Transformation ~ PopTransformation[self];
v: Vector ~ PopVector[self];
PushVector[self, IPImager.ModifyFont[v, m]];
};
ApplySETFONT:
PUBLIC
PROC[self: State] ~ {
n: Integer ~ PopInteger[self];
SetShowVec[self, VectorFromAny[FGet[self, n]]];
};
ApplyCORRECTMASK:
PUBLIC
PROC[self: State] ~ {
Imager.CorrectMask[self.imager];
};
ApplyCORRECTSPACE:
PUBLIC
PROC[self: State] ~ {
Imager.CorrectSpace[self.imager, PopVec[self]];
};
ApplyCORRECT:
PUBLIC
PROC[self: State] ~ {
index: INT ~ IO.GetIndex[self.stream];
action:
PROC ~ {
inner: PROC ~ { CallInlineBody[self] };
IO.SetIndex[self.stream, index];
DoProtected[self, inner];
};
Imager.Correct[self.imager, action];
};
ApplySETCORRECTMEASURE:
PUBLIC
PROC[self: State] ~ {
Imager.SetCorrectMeasure[self.imager, PopVec[self]];
};
ApplySETCORRECTTOLERANCE:
PUBLIC
PROC[self: State] ~ {
Imager.SetCorrectTolerance[self.imager, PopVec[self]];
};
ApplySPACE:
PUBLIC
PROC[self: State] ~ {
Imager.Space[self.imager, PopReal[self]];
};
END.