Patent ID: 6734870
Filing Date: 2004-05-11
Classification: G06T

Abstract:
A method for scan-converting a line segment in a pixel output space for adjusting attributes of display pixels in a graphics system, the method comprising the steps of:defining a two-dimensional pixel output space having orthogonal X and Y axes, and each pixel of the output space having attributes of location, color and brightness; providing a positive integer N; defining a sub-pixel overlay on the pixel output space, the overlay sharing the X and Y axes, and each pixel containing NÃ—N sub-pixels; receiving a pair of vertices, VA=(xA, yA) and VB=(xB, yB), having integer coordinates, and defining a line segment relative to the sub-pixel overlay; ordering the vertices such that VS=(xS, yS), VL=(xL, yL), where yL=the larger of yA, yB, yB=the smaller of yA, yB, and xL and xS are the X-components which correspond to yL and yS, respectively; determining integer values for the following fixed parameters, dY=N dx=|xLâˆ’xS|dy=yLâˆ’yS xZ=â€œlargest integerâ€ &lE;dYÂ·dx/dy Xd=dYÂ·dxâˆ’xZÂ·dy ym=dYâˆ’(yS modulo dY) xj=(ymÂ·xZ) modulo dY y0=â€œsmallest integer multiple of dYâ€ &gE;yS; determining initial integer values for the parameters, K0=[ymÂ·Xd+(xjâˆ’dY/2)Â·dy]Â·2/dY. x0=[â€œlargest integerâ€ &lE;ymÂ·xZ/dY]+xS; testing the sign of K0, and if K0 is negative, returning the point (x0, y0), and continuing from the setting an iteration control variable step, else, adjusting the integer values for K0 and x0 as follows, K0=K0âˆ’2Â·dy x0=x0+1, and continuing from the testing the sign of K0 step; setting an iteration control variable i=1; determining an integer value for yi=yiâˆ’1+dY; comparing yi with yL, and if yi is less-than-or-equal-to yL, determining integer values for xi and Ki as follows, xi=xiâˆ’1+xZ Ki=Kiâˆ’1+2Â·Xd, then testing the sign of Ki, and if Ki is positive or zero, correcting the integer values of xi and Ki, as follows, â€ƒxi=xi+1 â€ƒKi=Kiâˆ’2Â·dy, then returning the point (xi, yi), using yi to select a row location of display pixels in the graphics system, using xi to select two pixels of the selected row location that are closest to the line segment, adjusting display attributes of the two pixels, updating the value of the iteration control variable i, as follows, â€ƒi=i+1, and continuing from the determining a value for yi step, else, quitting the procedure.