DIRECTORY AdjustColor USING [TRC], SampleArrays USING [SampleArray], SampleMapOps USING [CVEC, SampleMap]; SelectRegions: CEDAR DEFINITIONS = BEGIN CVEC: TYPE ~ SampleMapOps.CVEC; SampleArray: TYPE ~ SampleArrays.SampleArray; SampleMap: TYPE ~ SampleMapOps.SampleMap; TRC: TYPE ~ AdjustColor.TRC; Operation: TYPE ~ {on, off, flip}; Rectangle: TYPE ~ RECORD [sMin, fMin, sMax, fMax: CARDINAL]; OutOfRectangle: ERROR; --Point not within bounds specified TRCSequence: TYPE ~ REF TRCSequenceRep; TRCSequenceRep: TYPE ~ RECORD [ SEQUENCE n: NAT OF REF TRC ]; RGB: TYPE ~ RECORD [r, g, b: CARDINAL]; nullRectangle: Rectangle ~ [0, 0, LAST[CARDINAL], LAST[CARDINAL]]; FillRectangle: PROC [sm: SampleMap, rect: Rectangle, op: Operation]; PaintPixel: PROC [sm: SampleMap, loc: CVEC, op: Operation]; PaintBrush: PROC [sm: SampleMap, loc: CVEC, op: Operation, brush: SampleMap]; Fill: PROC [sm: SampleMap, loc: CVEC, bounds: Rectangle _ nullRectangle] RETURNS [extent: Rectangle]; defaultColorDistance: CARDINAL; MatchColor: PROC [sm: SampleMap, sa: SampleArray, rgb: RGB, bounds: Rectangle _ nullRectangle, colorDistance: CARDINAL _ defaultColorDistance]; DiscriminateColor: PROC [sm: SampleMap, sa: SampleArray, near, far: RGB, bounds: Rectangle _ nullRectangle]; MatchColorFill: PROC [sm: SampleMap, sa: SampleArray, loc: CVEC, bounds: Rectangle _ nullRectangle, colorDistance: CARDINAL _ defaultColorDistance] RETURNS [extent: Rectangle]; ApplyTRC: PROC [sm: SampleMap, sa: SampleArray, trcs: TRCSequence, bounds: Rectangle _ nullRectangle]; Differences: PROC [a, b: Rectangle, action: PROC [r: Rectangle]]; Intersect: PROC [a, b: Rectangle] RETURNS [Rectangle]; END. ΌSelectRegions.mesa Copyright c 1985, Xerox Corporation. All rights reserved. Last edited by Eric Nickell, January 7, 1986 8:14:57 pm PST Turns a portion of the map on or off, filling out an area Paints a single pixel with the chosen operation. Paints using a brush. Turns a portion of the map on or off, filling out an area Selects the pixels in bounds which are within colorDistance of the original pixel. Selects the pixels in bounds which are within colorDistance of the original pixel. Selects the portion of the screen spreading out from loc which are closer (Manhatten-wise) to near than to far. trc.n must equal sa.n Calls action for (up to 4) regions covered by a or b, but not both. ΚP˜title™Icodešœ Οmœ/™:L™;L™—šΟk ˜ Lšœ žœžœ˜Lšœ žœ˜!Lšœ žœžœ ˜%J˜—šΟb œžœž œž˜(L˜Lšžœžœžœ˜Lšœ žœ˜-Lšœ žœ˜)Lšžœžœžœ˜L˜Lšœ žœ˜"Lšœ žœžœžœ˜