Raster Graphics
description
Transcript of Raster Graphics
![Page 1: Raster Graphics](https://reader035.fdocuments.in/reader035/viewer/2022062804/56814be1550346895db8bb92/html5/thumbnails/1.jpg)
Graphics
Graphics Lab @ Korea University
cgvr.korea.ac.kr
Raster Graphics
![Page 2: Raster Graphics](https://reader035.fdocuments.in/reader035/viewer/2022062804/56814be1550346895db8bb92/html5/thumbnails/2.jpg)
CGVR
Graphics Lab @ Korea University
cgvr.korea.ac.kr
Contents
Display Hardware How are images display?
Raster Graphics Systems How are imaging system organized?
Output Primitives How can we describe shapes with primitives?
Color Models How can we describe and represent colors?
![Page 3: Raster Graphics](https://reader035.fdocuments.in/reader035/viewer/2022062804/56814be1550346895db8bb92/html5/thumbnails/3.jpg)
CGVR
Graphics Lab @ Korea University
cgvr.korea.ac.kr
Display Hardware
Video Display Devices Cathode Ray Tube (CRT) Liquid Crystal Display (LCD) Plasma panels Thin-film electroluminescent display Light-emitting diodes (LED)
Hard-Copy Devices Ink-jet printer Laser printer Film recorder Electrostatic printer Pen plotter
![Page 4: Raster Graphics](https://reader035.fdocuments.in/reader035/viewer/2022062804/56814be1550346895db8bb92/html5/thumbnails/4.jpg)
CGVR
Graphics Lab @ Korea University
cgvr.korea.ac.kr
Cathode Ray Tube (CRT)
![Page 5: Raster Graphics](https://reader035.fdocuments.in/reader035/viewer/2022062804/56814be1550346895db8bb92/html5/thumbnails/5.jpg)
CGVR
Graphics Lab @ Korea University
cgvr.korea.ac.kr
Liquid Crystal Display (LCD)
![Page 6: Raster Graphics](https://reader035.fdocuments.in/reader035/viewer/2022062804/56814be1550346895db8bb92/html5/thumbnails/6.jpg)
CGVR
Graphics Lab @ Korea University
cgvr.korea.ac.kr
Raster Graphics
![Page 7: Raster Graphics](https://reader035.fdocuments.in/reader035/viewer/2022062804/56814be1550346895db8bb92/html5/thumbnails/7.jpg)
CGVR
Graphics Lab @ Korea University
cgvr.korea.ac.kr
Frame Buffer
![Page 8: Raster Graphics](https://reader035.fdocuments.in/reader035/viewer/2022062804/56814be1550346895db8bb92/html5/thumbnails/8.jpg)
CGVR
Graphics Lab @ Korea University
cgvr.korea.ac.kr
Frame Buffer Refresh
Refresh Rate Usually 30~75 Hz
![Page 9: Raster Graphics](https://reader035.fdocuments.in/reader035/viewer/2022062804/56814be1550346895db8bb92/html5/thumbnails/9.jpg)
CGVR
Graphics Lab @ Korea University
cgvr.korea.ac.kr
Color Frame Buffer
255 150 75 0
255 150 75 0
255 150 75 0
255 150 75 0
255 150 75 0
255 150 75 0
255 150 75 0
255 150 75 0
255 150 75 0
255 150 75 0
255 150 75 0
255 150 75 0
255 150 75 0
255 150 75 0
255 150 75 0
Blue channel
Green channel
Red channel
![Page 10: Raster Graphics](https://reader035.fdocuments.in/reader035/viewer/2022062804/56814be1550346895db8bb92/html5/thumbnails/10.jpg)
CGVR
Graphics Lab @ Korea University
cgvr.korea.ac.kr
Color CRT
![Page 11: Raster Graphics](https://reader035.fdocuments.in/reader035/viewer/2022062804/56814be1550346895db8bb92/html5/thumbnails/11.jpg)
CGVR
Graphics Lab @ Korea University
cgvr.korea.ac.kr
Contents
Display Hardware How are images display?
Raster Graphics Systems How are imaging system organized?
Output Primitives How can we describe shapes with primitives?
Color Models How can we describe and represent colors?
![Page 12: Raster Graphics](https://reader035.fdocuments.in/reader035/viewer/2022062804/56814be1550346895db8bb92/html5/thumbnails/12.jpg)
CGVR
Graphics Lab @ Korea University
cgvr.korea.ac.kr
Output Primitives
Points Lines
DDA Algorithm Bresenham’s Algorithm
Polygons Scan-Line Polygon Fill Inside-Outside Tests Boundary-Fill Algorithm Antialiasing
![Page 13: Raster Graphics](https://reader035.fdocuments.in/reader035/viewer/2022062804/56814be1550346895db8bb92/html5/thumbnails/13.jpg)
CGVR
Graphics Lab @ Korea University
cgvr.korea.ac.kr
Points
Single Coordinate Position Set the bit value(color code) corresponding to a
specified screen position within the frame buffer
x
ysetPixel (x, y)
![Page 14: Raster Graphics](https://reader035.fdocuments.in/reader035/viewer/2022062804/56814be1550346895db8bb92/html5/thumbnails/14.jpg)
CGVR
Graphics Lab @ Korea University
cgvr.korea.ac.kr
Lines
Intermediate Positions between Two Endpoints DDA, Bresenham’s line algorithms
Jaggies= Aliasing
![Page 15: Raster Graphics](https://reader035.fdocuments.in/reader035/viewer/2022062804/56814be1550346895db8bb92/html5/thumbnails/15.jpg)
CGVR
Graphics Lab @ Korea University
cgvr.korea.ac.kr
DDA Algorithm
Digital Differential Analyzer 0 < Slope <= 1
Unit x interval = 1
x1
y1
x2
y2
myy kk 1
![Page 16: Raster Graphics](https://reader035.fdocuments.in/reader035/viewer/2022062804/56814be1550346895db8bb92/html5/thumbnails/16.jpg)
CGVR
Graphics Lab @ Korea University
cgvr.korea.ac.kr
DDA Algorithm
Digital Differential Analyzer 0 < Slope <= 1
Unit x interval = 1
Slope > 1 Unit y interval = 1
x1
y1
x2
y2
mxx kk
11
![Page 17: Raster Graphics](https://reader035.fdocuments.in/reader035/viewer/2022062804/56814be1550346895db8bb92/html5/thumbnails/17.jpg)
CGVR
Graphics Lab @ Korea University
cgvr.korea.ac.kr
DDA Algorithm
Digital Differential Analyzer 0 < Slope <= 1
Unit x interval = 1
Slope > 1 Unit y interval = 1
-1 <= Slope < 0 Unit x interval = -1
myy kk 1
x1
y2
x2
y1
![Page 18: Raster Graphics](https://reader035.fdocuments.in/reader035/viewer/2022062804/56814be1550346895db8bb92/html5/thumbnails/18.jpg)
CGVR
Graphics Lab @ Korea University
cgvr.korea.ac.kr
DDA Algorithm
Digital Differential Analyzer Slope >= 1
Unit x interval = 1
0 < Slope < 1 Unit y interval = 1
-1 <= Slope < 0 Unit x interval = -1
Slope < -1 Unit y interval = -1
mxx kk
11
x1
y1
x2
y2
![Page 19: Raster Graphics](https://reader035.fdocuments.in/reader035/viewer/2022062804/56814be1550346895db8bb92/html5/thumbnails/19.jpg)
CGVR
Graphics Lab @ Korea University
cgvr.korea.ac.kr
Bresenham’s Line Algorithm
Midpoint Line Algorithm Decision variable
d > 0 : choose NE
: dnew= dold+a+b
d <= 0 : choose E : dnew= dold+a
NE
MQ
cybxa
yxF
MFd
pp
pp
2
11
2
1,1
2
3,2 ppnew yxFd
2
1,2 ppnew yxFd
P(xp, yp) E
![Page 20: Raster Graphics](https://reader035.fdocuments.in/reader035/viewer/2022062804/56814be1550346895db8bb92/html5/thumbnails/20.jpg)
CGVR
Graphics Lab @ Korea University
cgvr.korea.ac.kr
Bresenham’s Algorithm(cont.)
Initial Value of d
Update d
bayxF
cybxayxF
2
1,
2
11
2
1,1
00
0000
cbyaxyxF 2,
bad 2
2
,
,
then ,0 if
bad
y
x
d 2
, then ,0 if
ad
xd