raster display(1)

Post on 13-Jan-2015

583 Views

Category:

Education

2 Downloads

Preview:

Click to see full reader

DESCRIPTION

 

TRANSCRIPT

Graphics

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

Raster Graphics

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

cgvr.korea.ac.kr

CGVR

Graphics Lab @ Korea University

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?

cgvr.korea.ac.kr

CGVR

Graphics Lab @ Korea University

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

cgvr.korea.ac.kr

CGVR

Graphics Lab @ Korea University

Cathode Ray Tube (CRT)

cgvr.korea.ac.kr

CGVR

Graphics Lab @ Korea University

Liquid Crystal Display (LCD)

cgvr.korea.ac.kr

CGVR

Graphics Lab @ Korea University

Raster Graphics

cgvr.korea.ac.kr

CGVR

Graphics Lab @ Korea University

Frame Buffer

cgvr.korea.ac.kr

CGVR

Graphics Lab @ Korea University

Frame Buffer Refresh

Refresh Rate Usually 30~75 Hz

cgvr.korea.ac.kr

CGVR

Graphics Lab @ Korea University

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

cgvr.korea.ac.kr

CGVR

Graphics Lab @ Korea University

Color CRT

cgvr.korea.ac.kr

CGVR

Graphics Lab @ Korea University

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?

cgvr.korea.ac.kr

CGVR

Graphics Lab @ Korea University

Output Primitives

Points Lines

DDA Algorithm Bresenham’s Algorithm

Polygons Scan-Line Polygon Fill Inside-Outside Tests Boundary-Fill Algorithm Antialiasing

cgvr.korea.ac.kr

CGVR

Graphics Lab @ Korea University

Points

Single Coordinate Position Set the bit value(color code) corresponding to a

specified screen position within the frame buffer

x

ysetPixel (x, y)

cgvr.korea.ac.kr

CGVR

Graphics Lab @ Korea University

Lines

Intermediate Positions between Two Endpoints DDA, Bresenham’s line algorithms

Jaggies= Aliasing

cgvr.korea.ac.kr

CGVR

Graphics Lab @ Korea University

DDA Algorithm

Digital Differential Analyzer 0 < Slope <= 1

Unit x interval = 1

x1

y1

x2

y2

myy kk 1

cgvr.korea.ac.kr

CGVR

Graphics Lab @ Korea University

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

cgvr.korea.ac.kr

CGVR

Graphics Lab @ Korea University

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

cgvr.korea.ac.kr

CGVR

Graphics Lab @ Korea University

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

cgvr.korea.ac.kr

CGVR

Graphics Lab @ Korea University

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

cgvr.korea.ac.kr

CGVR

Graphics Lab @ Korea University

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

top related