Inter-Office MemorandumToInterpress NotebookDateMarch 3, 1983FromKen Pier and Bob SproullLocationPalo AltoSubjectPrinting Device File FormatOrganizationPARC/ISLXEROX Filed on: [maxc]PDFormat.memo & .press1. IntroductionThis memo describes the format of printing device (PD) files. A PD file encodes a series of low-levelimaging commands that are used to create a binary image that is then printed on a printing device; aPD file is similar in concept to "bandslists" in [2]. The interpretation of the imaging commands isdevice-independent, but the way in which the resulting binary image is presented on the device isdevice-dependent.An Alto implementation of a PD interpreter is able to create images on a number of different ROSdevices [1]. Although this particular implementation builds a full image buffer on a large disk file, it ispossible to interpret PD files on-the-fly as the image is being formed.2. Coordinate systemLocations on the image are measured in a device-dependent coordinate system. The two axisdimensions are labeled s and f. The s, or slow, direction, is measured along the direction of papertransport, i.e., locations with greater values of s are imaged after locations with lesser values of s. Mostprinters Xerox builds have the s direction oriented along the narrow edge of an 8|X11 inch piece ofpaper ("landscape scanning"), i.e., it is oriented left-to-right on this piece of paper when you areholding it in the normal reading orientation. The f, or fast, direction is chosen so that sXf pointstoward the viewer of the image. On this piece of paper, f points vertically, from bottom to top. Theorigin of the coordinate system is chosen so that it lies on the medium and so that all points on themedium are measured with non-negative values of s and f. On this page, the origin is at the lower-leftcorner; s points to the right and f points up. On a display ("portrait scanning"), the origin is at theupper-left corner, s points down and f points to the right.The coordinate s can be thought of as addressing a scan-line and f the pixels along a scan-line. We try to avoidusing the terms width and height because these are tied to the final image and the orientation in which it is heldrather than to the raster imaging scheme; we speak instead of fSize and sSize. Note that the f direction may ormay not indicate the order in which pixels are laid down on the image.The Pimlico and Puffin color printers and the MIG use portrait scanning.The entire image size is determined by the two quantities imageSSize and imageFSize. A coordinate(s,f) lies on the image iff 0�ôšô›ðFî ·ï<Æô’sqð,ô“sq î ·ï:ûsqô�sqsqsqð"ôŽð"î ·ï90ô�ðNô‚sqs qî ·ï7fô¡sqðHô¢î ·ï5›ô‘ðEô’î ·ï3Ðô¿s qð>ôÀî ·ï0_ô…ð'ô†ð(sqsq î ·ï.”ô sqî­ï+"wqsqswqsqstsqtqstsqwqsqstqstsqî ·ï'ipî ·ï#øqô…ðFô†î ·ï"-ô î­ï»ô¤sqðMî­ïðôÑð-ôÒð(î­ï&ô¸sqð0ô¹î­ï´ô¬s qô­ð*î­ïéô°ð"ô±ð5î­ïô�ðYôŽî­ïTôåðQôæî­ï‰ô†ô‡ð&s qî­ï¿ô‹ð-ôŒð0î­ï ôÿ j · ­?²[^’Printing Device File Format3In both cases, the information is sorted by band number, i.e., commands that apply to band 0 appearbefore commands that apply to band 1. Some interpreters may support only bandMode.When the interpreter is operated in bandMode, an operation called band clipping is performed. Bandclipping clips all imaging commands for a band so as to exclude any parts of the modification that lieoutside the band.For example, band clipping allows an imaging command that affects a region 35î ·ïFøô©ðOôªî ·ïE-ôœð,ô�s qð#î ·ïCcô“ðDô”î ·ïA˜ô’ðEô“î ·ï?Îô�ô�ðVî ·ï>ôÐðGôÑî ·ï<8ôð)î­ï8êuô€ðLv uô�î­ï7Bôð:î ·ï3Špî ·ï0qôÚ ôÛsqð7î ·ï.MôðSî­ï*Ûuqð2uq î­ï'iuqî­ï#øuô…qðFô† î­ï"-î­ï»ôž ôŸsqð#uî­ïðqô�uqð#ô‚ð'î­ï&ôî­ï´ðTî ·ïBðQî ·ïÐsô¢qð.ô£ð-î ·ïôŒsqô�ð2î ·ï ;ô�ð5ô‚ð4î ·ï pô¥ô¦ s qð,sÿ X · )?²\âBPrinting Device File Format40sô–qðCô— sq î ·ï<8ôð4î­ï8Æsôƒqsuqsuqsqô„ î­ï6üô¤ð)ô¥sqs qsqs qsqsq î­ï51ôsqsî­ï1ãuô¯ð;ô°ð.î­ï0;ôî ·ï,És qð?î­ï)Wsô qsqusuqsqststs qî­ï'�ôþsqôÿð0î­ï$sqô¯squqsuqô°î­ï"Pô�sqð?ôžî­ï †ôsq î ·ïÍpôiî ·ï[qô£ô¤ðQsqî ·ï‘ô»ð(ô¼s qî ·ïÆsqô—ð;ô˜s qî ·ïTwô î ·ïâqô˜ð$ô™ðDî ·ï  º · Ð?²[;rPrinting Device File Format5password: CARD=125252B. The password identifies the file as a PD file. All versions will usethis password.version: CARD. Identifies the version for which this PD file is constructed. This documentdefines files for which version=1.deviceCode: CARD. Identifies the device for which this PD file is constructed. Section 7 givesdevice codes and parameters as of this writing.sResolution, fResolution: CARD. Resolution of the device in pixels per inch along the s and fdirections.imageSSize, imageFSize: CARD. Total image size assumed by the images in this PD file. Thesedimensions may not be larger than the device can handle. The PD interpreter never translatesan image (e.g., centers it)the (0, 0) point must always lie at a corner of the page.bandSSize: CARD. The number of scan-lines in a band; otherwise ignored.maxLoadWords: LONG CARD. The size of the memory area that must be allocated to the load.copies: CARD. The number of copies of the file to print.The PD interpreter will examine the herald to determine whether it can print the file. It may disagreeabout the properties of the device or it may not be able to accommodate the resources requested (e.g.,maxLoadWords). For any of these reasons, the interpreter may reject the file.6.2 Control commandsControl commands delineate portions of a PD file and set several state variables that control theinterpretation of imaging commands (curC, curT, and curP). At the beginning of each band, curC :=ALL[1], curT := opaque, and curP := 0.startImage[interpreterMode: {bandMode, leftOverMode}, feed, strip: {false, true}, tonerColor:[0..16), passBands, nBands, fMinPage, fSizePage: CARD]. The startImage command precedesany imaging commands for an image. It tells the printer whether a new sheet of paper is to befed to the printer to hold the image, and whether the sheet is to be stripped out of the printerafter the image is formed. For all black-and-white printers, feed and strip must be true, but forcolor printers that take several passes to assemble a multi-colored page, a page will be fed onthe first pass and stripped on the last pass. The color of the toner to use for the image isspecified by tonerColor:0Black1Cyan2Magenta3YellowThe interpreterMode field determines how the interpreter will operate in the image that isstarting.The passBands argument specifies how many initial bands on the page are empty; nBandsdetermines how many bands are to be imaged (some may not have any images in them, ofÿî ·ïfñqôîGïî­ïbsqôšuqð<ô›î­ï`Sô î­ï\ásqôÉuqð*ôÊð#î­ï[ôð"î­ïW¥s qô¢uqðHô£î­ïUÚôð/î­ïRhsô¢qô£uqð8sqsî­ïPžq î­ïM,sôŒquqô�ð%î­ïKaô•ð!ô–ð+sq î­ïI–ôüð?ôýî­ïF$sqôuqð8î­ïB²s qô�uqð4ôŽ î­ï?Asqôuqð,î ·ï;Ïô�ô�ðGî ·ï:ôŒðfî ·ï89s qôðAî ·ï4Çwî ·ï1UqôËôÌðQî ·ï/‹ô•ð$s qsqô–sqî ·ï-Àôsqsqsqî­ï*Ns tqsqôÎsqs qsôÏqs î­ï(„qôÅsusuqs qôÆî­ï&¹ô† ô‡ðRî­ï$îôˆð5ô‰ð+î­ï#$ô‡ôˆsqsqsqî­ï!Yô•ð_î­ï�ôµð"ô¶ð:î­ïÄô s qî£ïRî?î£ï‡î?î£ï½î?î£ïòî?î­ï€ôÆsqð?ôÇî­ï¶î­ï DôÁsqð$ôÂsî­ï yqô¬ð8ô­ ¼ · 2?²]ÙPPrinting Device File Format6course). The fMinPage and fSizePage arguments specify the range of values of f thatencompasses the entire image of the page. These numbers allow the interpreter to allocatesmaller band and disk buffers for images. For multiple separations being imaged on the samesheet, all separations should have the same values for these four parameters.setPriority[priority: CARD24]. This command sets the priority for all subsequent imagingcommands, i.e., curP := priority.setColorInk. This command sets the current color curC := ALL[1], and curT := opaque.setColorClear. This command sets the current color curC := ALL[0], and curT := opaque.setColorTile[t: {opaque, transparent}, addr: LONG CARD]. This command sets the current colorcurC := (the Tile at address addr in the load), and curT := t.endBand. This control command signals the end of a band. There are nBands such commandsin each image.endDocument. This command signals the end of the document. The PD interpreter ignores anyinformation following this command.storeLoad[firstAddress: LONG CARD, wordCount: CARD, data: WORD [1..wordCount]]. Thiscommand causes the data words to be stored in the load, starting with the word whose addressrelative to the start of the load is firstAddress.deviceCommand[wordCount: CARD, data: WORD [1..wordCount]]. This command cause the datawords to be interpreted in a device-dependent way by the printer.6.3 Imaging commandsThere are seven commands that modify the image I being built up:imagePrimitive={maskSamplesRef, maskRunGroupRef, maskRectangle, maskTrapezoid,maskRunGroup, maskSamples, colorData};The following paragraphs define the interpretation of each mask type and the parameters it requires.Unless otherwise noted, C=curC, T=curT, and P=curP.maskRectangle[sMin, sSize, fMin, fSize: CARD]. M is set to 1 for (s,f) in the regionsMinî­ï(„ôð$qî ·ï%ô¡ðHô¢î ·ï#Gôsqsî­ïÕ tqsôôquqsqstqî­ï ststsqsqsô§ tstsqs qsqô¨î­ï™s tqsô— ô˜ð!quqsqstqî­ïÎôRð2ôSs qsî­ïqsqô”sqsqsqsqô•sqsqsqsqî­ï9ôî£ïÇô†ô‡s qð%î£ïüô«ðOô¬î£ï2ô¯ ô°stq ststsqsqî£ï gsqsqtstsqsqôî£ï Àvuvuvuvuvuvuvuvu è · �?²]n»Printing Device File Format7t(s)=fMin+fSize+(fMinLast+fSizeLastfMinfSize)*(ssMin)/(sSize1).maskRunGroup[sMin: CARD, rg: RunGroup]. M is set to 1 in the regionsMinpdprintops.press.[2] O. Sperber, J. Kellman, R.E. Joiner, and S.R. Dashiell, "A VLSI based Image GenerationArchitecture for Low End Electronic Printing," November 1982. RBG/ED/EED/ESDÿî ·ïfñqôîGïî ·ïbsqî ·ï^¬s qî ·ï[:sôØqsqôÙs qî ·ïYos qôsqî ·ïU·p î ·ïREqðZî ·ïNÓôóôôðTî ·ïMôðLä ·LÁ?²JHMASKSCOLORSTrapezoidRectangleWhite RectangleWhite TrapezoidWhite ShapeRectangleTrapezoidBlack ShapeBlack TrapezoidBlack RectangleShapeRunGroupSampledWhite ImageBlack ImageImageClearInkFilledFilledFilledFilledM _ LinesM _ SamplesM _ Computed maskM _ Computed maskC _ 0C _ 1C _ LinesColor/Mask operation: I _ I OR (C AND M); IF TRANSPARENT THEN NULL ELSE I _ I AND NOT (M AND NOT C)which is equivalent to: IF opaque THEN I _ (I AND NOT M) OR (C AND M) ELSE I _ I OR (C AND M)File: PDFormat01.silFigure 1 - PD Functional MatrixSample Arrayline[1]line[0]line[sSize-1]...sSizefSizesSizefSize(0,0)sfphasef.QQ(sMin,fMin)'.QW,TiledWQ.sIMAGEDATA STRUCTURESTILED FORMFigure 2 - Data structuresRun GroupsSizefMinfSizeNlastRun. . .3/3/83TileSamplearrayfMinsMinphaseSampledC _ LinesImageî(�ïNŸþkÈîŽï_üþGkî%:ïf<ðî rïdüþ>;kîŽïY¼þGŽîŽïT-þGŽîï`®ðîäïbçð î Èïbçð î ï]Xðî¬ï]Xðî*:ï]Xð îïQð î¬ïQð î*:ïW<ð î¬ïW<ðî ïW<ðî/:ïQðî+åïbçðî<�ïbçðî9Éï]Xð î9ÉïW<ð î>ÉïQðîG­ïNþŽVî8ïNŸþkÈî9ï]Xðî9ïWÊðî ïQðî¬ïQðî*:ïQðî9ÉïQðî*Èvïað î:Wïað î ïaðî¬ïaðî9pï[ðî9ïU‘ðî9ïOtð îŽïNþGŽî vïEPðgî ïCðaî>;ïðîspï@tð"î«ï4;ð î«ï.¬þ Gî«ï0åþ Gî«ï%ÈþG �î«ï%Èþ dGîÈï&þG VîÇï*ÈðîÇï-ðîÇï&Wð îäï(�ðîäï)ðîäï)¬ðîÇï1sðîÇï/:ðîï;vïùðî$ï«þ9Gî¬ï3þ Gî*Èï&þG Vî¬ï%Èþ dGî¬ï%ÈþG �î¬ï0åþ Gî¬ï.¬þ Gî¬pï4;ðî Èï(�ðî Èï&åðî¬ï,sþ Gî Èï-ðî Èï/:ðî Èï1sðîŽïH‚þkäîŽïHþskî rïH‚þkäîïH‚þkäî9ïK‘ðî9ïIXð î äïKðäùOtf§%Herald..................* indicates optional control codesFile: PDFormat02.silsResolutionfResolutionbandSSizecopiespassworddeviceCodeFigure 4 - Herald Formatall entries CARD unless otherwise shownFigure 3 - PD File StructureversionimageSSize imageFSize 3/3/83maxLoadWords(LONG CARD)setColorInk*imagingCommandimagingCommandimagingCommandendBandimagingCommandimagingCommandimagingCommandimagingCommandendBandimagingCommandendBandendBandendBandendDocumentstartImagestartImagestartImagestoreLoad*îrï[ðîVïNæðîVïNXðîVïMÊðîVïB­ðîVïC;ðîVïCÉðî äï9Éðî äï9;ðî äï8¬ðî ï/:ðî ï/Éðî ï0Wðî ï)¬ðî ï)ðî ï(�ðî äï=ðî äï=­ðî äï>;ðîï:ð#î>;vïÝðî%ÈïÕþŽ]çî0åpïNXð î0åïKð î0åïAð î0åï7ðî0åïXXðî0åïQ­ð î.¬ïZþ¬GîIXï6,þG$î.¬ï5åþG$eî.¬ïW<þ¬Gî.¬ïSæþ¬Gî.¬ïP‘þ¬Gî.¬ïM;þ¬Gî.¬ïIæþ¬Gî.¬ïF�þ¬Gî.¬ïC;þ¬Gî.¬ï?æþ¬Gî.¬ï9;þ¬Gî.¬ï5åþ¬Gî.¬ï9ðî.¬ï2ð'î«ï9ðî0åïUðî0åïG­ð î0åïDXð î>;vïÀðî0åpï=­ð î0åï:åð î ïP‘ð î ïSæðî ïR<ðî ïLðî ïJtðî ïH;ðî ïF�ðî ïDæðî ïAðî ï?Wðî ï6tðî ï4Éðî ï-ðî ï&Wðî«ï$ð î«ï*Èð î«ï1sð î«ïVð î«ïXæð ïärÕLB]ç7File: PDFormat03.silmaskRectangle argumentssMinsSizesSizesMinmaskTrapezoid argumentsfMinLastfSizeLastsMinmaskRunGroup argumentsfMinfSizefMinfSizeRunGroupsee Figure 2sMinfMinSampleArraysee Figure 2maskSamples argumentsfMinsMinmaskRunGroupRef argumentsaddraddr (low 16 bits)addr (low 16 bits)addrsMinfMinmaskSamplesRef argumentsFigure 5 - Commandstypcomtyp (2 bit field) rest00 = control commandmaskRectangle, maskTrapezoid,com is 6-bit command field, depending on type:Additional arguments in Figure 6Note that 'rest' is used in maskSamplesRefand maskRunGroupRef3/3/8310 = imaging commandmaskRunGroup, maskSamples, colorSamples}imaging: com={maskSamplesRef, maskRunGroupRef,control: com={startImage, setPriority, setColorInk,setColorClear, setColorTile, endBand,endDocument, storeLoad, deviceCommand}Additional arguments in Figure 7Figure 6 - Imaging argumentssee Figure 2SampleArrayfMinsMincolorSamples argumentsî<vï¤ðî,sïGþkgYî0åpïd‘ðî5åïaÊðî5åï_‘ðî0åïcuþÈGîG­ïZØþGäî0åïZ‘þGî0åïZ‘þG +î0åïa<þGî0åï_þGî0åï\ÊþGî0åïOtþGî0åïQ­þGî0åïSæþGî0åïHÉþG �î0åïM;þGîG­ïIþG Vî0åïVþÈGî5åïR<ðî5åïTtðî0åïW<ðî0åïHÉþGî0åïKþGî5åïK‘ðî5åïIXð î5åïB­ðî0åïDXþÈGî0åïBþGî0åï=­þGî0åïEtðî5åï]Xðî5åï[ðî5åïPðî5åïMÊðî5åï@tðî5åï>Éð îG­ï=ôþG«î0åï=ôþG«î0åï0WþGî5åï8ðî0åï9ÉþÈGî0åï7�þGî0åï5WþGî5åï5åðî0åï0žþG rîG­ï0žþG rî5åï3ð î5åï1sð î0åï:åðî5åï$ðî0åï#�þGî0åï%ÈþGî5åï&Wðî0åï-�ðî<ï,sþ «GîG­ï#ÖþGäî<ï*�þG9î0åï(þÈGî0åï*:þ Gî<ï*^þ «$î?æï*Èðî5åï(�ðî0åï#ÖþG«î0åïþG«î5åïÈðî?æïðî<ï–þ «$î0åïsþ Gî0åï:þÈGî<ïºþG9îG­ïþGäî<ï¬þ «Gî5åï�ðî0åïþGî0åïÈþGî5åïVðî0åï Èðî 9ï«ðî9ïe þÈGîïc.þG9î9ïbçþGî9ïbçþG€îïeCþÈ$î%Èïc.þ$9îïc þë$î«ïc.þ$9îÇïcuðîÇïcuðîÇï_ðîÇï]XðîïcuðîŽï[®ðî«ïR<ðîÇïW<ð.î«ïMÊð î«ïK‘ð*î«ïIæðî<vï‡ðîŽpï]Xðî«ïP‘ð(îÇïSæð.îÇïGð3î«ïEtð%î«ïCÉð&î«ï@tð î0åï«ðî5åï �ð î5åï 9ð î5åïðî0åïrþGî0åï«þGî0åïäþÈGî5åï9ðî0åï rþGî0åï ¹þG rîG­ï ¹þG rî0åïð’ä9GH‚gY@File: PDFormat04.silstartImage argumentsXFStonertoner = {black, cyan, magentayellow, ...}setPriority argumentsprioritywordCount......data wordsdata words......wordCountdeviceCommand argumentsS = {noStripSheet, stripSheet}F = {noFeedSheet, feedSheet}storeLoad arguments3/3/83firstAddress(LONG CARD)X = 9-bit zeroed fieldMM = {bandMode, leftOverMode}passBandsfMinPagefSizePagenBandssetColorTile argumentstaddr(LONG CARD)Figure 7 - Control arguments7-bit field4-bit fieldîVïbXþsGîVï` þºGî<vï¤ðîVpïe ðî+åï`gþG9î)¬ï`gþG9î'sï`gþG9î%:ï`gþG9îï`®ðî(ï`®ðî*:ï`®ðî-�ï`®ðîVïM;ðî#ïK‘ð îVïBþG€îVïBþ�GîVïG­ðî$¬ïB­ðîVï3þ:Gî2�ï.óþGrîVï.¬þ�GîVï.¬þG¹îVï!VþG �îVï!Vþ�Gî2�ï!žþG VîVï,sþ:Gî"sï-ð î%:tï+3ðî%:ï*¥ðî%:ï*ðî%:ï#úðî%:ï$ˆðî%:ï%ðî"spï&åð î"sï«ð î%:tïÝðî%:ïOðî%:ïÁðî%:ïÝðî%:ïkðî%:ïúðî!VpïÈð îVï:þ:GîVïsþ:Gî2�ïdþG VîVïþ�GîVïþG �îVïsþ�GîVï�ðîVïNæðîVïP‘ðîVï4;ðî<vï‡ðî!åpï1sð î!åï/:ð îVïSæðî%Èï`®ðîVïR<ðîVï]çþsGîVïYuþºGîVïW<þsGîVïWƒþG î4ÉïWƒþG î Èï^uð î ÈïZðî ÈïWÊð îVï[®þºGî Èï\<ðî'sïDŸþG9î2�ïBfþGrî&WïD{þ 9$îVï>ÉðîVï7þ:GîVïDXþ Gî'sïF�þ Gî'sï=­þ Gî'sï;»þG9îVï7IþGrî2�ï7IþG«îVï;tþ:Gî0åï;»þG9î1sï<ðî#ï9Éðî"sï7�ð îVï rðî(tïi r½‚~¬éž=þú =%Í*%i<‚  üZ Y�œ}:ú }üZ" -¹iP=O;]N=L;]L=I;]J%G9IçÀÈEG=G#=¦å |ÖÕŸÛÈ=5;]X%39Wç�È-3ŽM1 í=)]K=(Z$"9‹å :ú  %A9aæ9`çE<"$9[æ9ZçB$=5]W:ú %S9Pæ9Oç í= í)­Õ™–•ü®¸%AE_%^)› çE\%÷=[抅iX=°Cý]R%ì=‹C%å9Oç…P‚ „…B—ø" -EiÖ%^9^çB"j/M Kÿÿš°þêÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿpdformat.pressSproull29-Mar-83 18:07:38 PST: