Anomalies in Incremental Line Rastering

Discussed are implementation considerations relevant to selecting and customizing incremental line drawing algorithms to cope with such anomalies as equal error metric instances, perturbation effects of clipping, intersections in raster space, EXOR interpretations for polylines, reversibility, and fractional end point rounding. Pel-level, visibly noticeable, effects are illustrated by reference to four rastering considerations: 1) Exactly reversible paths or RETRACEABILITY Should grid points selected for the line from (0,0) to (2,1) be identical to the grid points selected for the line back from (2,1) to (0,0)? 2) Fractional end point processing or FIDELITY Should grid points selected for the line from (5.5,0.5) to (0.5,5.5) actually be coincident with any of the points selected for the line from (6,0) to (0,6); both do have the same form: y=6-x. 3) Chained, concatenated line segments or POLYLINE Should a POLYLINE from (10,0) to (0,0) to (10,0) written in EXCLUSIVE OR drawing mode actually display multiple pels or one pel or no pels in a frame-buffer display? 4) Line parameter choices or SPECIFICATION Should the two radial lines bounding a pie chart slice of the 13-unit radius, origin centered circle between arc end points (5,12) and (0,13) intersect close to (0,0) if the circular sector or pie chart slice is constrained to specification only as an integer three-point circumferential arc with circle center point inferred? Ambiguities and anomalies in rastering are not always apparent. As I’ve lectured at university colloquia or perused papers in professional journals, I’ve sometimes been surprised to observe minimal awareness of what I choose to call pel-level considerations implicit in rastering algorithm usage. In this paper I propose to illustrate several such pel-level, visibly noticeable, effects by reference to four rastering considerations: 1) Exactly reversible paths or RETRACEABILITY Will, for instance, grid points selected for the line from (0,0) to (2,1) be identical to the grid points selected for the line back from (2,1) to (0,0)? Does reversibility affect polygon approximation of curves and arcs? 2) Fractional end point processing or FIDELITY Will, say, grid points selected for the line from (5.5,0.5) to (0.5,5.5) actually be coincident with any of the points selected for the line from (6,0) to (0,6); after all, both do have the same form: y=6-x. Is pre-raster algebraic clipping in geometric space likely to differ from post-raster scissor clipping in raster space? 3) Chained, concatenated line segments or POLYLINE Will, say, a polyline from (10,0) to (0,0) to (10,0) rastered in EXCLUSIVE OR drawing mode actually display multiple pels or one pel or no pels in a frame-buffer display? Is polyline a geometric entity itself or are its individual line segments, separately, each a unique entity distinct from polyline as merely a concatenation construct for compact specification? 4) Line parameter choices or SPECIFICATION will, say, the two radial lines bounding the sector of a 13-unit radius, origin centered circle between arc end points (5,12) and (0,13) intersect close to (0,0) if the circular sector or pie chart slice is constrained to specification only as an integer three-point circumferential arc with circle center point inferred? As frame-buffer raster function such as BIT-BLIT and EXOR (exclusive or) come into more prominence and portability receives more attention together with picture interchange, pel-level matters merit more explicit awareness. Verifying drawing results by, say, EXORing two interchange bit-maps drawn by separate implementations will infer commonality or at least understanding of pel-level ambiguities or anomalies. My purpose here is not to provide cookbook answers. Rather, my intent is to counsel that graphics algorithms, even a quarter-century-old rastering algorithm (2) developed in 1962, should be thoroughly understood and adapted as appropriate to fit implementation specific environments. The notions discussed are not necessarily new or original or unknown. Any raster graphics implementation ever done has resolved, explicitly or more often implicitly, each of the matters raised in the illustrative examples. What concerns me is that little has been published on the matter. Standardization activities, even those at the device driver level, often prefer to avoid sticky questions of pel-level attention to picture equivalence. Even classroom coverage can skirt pel-level matters by leaving any consideration to self-discovery through debugging thoroughness of the student. I believe a bit more explicit attention to pel-level details and clarity of system conceptual constructs --such as POLYLINE or EXOR or WIDELINE or even the sampling function for rastering incremental lines--can enhance past practices. Implementers, hardware or software, should make overt, conscious, explicit choices for ambiguity resolution and should document resultant pel-level behavior to preclude wasted time by users who may have intuitive expectations that differ from those of the designer. It is not enough to define a raster function in isolation; one needs to pay attention to interaction of related functions as they make up a system as a whole. Wideline interaction with linestyle and drawing modes and fractional end-points from affine transformations, for example, should be conscientiously and consistently specified if one is to be able to predict rendered picture content. Pel-level behavior may appear negligible, certainly disinteresting, at the surface level. As the time taken finally to arrive at a floating-point standard such as ANSI/IEEE 754-1985 illustrates, attention to fine detail is useful if common resolution is to be achieved for what may seem at first glance to be merely “don’t care” items which, in reality, do propagate through to influence a final result.