DIRECTORY FEPSMergerOps USING [OutputH], Interpress USING [LongOperator], NSSegment USING [PageCount, PageNumber], Stream USING [Handle], XeroxCompress USING [PutBitsProc]; FEPSIvOutput: DEFINITIONS SHARES Interpress = BEGIN OPEN IP: Interpress; Position: TYPE = RECORD [ page: NSSegment.PageNumber, offset: LONG CARDINAL]; startPos: Position = [0,0]; ExceptionKind: TYPE = {noResources, unknown}; Exception: SIGNAL [code: ExceptionKind]; Initialize: PROCEDURE [ output: FEPSMergerOps.OutputH, initialSize: NSSegment.PageCount, growIncrement: NSSegment.PageCount, bufferSize: NSSegment.PageCount]; PutBits: XeroxCompress.PutBitsProc; PutByte: PROCEDURE [val: CARDINAL]; PutWord: PROCEDURE [val: CARDINAL]; Retrieve: PROCEDURE [inputSH: Stream.Handle, byteCount: LONG CARDINAL]; GetCurrentPosition: PROCEDURE RETURNS [pos: Position]; SetPosition: PROCEDURE [pos: Position]; CloseOutput: PROCEDURE; EmptyOutput: PROCEDURE; IPDo: PROCEDURE = INLINE {OpOnly[do]}; IPFindDecompressor: PROCEDURE = INLINE {OpOnly[findDecompressor]}; IPIdentifier: PROCEDURE [s: LONG STRING]; IPInteger: PROCEDURE [n: LONG INTEGER, length: CARDINAL ¬ 0]; IPMakePixelArray: PROCEDURE = INLINE {OpOnly[makePixelArray]}; IPMaskPixel: PROCEDURE = INLINE {OpOnly[maskPixel]}; IPRational: PROCEDURE [num: LONG INTEGER, den: LONG CARDINAL]; IPScale: PROCEDURE = INLINE {OpOnly[scale]}; IPSeqCompressedPixel: PROCEDURE [size: LONG CARDINAL]; OpOnly: PRIVATE PROCEDURE [code: IP.LongOperator]; END... LOG 6Sep84 - Okamoto - Conceived and created. 20Nov84 - Okamoto - Changed FreeOutput to CloseOutput and added EmptyOutput. 19Jun85 - castillo - copyright notice. èFEPSIvOutput.mesa Copyright (C) Xerox Corporation 1985. All rights reserved. last edited by castillo 19-Jun-85 10:04:22 This module defines the interface to FEPS output routines whose primary job is to write data to the output. This interface was created to hide various output and efficiency specifics from rest of FEPS merge routine. The implementation is assumed NOT to be reentrant. Initialize must be called first to start things off. outputH ... is the handle to output object. Usually it is FEPSMergerOps.OutputH which contains NSFile handle. It could be different for the test environment. initialSize ... is the initial size of the output file in pages. growIncrement ... is the size that the file should grow every time the size is exceeded. bufferSize ... is the size of the buffer to be used. PutBits writes the specified number of bits to the output. The bits can be up to 16 bits. This routine exists mainly for the Xerox compression algorthm which deals with nibbles (ugh!). PutBits can only be called while in Bit Mode. Bit Mode is entered with EnterBitMode call; it is ended with ExitBitMode call. All other output routine cannot be called while in Bit Mode. (Primarily done for efficiency) PutByte writes the specified number bytes to the output. Retrieve reads, from the input stream, specified number of bytes and writes it out to the output. GetCurrentPosition is called to retrieve the current output position of the output. SetPosition is called to set the current position. CloseOutput will get rid of output buffers and excess pages allocated to the file. It should be called after all output has been completed. EmptyOutput will get rid of output buffers and set the size to zero. IP* calls are used to put Interpress operands and operators into the output. ===== TYPES ===== ======== CONSTANTS ========= ======= SIGNALS ======= This signal is resumable if code is noResources ========== PROCEDURES ========== General output routines Interpress output routines Ê4˜Jšœ™Jšœ:™:Jšœ+™+J˜šÏk ˜ Jšœœ ˜Jšœ œ˜ Jšœ œ˜(Jšœœ ˜Jšœœ˜"J˜—šÏn œ œ˜Jšœ ˜Jšœœœ ˜—J˜J™Jšœ@™@Jšœ2™2Jšœ;™;JšœA™AJšœ™J™Jšœ4™4Jšœ7™7Jšœ.™.Jšœ+™+Jšœ ™ Jšœ@™@Jšœ=™=Jšœ™Jšœ4™4J™Jšœ?™?Jšœ>™>Jšœ;™;Jšœ:™:Jšœ<™™>Jšœ™J™Jšœ@™@Jšœ ™ J™J˜Jšœ™Jšœ™Jšœ™˜šœ œœ˜J˜Jšœœœ˜——J˜Jšœ ™ Jšœ ™ šœ ™ ˜J˜——Jšœ™Jšœ™Jšœ™˜Jšœœ˜-—˜šž œœ˜(Jšœ/™/—J˜—Jšœ ™ Jšœ ™ Jšœ ™ ˜Jšœ™—˜šž œ œ˜J˜J˜!J˜#J˜!J˜—šžœ˜#J˜—Jšžœ œœ˜#J˜Jšžœ œœ˜#J˜šžœ œ%œœ˜GJ˜—Jšžœ œœ˜6J˜Jšž œ œ˜'J˜Jšž œ œ˜J˜Jšž œ œ˜J˜Jšœ™J˜Jšžœ œœ˜&—˜Jšžœ œœ˜BJ˜šž œ œœœ˜)J˜—Jš ž œ œœœ œ˜=—˜Jšžœ œœ˜>J˜Jšž œ œœ˜4J˜Jš ž œ œœœœœ˜>J˜Jšžœ œœ˜,—˜šžœ œœœ˜6J˜—Jšžœœ œœ˜2J˜Jšœ˜J˜—š˜J˜)—J˜MJ˜&—…—‚ž