ImagerPDImpl.mesa
Copyright © 1984 Xerox Corporation. All rights reserved.
Michael Plass, June 22, 1984 9:41:51 am PDT
Doug Wyatt, November 30, 1984 2:35:38 pm PST
DIRECTORY
Imager USING [Class, Context, ContextRep],
ImagerDevice USING [Device],
ImagerPD USING [PDParameters],
ImagerPDDevice USING [Create],
ImagerRaster USING [CreateClass],
ImagerRasterPrivate USING [CreateData, Data],
PDFileWriter USING [Create, PDState],
Rope USING [ROPE];
ImagerPDImpl: CEDAR PROGRAM
IMPORTS ImagerPDDevice, ImagerRaster, ImagerRasterPrivate, PDFileWriter
EXPORTS ImagerPD
~ BEGIN
PDParameters: TYPE ~ ImagerPD.PDParameters;
Context: TYPE ~ Imager.Context;
ROPE: TYPE ~ Rope.ROPE;
PixelMap: TYPE ~ ImagerPixelMaps.PixelMap;
Tile: TYPE ~ ImagerPixelMaps.Tile;
SpecialColor: TYPE ~ REF ColorRep[special];
Name: TYPE ~ ImagerPrivate.Name;
ManhattanPolygon: TYPE ~ ImagerManhattan.Polygon;
Raven: PUBLIC PROC RETURNS[PDParameters] ~ {
RETURN[[deviceCode: raven,
sResolution: 300, fResolution: 300,
imageSSize: 300*8+300/2, imageFSize: 300*11, -- 8.5 by 11 inches
nColors: 1, leftovers: TRUE, bandSSize: 16, maxLoadWords: 60000
]]
};
Hornet: PUBLIC PROC RETURNS[PDParameters] ~ {
RETURN[[deviceCode: hornet,
sResolution: 384, fResolution: 384,
imageSSize: 384*8+384/2, imageFSize: 384*11, -- 8.5 by 11 inches
nColors: 1, leftovers: TRUE, bandSSize: 16, maxLoadWords: 60000
]]
};
Gnat: PUBLIC PROC RETURNS[PDParameters] ~ {
RETURN[[deviceCode: gnat,
sResolution: 384, fResolution: 384,
imageSSize: 384*11, imageFSize: 384*14, -- 11 by 14 inches
nColors: 1, leftovers: TRUE, bandSSize: 16, maxLoadWords: 60000
]]
};
PlateMaker: PUBLIC PROC RETURNS[PDParameters] ~ {
RETURN[[deviceCode: mig,
sResolution: 880, fResolution: 880,
imageSSize: 880*11, imageFSize: 880*8+880/2, -- 11 by 8.5 inches
nColors: 1, leftovers: TRUE, bandSSize: 16, maxLoadWords: 60000
]]
};
ReticleMaker: PUBLIC PROC RETURNS[PDParameters] ~ {
RETURN[[deviceCode: reticleMaker,
sResolution: 880, fResolution: 880,
imageSSize: 880*10, imageFSize: 880*10, -- 10 by 10 inches ???
nColors: 1, leftovers: TRUE, bandSSize: 16, maxLoadWords: 60000
]] -- These are surely wrong.
};
Puffin: PUBLIC PROC RETURNS[PDParameters] ~ {
RETURN[[deviceCode: puffin,
sResolution: 384, fResolution: 384,
imageSSize: 384*11, imageFSize: 384*8+384/2, -- 11 by 8.5 inches
nColors: 3, leftovers: TRUE, bandSSize: 16, maxLoadWords: 60000
]]
};
ColorVersatec: PUBLIC PROC RETURNS[PDParameters] ~ {
RETURN[[deviceCode: colorVersatec,
sResolution: 200, fResolution: 200,
imageSSize: 200*100, imageFSize: 200*40, -- 100 (arbitrary) by 40 inches
nColors: 4, leftovers: FALSE, bandSSize: 64, maxLoadWords: 100000
]]
};
pdClass: Imager.Class ~ ImagerRaster.CreateClass[$PD];
Create: PUBLIC PROC[name: ROPE, params: PDParameters] RETURNS[Imager.Context] ~ {
pdState: PDFileWriter.PDState ~ PDFileWriter.Create[
fileName: name,
deviceCode: params.deviceCode,
sResolution: params.sResolution,
fResolution: params.fResolution,
imageSSize: params.imageSSize,
imageFSize: params.imageFSize,
bandSSize: params.bandSSize,
leftOverMode: params.leftovers,
maxLoadWords: params.maxLoadWords
];
data.firstToner ← IF desc.nColors = 3 THEN 1 ELSE 0;
data.lastToner ← data.firstToner + desc.nColors - 1;
data.currentToner ← data.lastToner + 1;
device: ImagerDevice.Device ~ ImagerPDDevice.Create[pdState: pdState,
sSize: params.imageSSize, fSize: params.imageFSize,
sPixelsPerInch: params.sResolution, fPixelsPerInch: params.fResolution];
data: ImagerRasterPrivate.Data ~ ImagerRasterPrivate.CreateData[device];
RETURN[NEW[Imager.ContextRep ← [class: pdClass, data: data]]];
};
Close: PUBLIC PROC[context: Context] ~ {
WITH context.data SELECT FROM
data: ImagerRaster.Data => {
data.pdState.EndPage;
data.pdState.Close;
};
ENDCASE => ERROR Imager.Error[$Unimplemented];
};
NewPage: PUBLIC PROC[context: Context] ~ {
WITH context.data SELECT FROM
data: ImagerRaster.Data => {
data.pdState.EndPage;
Reset[context];
data.pdStatePriorityImportant ← 0;
};
ENDCASE => ERROR Imager.Error[$Unimplemented];
};
END.