Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 20

Graphics

Raster Graphics

고려대학교 컴퓨터 그래픽스 연구실

cgvr.korea.ac.kr Graphics Lab @ Korea University


Contents
CGVR

 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?

cgvr.korea.ac.kr Graphics Lab @ Korea University


Display Hardware
CGVR

 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
cgvr.korea.ac.kr Graphics Lab @ Korea University
Cathode Ray Tube (CRT)
CGVR

cgvr.korea.ac.kr Graphics Lab @ Korea University


Liquid Crystal Display (LCD)
CGVR

cgvr.korea.ac.kr Graphics Lab @ Korea University


Raster Graphics
CGVR

cgvr.korea.ac.kr Graphics Lab @ Korea University


Frame Buffer
CGVR

cgvr.korea.ac.kr Graphics Lab @ Korea University


Frame Buffer Refresh
CGVR

 Refresh Rate
 Usually 30~75 Hz

cgvr.korea.ac.kr Graphics Lab @ Korea University


Color Frame Buffer
CGVR

255 150 75 0
255 255
150 150
75 750 0
255 255
150 150
75 750
255 150 750 0
255 255
150 150
75 750
255 150 750 0
255 255
150 150
75 750
255 150 750 0
255 255
150 150
75 750 Blue channel
0
255 150 75 0 Green channel
Red channel

cgvr.korea.ac.kr Graphics Lab @ Korea University


Color CRT
CGVR

cgvr.korea.ac.kr Graphics Lab @ Korea University


Contents
CGVR

 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?

cgvr.korea.ac.kr Graphics Lab @ Korea University


Output Primitives
CGVR

 Points
 Lines
 DDA Algorithm
 Bresenham’s Algorithm
 Polygons
 Scan-Line Polygon Fill
 Inside-Outside Tests
 Boundary-Fill Algorithm
 Antialiasing

cgvr.korea.ac.kr Graphics Lab @ Korea University


Points
CGVR

 Single Coordinate Position


 Set the bit value(color code) corresponding to a
specified screen position within the frame buffer

y
setPixel (x, y)

cgvr.korea.ac.kr Graphics Lab @ Korea University


Lines
CGVR

 Intermediate Positions between Two Endpoi


nts
 DDA, Bresenham’s line algorithms

Jaggies
= Aliasing

cgvr.korea.ac.kr Graphics Lab @ Korea University


DDA Algorithm
CGVR

 Digital Differential Analyzer


 0 < Slope <= 1
 Unit x interval = 1

y2
y1

x1 x2

yk 1  yk  m

cgvr.korea.ac.kr Graphics Lab @ Korea University


DDA Algorithm
CGVR

 Digital Differential Analyzer


 0 < Slope <= 1
 Unit x interval = 1

 Slope > 1 y2
 Unit y interval = 1

y1
x1 x2
1
xk 1  xk 
m

cgvr.korea.ac.kr Graphics Lab @ Korea University


DDA Algorithm
CGVR

 Digital Differential Analyzer


 0 < Slope <= 1
 Unit x interval = 1

 Slope > 1 y1
 Unit y interval = 1
y2
 -1 <= Slope < 0
 Unit x interval = -1
x1 x2

yk 1  yk  m

cgvr.korea.ac.kr Graphics Lab @ Korea University


DDA Algorithm
CGVR

 Digital Differential Analyzer


 Slope >= 1
 Unit x interval = 1

 0 < Slope < 1 y2


 Unit y interval = 1

 -1 <= Slope < 0 y1


 Unit x interval = -1
x1 x2
 Slope < -1 1
 Unit y interval = -1 xk 1  xk 
m

cgvr.korea.ac.kr Graphics Lab @ Korea University


Bresenham’s Line Algorithm
CGVR

 Midpoint Line Algorithm


 Decision variable
d  FM 
 1 NE
 F  x p  1, y p  
 2 Q
M
 a  x p  1  b y p    c
 1
 2
P(xp, yp) E
 d > 0 : choose NE
 3
 d new  F  x p  2, y p   : d = d +a+b
 2 new old

 d <= 0 : choose E
 1
 d new  F  x p  2, y p   : dnew= dold+a
 2
cgvr.korea.ac.kr Graphics Lab @ Korea University
Bresenham’s Algorithm(cont.)
CGVR

 Initial Value of d
 1  1
F  x0  1, y0    a x0  1  b y0    c
 2  2
1
 F  x0 , y0   a  b
2
 F  x, y   2 ax  by  c 
 d  2a  b

 Update d
 x  ,
  x  ,
if d  0, then  y  , if d  0, then 
d   2 a  b  d   2 a

cgvr.korea.ac.kr Graphics Lab @ Korea University

You might also like