Output Primitive - PowerPoint PPT Presentation

1 / 22
About This Presentation
Title:

Output Primitive

Description:

Output Primitive Contents Points Lines DDA Algorithm Bresenham s Algorithm Polygons Scan-Line Polygon Fill Inside ... – PowerPoint PPT presentation

Number of Views:53
Avg rating:3.0/5.0
Slides: 23
Provided by: 4518
Category:
Tags: output | primitive

less

Transcript and Presenter's Notes

Title: Output Primitive


1
Output Primitive
????? ??? ???? ???
2
Contents
  • Points
  • Lines
  • DDA Algorithm
  • Bresenhams Algorithm
  • Polygons
  • Scan-Line Polygon Fill
  • Inside-Outside Tests
  • Boundary-Fill Algorithm
  • Antialiasing

3
Points
  • Single Coordinate Position
  • Set the bit value(color code) corresponding to a
    specified screen position within the frame buffer

y
setPixel (x, y)
x
4
Lines
  • Intermediate Positions between Two Endpoints
  • DDA, Bresenhams line algorithms

Jaggies Aliasing
5
DDA Algorithm
  • Digital Differential Analyzer
  • 0 lt Slope lt 1
  • Unit x interval 1

6
DDA Algorithm
  • Digital Differential Analyzer
  • 0 lt Slope lt 1
  • Unit x interval 1
  • Slope gt 1
  • Unit y interval 1

7
DDA Algorithm
  • Digital Differential Analyzer
  • 0 lt Slope lt 1
  • Unit x interval 1
  • Slope gt 1
  • Unit y interval 1
  • -1 lt Slope lt 0
  • Unit x interval -1

8
DDA Algorithm
  • Digital Differential Analyzer
  • Slope gt 1
  • Unit x interval 1
  • 0 lt Slope lt 1
  • Unit y interval 1
  • -1 lt Slope lt 0
  • Unit x interval -1
  • Slope lt -1
  • Unit y interval -1

9
Bresenhams Line Algorithm
  • Midpoint Line Algorithm
  • Decision variable
  • d gt 0 choose NE
  • dnew
    doldab
  • d lt 0 choose E
  • dnew
    dolda

NE
Q
M
P(xp, yp)
E
10
Bresenhams Algorithm(cont.)
  • Initial Value of d
  • Update d

11
Polygons
  • Filling Polygons
  • Scan-line fill algorithm
  • Inside-Outside tests
  • Boundary fill algorithm

11
1
2
3
4
5
6
7
8
9
6
7
8
9
10
5
1
2
3
4
12
Scan-Line Polygon Fill
  • Topological Difference between 2 Scan lines
  • y intersection edges are opposite sides
  • y intersection edges are same side

y
y
13
Scan-Line Polygon Fill (cont.)
  • Edge Sorted Table

B
yC
yB
xC
1/mCB
C
C
E
yD
yC
xD
1/mDC
yE
xD
1/mDE
D
yA
yE
xA
1/mAE
yB
xA
1/mAB
A
1
0
Scan-Line Number
14
Inside-Outside Tests
  • Self-Intersections
  • Odd-Even rule
  • Nonzero winding number rule

exterior
interior
15
Boundary-Fill Algorithm
  • Proceed to Neighboring Pixels
  • 4-Connected
  • 8-Connected

16
Antialiasing
  • Aliasing
  • Undersampling Low-frequency sampling
  • Nyquist sampling frequency
  • Nyquist sampling interval

original
sample
reconstruct
17
Antialiasing (cont.)
  • Supersampling (Postfiltering)
  • Pixel-weighting masks
  • Area Sampling (Prefiltering)
  • Pixel Phasing
  • Shift the display location of pixel areas
  • Micropositioning the electron beam in relation to
    object geometry

18
Supersampling
  • Subpixels
  • Increase resolution

22
(10, 20) Maximum Intensity (11, 21) Next
Highest Intensity (11, 20) Lowest Intensity
21
20
10
11
12
19
Supersampling
  • Subpixels
  • Increase resolution

22
(10, 20) Maximum Intensity (11, 21) Next
Highest Intensity (11, 20) Lowest Intensity
21
20
10
11
12
20
Pixel-Weighting Masks
  • Give More Weight to Subpixels Near the Center of
    a Pixel Area

21
Area Sampling
  • Set Each Pixel Intensity Proportional to the Area
    of Overlap of Pixel
  • 2 Adjacent vertical (or horizontal) screen grid
    lines ? trapezoid

22
(10, 20) 90 (10, 21) 15
21
20
10
11
12
22
Filtering Techniques
  • Filter Functions (Weighting Surface)

Box Filter
Cone Filter
Gaussian Filter
Write a Comment
User Comments (0)
About PowerShow.com