DIRECTORY CtBasic, CtMap, G2dBasic, G2dVector, ImagerColor, ImagerSample, SF; CtTransform: CEDAR DEFINITIONS ~ BEGIN PairSequence: TYPE ~ G2dVector.PairSequence; IntegerSequence: TYPE ~ G2dBasic.IntegerSequence; SampleMaps: TYPE ~ CtBasic.SampleMaps; PixelArray: TYPE ~ CtBasic.PixelArray; IntegerPair: TYPE ~ CtBasic.IntegerPair; Cmap: TYPE ~ CtMap.Cmap; Table: TYPE ~ CtMap.Table; Box: TYPE ~ ImagerSample.Box; SampleMap: TYPE ~ ImagerSample.SampleMap; Vec: TYPE ~ SF.Vec; RGBProc: TYPE ~ CtBasic.RGBProc; ValueProc: TYPE ~ CtBasic.ValueProc; Display: TYPE ~ RECORD [ box: Box ¬ [[0, 0], [0, 0]], center: IntegerPair ¬ [0, 0], bpp: INTEGER ¬ 0, rpa, gpa, bpa, vpa: PixelArray ¬ NIL ]; EscherData: TYPE ~ RECORD [ exponent: REAL ¬ 2.0, -- client control rad, scl, x, p: REAL ¬ 0.0, -- accelerators and cache display: Display ¬ [] ]; BugeyeData: TYPE ~ RECORD [ xSize, ySize: INTEGER ¬ 20, -- client control xSize2, ySize2: INTEGER ¬ 0, display: Display ¬ [] ]; ShuffleData: TYPE ~ RECORD [ xSize, ySize: INT ¬ 20, -- client control xShuf, yShuf: IntegerSequence ¬ NIL, wid, hgt: INTEGER ¬ 0, display: Display ¬ [] ]; STLaplaceData: TYPE ~ RECORD [ threshold: INTEGER ¬ 8, -- client control dif: INTEGER ¬ 11, -- client control display: Display ¬ [] ]; PopularityData: TYPE ~ RECORD [ diameter: INTEGER ¬ 5, -- client control idiameter: REAL ¬ 0.0, lowd, highd: INTEGER ¬ 0, vpop: ARRAY [0..255] OF INTEGER ¬ ALL[0], display: Display ¬ [] ]; EdgesData: TYPE ~ RECORD [ xSize, ySize: INTEGER ¬ 20, -- client control tmp: INTEGER ¬ 0, display: Display ¬ [] ]; WoodcutData: TYPE ~ RECORD [ cutHeight: INTEGER ¬ 20, -- client control cutBlend: INTEGER ¬ 2, -- client control threshold: REAL ¬ 1.0, -- client control clamp: BOOL ¬ TRUE, -- client control height2: INTEGER ¬ 0, maxsum: INTEGER ¬ 0, sumscl: REAL ¬ 0, vbarscl: REAL ¬ 0, rsums: IntegerSequence ¬ NIL, -- also used for value sums gsums: IntegerSequence ¬ NIL, bsums: IntegerSequence ¬ NIL, yMax: INTEGER ¬ 0, tmp: INTEGER ¬ 0, display: Display ¬ [] ]; SpinData: TYPE ~ RECORD [ cycles: REAL ¬ 1.0, -- client control rad, thetaScl: REAL ¬ 0.0, tmp: INTEGER ¬ 0, display: Display ¬ [] ]; BlockData: TYPE ~ RECORD [ xSize, ySize: INTEGER ¬ 20, -- client control rsums: IntegerSequence ¬ NIL, -- also used for value sums gsums: IntegerSequence ¬ NIL, bsums: IntegerSequence ¬ NIL, yMax: INTEGER ¬ -1, tmp: INTEGER ¬ 0, display: Display ¬ [] ]; EscherSetup: PROC [exp: REAL, maps: SampleMaps] RETURNS [REF EscherData]; EscherRGB: RGBProc; EscherValue: ValueProc; BugeyeSetup: PROC [xSize, ySize: NAT, maps: SampleMaps] RETURNS [REF BugeyeData]; BugeyeRGB: RGBProc; BugeyeValue: ValueProc; ShuffleSetup: PROC [xSize, ySize: INTEGER, maps: SampleMaps] RETURNS [REF ShuffleData]; ShuffleRGB: RGBProc; ShuffleValue: ValueProc; STLaplaceSetup: PROC [threshold, dif: INTEGER, maps: SampleMaps] RETURNS [REF STLaplaceData]; STLaplaceRGB: RGBProc; STLaplaceValue: PUBLIC ValueProc; PopularitySetup: PROC [diameter: INTEGER, maps: SampleMaps] RETURNS [REF PopularityData]; PopularityRGB: RGBProc; PopularityValue: PUBLIC ValueProc; EdgesSetup: PROC [xSize, ySize: INTEGER, maps: SampleMaps] RETURNS [REF EdgesData]; EdgesRGB: RGBProc; EdgesValue: PUBLIC ValueProc; WoodcutSetup: PROC [height, blend: INT, threshold: REAL, clamp: BOOL, maps: SampleMaps] RETURNS [REF WoodcutData]; WoodcutRGB: RGBProc; WoodcutValue: ValueProc; SpinSetup: PROC [cycles: REAL, maps: SampleMaps] RETURNS [REF SpinData]; SpinRGB: RGBProc; SpinValue: ValueProc; BlockSetup: PROC [xSize, ySize: INTEGER, maps: SampleMaps] RETURNS [REF BlockData]; BlockRGB: RGBProc; BlockValue: PUBLIC ValueProc; END. Ø CtTransform.mesa Copyright Ó 1989, 1992 by Xerox Corporation. All rights reserved. Glassner, May 18, 1989 2:07:07 pm PDT Jules Bloomenthal July 3, 1992 1:28 pm PDT Imported Types Local Types Transformations For the following RGBProcs and ValueProcs, clientData must be a ref to the appropriate data. Each point (r, q) takes the value at (r', q); r' = R*(r/R)ed.exponent , where R is the maximum radius within the specified box (MIN[width, height]/2). The result is an image that is either "exploded" around the center (if ed.exponent > 1) or "shrunk" around the center (if ed.exponent < 1). Each point (x, y) takes the value at (x MOD bd.xSize, y MOD bd.ySize). Each row and column is shifted a random amount. The amount of relative shift from row to row is controlled by sd.xSize and sd.ySize. Signed, thresholded Laplacian filter. A local neighborhood is summed, and then a scaled amount of the center value is removed from the sum (the amount is sd.threshold). The result is then compared to sd.dif; the returned value is black or white depending on the result of that comparison. For STLaplaceRGB and STLaplaceValue, clientData should be REF STLaplaceData. A square region is sampled around each pixel. The returned value is the most commonly occuring value in that neighborhood. The size of the region is controlled by pd.diameter. Extracts edges from local intensity differences. The pixel referenced for is at a distance (ed.xSize, ed.ySize) from the pixel queried. Simulates a woodcut. wd.cutHeight is the size of each strip. wd.cutBlend controls how many horizontal neighbors are averaged together to find the intensity at a pixel; 0 means no neighbors, 1 means 1 neighbor on each side (a total of three samples), and so on. wd.clamp is a boolean; if TRUE, the result at each pixel is black or white, otherwise, the result is either black (if outside the band) or a value representing the average value in that column of that strip. The value of wd.threshold is used to pre-scale the pixels before the test is done; it is most useful when wd.clamp is true. Note that the resulting image may be used as a matte for the original, in either clamp or unclamped modes. Each point (r, q) takes the value at (r, q'); q' = q + (2p*sd.cycles*r)/R, where R is the maximum radius within the specified box (MIN[width, height]/2). The result is an image that is "spun" around the center of the box. Each (bd.xSize x bd.ySize) block in the image is replaced by the average value within that block. ÊŠ–"cedarcode" style•NewlineDelimiter ™™Jšœ Ïeœ7™BJšœ%™%J™*J™—JšÏk œAžœ˜MJ™JšÑbln œžœž ˜Jšœž˜headšÏl™Jšœžœ˜,Jšœžœ˜1Jšœ žœ˜'Jšœ žœ˜'Jšœžœ˜)Jšœ žœ˜Jšœ žœ˜Jšœžœ˜ Jšœ žœ˜*Jšœžœžœ˜Jšœ žœ˜"Jšœ žœ˜%—š  ™ šœ žœžœ˜J˜#J˜#Jšœ žœ˜Jšœ$ž˜'J˜—J˜šœžœžœ˜Jšœ žœ Ïc˜0Jšœžœ ¡˜