AISIO.mesa
Copyright Ó 1985, 1992 by Xerox Corporation. All rights reserved.
Bloomenthal, December 29, 1990 5:19 pm PST
Maureen Stone, March 28, 1991 3:40 pm PST
DIRECTORY AISFileFormat, ImagerSample, Rope;
AISIO: CEDAR DEFINITIONS
~ BEGIN
ROPE:   TYPE ~ Rope.ROPE;
SampleMap: TYPE ~ ImagerSample.SampleMap;
SampleBuffer: TYPE ~ ImagerSample.SampleBuffer;
Photometry: TYPE ~ REF AISFileFormat.PhotometryPart;
Placement: TYPE ~ REF AISFileFormat.PlacementPart;
Raster:  TYPE ~ REF AISFileFormat.RasterPart;
UCACoding: TYPE ~ REF AISFileFormat.UCACoding;
Info:   TYPE ~ REF InfoRep;
InfoRep:  TYPE ~ RECORD [
rasterOffset:   INT ¬ 0,
raster:    Raster ¬ NIL,
uca:     UCACoding ¬ NIL,
placement:   Placement ¬ NIL,
photometry:   Photometry ¬ NIL,
comments:   LIST OF ROPE ¬ NIL,
error:     ROPE ¬ NIL
];
Error: ERROR [reason: ROPE]; 
ReadInfo: PROC [name: ROPE] RETURNS [Info];
Read: PROC [name: ROPE, info: Info ¬ NIL] RETURNS [map: SampleMap ¬ NIL];
Return a sample map from the named AIS file.
If info # NIL, overwrite its contents with placement, photometry or comment, if in file.
!Error
Write: PUBLIC PROC [
name: ROPE,
map: SampleMap,
placement: Placement ¬ NIL,
photometry: Photometry ¬ NIL,
comments: LIST OF ROPE ¬ NIL];
Write the sample map to the named AIS file, including any optionally specified information.
Convenience procs for converters
NewSampleMap: PROC [scanCount: CARDINAL, scanLength: CARDINAL, bitsPerPixel: [0..8] ¬ 8] RETURNS [map: SampleMap];
Makes a SampleMap for a new AIS file
ReadSample: PROC [map: SampleMap, line, pixel: CARDINAL] RETURNS [value: CARDINAL];
Calls ImagerSample.Get
WriteSample: PROC [map: SampleMap, value: CARDINAL, line, pixel: CARDINAL];
Calls ImagerSample.Put
ReadLine: PROC [map: SampleMap, buffer: SampleBuffer, line: CARDINAL];
Calls ImagerSample.GetSamples
WriteLine: PROC [map: SampleMap, buffer: SampleBuffer, line: CARDINAL];
Calls ImagerSample.PutSamples
END.