DIRECTORY Rope USING [ROPE]; DitherAIS: DEFINITIONS = BEGIN Pixel: TYPE = RECORD [ red, green, blue:INTEGER, rgb:CARDINAL]; PixelBuf: TYPE = REF PixelBufRec; PixelBufRec: TYPE = RECORD [ data:SEQUENCE ix:CARDINAL OF Pixel]; UserMapProc: TYPE = PROC [r, g, b:INTEGER] RETURNS [palix:CARDINAL, re, ge, be:INTEGER]; UserUnmapProc: TYPE = PROC [palix:CARDINAL] RETURNS [r, g, b:INTEGER]; Stretch: PUBLIC PROCEDURE [redFn, greenFn, blueFn, rgbFn:Rope.ROPE, unMap:UserUnmapProc]; Squash: PUBLIC PROCEDURE [redFn, greenFn, blueFn, rgbFn:Rope.ROPE, map:UserMapProc]; SquashScan: PUBLIC PROCEDURE [this, next:PixelBuf, left,right:CARDINAL, map:UserMapProc]; END. όDitherAIS.mesa Mik Lamming September 29, 1982 2:44 pm Takes three INTEGER values of red, green and blue (which may be negative) and returns the index of the 'nearest' color in a user defined color palette together with three error values. The error values represent the difference between the r,g,b given as inputs and the r,g,b values of the 'nearest' color. N.B. r,g,b values outside the range [0..256) should be MiniMaxed to 0/255. Errors re,ge,be should be computed before MiniMaxing. Takes a palette index and returns r,g and b [0..256) Takes a dithered file rgbFn and cretates three separations using the unMap procedure Transforms the three AIS files red,green and blue into the single AIS file: rgb using the user supplied map procedure and applying Floyd-Steinberg error distribution. Processes the pixel buffer 'this' using the user supplied map procedure 'map' to fill in the rgb field in each pixel of 'this' and modifies the contents of the buffer 'next' using Floyd-Steinberg error distribution Κ[– "Mesa" style˜Jšœ™Jšœ&™&J™šΟk ˜ Jšœœœ˜—J˜šΟn œ œ˜J˜Jš žœœœ œœ˜@Jšžœœœ ˜!šž œœ˜Jšœ œ œ˜$——˜Jš ž œœ œœœ œ˜XJšœ³™³J™Jš žœœœœ œ˜FJ™4J˜Jšžœœ#œ˜YJ™T—˜Jšžœ#œœ˜TJ™¦J™Jšž œœ" œœ ˜YJ™ΦJ˜Jšœ˜J˜——…—šρ