<> <> <> <> <<>> <> <> DIRECTORY SF USING [Box, BoxAction, BoxGenerator]; ImagerManhattan: CEDAR DEFINITIONS ~ BEGIN <> Box: TYPE ~ SF.Box; BoxAction: TYPE ~ SF.BoxAction; BoxGenerator: TYPE ~ SF.BoxGenerator; Polygon: TYPE ~ LIST OF Box; <> <<(a.min.s = b.min.s AND a.max.s = b.max.s AND a.max.f <= b.min.f)>> <> <<(a.max.s <= b.min.s)>> Validate: PROC [polygon: Polygon] RETURNS [Polygon]; <> <<>> InvalidManhattanPolygon: ERROR; <> <> CreateFromRuns: PROC [ runs: PROC[ -- Create calls this back run: PROC[sMin, fMin: INTEGER, fSize: NAT], -- client calls this from inside runs. repeat: PROC[timesToRepeatScanline: NAT] -- client calls this to repeat a scanline ] ] RETURNS [Polygon]; <> CreateFromBox: PROC [box: Box] RETURNS [Polygon]; CreateFromBoxes: PROC [boxes: BoxGenerator] RETURNS [Polygon]; <> Destroy: PROC [rectangleList: LIST OF Box]; <> <> Copy: PROC [polygon: Polygon] RETURNS [Polygon]; Union: PROC [a, b: Polygon] RETURNS [Polygon]; Intersection: PROC [a, b: Polygon] RETURNS [Polygon]; Difference: PROC [a, b: Polygon] RETURNS [Polygon]; <> Shift: PROC [polygon: Polygon, sShift, fShift: INTEGER]; Canonicalize: PROC [list: LIST OF Box] RETURNS [Polygon]; <> <> <> BoundingBox: PROC [polygon: Polygon] RETURNS [Box]; CountBoxes: PROC [polygon: Polygon] RETURNS [INT]; CountRuns: PROC [polygon: Polygon] RETURNS [INT]; Map: PROC [polygon: Polygon, boxAction: BoxAction, runs: BOOL _ FALSE]; Clip: PROC [polygon: Polygon, box: Box, boxAction: BoxAction, runs: BOOL _ FALSE]; Visibility: TYPE ~ {visible, partlyVisible, invisible}; IsVisible: PROC [mask, clipper: Polygon] RETURNS [Visibility]; <