-- File: ColorPressUtils.mesa
-- Last Edited: November 5, 1981 6:28 PM By: GWilliams
DIRECTORY
AltoRam USING[DoSilentBoot],
ImageDefs USING [StopMesa],
IODefs USING[--CR, NUL, SP, TAB, ReadChar, WriteChar, WriteString,-- WriteLine],
PressDefs USING [copies, filePtr, Init, LockNeededCode, numPages, pageGarray, PrintInit, PSlot, ReadCommandFile],
PressNetDefs USING [GetBits],
SystemDefs USING [FreeHeapNode],
TridentDefs USING [PAGE, tfsdskPtr, TfsCloseDisk, VDA];
ColorPressUtils: PROGRAM
IMPORTS AltoRam, ImageDefs, IODefs, PressDefs, ColorPressDefs, SystemDefs, TridentDefs
EXPORTS ColorPressDefs
=
BEGIN OPEN AltoRam, IODefs, ColorPressDefs, PressDefs, SystemDefs, TridentDefs;
firstBand, LastBand: CARDINAL;
bitMargin: CARDINAL;--we’ll use the smallest
InitPage: PROC[disk: tfsdskPtr, pageNum] =
{
length1, length2, length3: CARDINAL;

firstBand ← MIN[pageGarray[0*i].FirstBand, MIN[pageGarray[1*i].FirstBand, pageGarray[2*i].FirstBand]];
lastBand ← MAX[pageGarray[0*i].LastBand, MAX[pageGarray[1*i].LastBand, pageGarray[2*i].LastBand]];
bitMargin ← MIN[pageGarray[0*i].BitMargin, MIN[pageGarray[1*i].BitMargin, pageGarray[2*i].BitMargin]];
bitMargin ← bitMargin/16;--this was a bit count

length1 ← pageGarray[0*i].BitWc + pageGarray[0*i].BitMargin;
, MAX[pageGarray[1*i].LastBand, pageGarray[2*i].LastBand]];
};--Procedure InitPage

END
. -- ColorPressUtils