DIRECTORY Atom USING [PropList], ImagerColor USING [RGB], Vector3d USING [Pair], Pixels USING [PixelBuffer, SampleSet, SampleSetSequence]; ScanConvert: CEDAR DEFINITIONS ~ BEGIN PixelBuffer: TYPE ~ Pixels.PixelBuffer; RGB: TYPE ~ ImagerColor.RGB; -- RECORD[ r, g, b: REAL]; IntRGBT: TYPE ~ RECORD[ r, g, b, t: CARDINAL]; RealSequence: TYPE ~ RECORD [length: NAT _ 0, s: SEQUENCE maxLength: NAT OF REAL]; Pair: TYPE ~ Vector3d.Pair; -- RECORD[x, y: REAL]; IntPair: TYPE ~ RECORD[x, y: INTEGER]; IntPairSequence: TYPE ~ RECORD [length: NAT, pairs: SEQUENCE maxLength: NAT OF IntPair]; SampleSet: TYPE ~ Pixels.SampleSet; SampleSetSequence: TYPE ~ Pixels.SampleSetSequence; ScanConvertError: SIGNAL [reason: ATOM]; justNoticeable: REAL ~ 0.02; -- percentage intensity change for a just noticeable difference GetColorProc: TYPE ~ PROC[spot: Spot] RETURNS[RGB, REAL]; Spot: TYPE ~ RECORD[ x, y: NAT, -- screen coordinates coverage: REAL _ 1.0, -- percentage of pixel area covered by surface mask: CARDINAL _ LAST[CARDINAL], -- coding for position of covered area val: REF RealSequence _ NIL, -- interpolated values for shading yIncr: REF RealSequence _ NIL, -- vertical increments for interpolated values xIncr: REF RealSequence _ NIL, -- horizontal increments for interpolated values props: Atom.PropList _ NIL, -- catchall proc: GetColorProc _ NIL -- extracts color for painting display ]; SpotSequence: TYPE ~ RECORD [ length: NAT, spots: SEQUENCE maxLength: NAT OF Spot ]; Extend: PROC[ seq: REF RealSequence, newLength: NAT] RETURNS[REF RealSequence]; Power: PROC[ value: INTEGER, power: NAT] RETURNS[ result: INTEGER ]; DitheredRGB: PROC[renderMode: ATOM, x, y, red, grn, blu: INTEGER] RETURNS[INTEGER]; MappedRGB: PROC[renderMode: ATOM, clr: RGB] RETURNS[NAT]; RGBFromMap: PROC[renderMode: ATOM, value: NAT] RETURNS[RGB]; PutSpot: PROC [ buf: PixelBuffer, spot: Spot, op, renderMode: ATOM ]; GetSpot: PROC [ buf: PixelBuffer, spot: Spot, renderMode: ATOM ] RETURNS[ Spot ]; PutLine: PROC [buf: PixelBuffer, p1, p2: IntPair, color: SampleSet ]; ConstantPoly: PROC [buf: PixelBuffer, color: SampleSet, plygn: REF SpotSequence]; SmoothPoly: PROC [buf: PixelBuffer, plygn: REF SpotSequence, renderMode: ATOM]; ShinyPoly: PROC [buf: PixelBuffer, plygn: REF SpotSequence, shininess: NAT, renderMode: ATOM]; END. LScanConvert.mesa Copyright c 1984 by Xerox Corporation. All rights reserved. Frank Crow, October 2, 1986 11:35:57 am PDT Fancy operations on two-dimensional arrays of pixels. Type Definitions Constants Spot - (Point/PIxel/Spot) Definitions A spot is the information necessary to compute one or more pixels over a given position in an image Utility Procedures Point/Spot Operations Currently r, g, b are returned as spot.lerp[0] - spot.lerp[2] Scan Conversion for Lines Device dependent, numbers must fit PixelBuffer dimensions, bytes used as is Scan Conversion for Convex Areas Κ|˜Ihead2šœ™šœ Οmœ1™Iašœ žœžœžœ˜/Jšœžœžœ žœ žœ žœžœžœ˜SMšœžœŸœ˜;Lšœ žœžœžœ˜&Jš œžœžœ žœ žœ žœžœ ˜YJšœ žœ˜#Jšœžœ˜3J˜Mšœžœ žœ˜(—™ Lšœžœ Ÿ?˜\—šΟb%™%L™eLš œžœžœ žœžœžœ˜9šœžœžœ˜Lšœžœ Ÿ˜(Lšœ žœŸ.˜JLšœžœžœžœŸ&˜HLšœžœžœŸ"˜BLšœžœžœŸ.˜PLšœžœžœŸ0˜RLšœžœŸ ˜*LšœžœŸ&˜CLšœ˜—Jš œžœžœ žœ žœ žœžœ˜T—™Jš Οnœžœžœžœžœžœ˜OJš ‘œžœ žœ žœžœ žœ˜DMš ‘ œžœ žœžœžœžœ˜SMš Πbn‘œžœ žœžœžœžœ˜9Mš ‘ œžœ žœ žœžœžœ˜<—š ™Lš‘œžœ1žœ˜Eš‘œžœ-žœžœ ˜RL™=——™š‘œžœ8˜ELšœK™K——™ Lš‘ œžœ-žœ˜QLš‘ œžœžœžœ˜OLš ‘ œžœžœžœžœ˜fM˜—Jšžœ˜—…— R