Sie sind auf Seite 1von 21

GRAPHICS DEVICES AND

OUTPUT PRIMITIVES
J.J. ADRI JOVIN
Assistant Professor
Department of Information Technology
Sri Ramakrishna Institute of Technology

Raster Scan Displays

J.J. ADRI JOVIN, Assistant Professor, Dept.
of IT, SRIT
2
Architecture

J.J. ADRI JOVIN, Assistant Professor, Dept.
of IT, SRIT
3
Random Scan Displays

J.J. ADRI JOVIN, Assistant Professor, Dept.
of IT, SRIT
4
Architecture

J.J. ADRI JOVIN, Assistant Professor, Dept.
of IT, SRIT
5
Color CRT Monitor

J.J. ADRI JOVIN, Assistant Professor, Dept.
of IT, SRIT
6

J.J. ADRI JOVIN, Assistant Professor, Dept.
of IT, SRIT
7
Flat Panel Displays

J.J. ADRI JOVIN, Assistant Professor, Dept.
of IT, SRIT
8
Input Devices
J.J. ADRI JOVIN, Assistant Professor, Dept.
of IT, SRIT
9
Trackball
J.J. ADRI JOVIN, Assistant Professor, Dept.
of IT, SRIT
10
Space ball

J.J. ADRI JOVIN, Assistant Professor, Dept.
of IT, SRIT
11
Joystick

J.J. ADRI JOVIN, Assistant Professor, Dept.
of IT, SRIT
12
Image Scanner

J.J. ADRI JOVIN, Assistant Professor, Dept.
of IT, SRIT
13
Touch Panel

J.J. ADRI JOVIN, Assistant Professor, Dept.
of IT, SRIT
14
Light Pen

J.J. ADRI JOVIN, Assistant Professor, Dept.
of IT, SRIT
15
Points and Lines

setpixel(x,y) load a specified color point in
the location specified by x and y

getpixel(x,y) retrieve the current frame
buffer intensity
J.J. ADRI JOVIN, Assistant Professor, Dept.
of IT, SRIT
16
Line drawing algorithms
J.J. ADRI JOVIN, Assistant Professor, Dept.
of IT, SRIT
17
c x m y .
1 2
1 2
x x
y y
m

1 1
x m y c
m
y
x


x m y
DDA Algorithm
Digital Differential Analyzer
Consider positive slope and the slope is less
than or equal to 1.
We sample at unit x interval

For lines with positive slope, greater than 1,
the roles of x and y are reversed

J.J. ADRI JOVIN, Assistant Professor, Dept.
of IT, SRIT
18
m y y
k k

1
m
x x
k k
1
1

DDA Algorithm (Contd..)


If the process start from right end point, we
have
Therefore

Similarly, for slope greater than 1,


J.J. ADRI JOVIN, Assistant Professor, Dept.
of IT, SRIT
19
1 x
m y y
k k

1
m
x x
k k
1
1

DDA Algorithm (Contd..)



J.J. ADRI JOVIN, Assistant Professor, Dept.
of IT, SRIT
20
Bresenham Line Drawing Algorithm

J.J. ADRI JOVIN, Assistant Professor, Dept.
of IT, SRIT
21

1. Input the two line endpoints and store the left endpoint in ) , (
0 0
y x .
2. Load ) , (
0 0
y x into the frame buffer; that is, plot the first point.
3. Calculate constants , 2 , , y y x and x y 2 2 and obtain the starting value for the
decision parameter as
x y p 2
0

4. At each
k
x ,along the line, starting at 0 k ,perform the following test. If 0
k
p , the
next point to plot is ) , 1 (
k k
y x and
y p p
k k

2
1

Otherwise, the next point to plot is ) 1 , 1 (
k k
y x and
x y p p
k k

2 2
1

5. Repeat step 4 x times.

Das könnte Ihnen auch gefallen