Graphics Output Primitive Graphics Lab Korea University Contents
Graphics Output Primitive 고려대학교 컴퓨터 그래픽스 연구실 Graphics Lab @ Korea University
Contents CGVR Points n Lines n DDA Algorithm n Bresenham’s Algorithm n n Polygons Scan-Line Polygon Fill n Inside-Outside Tests n Boundary-Fill Algorithm n Antialiasing n Graphics Lab @ Korea University
Points n CGVR Single Coordinate Position n Set the bit value(color code) corresponding to a specified screen position within the frame buffer y set. Pixel (x, y) x Graphics Lab @ Korea University
Lines n CGVR Intermediate Positions between Two Endpoints n DDA, Bresenham’s line algorithms Jaggies = Aliasing Graphics Lab @ Korea University
DDA Algorithm n CGVR Digital Differential Analyzer n 0 < Slope <= 1 o Unit x interval = 1 y 2 y 1 x 2 Graphics Lab @ Korea University
DDA Algorithm n CGVR Digital Differential Analyzer n 0 < Slope <= 1 o n Unit x interval = 1 Slope > 1 o y 2 Unit y interval = 1 y 1 x 2 Graphics Lab @ Korea University
DDA Algorithm n CGVR Digital Differential Analyzer n 0 < Slope <= 1 o n Slope > 1 o n Unit x interval = 1 Unit y interval = 1 y 2 -1 <= Slope < 0 o Unit x interval = -1 x 2 Graphics Lab @ Korea University
DDA Algorithm n CGVR Digital Differential Analyzer n Slope >= 1 o n 0 < Slope < 1 o n y 2 Unit y interval = 1 -1 <= Slope < 0 o n Unit x interval = 1 Unit x interval = -1 y 1 x 2 Slope < -1 o Unit y interval = -1 Graphics Lab @ Korea University
Bresenham’s Line Algorithm n CGVR Midpoint Line Algorithm n Decision variable NE Q n d > 0 : choose NE o n P(xp, yp) M E : dnew= dold+a+b d <= 0 : choose E o : dnew= dold+a Graphics Lab @ Korea University
Bresenham’s Algorithm(cont. ) n Initial Value of d n Update d CGVR Graphics Lab @ Korea University
Polygons n CGVR Filling Polygons n Scan-line fill algorithm o n Boundary fill algorithm Inside-Outside tests 1 2 3 4 5 6 7 8 9 11 10 5 6 7 8 9 4312 Graphics Lab @ Korea University
Scan-Line Polygon Fill n CGVR Topological Difference between 2 Scan lines y : intersection edges are opposite sides n y’ : intersection edges are same side n y y’ Graphics Lab @ Korea University
Scan-Line Polygon Fill (cont. ) n CGVR Edge Sorted Table B y. C y. B x. C 1/m. CB y. D y. C’ x. D 1/m. DC y. E x. D 1/m. DE y. A y. E x. A 1/m. AE y. B x. A 1/m. AB C C’ E D A 1 Scan-Line Number 0 Graphics Lab @ Korea University
Inside-Outside Tests n CGVR Self-Intersections n Odd-Even rule n Nonzero winding number rule exterior interior Graphics Lab @ Korea University
Boundary-Fill Algorithm n CGVR Proceed to Neighboring Pixels 4 -Connected n 8 -Connected n Graphics Lab @ Korea University
Antialiasing n CGVR Aliasing n Undersampling: Low-frequency sampling original sample reconstruct Nyquist sampling frequency: n Nyquist sampling interval: n Graphics Lab @ Korea University
Antialiasing (cont. ) n CGVR Supersampling (Postfiltering) n Pixel-weighting masks Area Sampling (Prefiltering) n Pixel Phasing n Shift the display location of pixel areas n Micropositioning the electron beam in relation to object geometry n Graphics Lab @ Korea University
Supersampling n CGVR Subpixels n Increase resolution 22 (10, 20): Maximum Intensity 21 (11, 21): Next Highest Intensity (11, 20): Lowest Intensity 20 10 11 12 Graphics Lab @ Korea University
Supersampling n CGVR Subpixels n Increase resolution 22 (10, 20): Maximum Intensity 21 (11, 21): Next Highest Intensity (11, 20): Lowest Intensity 20 10 11 12 Graphics Lab @ Korea University
Pixel-Weighting Masks n CGVR Give More Weight to Subpixels Near the Center of a Pixel Area 1 2 2 4 1 2 1 Graphics Lab @ Korea University
Area Sampling n CGVR Set Each Pixel Intensity Proportional to the Area of Overlap of Pixel n 2 Adjacent vertical (or horizontal) screen grid lines trapezoid 22 (10, 20): 90% 21 (10, 21): 15% 20 10 11 12 Graphics Lab @ Korea University
Filtering Techniques n CGVR Filter Functions (Weighting Surface) Box Filter Cone Filter Gaussian Filter Graphics Lab @ Korea University
- Slides: 22