1. Attributes of Output Primitives
Any parameter that affects the way a primitive is to be display is referred to as an
attribute parameter.
Some attribute parameters such as Color and Size
Line Attributes
1. Line Type
Line type Attributes are solid lines, dashed lines and dotted lines.
We modify a line drawing algorithm to generate such lines by setting the length and
spacing of displayed solid sections along the line path.
Function: setlineType(lt)
lt is assigned a positive integer of 1-Solid, 2-Dashed, 3-Dotted, 4-Dash dotted
Raster line algorithm display linetype attributes by plotting pixel spans.
Pixel counts for the span length and interspan spacing can be specified in a pixel mask,
which is a string containing the digits 1 and 0.
2. Line Width
Implementation of line width options depends on the capabilities of the output device.
Line width determines the thickness of line.
Function: setlineWidthScaleFactor(lw)
Lw is assigned positive integer of 1-standard line, 0.5- half of the standard line, >1-
thickness than the standard line.
Thickness lines are generated quickly by plotting horizontal or vertical pixel spans
Line caps
Adjusting the shape of the line ends to give them a better appearance.
2. Butt cap : Adjusting the endpoints of the component parallel lines. So that the thick line
is display with square ends that as perpendicular to the line path.
Round cap: Adding a filled semi circle to each butt caps.
Projecting Square cap: Extend the line and add butt caps.
Three possible methods for smoothly joining the two line segments of poly lines.
Mitter join : Extending the outer boundaries of each of the two lines until they meet.
Round join : Caping the connection between the two segments with a circular boundary
who diameter is equal to the line width.
Bevel join : Displaying the line segments with butt caps and filling in the triangular cap
where the segments meet.
3. 3. Pen and Brush Options
Lines generated with pen or brush shapes can be displayed in various widths by changing
the size of the mask.
Options in this category include shape, size and pattern.
4. Line Color
When a system provides color options, a parameter giving the current color index is
included in the list of system attribute values.
The number of color choices depends on the number of bits available per pixel in the
frame buffer.
Function: setPolylineColourIndex(lc);
Area Fill Attributes
Options for filling a defined region include choice between a solid color or patterned fill.
1. Fill styles
Areas are display with three basic fill styles.
• Hollow with color border
• Filled with a solid color
• Filled with a specified pattern or design
5. Another value for fill style hatch, which is used to fill a area with selected hatching
patterns(parallel lines or crossed lines)
Function for choose color for solid interior or Hollow area
setInteriorColourIndex(fc)
2. Pattern Fill
We select fill patters with function setInteriorStyleIndex(pi)
Where pattern index parameter pi specifies a table position. We use the function
setPatternRepresentation(ws,pi,nx,ny,cp)
Where cp is two dimensional array of color codes with nx columns and ny rows, ws is
workstation, pi is patternindex.
Example setPatternRepresentation(1,1,2,2,cp)
4 0
0 4
The process of filling an area with a rectangular pattern is called tiling.
3. Soft fill
Fill color is combined with the background colors are referred to as soft fill or tint fill
algorithms.
Linear soft fill algorithm repaints an area that was originally painted by merging a
foreground color F with a single Background color B, where F not equal to B
Function: p=tF+(1-t)B
Where t is transparency factor value between 0 and 1 for each pixel.
6. T can be calculated using on of the RGB Components.
T=(Pk –Bk)/ (Fk-Bk)
Where k= R, G, or B and Fk not equal to Bk
We can minimize the round off error by selecting the component with the largest
difference between F and B.
Soft fill procedures can be applied to an area whose foreground color is to be merged
with multiple background color areas such as checkered pattern.
Function : P= t0F + t1B1+(1-t0-t1)B2
Character Attributes
The appearance of displayed characters is controlled by attributes such as font, size, color
and orientation.
1. Text Attributes
i. Choice of font (or typeface), which is a set of characters with a particular design style
such as courier, arial, times new roman, etc.
The characters is a selected for can also be displayed with assorted underlying styles
(solid,dotted,double) in boldface, in italics.
Function: setTextFont(tf)
7. ii. Color settings for displayed text are stored in the system attribute list and used by the
procedure the load character definition into the framebuffer.
Function: setTextColourIndex(tc)
iii. we can adjust text size by scalling the overall dimensions ( height and width) of
characters or by scaling only the character width.
1 point = 0.013837 inch
Text size can be adjusted using the Function setCharacterHeight(ch).
The width only of text can be set with the function setCharacterExpansionFactor(cw).
Spacing between Characters is controlled separately with setChatacterSpacing(cs).
iv. The Orientation for a displayed character string is set according to the direction of the
character upvector: Function: setCharacterUpVector(upvect)
where upvect is the orientation from base line (x) to cap line (y)
Example : upvect(1,1,) – the direction of the up vector is 450
v. Text path function : setTextpath(tp) where tp- right, left ,up or down
8. vi. Text Alignment – Function : setTExtAlignment(h,v)
h-horizantal alignment(left, center and right)
v-vertical alignment( top, cap, half, base and bottom)
vii. Precision
for this precision setting greater detail would be used in defining the character shape.
Lowest quality precision setting, string is used for faster display of character strings.
Function : setTextPrecision(tpr). Where tpr= string, character and stroke.
9. Marker Attributes
A marker symbol is a single character that can be displayed a different colors and in
different sizes.
i. Maker type
we select a particular character to be the marker symbol with the function
set MakerType(mt) where 1- dot(.), 2-vertical cross(+), 3- Asterisk(*), 4-Circle(o), 5-
Diagonal cross (X)
ii. size
setMakerSize ScaleFactor(ms)
iii. Color
setPolymarkerColourIndex(mc).
10. Marker Attributes
A marker symbol is a single character that can be displayed a different colors and in
different sizes.
i. Maker type
we select a particular character to be the marker symbol with the function
set MakerType(mt) where 1- dot(.), 2-vertical cross(+), 3- Asterisk(*), 4-Circle(o), 5-
Diagonal cross (X)
ii. size
setMakerSize ScaleFactor(ms)
iii. Color
setPolymarkerColourIndex(mc).