<> <> <> <> 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]; }.