DIRECTORY ImagerPixelArrayDefs USING [PixelArray], ImagerPixelMap USING [PixelMap], ImagerSample USING [SampleBuffer, Sample, UnsafeSamples], ImagerTransformation USING [Transformation], PrincOps USING [BitAddress, DstFunc, SrcFunc], Rope USING [ROPE]; ImagerPixelArray: CEDAR DEFINITIONS ~ BEGIN PixelMap: TYPE ~ ImagerPixelMap.PixelMap; Transformation: TYPE ~ ImagerTransformation.Transformation; ROPE: TYPE ~ Rope.ROPE; PixelArray: TYPE ~ ImagerPixelArrayDefs.PixelArray; Sample: TYPE ~ ImagerSample.Sample; UnsafeSamples: TYPE ~ ImagerSample.UnsafeSamples; SampleBuffer: TYPE ~ ImagerSample.SampleBuffer; ErrorDesc: TYPE ~ RECORD [code: ATOM, explanation: ROPE]; Error: ERROR [error: ErrorDesc]; GetClass: PROC [pa: PixelArray] RETURNS [ATOM]; MaxSampleValue: PROC [pa: PixelArray, i: NAT] RETURNS [Sample]; GetSample: PROC [pa: PixelArray, i: NAT, s, f: INT] RETURNS [Sample]; UnsafeGetSamples: UNSAFE PROC [pa: PixelArray, i: NAT, s, f: INT, samples: UnsafeSamples, count: NAT]; GetSamples: PROC [pa: PixelArray, i: NAT, s, f: INT, buffer: SampleBuffer, bi, bj: NAT _ 0, count: NAT]; GetPixels: PROC [pa: PixelArray, s, f: INT, buffer: SampleBuffer, bj: NAT _ 0, count: NAT]; UnsafeGetBits: UNSAFE PROC [pa: PixelArray, i: NAT _ 0, s, f: INT, dst: PrincOps.BitAddress, dstBpl: INTEGER, width, height: CARDINAL, srcFunc: PrincOps.SrcFunc _ null, dstFunc: PrincOps.DstFunc _ null]; Extract: PROC [old: PixelArray, samplesPerPixel: NAT, select: PROC [NAT] RETURNS [NAT]] RETURNS [new: PixelArray]; Join: PROC [list: LIST OF PixelArray] RETURNS [PixelArray]; Join3: PROC [pa1, pa2, pa3: PixelArray] RETURNS [PixelArray]; FromAIS: PROC [name: ROPE] RETURNS [PixelArray]; Join3AIS: PROC [name1, name2, name3: ROPE] RETURNS [PixelArray]; END. €ImagerPixelArray.mesa Copyright c 1984, 1985 by Xerox Corporation. All rights reserved. Michael Plass, August 1, 1984 9:59:33 am PDT Doug Wyatt, May 19, 1985 2:49:54 pm PDT Basic operations The pixel array contains sSize*fSize pixels, samplesPerPixel*sSize*fSize samples. A sample is named by a triple: i IN[0..samplesPerPixel), s IN[0..sSize), f IN[0..fSize). ... returns an ATOM that identifies the PixelArray's class. ... returns the maximum sample value for the ith sample. For all i IN[0..pa.samplesPerPixel), s IN[0..pa.sSize), f IN[0..pa.fSize): pa.GetSample[i, s, f] IN[0..pa.MaxSampleValue[i]]. ... returns the sample value with indices [i, s, f]. ! BoundsFault if i ~IN[0..pa.samplesPerPixel) OR s ~IN[0..pa.sSize) OR f ~IN[0..pa.fSize). ... fetches a run of samples into raw storage; same effect as the following, but faster: FOR k: NAT IN[0..count) DO samples[k] _ GetSample[pa, i, s, f+k] ENDLOOP ! BoundsFault if any index into pa is out of range ... fetches a run of samples into a buffer; same effect as the following, but faster: FOR k: NAT IN[0..count) DO buffer.PutSample[bi, bj+k, GetSample[pa, i, s, f+k]] ENDLOOP ! BoundsFault if any index into pa is out of range ... fetches a run of pixels into a buffer; same effect as the following, but faster: FOR i: NAT IN[0..pa.samplesPerPixel) DO GetSamples[pa, i, s, f, buffer, i, bj, count] ENDLOOP ! BoundsFault if any index into pa or samples is out of range ... does a BITBLT-like transfer of samples [i, [s..s+height), [f..f+width)]. ! Error[[$samplesTooBig, ...]] if pa.MaxSampleValue[i]>1 ! BoundsFault if any sample index is out of range Creating pixel arrays ... extracts selected sample layers from a pixel array. new.samplesPerPixel = samplesPerPixel new.sSize = old.sSize, new.fSize = old.fSize ImagerTransformation.Equal[new.m, old.m] new.MaxSampleValue[i] = old.MaxSampleValue[select[i]] new.GetSample[i, s, f] = old.GetSample[select[i], s, f] ! BoundsFault if for any i IN[0..samplesPerPixel), select[i] ~IN[0..pa.samplesPerPixel). ... joins multiple sample planes into one PixelArray. ! Error[[$incompatibleJoin, ...]] if sizes or transformations do not match. ... makes a pixel array from an AIS file with the specified name. ! FS.Error if the named file cannot be opened. ! Error[[$malformedAISFile, ...]] if the file is not a valid AIS file. A convenience, equivalent to Join3[FromAIS[name1], FromAIS[name2], FromAIS[name3]]. ! FS.Error or Error, as for FromAIS or Join. Κχ˜codešœ™Kšœ Οmœ7™BK™,K™'—K˜šΟk ˜ Kšœžœ˜(Kšœžœ ˜ Kšœ žœ'˜9Kšœžœ˜,Kšœ žœ ˜.Kšœžœžœ˜—K˜KšΠblœžœž ˜#šœž˜K˜Kšœ žœ˜)Kšœžœ'˜;Kšžœžœžœ˜—head™šœ žœ#˜3KšœQ™QKšœ!žœžœžœ ™XK™—Kšœžœ˜#Kšœžœ˜1Kšœžœ˜/K˜Kš œ žœžœžœžœ˜9Kšœžœ˜ K˜šΟnœžœžœžœ˜/Kšœžœ(™;K™—š œžœžœžœ ˜?K™8šœ žœžœžœ™JKšœžœ™2—K™—š   œžœžœžœžœ ˜EK™4Kš œžœžœžœžœžœ™ZK˜—š  œžœžœžœžœ"žœ˜gK™XKš žœžœžœ žœ'ž™HKšœ2™2K˜—š   œžœžœžœ!žœ žœ˜iK™UKš žœžœžœ žœ6ž™WKšœ2™2K˜—š   œžœžœžœ žœ˜\K™TKš žœžœžœžœ/ž™]Kšœ=™=K˜—š  œžœžœžœ žœ%žœžœG˜ΝKšœ žœ;™LKšœ8™8Kšœ1™1K˜——™š œžœ$žœ žœžœžœžœžœ˜s™7Kšœ%™%Kšœ,™,Kšœ(™(Kšœ5™5Kšœ7™7—Kšœžœ!žœ™XK˜—K˜Kš  œžœžœžœ žœ˜;š œžœžœ˜=Kšœ5™5KšœK™KK™—K˜š œžœžœžœ˜0KšœA™AKšœžœ*™.KšœF™FK™—š œžœžœžœ˜@KšœS™SKšœžœ(™,K™——K˜Kšžœ˜—…—δ