20
Chapter 4 Attributes of Graphics Primitives Myung-Soo Kim Seoul National University http://cse.snu.ac.kr/mskim http://3map.snu.ac.kr

Chapter 4 Attributes of Graphics Primitives3map.snu.ac.kr/courses/2013/cg/Chap4.pdf · 2012. 10. 17. · 196 196 255 Color Look up Table 2081 To Red Gun To Green Gun To Blue Gun 00000000

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Chapter 4 Attributes of Graphics Primitives3map.snu.ac.kr/courses/2013/cg/Chap4.pdf · 2012. 10. 17. · 196 196 255 Color Look up Table 2081 To Red Gun To Green Gun To Blue Gun 00000000

Chapter 4 Attributes of Graphics Primitives

Myung-Soo Kim

Seoul National University

http://cse.snu.ac.kr/mskim

http://3map.snu.ac.kr

Page 2: Chapter 4 Attributes of Graphics Primitives3map.snu.ac.kr/courses/2013/cg/Chap4.pdf · 2012. 10. 17. · 196 196 255 Color Look up Table 2081 To Red Gun To Green Gun To Blue Gun 00000000

Attributes

• Color Attributes

• Point Attributes

• Line Attributes

• Curve Attributes

• Fill-Area Attributes

- Fill Styles: Hollow, Solid, Patterned

• Character Attributes

Page 3: Chapter 4 Attributes of Graphics Primitives3map.snu.ac.kr/courses/2013/cg/Chap4.pdf · 2012. 10. 17. · 196 196 255 Color Look up Table 2081 To Red Gun To Green Gun To Blue Gun 00000000

RGB Color Components

Page 4: Chapter 4 Attributes of Graphics Primitives3map.snu.ac.kr/courses/2013/cg/Chap4.pdf · 2012. 10. 17. · 196 196 255 Color Look up Table 2081 To Red Gun To Green Gun To Blue Gun 00000000

Color Lookup Tables

Page 5: Chapter 4 Attributes of Graphics Primitives3map.snu.ac.kr/courses/2013/cg/Chap4.pdf · 2012. 10. 17. · 196 196 255 Color Look up Table 2081 To Red Gun To Green Gun To Blue Gun 00000000

Color Blending

• The current color is the destination color

• The color of the second object is the source color

Page 6: Chapter 4 Attributes of Graphics Primitives3map.snu.ac.kr/courses/2013/cg/Chap4.pdf · 2012. 10. 17. · 196 196 255 Color Look up Table 2081 To Red Gun To Green Gun To Blue Gun 00000000

Color-Blended Fill Regions

Page 7: Chapter 4 Attributes of Graphics Primitives3map.snu.ac.kr/courses/2013/cg/Chap4.pdf · 2012. 10. 17. · 196 196 255 Color Look up Table 2081 To Red Gun To Green Gun To Blue Gun 00000000

Linear Soft-Fill Algorithm

Page 8: Chapter 4 Attributes of Graphics Primitives3map.snu.ac.kr/courses/2013/cg/Chap4.pdf · 2012. 10. 17. · 196 196 255 Color Look up Table 2081 To Red Gun To Green Gun To Blue Gun 00000000

Scan-Line Polygon Fill

Page 9: Chapter 4 Attributes of Graphics Primitives3map.snu.ac.kr/courses/2013/cg/Chap4.pdf · 2012. 10. 17. · 196 196 255 Color Look up Table 2081 To Red Gun To Green Gun To Blue Gun 00000000

Scan-Line Polygon Fill

Page 10: Chapter 4 Attributes of Graphics Primitives3map.snu.ac.kr/courses/2013/cg/Chap4.pdf · 2012. 10. 17. · 196 196 255 Color Look up Table 2081 To Red Gun To Green Gun To Blue Gun 00000000

Boundary-Fill Algorithm

Page 11: Chapter 4 Attributes of Graphics Primitives3map.snu.ac.kr/courses/2013/cg/Chap4.pdf · 2012. 10. 17. · 196 196 255 Color Look up Table 2081 To Red Gun To Green Gun To Blue Gun 00000000

Boundary-Fill Algorithm

• This procedure requires considerable stacking of neighboring points

Page 12: Chapter 4 Attributes of Graphics Primitives3map.snu.ac.kr/courses/2013/cg/Chap4.pdf · 2012. 10. 17. · 196 196 255 Color Look up Table 2081 To Red Gun To Green Gun To Blue Gun 00000000

More Efficient Algorithm

Page 13: Chapter 4 Attributes of Graphics Primitives3map.snu.ac.kr/courses/2013/cg/Chap4.pdf · 2012. 10. 17. · 196 196 255 Color Look up Table 2081 To Red Gun To Green Gun To Blue Gun 00000000

Flood-Fill Algorithm

Page 14: Chapter 4 Attributes of Graphics Primitives3map.snu.ac.kr/courses/2013/cg/Chap4.pdf · 2012. 10. 17. · 196 196 255 Color Look up Table 2081 To Red Gun To Green Gun To Blue Gun 00000000

Antialiasing

• Information loss due to under-sampling

Page 15: Chapter 4 Attributes of Graphics Primitives3map.snu.ac.kr/courses/2013/cg/Chap4.pdf · 2012. 10. 17. · 196 196 255 Color Look up Table 2081 To Red Gun To Green Gun To Blue Gun 00000000

Antialiasing

• Super-sampling Straight-Line Segments

Page 16: Chapter 4 Attributes of Graphics Primitives3map.snu.ac.kr/courses/2013/cg/Chap4.pdf · 2012. 10. 17. · 196 196 255 Color Look up Table 2081 To Red Gun To Green Gun To Blue Gun 00000000

Antialiasing

• Sub-pixel Weighting Masks

• Area Sampling Line Segments

Pixel (10,20) is about 90% covered, Pixel (10,21) is about 15% covered

Page 17: Chapter 4 Attributes of Graphics Primitives3map.snu.ac.kr/courses/2013/cg/Chap4.pdf · 2012. 10. 17. · 196 196 255 Color Look up Table 2081 To Red Gun To Green Gun To Blue Gun 00000000

Antialiasing

• Filtering Techniques

Page 18: Chapter 4 Attributes of Graphics Primitives3map.snu.ac.kr/courses/2013/cg/Chap4.pdf · 2012. 10. 17. · 196 196 255 Color Look up Table 2081 To Red Gun To Green Gun To Blue Gun 00000000

Antialiasing

• Pixel Phasing

Page 19: Chapter 4 Attributes of Graphics Primitives3map.snu.ac.kr/courses/2013/cg/Chap4.pdf · 2012. 10. 17. · 196 196 255 Color Look up Table 2081 To Red Gun To Green Gun To Blue Gun 00000000

Antialiasing

• Area Boundaries

Page 20: Chapter 4 Attributes of Graphics Primitives3map.snu.ac.kr/courses/2013/cg/Chap4.pdf · 2012. 10. 17. · 196 196 255 Color Look up Table 2081 To Red Gun To Green Gun To Blue Gun 00000000

Antialiasing

• Pittway-Watkinson Algorithm