1.1 POINTS & LINE - Output Primitive
1.1 POINTS & LINE - Output Primitive
Output Primitives
Unit: I Drawing Line, Circle and
Ellipse
Dr.M.Manimaran,
Associate Professor,
Department Computer Science, SKACAS
oefqdki - Graphics & Multimedia Unit I Output Primitives 1
Computer Science III B.Sc CS Sem : VI Year 2019 - 2020
Lecture Agenda
• Introduction to Primitives
– Bresenham’s Algorithm
Expected outcome
After studying this class, you should be able to:
Introduction
• For a raster display, a picture is completely specified
by:
• intensity and position of pixels, or/and
• set of complex objects
Introduction
• Output primitives are the basic geometric structures
which facilitate or describe a scene/picture. Example
of these include:
Points
• A point is shown by
illuminating a pixel
on the screen
Lines
• A line segment is completely defined in terms
of its two endpoints.
• A line segment is thus defined as:
Line_Seg = { (x1, y1), (x2, y2) }
Lines
y
• A line is
produced by
means of
illuminating a
y2
set of
intermediary
pixels between y1
the two
endpoints.
x
x1 x2
Lines
• Lines is digitized into a set of discrete integer
positions that approximate the actual line path.
• Example: A computed line position of (10.48, 20.51)
is converted to pixel position (10, 21).
Line
• The rounding of coordinate values to integer causes
all but horizontal and vertical lines to be displayed
with a stair step appearance “the jaggies(informal
name for artifacts in raster images)”.
Key Points
• Output Primitives
• Pixel
• Points
• Lines
• End points
• Curves
MCQ
1. The basic attributes of a straight line segment
are
a) Type
b) Width
c) Color
d) All of these
MCQ
2. A dashed line could be displayed by
generating_________.
a) Inter dash spacing
b) Very short dashes
c) Botha a and b
d) A or B
MCQ
3. A dotted line can be displayed by generating
a) Very short dashes with spacing equal to and greater
than dash size
b) Very long dashes with spacing equal to or greater
than dash size
c) Very short dashes with spacing equal to and greater
than dash size
d) Dots
MCQ
4. Which of the following is not a line-type?
a) Dashed line
b) Dark line
c) Dotted line
d) Only b
MCQ
5). The algorithm which displays line-type attributes
by plotting pixel spans is
a) Raster line algorithm
b) Raster scan algorithm
c) Random line algorithm
d) Random scan algorithm
MCQ ANSWERS
1) Answer: d
Explanation: Type, width and colors are the basic
attributes of line.
2) Answer: a
Explanation: The inter dash spacing that is equal to
the length of the solid sections displays dashed line.
MCQ ANSWERS
3) Answer: c
Explanation: Very long dashes with spacing equal to or
greater than dash size can displays dotted line.
4) Answer: d
Explanation: Except dark line those are the types of the
line.
5) Answer: a
Explanation: Raster line algorithm displays line-
type attributes.
Next Lecture
LINE DRAWING ALGORITHMS
Video URL
https://www.youtube.com/watch?v=yZIyWA08s
J4
DISCUSSIONS