DIRECTORY Atom USING [PropList], Vector2 USING [VEC], ImagerColor USING [RGB], Pixels USING [PixelBuffer, SampleSet, SampleSetSequence]; ScanConvert: CEDAR DEFINITIONS ~ BEGIN PixelBuffer: TYPE ~ Pixels.PixelBuffer; RGB: TYPE ~ ImagerColor.RGB; -- RECORD[ r, g, b: REAL]; IntRGB: TYPE ~ RECORD[ r, g, b: CARDINAL]; IntRGBT: TYPE ~ RECORD[ r, g, b, t: CARDINAL]; Vec2: TYPE ~ Vector2.VEC; -- RECORD[x, y: REAL]; IntVec2: TYPE ~ RECORD[x, y: INTEGER]; RealSequence: TYPE ~ RECORD [ length: NAT, reals: SEQUENCE maxLength: NAT OF REAL ]; SampleSet: TYPE ~ Pixels.SampleSet; IntVec2Sequence: TYPE ~ RECORD [length: NAT, pairs: SEQUENCE maxLength: NAT OF IntVec2]; 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[IntRGBT]; 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: IntRGB] RETURNS[NAT]; RGBFromMap: PROC[renderMode: ATOM, value: NAT] RETURNS[IntRGB]; 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: IntVec2, color: SampleSet ]; ConstantPoly: PROC [buf: PixelBuffer, color: SampleSet, plygn: REF IntVec2Sequence]; SmoothPoly: PROC [buf: PixelBuffer, plygn: REF SpotSequence, renderMode: ATOM]; ShinyPoly: PROC [buf: PixelBuffer, plygn: REF SpotSequence, shininess: NAT, renderMode: ATOM]; END. JScanConvert.mesa Copyright c 1984 by Xerox Corporation. All rights reserved. Frank Crow, May 16, 1986 11:45:29 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šœžœžœ žœ˜*Lšœ žœžœžœ˜.Lšœžœ žœ Ÿœ˜9Idefaultšœ žœžœžœ˜&Mšœžœžœ žœ žœ žœžœžœ˜TJšœ žœ˜#Jš œžœžœ žœ žœ žœžœ ˜XJšœžœ˜3J˜Lšœžœ žœ˜(—™ Mšœžœ Ÿ?˜\—šΟb%™%M™eMšΟn œžœžœ žœ ˜7šœžœžœ˜Mšœžœ Ÿ˜(Mšœ žœŸ.˜JMšœžœžœžœŸ&˜HMšœžœžœŸ"˜BMšœžœžœŸ.˜PMšœžœžœŸ0˜RMšœžœŸ ˜*MšœžœŸ&˜CMšœ˜—Jš œžœžœ žœ žœ žœžœ˜T—™Jš ‘œžœžœžœžœžœ˜OJš ‘œžœ žœ žœžœ žœ˜DLš ‘ œžœ žœžœžœžœ˜SLš Πbn‘œžœ žœžœžœ˜