JaMRESImpl.mesa
Copyright Ó 1985, 1992 by Xerox Corporation. All rights reserved.
Last edited by: Mik Lamming - November 10, 1987 11:04:20 am PST
DIRECTORY Imager, ImagerRES, JaMIPrivate, JaM, RasterEncodingStandardIO;
JaMRESImpl: CEDAR MONITOR
IMPORTS Imager, ImagerRES, RasterEncodingStandardIO, JaM, JaMIPrivate
EXPORTS JaMIPrivate
~ BEGIN OPEN JaM;
ApplyLoadRes: PUBLIC PROC [self: State] ~ {
Push[self, RasterEncodingStandardIO.Read[PopRope[self]]];
};
PopRES: PROC [self: State] RETURNS [RasterEncodingStandardIO.RES] ~ {
any: REF ANY ~ Pop[self];
WITH any SELECT FROM
r: RasterEncodingStandardIO.RES => RETURN [r];
ENDCASE => ERROR JaM.Error[WrongType];
};
ApplyResBounds: PUBLIC PROC [self: State] ~ {
res: RasterEncodingStandardIO.RES ~ PopRES[self];
PushInt[self, res.xDimension]; PushInt[self, res.yDimension];
};
GetContext: PROC [self: State] RETURNS [Imager.Context] ~ {
info: JaMIPrivate.Info ¬ JaMIPrivate.GetInfo[self];
IF info = NIL THEN ERROR;
IF info.ipenabled THEN RETURN [info.ipdc];
RETURN[info.vdc];
};
ApplySetResColor: PUBLIC PROC [self: State] ~ {
res: RasterEncodingStandardIO.RES ~ PopRES[self];
context: Imager.Context ~ GetContext[self];
context.SetSampledColor[res.colorImage, NIL, res.colorOperator]
};
ApplyShowRes: PUBLIC PROC [self: State] ~ {
useScale: BOOL ~ JaM.PopBool[self];
res: RasterEncodingStandardIO.RES ~ PopRES[self];
context: Imager.Context ~ GetContext[self];
ImagerRES.ShowRES[context, res, useScale];
};
ApplyShowUnitRes: PUBLIC PROC [self: State] ~ {
center: BOOL ~ JaM.PopBool[self];
res: RasterEncodingStandardIO.RES ~ PopRES[self];
context: Imager.Context ~ GetContext[self];
ImagerRES.ShowUnitRES[context, res, center];
};
ApplySetColorRes: PUBLIC PROC [self: State] ~ {
res: RasterEncodingStandardIO.RES ~ PopRES[self];
context: Imager.Context ~ GetContext[self];
ImagerRES.SetColorRES[context, res];
};
ApplySetSampledBlackRes: PUBLIC PROC [self: State] ~ {
clear: BOOL ~ JaM.PopBool[self];
res: RasterEncodingStandardIO.RES ~ PopRES[self];
context: Imager.Context ~ GetContext[self];
ImagerRES.SetSampledBlackRES[context, res, clear];
};
ApplyMaskRes: PUBLIC PROC [self: State] ~ {
res: RasterEncodingStandardIO.RES ~ PopRES[self];
context: Imager.Context ~ GetContext[self];
ImagerRES.MaskRES[context, res];
};
ApplyCombineAlphaAndMask: PUBLIC PROC [self: State] ~ {
res: RasterEncodingStandardIO.RES ~ PopRES[self];
JaM.Push[self, ImagerRES.CombineAlphaAndMask[res]];
};
RegisterRES: PUBLIC PROC [self: JaM.State] ~ {
Register[self, ".loadres", ApplyLoadRes];
Register[self, ".resbounds", ApplyResBounds];
Register[self, ".showres", ApplyShowRes];
Register[self, ".showunitres", ApplyShowUnitRes];
Register[self, ".setcolorres", ApplySetColorRes];
Register[self, ".setsampledblackres", ApplySetSampledBlackRes];
Register[self, ".maskres", ApplyMaskRes];
Register[self, ".combinealphaandmask", ApplyCombineAlphaAndMask];
};
END.