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 0F <sq,sq :sqsqsqsq"" 90Nsqs q 7fsqH 5E 3s q> 0_'(sqsq . sq+"wqsqswqsqstsqtqstsqwqsqstqstsq 'ip #qF "- sqM-(&sq0s q*"5YTQ&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 FO E-,s q# CcD AE ?V >G <8)8uLv u7B: 3p 0q sq7 .MS*uq2uq 'iuq#uqF "- sq#uquq#'&T BQ sq.- sq2 ;54 p s q,s X )?\BPrinting Device File Format40sqC sq <848sqsuqsuqsq 6)sqs qsqs qsqsq 51sqs1u;.0; ,s q?)Wsqsqusuqsqststs q'sq0$sqsquqsuq"Psq? sq pi [qQsq (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 fqGbsquq<`S \squq*#["Ws quqHU/Rhsquq8sqsPq M,squq%Ka!+sq I?F$squq8Bs quq4 ?Asquq, ;G :f 89s qA 4w 1UqQ /$s qsqsq -sqsqsq*Ns tqsqsqs qsqs (qsusuqs q& R$5+#$sqsqsq!Y_": s qR????sq? Dsq$s yq8 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 #Gsqs tqsquqsqstq ststsqsqs tstsqs qsqs tqs !quqsqstqR2Ss qsqsqsqsqsqsqsqsqsqsq9s q%O2 stq ststsqsq gsqsqtstsqsq vuvuvuvuvuvuvuvu ?]nPrinting 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 fqG bsq ^s q [:sqsqs q Yos qsq Up REqZ NT ML 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(Nk_Gk%:f< rd>;kYGT-G`b b ]X]X*:]X Q Q *:W< W< W</:Q+bQGNV8Nk9]X9W QQ*:Q9Q*va :Wa aa9p[9U9Ot NG vEPg Ca>;sp@t"4; . G0 G%G % dG&G V*-&W ())1s/:;v$9G3 G*&G V% dG%G 0 G. Gp4; ( &,s G - /: 1sHkHsk rHkHk9K9IX KOtf%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[VNVNXVMVBVC;VC 9 9; 8 /: / 0W ) ) ( = = >;:#>;v%]0pNX 0K 0A 070XX0Q .ZGIX6,G$.5G$e.W<G.SG.PG.M;G.IG.FG.C;G.?G.9;G.5G.9.2'90U0G 0DX >;v0p= 0: P S R< L Jt H; F D A ?W 6t 4 - &W$ * 1s V X rLB]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,sGkgY0pd5a5_0cuGGZG0ZG0ZG +0a<G0_G0\G0OtG0QG0SG0HG 0M;GGIG V0VG5R<5Tt0W<0HG0KG5K5IX 5B0DXG0BG0=G0Et5]X5[5P5M5@t5> G=G0=G00WG5809G07G05WG5500G rG0G r53 51s 0:5$0#G0%G5&W0-<,s GG#G<*G90(G0*: G<*^ $?*5(0#G0G5?< $0s G0:G<G9GG< G50G0G5V0  99e Gc.G99bG9bGeC$%c.$9c $c.$9cucu_]Xcu[R<W<.M K*I<vp]XP(S.G3Et%C&@t 05 5 9 50rG0G0G590 rG0 G rG G r09GHgY@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 fieldVbXsGV` G<vVpe +`gG9)`gG9's`gG9%:`gG9`(`*:`-`VM;#K VBGVBGVG$BV3:G2.GrV.GV.GV!VG V!VG2!G VV,s:G"s- %:t+3%:*%:*%:#%:$%:%"sp& "s %:t%:O%:%:%:k%:!Vp V::GVs:G2dG VVGVG VsGVVNVPV4;<v!p1s !/: VS%`VR<V]sGVYuGVW<sGVWG 4WG  ^u Z W V[G \<'sDG92BfGr&WD{ 9$V>V7:GVDX G'sF G's= G's;G9V7IGr27IGV;t:G0;G91s<#9"s7 V r(ti r~= =%*%i<  Z Y}: }Z" -iP=O;]N=L;]L=I;]J%G9IEG=G#= |=5;]X%39W-3M1 =)]K=(Z$"9 :  %A9a9`E<"$9[9ZB$=5]W: %S9P9O = )%AE_%^) E\%=[iX=C]R%=C%9OP B" -Ei%^9^B"j/M Kpdformat.pressSproull29-Mar-83 18:07:38 PST: