Graphic Devices and Output Primitives

November 13, 2016 | Author: Adri Jovin | Category: N/A
Share Embed Donate


Short Description

UNIT II: Graphic Devices and Output Primitives Display devices-raster scan and random scan displays, color CRT monitors...

Description

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

y  m.x  c y 2  y1 m x 2  x1 y x  m

c  y1  m  x1

y  mx

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

17

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

• For lines with positive slope, greater than 1, the roles of x and y are reversed 1 xk 1  xk  m

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

18

DDA Algorithm (Contd..) • If the process start from right end point, we have x  1 • Therefore

yk 1  yk  m

• Similarly, for slope greater than 1, 1 xk 1  xk  m J.J. ADRI JOVIN, Assistant Professor, Dept. of IT, SRIT

19

DDA Algorithm (Contd..)

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

20

Bresenham Line Drawing Algorithm 1. Input the two line endpoints and store the left endpoint in ( x0 , y0 ) . 2. Load ( x0 , y0 ) into the frame buffer; that is, plot the first point. 3. Calculate constants x, y,2y, and 2y  2x and obtain the starting value for the decision parameter as

p0  2y  x 4. At each x k ,along the line, starting at k  0 ,perform the following test. If p k  0 , the next point to plot is ( xk  1, y k ) and

pk 1  pk  2y Otherwise, the next point to plot is ( xk  1, y k  1) and

pk 1  pk  2y  2x 5. Repeat step 4 x times.

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

21

View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF