Graphics Output Primitive cgvr korea ac kr 1

  • Slides: 21
Download presentation
Graphics Output Primitive 고려대학교 컴퓨터 그래픽스 연구실 cgvr. korea. ac. kr 1 Graphics Lab

Graphics Output Primitive 고려대학교 컴퓨터 그래픽스 연구실 cgvr. korea. ac. kr 1 Graphics Lab @ Korea University

Contents CGVR Points n Lines n DDA Algorithm n Bresenham’s Algorithm n n Polygons

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 cgvr. korea. ac. kr 2 Graphics Lab @ Korea University

Points n CGVR Single Coordinate Position n Set the bit value(color code) corresponding to

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 cgvr. korea. ac. kr 3 Graphics Lab @ Korea University

Lines n CGVR Intermediate Positions between Two Endpoints n DDA, Bresenham’s line algorithms Jaggies

Lines n CGVR Intermediate Positions between Two Endpoints n DDA, Bresenham’s line algorithms Jaggies = Aliasing cgvr. korea. ac. kr 4 Graphics Lab @ Korea University

DDA Algorithm n CGVR Digital Differential Analyzer n 0 < Slope <= 1 o

DDA Algorithm n CGVR Digital Differential Analyzer n 0 < Slope <= 1 o Unit x interval = 1 y 2 y 1 x 1 cgvr. korea. ac. kr 5 x 2 Graphics Lab @ Korea University

DDA Algorithm n CGVR Digital Differential Analyzer n 0 < Slope <= 1 o

DDA Algorithm n CGVR Digital Differential Analyzer n 0 < Slope <= 1 o n Unit x interval = 1 y 2 Slope > 1 o Unit y interval = 1 y 1 x 1 cgvr. korea. ac. kr 6 x 2 Graphics Lab @ Korea University

DDA Algorithm n CGVR Digital Differential Analyzer n 0 < Slope <= 1 o

DDA Algorithm n CGVR Digital Differential Analyzer n 0 < Slope <= 1 o n y 2 Slope > 1 o n Unit x interval = 1 Unit y interval = 1 y 1 -1 <= Slope < 0 o Unit x interval = -1 cgvr. korea. ac. kr 7 x 1 x 2 Graphics Lab @ Korea University

DDA Algorithm n CGVR Digital Differential Analyzer n Slope >= 1 o n 0

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 cgvr. korea. ac. kr 8 Graphics Lab @ Korea University

Bresenham’s Line Algorithm n CGVR Midpoint Line Algorithm n Decision variable NE Q n

Bresenham’s Line Algorithm n CGVR Midpoint Line Algorithm n Decision variable NE Q n d > 0 : choose NE E : dnew= dold+a+b o n P(xp, yp) M d <= 0 : choose E : dnew= dold+a o cgvr. korea. ac. kr 9 Graphics Lab @ Korea University

Bresenham’s Algorithm(cont. ) n Initial Value of d n Update d cgvr. korea. ac.

Bresenham’s Algorithm(cont. ) n Initial Value of d n Update d cgvr. korea. ac. kr 10 CGVR Graphics Lab @ Korea University

Polygons n CGVR Filling Polygons n Scan-line fill algorithm o n Boundary fill algorithm

Polygons n CGVR Filling Polygons n Scan-line fill algorithm o n Boundary fill algorithm Inside-Outside tests 1 2 3 4 cgvr. korea. ac. kr 5 6 7 8 9 11 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

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’ cgvr. korea. ac. kr 12 Graphics Lab @ Korea University

Scan-Line Polygon Fill (cont. ) n CGVR Edge Sorted Table B y. C y.

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 cgvr. korea. ac. kr 13 Graphics Lab @ Korea University

Inside-Outside Tests n CGVR Self-Intersections n Odd-Even rule n Nonzero winding number rule exterior

Inside-Outside Tests n CGVR Self-Intersections n Odd-Even rule n Nonzero winding number rule exterior interior cgvr. korea. ac. kr 14 Graphics Lab @ Korea University

Boundary-Fill Algorithm n CGVR Proceed to Neighboring Pixels 4 -Connected n 8 -Connected n

Boundary-Fill Algorithm n CGVR Proceed to Neighboring Pixels 4 -Connected n 8 -Connected n cgvr. korea. ac. kr 15 Graphics Lab @ Korea University

Antialiasing n CGVR Aliasing n Undersampling: Low-frequency sampling original sample reconstruct Nyquist sampling frequency:

Antialiasing n CGVR Aliasing n Undersampling: Low-frequency sampling original sample reconstruct Nyquist sampling frequency: n Nyquist sampling interval: n cgvr. korea. ac. kr 16 Graphics Lab @ Korea University

Antialiasing (cont. ) n CGVR Supersampling (Postfiltering) n Pixel-weighting masks Area Sampling (Prefiltering) n

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 cgvr. korea. ac. kr 17 Graphics Lab @ Korea University

Supersampling n CGVR Subpixels n Increase resolution 22 (10, 20): Maximum Intensity 21 (11,

Supersampling n CGVR Subpixels n Increase resolution 22 (10, 20): Maximum Intensity 21 (11, 21): Next Highest Intensity (11, 20): Lowest Intensity 20 10 cgvr. korea. ac. kr 11 18 12 Graphics Lab @ Korea University

Pixel-Weighting Masks n CGVR Give More Weight to Subpixels Near the Center of a

Pixel-Weighting Masks n CGVR Give More Weight to Subpixels Near the Center of a Pixel Area 1 2 1 cgvr. korea. ac. kr 19 2 4 2 1 Graphics Lab @ Korea University

Area Sampling n CGVR Set Each Pixel Intensity Proportional to the Area of Overlap

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 cgvr. korea. ac. kr 20 11 12 Graphics Lab @ Korea University

Filtering Techniques n CGVR Filter Functions (Weighting Surface) Box Filter cgvr. korea. ac. kr

Filtering Techniques n CGVR Filter Functions (Weighting Surface) Box Filter cgvr. korea. ac. kr 21 Cone Filter Gaussian Filter Graphics Lab @ Korea University