DIRECTORY AISFormat, CountedVM, FS, PrincOps, 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, abase: PrincOps.PageNumber _ 0, -- first page of attribute part rbase: PrincOps.PageNumber _ 0, -- first page of raster part raster: Raster, -- the raster information attributes: ARef, -- modify using procs only wordsPerLine: CARDINAL _ 0, -- words per scan line buffersize: PrincOps.PageCount _ 0, -- raster buffer size outputBuffer: BRef _ NIL -- Unwritten output buffers. ]; ARef: TYPE = REF ARep; ARep: TYPE = PRIVATE RECORD [ 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 ]; 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 [ countedVM: CountedVM.Handle, 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 [ signal: AISFormat.SignalType, sense: AISFormat.Sense, scaleType: AISFormat.ScaleType, pointA: AISFormat.Point, pointB: AISFormat.Point, pointC: AISFormat.Point, spotType: AISFormat.SpotType, 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 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, December 27, 1983 9:19 am Types -- 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 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 Ê ˜Jšœ™Jšœ1™1Jšœ.™.šœ8™8J˜—šÏk ˜ J˜ J˜ Jšœ˜Jšœ ˜ J˜J˜J˜—šœœ œ˜J™—šœ™J˜—šœœœ˜J˜—JšœœœÏc ˜"šœœœ˜Jšœž˜"Jšœœœ˜Jšœ ž˜?Jšœ ž˜Jšœœž+˜GJ˜J˜—Jšœ œ$˜2Jšœ=™=Jšœ-™-Jšœ/™/J˜Jšœ™Jšœœœ ˜šœ œœ˜Jšœ œž˜,Jšœ œž!˜7Jšœž˜*Jšœž˜2Jšœœž'˜@Jšœœž ˜%J˜J˜—Jšœ œœ˜$šœœœ˜Jšœœ˜Jšœ œ˜Jšœœ˜Jšœ ˜J˜J˜—Jšœ œœ˜&šœœœ˜J˜J˜J˜J˜J˜J˜J˜Jšœ œž$˜8Jšœ œž(˜=Jšœ œ˜Jšœ œ˜Jšœœž˜5J˜J˜—Jšœ œœ˜#Jš œœœœ œœœ˜>J˜JšÏb™J˜šœœ˜ Jšœ œ{˜ŠJ˜J˜—šŸ™J˜—š Ïn œœœ#œœ ˜_Jšœ3™3J˜—š  œœœ˜J˜—š  œœœ œœœ ˜FJ˜—š  œœ ˜J˜—šœ$™$JšœP™PJšœJ™JJšœ œ˜Jšœ,™,J™—š  œœ œœ˜+J˜—š  œœœ˜,J˜—š  œœ œ˜=J˜—š œœ ˜5J˜—JšœX™Xšœ@™@Jš œœ œ˜5Jš  œœ œ ˜3Jšœ7™7Jš œœ9œ˜TJ˜—šœ™Jšœ8™8—š  œœ œ ˜,J˜—šœ™J˜—Jšœ"™"š   œœœœœœ˜XJš œ œœœœ˜?Jšœ ˜J™xJ˜—š  œœ ˜J˜—š  œœ œ œ œ˜QJšœ œ œ˜+J˜—JšœD™Dš  œœ œ œ˜9J˜—JšœI™Iš  œœ œœ˜/J˜—Jš œœœ œœœœ˜BJš œœœ!œ˜Jš œœœ!œ˜KJ˜—Jš   œœœœœ˜Lš  œœœœ˜DJ˜—J˜J˜—…—r