Attributes of Output Primitives
Attributes of Output Primitives
INTRODUCTION
12/19/2014
12/19/2014
OUTPUT PRIMITIVES:
12/19/2014
LINE DRAWING
It is accomplished by calculating intermediate positions along the
line path between two specified end points positions.
An output device is then directed to fill in these positions between
the end points
12/19/2014
DEFINITION
Any parameter that affects the way a primitive is to be displayed is
referred to as an attribute parameter.
LINE ATTRIBUTE
CURVE ATTRIBUTE
12/19/2014
LINE ATTRIBUTES
Basic attributes of a straight line segment are its type, its width, and its
color.
Line Type
Line Width
Line Color
12/19/2014
LINE TYPE
To set line type a user invokes the function
setLinetype (lt)
Integer value- 1
Solid line
Integer value- 2
Dashed line
Integer value- 3
Dotted line
12/19/2014
LINE WIDTH
To set the line width attributes.
setLinewidthScaleFactor(lw)
Line width parameter lw is assigned a positive number
A value of 1 specifies a standard width line.
Values greater than 1 produce lines thicker than the standard.
12/19/2014
LINE CAP
Adjust the shape of the line ends to give them a better appearance by adding
line caps.
There are three types of line cap. They are
Butt cap - displayed with square ends that are perpendicular to the line path.
12/19/2014
12/19/2014
10
LINE JOINS
Three possible methods for smoothly joining two line segments
Mitter Join - extending the outer boundaries of each of the two lines until
they meet
Round Join - capping the connection between the two segments with a
circular boundary whose diameter is equal to the width
Bevel Join - displaying the line segment with but caps and filling in
12/19/2014
11
12/19/2014
12
12/19/2014
13
CURVE ATTRIBUTE
Similar to line : type + width
Curves displayed with varying colors, widths, dot dash patterns and available
pen or brush options
12/19/2014
14
12/19/2014
COLOR
Direct
12/19/2014
16
COLOR
Indirect
12/19/2014
17
12/19/2014
18
12/19/2014
19
Ex:
Color code in color display is 118
To map to nearest grayscale then
118/256 = 0.45
light gray
12/19/2014
20
Fill Styles
Three basic fill styles are:
Hollow with color border.
Interior color is same with background
Pattern
12/19/2014
21
12/19/2014
22
12/19/2014
23
12/19/2014
24
12/19/2014
25