<> <> <> <> <> DIRECTORY SampleMapOps, Rope USING [ROPE]; SampleArrays: CEDAR DEFINITIONS IMPORTS SampleMapOps ~ BEGIN Buffer: TYPE ~ SampleMapOps.Buffer; CVEC: TYPE ~ SampleMapOps.CVEC; Function: TYPE ~ SampleMapOps.Function; SampleMap: TYPE ~ SampleMapOps.SampleMap; ROPE: TYPE ~ Rope.ROPE; maxCount: NAT ~ SampleMapOps.maxCount; nullFunction: Function ~ SampleMapOps.nullFunction; <> SampleArray: TYPE ~ REF SampleArrayRep; SampleArrayRep: TYPE ~ RECORD [ sSize, fSize: NAT, layer: SEQUENCE n: NAT OF SampleMapEntry ]; SampleMapEntry: TYPE ~ RECORD [ sm: SampleMap _ NIL, class: ATOM _ NIL, data: REF _ NIL ]; <> <> <<>> Sample: TYPE ~ CARDINAL; ErrorDesc: TYPE ~ RECORD [code: ATOM, explanation: ROPE]; Error: ERROR [error: ErrorDesc]; MaxSampleValue: PROC [sa: SampleArray, i: NAT] RETURNS [Sample]; <<... returns the maximum sample value for the ith sample.>> <> <> <<>> GetSample: PROC [sa: SampleArray, i: NAT, index: CVEC] RETURNS [Sample] ~ INLINE { RETURN [SampleMapOps.GetSample[sampleMap: sa.layer[i].sm, index: index]]; }; <<... returns the sample value with indices [i, s, f].>> <> PutSample: PROC [sa: SampleArray, i: NAT, index: CVEC, value: Sample, function: Function _ nullFunction] ~ INLINE { SampleMapOps.PutSample[sampleMap: sa.layer[i].sm, index: index, value: value, function: function]; }; <<... returns the sample value with indices [i, s, f].>> <> GetSamples: PROC [buffer: Buffer, start: NAT _ 0, count: NAT _ maxCount, sa: SampleArray, i: NAT, s, f: NAT _ 0, ds: NAT _ 0, df: NAT _ 1]; InlineGetSamples: PROC [buffer: Buffer, start: NAT _ 0, count: NAT _ maxCount, sa: SampleArray, i: NAT, s, f: NAT _ 0, ds: NAT _ 0, df: NAT _ 1] ~ INLINE { SampleMapOps.Get[buffer: buffer, start: start, count: count, sampleMap: sa.layer[i].sm, s: s, f: f, ds: ds, df: df]; }; <> PutSamples: PROC [buffer: Buffer, start: NAT _ 0, count: NAT _ maxCount, sa: SampleArray, i: NAT, s, f: NAT _ 0, ds: NAT _ 0, df: NAT _ 1, function: Function _ nullFunction]; InlinePutSamples: PROC [buffer: Buffer, start: NAT _ 0, count: NAT _ maxCount, sa: SampleArray, i: NAT, s, f: NAT _ 0, ds: NAT _ 0, df: NAT _ 1, function: Function _ nullFunction] ~ INLINE { SampleMapOps.Put[buffer: buffer, start: start, count: count, sampleMap: sa.layer[i].sm, s: s, f: f, ds: ds, df: df, function: function]; }; <> Save: PROC [sa: SampleArray]; <> <> Extract: PROC [old: SampleArray, samplesPerSample: NAT, select: PROC [NAT] RETURNS [NAT]] RETURNS [new: SampleArray]; <<... extracts selected sample layers from a pixel array.>> <> <> <> <> <> Join: PROC [list: LIST OF SampleArray] RETURNS [SampleArray]; JoinMaps: PROC [list: LIST OF SampleMapEntry] RETURNS [SampleArray]; Join3: PROC [sa1, sa2, sa3: SampleArray] RETURNS [SampleArray]; Join3Maps: PROC [sm1, sm2, sm3: SampleMapEntry] RETURNS [SampleArray]; <<... joins multiple sample planes into one SampleArray.>> <> FromAIS: PROC [name: ROPE] RETURNS [SampleArray]; <<... makes a pixel array from an AIS file with the specified name.>> <> <> MapFromAIS: PROC [name: ROPE] RETURNS [SampleMapEntry]; <<... makes a pixel array from an AIS file with the specified name.>> <> <> CreateAISFromMap: PROC [sm: SampleMap, name: ROPE]; <> Join3AIS: PROC [name1, name2, name3: ROPE] RETURNS [SampleArray]; <> <> <> FileNameRoot: PROC [sa: SampleArray] RETURNS [root: ROPE]; <> BackingFileOf: PROC [sme: SampleMapEntry] RETURNS [backingFileName: ROPE]; <> END.