DIRECTORY FS, Rope; AIS: CEDAR DEFINITIONS ~ { ROPE: TYPE ~ Rope.ROPE; FRef: TYPE ~ REF FRep; -- AIS File FRep: TYPE ~ RECORD [ file: FS.OpenFile, -- the AIS file write: BOOLEAN ¬ FALSE, raster: Raster, -- the raster information attributes: ARef, -- modify using procs only wordsPerLine: CARDINAL ¬ 0, -- words per scan line outputBuffer: BRef ¬ NIL -- Unwritten output buffers. ]; ARef: TYPE = REF ARep; ARep: TYPE = PRIVATE RECORD [ ]; WRef: TYPE ~ REF WRep; -- AIS Window WRep: TYPE ~ RECORD [ fref: FRef ¬ NIL, --file descriptor bref: BRef ¬ NIL, --file buffer descriptor (mess with this at your own risk!) firstScan: CARDINAL ¬ 0, lastScan: CARDINAL ¬ 0, firstPixel: CARDINAL ¬ 0, lastPixel: CARDINAL ¬ 0, wordsPerLine: CARDINAL ¬ 0, --the number of words for one windowed scan line pixelsPerWord: CARDINAL ¬ 0, nextScanLine: CARDINAL ¬ 0, currline: CARDINAL ¬ 177777B, clineaddr: LONG POINTER ¬ NIL ]; BRef: TYPE ~ REF BRep; --AIS file buffer BRep: TYPE ~ RECORD [ addr: LONG POINTER ¬ NIL, -- points to first scan line first, last: CARDINAL ¬ 0, -- first and last scan line numbers firstPage, nPages: CARDINAL -- Where the bufferload belongs in the file ]; ScanMode: TYPE ~ {ru, ul, ld, dr, rd, ur, lu, dl}; Raster: TYPE ~ REF RasterPart; RasterPart: TYPE ~ RECORD [ scanCount: CARDINAL, -- number of scan lines scanLength: CARDINAL, -- number of pixels per scan line scanMode: ScanMode, -- scanning directions bitsPerPixel: [0..16], -- number of bits per pixel linesPerBlock: INTEGER, -- for blocked AIS files. -1~no blocks paddingPerBlock: CARDINAL --in words ]; Placement: TYPE ~ REF PlacementPart; PlacementPart: TYPE ~ RECORD [ xLeft: INTEGER, yBottom: INTEGER, xWidth: INTEGER, yHeight: INTEGER ]; Photometry: TYPE ~ REF PhotometryPart; PhotometryPart: TYPE ~ RECORD [ spotWidth: INTEGER, -- in units of 100*(width in pixels) spotLength: INTEGER, -- in units of 100*(length in scanlines) sampleMin: INTEGER, sampleMax: INTEGER, histogramLength: INTEGER --0 or -1 means no histogram ]; Histogram: TYPE ~ REF HistogramRep; HistogramRep: TYPE ~ RECORD [SEQUENCE length: NAT OF INTEGER]; Error: SIGNAL [type: ErrorType]; ErrorType: TYPE ~ {bufferTooSmall, outOfRange, invalidParameter, notImplemented, badWindow, attributesTooLong, readOnlyFile, invalidFile}; CreateFile: PROC [name: ROPE, raster: Raster, attributeLength: CARDINAL ¬ 0] RETURNS [f: FRef]; DeleteFile: PROC [name: ROPE]; OpenFile: PROC [name: ROPE, write: BOOLEAN ¬ FALSE] RETURNS [f: FRef]; CloseFile: PROC [f: FRef]; maxComment: CARDINAL ~ 256; ReadComment: PROC [f: FRef] RETURNS [ROPE]; WriteComment: PROC [f: FRef, comment: ROPE]; ReadPlacement: PROC [f: FRef] RETURNS [placement: Placement]; WritePlacement: PROC [f: FRef, placement: Placement]; ReadPhotometry: PROC [f: FRef] RETURNS [Photometry]; ReadHistogram: PROC [f: FRef] RETURNS [Histogram]; WritePhotometry: PROC [f: FRef, photometry: Photometry, histogram: Histogram ¬ NIL]; ReadRaster: PROC [f: FRef] RETURNS [Raster]; OpenWindow: PROC [f: FRef, firstScan: CARDINAL ¬ 0, lastScan: CARDINAL ¬ LAST[CARDINAL], firstPixel: CARDINAL ¬ 0, lastPixel: CARDINAL ¬ LAST[CARDINAL]] RETURNS [w: WRef]; CloseWindow: PROC [w: WRef]; GetWindowParams: PROC [w: WRef] RETURNS [firstScan: CARDINAL, lastScan: CARDINAL, firstPixel: CARDINAL, lastPixel: CARDINAL]; MinBufferSize: PROC [w: WRef] RETURNS [length: CARDINAL]; EndOfWindow: PROC [w: WRef] RETURNS [BOOLEAN]; Buffer: TYPE ~ RECORD [length: LONG CARDINAL, addr: LONG POINTER]; UnsafeReadLine: UNSAFE PROC [w: WRef, buffer: Buffer, line: INTEGER ¬ -1]; UnsafeWriteLine: UNSAFE PROC [w: WRef, buffer: Buffer, line: INTEGER ¬ -1]; ReadSample: PROC [w: WRef, line, pixel: CARDINAL] RETURNS [value: CARDINAL]; WriteSample: PROC [w: WRef, value: CARDINAL, line, pixel: CARDINAL]; }. " AIS.mesa Copyright Σ 1992 by Xerox Corporation. All rights reserved. This interface is not implemented in Cedar10. Please convert to AISIO.mesa. Last changed by Maureen Stone, 17-Nov-81 14:11:11 Last changed by Doug Wyatt, 18-Aug-81 17:46:12 Last changed by Michael Plass, February 3, 1992 11:07 am PST Bier, August 19, 1991 2:46 pm PDT Types -- abase: PrincOps.PageNumber _ 0, -- first page of attribute part rbase: PrincOps.PageNumber _ 0, -- first page of raster part buffersize: PrincOps.PageCount _ 0, -- raster buffer size header: REF AISFormat.Header _ NIL, raster: REF uca AISFormat.RasterPart _ NIL, placement: REF AISFormat.PlacementPart _ NIL, photometry: REF AISFormat.PhotometryPart _ NIL, comment: REF AISFormat.CommentPart _ NIL countedVM: CountedVM.Handle, Scan direction for pixels and lines; for example, "rd" means: successive pixels move rightward in the image successive scanlines move downward in the image attribute definitions signal: AISFormat.SignalType, sense: AISFormat.Sense, scaleType: AISFormat.ScaleType, pointA: AISFormat.Point, pointB: AISFormat.Point, pointC: AISFormat.Point, spotType: AISFormat.SpotType, Errors File operations attributeLength is in AIS pages (1024 word blocks). read and write attribute information For everthing but raster, client passes pointers to records of the correct type. A RETURN of FALSE from a Read indicates that the attribute was not present If string buffer is too short, will truncate histogram is separate from the rest of the photometry info because it is variable length Histogram Length is in Photometry. (0 or -1 means no histogram) Error is histogram length # photometry.histogramLength raster info always present raster info can only be written when doing a CreateFile; Window operations values will default to file values For an output file, opening more than one window is not recommended due to the possibility of strange buffering effects. the minimum number of words in a scan line buffer for a given window returns TRUE if the current scan line is the last scan line in the window Κ•NewlineDelimiter –(cedarcode) style™šœ™Jšœ Οeœ1™LšœŸœ +˜GL˜L˜—Lšœ Ÿœ$˜2Jšœ=™=Jšœ-™-Jšœ/™/L˜Jšœ™LšœŸœŸœ ˜šœ ŸœŸœ˜Lšœ Ÿœ ˜,Lšœ Ÿœ !˜7Lšœ ˜*Lšœ ˜2LšœŸœ '˜@LšœŸœ  ˜%L˜L˜—Lšœ ŸœŸœ˜$šœŸœŸœ˜LšœŸœ˜Lšœ Ÿœ˜LšœŸœ˜Lšœ Ÿ˜L˜L˜—Lšœ ŸœŸœ˜&šœŸœŸœ˜J™J™J™J™J™J™J™Lšœ Ÿœ $˜8Lšœ Ÿœ (˜=Lšœ Ÿœ˜Lšœ Ÿœ˜LšœŸœ ˜5L˜L˜—Lšœ ŸœŸœ˜#Lš œŸœŸœŸœ ŸœŸœŸœ˜>L˜JšΟb™L˜šœŸœ˜ Lšœ Ÿœ{˜ŠL˜L˜—š‘™L˜—š Οn œŸœŸœ#ŸœŸœ ˜_Jšœ3™3L˜—š’ œŸœŸœ˜L˜—š ’œŸœŸœ ŸœŸœŸœ ˜FL˜—š’ œŸœ ˜L˜—šœ$™$JšœP™PJšœJ™JLšœ Ÿœ˜Jšœ,™,J™—š’ œŸœ ŸœŸœ˜+L˜—š’ œŸœŸœ˜,L˜—š’ œŸœ Ÿœ˜=L˜—š’œŸœ ˜5L˜—JšœX™Xšœ@™@Lš’œŸœ Ÿœ˜5Lš’ œŸœ Ÿœ ˜3Jšœ7™7Lš’œŸœ9Ÿœ˜TL˜—šœ™Jšœ8™8—š’ œŸœ Ÿœ ˜,L˜—šœ™L˜—Jšœ"™"š ’ œŸœŸœŸœŸœŸœ˜XLš œ ŸœŸœŸœŸœ˜?LšŸœ ˜J™xL˜—š’ œŸœ ˜L˜—š ’œŸœ Ÿœ Ÿœ Ÿœ˜QLšœ Ÿœ Ÿœ˜+L˜—JšœD™Dš’ œŸœ Ÿœ Ÿœ˜9L˜—JšœI™Iš’ œŸœ ŸœŸœ˜/L˜—Lš œŸœŸœ ŸœŸœŸœŸœ˜BLš’œŸœŸœ!Ÿœ˜Jš’œŸœŸœ!Ÿœ˜KL˜—Lš ’ œŸœŸœŸœŸœ˜Lš’ œŸœŸœŸœ˜DL˜—L˜L˜L˜—…—β#