1 / 7

Circle Scan Conversion

Circle Scan Conversion. We assume the following – The circle centered at (0,0) – We draw 1/8 of the circle, Then use 8-way symmetry. Not 8-way Symmetry. Circle Scan Conversion. We assume (xp, yp) has been correctly Selected. The slope is between 0 and 1.0

thammond
Download Presentation

Circle Scan Conversion

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Circle Scan Conversion We assume the following – The circle centered at (0,0) – We draw 1/8 of the circle, Then use 8-way symmetry Not 8-way Symmetry Compute Graphics

  2. Circle Scan Conversion We assume (xp, yp) has been correctly Selected. The slope is between 0 and 1.0 If the circle passes above M, then We select E Else We select SE E M ME SE MSE We assume – The circle centered at (0,0) – We draw 1/8 of the circle, Then use 8-way symmetry Compute Graphics

  3. E M ME SE MSE Circle Scan Conversion We use D as in the case of line D = F(M) = F(xp+1, yp-0.5) = (xp+1)2+(yp-0.5)2-R2 If ( D < 0 ) then M is below the arc, pixel E is closer to the line. If (D >= 0 ) then M is above the arc, pixel SE is closer to the line. Compute Graphics

  4. E M ME SE MSE Circle Scan Conversion CASE I: E is next We use D as in the case of line Dnew = F(ME) = F(xp+2, yp-0.5) = (xp+2)2+(yp-0.5)2-R2 = D + ( 2*xp+3) CASE II: SE is next We use D as in the case of line Dnew = F(M) = F(xp+2, yp-1.5) = (xp+2)2+(yp-1.5)2-R2 = D + ( 2*xp-2yp+5) Initialization Dinit=F(1,R-0.5)= Compute Graphics

  5. E M ME SE MSE Circle Scan Conversion DrawCircel(int radius, Color clr){ int x = 0 ; int y = radius ; int d = 1-radius ; Plot(x,y, clr); while ( y > x ){ if ( d < 0 ) // E Selected d += 2*x + 3 ; else { d += 2*(x-y) + 5 ; y-- ; } x++ ; Plot(x,y, clr); } } Compute Graphics

  6. Circle Scan Conversion Let us use second order difference If E was selected then Eold = 2xp+3 Enew = 2(xp+1)+3 deltaE = Enew-Eold= 2 If SE was selected then SEold = 2xp-2yp+5 SEnew = 2(xp+1)-2yp + 5 deltaSE = SEnew-SEold= 4 E M ME SE MSE Compute Graphics

  7. E M ME SE MSE Circle Scan Conversion DrawCircel(int radius, Color clr){ int x = 0 , y = radius ; int d = 1-radius ; int deltaE = 3, deltaSE = -2*radius + 5 ; Plot(x,y, clr); while ( y > x ){ if ( d < 0 ){ // E Selected d += deltaE ; deltaE +=2 ; deltaSE +=2 ; else { // SE Selected d += deltaSE ; deltaE += 2 ; deltaSE += 4 ; y-- ; } x++ ; Plot(x,y, clr); } } Compute Graphics

More Related