DIRECTORY IISample USING [Function, maxCount, nullFunction, Sample, SampleBuffer, SampleMap], IITransformation USING [Transformation], SF USING [Box, BoxGenerator, Vec, zeroVec]; IIPixel: CEDAR DEFINITIONS ~ BEGIN Function: TYPE ~ IISample.Function; maxCount: NAT ~ IISample.maxCount; nullFunction: Function ~ IISample.nullFunction; Sample: TYPE ~ IISample.Sample; SampleBuffer: TYPE ~ IISample.SampleBuffer; SampleMap: TYPE ~ IISample.SampleMap; Transformation: TYPE ~ IITransformation.Transformation; PixelProc: TYPE ~ PROC [i: NAT] RETURNS [Sample]; PixelBuffer: TYPE ~ REF PixelBufferRep; PixelBufferRep: TYPE ~ RECORD [ length: NAT, sampleBuffers: SEQUENCE samplesPerPixel: NAT OF SampleBuffer ]; NewPixels: PROC [samplesPerPixel: NAT, length: NAT, scratch: PixelBuffer _ NIL] RETURNS [PixelBuffer]; ObtainScratchPixels: PROC [samplesPerPixel: NAT, length: NAT] RETURNS [PixelBuffer]; ReleaseScratchPixels: PROC [pixels: PixelBuffer]; DoWithScratchPixels: PROC [samplesPerPixel: NAT, length: NAT, action: PROC [PixelBuffer]]; PixelMap: TYPE ~ REF PixelMapRep; PixelMapRep: TYPE ~ RECORD [ box: SF.Box, sampleMaps: SEQUENCE samplesPerPixel: NAT OF SampleMap ]; NewPixelMap: PROC [samplesPerPixel: NAT, box: SF.Box, maxSample: PixelProc] RETURNS [PixelMap]; MakePixelMap: PROC [s0, s1, s2, s3, s4: SampleMap _ NIL] RETURNS [PixelMap]; GetPixels: PROC [self: PixelMap, initIndex: SF.Vec _ SF.zeroVec, delta: SF.Vec _ [s: 0, f: 1], pixels: PixelBuffer, start: NAT _ 0, count: NAT _ maxCount]; PutPixels: PROC [self: PixelMap, initIndex: SF.Vec _ SF.zeroVec, delta: SF.Vec _ [s: 0, f: 1], pixels: PixelBuffer, start: NAT _ 0, count: NAT _ maxCount, function: Function _ nullFunction]; ResampleAction: TYPE ~ PROC [pixels: PixelBuffer, min: SF.Vec]; Resample: PROC [self: PixelMap, m: Transformation, interpolate: BOOL, boxes: SF.BoxGenerator, bounds: SF.Box, action: ResampleAction]; END. ΤIIPixel.mesa Copyright c 1985, 1986 by Xerox Corporation. All rights reserved. Michael Plass, August 19, 1986 10:32:14 am PDT Doug Wyatt, March 7, 1986 2:41:21 pm PST Pixels, PixelBuffers and PixelMaps Convenience for creating a PixelMap from up to 5 existing SampleMaps. The boxes of the SampleMaps must all be the same. Gets a run of pixels from a pixel map into a pixel buffer. The effect is: FOR i: NAT IN [0..self.samplesPerPixel) DO self[i].GetSamples[initIndex, delta, pixels[i], start, count]; ENDLOOP; Stores a run of pixels into a pixel map from a pixel buffer. The effect is: FOR i: NAT IN [0..self.samplesPerPixel) DO self[i].PutSamples[initIndex, delta, pixels[i], start, count, function]; ENDLOOP; Κ˜codešœ ™ Kšœ Οmœ7™BK™.K™(—K˜šΟk ˜ Jšœ žœE˜SKšœžœ˜(Jšžœžœ#˜+—K˜KšΠblœžœž ˜šœž˜K˜Kšœ žœ˜#Kšœ žœ˜"Kšœ/˜/Kšœžœ˜Kšœžœ˜+šœ žœ˜%K˜—Kšœžœ#˜7—head™"Kš œ žœžœžœžœ ˜1K˜Kšœ žœžœ˜'šœžœžœ˜Kšœžœ˜ Kšœžœžœžœ ˜Kšžœ™——K˜—š  œžœžœžœžœ1žœ žœ0˜Ύ™Lšžœžœžœž™*J™HKšžœ™——K˜—K˜šœžœžœžœ˜?K˜—Kš  œžœ2žœ žœžœ˜‡K˜K˜—K˜Kšžœ˜—…—z ^