File: ReadAIS.mesa
Author: Eric Bier on June 17, 1983 10:40 am
Last edited by Bier on June 23, 1983 1:41 pm
DIRECTORY
AIS,
AISFormat,
Rope;
ReadAIS: DEFINITIONS =
BEGIN
Raster: TYPE = AIS.Raster;
RasterPart: TYPE = AIS.RasterPart;
Placement: TYPE = AIS.Placement;
PlacementPart: TYPE = AIS.PlacementPart;
Photometry: TYPE = AIS.Photometry;
PhotometryPart: TYPE = AIS.PlacementPart;
MyRaster: TYPE = REF MyRasterPart;
MyRasterPart: TYPE = RECORD [
scanCount: CARDINAL, -- number of scan lines
scanLength: CARDINAL, -- number of pixels per scan line
scanMode: AIS.ScanMode, -- scanning directions
bitsPerPixel: [0..16], -- number of bits per pixel
linesPerBlock: INTEGER, -- for blocked AIS files. -1=no blocks
paddingPerBlock: CARDINAL --in words
];
MyPlacement: TYPE = REF MyPlacementPart;
MyPlacementPart: TYPE = RECORD [
xLeft: INTEGER,
yBottom: INTEGER,
xWidth: INTEGER,
yHeight: INTEGER
];
MyPhotometry: TYPE = REF MyPhotometryPart;
MyPhotometryPart: 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
];
MyAISInfo: TYPE = REF MyAISInfoPart;
MyAISInfoPart: TYPE = RECORD [
raster: MyRaster,
placementExists: BOOL,
placement: MyPlacement,
photometryExists: BOOL,
photometry: MyPhotometry,
commentExists: BOOL,
comment: Rope.ROPE];
Read: PROC [filename: Rope.ROPE] RETURNS [info: MyAISInfo, success: BOOL];
ResolutionFromInfo: PROC [info: MyAISInfo] RETURNS [resolution: REAL];
SamplesFromInfo: PROC [info: MyAISInfo] RETURNS [samplesX, samplesY: NAT];
CreateRaster: PROC [
scanCount: CARDINAL, -- number of scan lines
scanLength: CARDINAL, -- number of pixels per scan line
scanMode: AIS.ScanMode, -- scanning directions
bitsPerPixel: [0..16], -- number of bits per pixel
linesPerBlock: INTEGER ← -1, -- for blocked AIS files. -1=no blocks
paddingPerBlock: CARDINAL --in words
] RETURNS [raster: MyRaster];
CreateFile: PROC [fileString: LONG STRING, raster: Raster, commentString: LONG STRING, overwrite: BOOLEANFALSE, attributeLength: CARDINAL ← 0, resolution: REAL] RETURNS[f: AIS.FRef];
OpenFile: PROC [name: Rope.ROPE, write: BOOLEANFALSE] RETURNS [f: AIS.FRef, resolution: REAL];
Resolution: PROC [filename: Rope.ROPE] RETURNS [resolution: REAL];
END.