4.Scan |
Scan conversionProblem
Concepts
|
Scan - conversion of rectangles |
Scan - conversion of rectanglesFor ( y from y0 to yn ) For ( x from x0 to xn ) Write Pixel (x, y, val) |
Scan - conversion of rectanglesFor ( y from y0 to yn ) For ( x from x0 to xn ) Write Pixel (x, y, val) |
Scan - conversion of rectanglesFor ( y from y0 to yn ) For ( x from x0 to xn ) Write Pixel (x, y, val) |
Scan - convert arbitrary polygonvertices: (4, 1) , (7, 13) , (11 , 2) |
Scan - convert arbitrary polygonvertices: (4, 1) , (7, 13) , (11 , 2)Intersect scanline w/pgon edges => span extrema |
Scan - convert arbitrary polygonvertices: (4, 1) , (7, 13) , (11 , 2)Intersect scanline w/pgon edges => span extrema Fill between pairs of span extrema |
Scan - convert arbitrary polygonvertices: (4, 1) , (7, 13) , (11 , 2)For each nonempty scanline Intersect scanline w/pgon edges => span extrema Fill between pairs of span extrema |
Scan - convert arbitrary polygonvertices: (4, 1) , (7, 13) , (11 , 2)For each nonempty scanline Intersect scanline w/pgon edges => span extrema Fill between pairs of span extrema |
Scan-Conversion: scanlines with vertices |
Scan-Conversion: scanlines with verticesat x = 1, 6, 6, 12 1/7 |
Scan-Conversion: scanlines with verticesat x = 1, 6, 6, 12 1/7 => Local extrema work as is (counted twice) |
Scan-Conversion: scanlines with verticesat x = 1, 1, 11 5/7 |
Scan-Conversion: scanlines with verticesat x = 1, 1, 11 5/7 ==> Count continuing edges once (shorten lower edge) now x=1, 11 5/7 |
Scan-Conversion: scanlines with verticesat x = 5, 5, 10, 10 |
Scan-Conversion: scanlines with verticesat x = 5, 5, 10, 10 => Don't count vertices of horizontal edges. Now x = 5, 10 |
Scan-line Rasterization Algorithm
|
Scan - conversionScanlines with vertices (4,1), (1,11), (9,5), (12,8), (12,1) |
Scan - conversionScanlines with vertices (4,1), (1,11), (9,5), (12,8), (12,1)bucket sort edges into sorted edge table sort on minY: 1 store:
|
Scan - conversionScanlines with vertices (4,1), (1,11), (9,5), (12,8), (12,1)bucket sort edges into sorted edge table initialize active edge list to first non empty scanline |
Scan - conversionScanlines with vertices (4,1), (1,11), (9,5), (12,8), (12,1)bucket sort edges into sorted edge table initialize active edge list to first non empty scanline for each non empty scanline |
Scan - conversionScanlines with vertices (4,1), (1,11), (9,5), (12,8), (12,1)bucket sort edges into sorted edge table initialize active edge list to first non empty scanline for each non empty scanline fill between pairs (x=4,12) |
Scan - conversionScanlines with vertices (4,1), (1,11), (9,5), (12,8), (12,1)bucket sort edges into sorted edge table initialize active edge list to first non empty scanline for each non empty scanline fill between pairs (x=4,12) remove exhausted edges update intersection points resort table add entering edges |
Scan - conversionScanlines with vertices (4,1), (1,11), (9,5), (12,8), (12,1)bucket sort edges into sorted edge table initialize active edge list to first non empty scanline for each non empty scanline fill between pairs (x=3 1/10,12) remove exhausted edges update intersection points |
Scan - conversionScanlines with vertices (4,1), (1,11), (9,5), (12,8), (12,1)bucket sort edges into sorted edge table initialize active edge list to first non empty scanline for each non empty scanline fill between pairs (x=3 1/10,12) remove exhausted edges update intersection points resort table add entering edges |
Scan - conversionScanlines with vertices (4,1), (1,11), (9,5), (12,8), (12,1)bucket sort edges into sorted edge table initialize active edge list to first non empty scanline for each non empty scanline fill between pairs (x=3 1/10,12) remove exhausted edges update intersection points resort table add entering edges |
Scan - conversionScanlines with vertices (4,1), (1,11), (9,5), (12,8), (12,1)bucket sort edges into sorted edge table initialize active edge list to first non empty scanline for each non empty scanline fill between pairs (x=3 1/10,12) remove exhausted edges update intersection points resort table add entering edges |
Scan-conversion: efficiency improvements |
Scan-conversion: efficiency improvements1. exploit coherencex(k + 1) = x(k) + 1/m
|
Scan-conversion: efficiency improvements1. exploit coherencex(k + 1) = x(k) + 1/m
|
Scan-conversion: efficiency improvements1. exploit coherencex(k + 1) = x(k) + 1/m
|
Scan-conversion: efficiency improvements1. exploit coherencex(k + 1) = x(k) + 1/m
|
Scan-conversion: efficiency improvements1. exploit coherencex(k + 1) = x(k) + 1/m
|
Scan-conversion: efficiency improvements1. exploit coherencex(k + 1) = x(k) + 1/m 2. integer calculations
|
Scan-conversion: efficiency improvements1. exploit coherencex(k + 1) = x(k) + 1/m 2. integer calculations
|
Scan-conversion: efficiency improvements1. exploit coherencex(k + 1) = x(k) + 1/m 2. integer calculations
|
Scan-conversion: efficiency improvements1. exploit coherencex(k + 1) = x(k) + 1/m 2. integer calculations
|
Fill variantsFill between pairs: for ( x = x1; x < x2; x++ ) framebuffer [ x, y ] = c |
Fill variants : Patterned fillFill between pairs: for ( x = x1; x < x2; x++ ) if ( ( x + y ) % 2 ) framebuffer [ x, y ] = c1 else framebuffer [ x, y ] = c1 |
Fill variants : Color WashFrom red to blueFill between pairs: for ( x = x1; x < x2; x++ ) framebuffer [ x, y ] = C0 + dC * ( x1 - x ) For efficiency carry C and dC in AET |
Fill variants : Vertex ColorsRed, Green and Blue
Fill between pairs: for ( x = x1; x < x2; x++ ) framebuffer [ x, y ] = Cy1x1 + [(x - x1) / (x2 - x1) * (Cy1x2 - Cy1x1)] dCx For efficiency carry Cy and dCy in AET |
Made by dynaPage 0.2 |