摘要 |
<p><P>PROBLEM TO BE SOLVED: To provide a line segment drawing processing method for shortening the processing time of a line segment whose inclination is especially small. <P>SOLUTION: The inclination of a line segment is checked, and the end point pixel of a scanning direction line segment is retrieved by binary search to a line segment having an inclination whose scale is equal to or less than a prescribed value. In one embodiment, when the x directional difference and y directional difference of the start point/end point of the line segment are respectively defined as dx and dy, the inclination dy/dx of the line segment is calculated, and whether dy/dx≤αis satisfied is determined, and when the above formula is satisfied, the binary search is applied. In the binary search, the position of a pixel under current consideration is moved to an x direction byΔx<SB>p</SB>, and an error e<SB>p</SB>=Δx<SB>p</SB>*dy/dx in the moved pixel is calculated, and when the error e<SB>p</SB>is 1≤e<SB>p</SB>≤2, the moved pixel is defined as the terminal pixel of the scanning direction line segment, and when the error e<SB>p</SB>is 0<e<SB>p</SB><1 or e<SB>p</SB>≥2,Δx<SB>p</SB>←1/2*Δx<SB>p</SB>is applied, and the pixel is further moved to a direction where x coordinates become large or small, and this is repeated until 1≤e<SB>p</SB><2 is satisfied. <P>COPYRIGHT: (C)2011,JPO&INPIT</p> |