Attributes of Output
Primitives
Structure :
Definition
Line Attribute
Curve Attribute
Color and Grayscale Level
Area Filled Attribute
Text and Characters
The way a primitive is to be displayed is referred to as an
Attribute Parameter.
Some attribute parameters include color ,size etc.
Different ways to incorporate attribute changes :
 Extend the parameter list associated with each
primitive
 Maintain a system list of current attribute values and
use separate functions to set attributes.
Introduction
Attributes of Line
. Type
. Width
. Color
. Pen & Brush
Type :
 Solid
 Dotted – very short dash with spacing equal to or greater than dash
itself
 Dashed – displayed by generating an inter dash spacing
Dash Dotted –combination of the earlier two
To set line type attribute in PHIGS Application,
setLineType(lt) can be used. Lt can be -1,2,3,4
Attributes of Line
Raster Line algorithms display line attributes by plotting pixel spans.
Pixel count for the span and inter span length and inter span spacing can
be specified using the mask .
Ex. 111100011110001111
Plotting dashes with fixed number of pixels result in unequal-length
dashes for different line orientations. Horizontal line looks small when
compared to a vertical line.
For dash lines to remain constant, we should adjust the pix span el count
for the solid span and inter space span according to the slope of the line.
Attributes of Line
Line Width
Specify in pixels and proportion of a standard line width.
Thicker line can be produced by.
. Adding extra pixel vertically when |m| < 1
. Adding extra pixel horizontally when |m| > 1
We can set the width of a line using
setLineWidthScaleFactor(lw);
Where lw is assigned a positive number.
Line Width
Issues:
Line have different thickness on the slope
Problem with
. End of the line (Use Line Caps)
. Joining the two lines (polygon)
Line Width
Line Width
Pen and Brush Options
The selected “pen” or “brush” determine the way a line will be
drawn.
Pens and brushes have size, shape, color and pattern attribute.
Pixel mask is applied in both of them.
Line Color
A polyline procedure displays a line in current color by setting this color
value in the frame buffer at pixel locations along the line path using the
set Pixel function.
setPolyLineColorIndex(lc)
A line drawn with background color in invisible.
Curve Attributes
Similar to line : type + width
Thicker curves can be produced by:
1. Plotting additional pixel
2. Filling the space between two concentric circles.
3. Using thicker pen or brush
Curve Attributes
Curve Attributes
Color and GreyScale Levels
Color
 General Purpose raster scan systems provide a variety of colors
while random scan monitors provide very few.
 Colors are represented by colors codes which are positive
integers.
 Color information is stored in frame buffer or in separate table
and use pixel values as index to the color table.
 Two ways to store color information :
1. Direct
2. Indirect
Direct : Color Lookup Table
Color Lookup Table
GrayScale
Apply for monitor that have no color
Shades of grey (white->light grey->dark grey->black)
Color code mapped onto grayscale codes
2 bits can give 4 level of grayscale
8 bits per pixel will allow 256 combination
Dividing the actual code with 256 will give range of 0 and 1
Ex:
Color code in color display is 118
To map to nearest grayscale then
118/256 = 0.45
 light gray
Area Fill Attributes
Option for filling a defined region is whether solid , pattern and
colors.
Fill Styles
Three basic fill styles are:
1. Hollow with color border
2. Solid
3. Patterened
Area Fill Attributes
Area Fill Attributes
A basic fill style can be assigned in a PHIGS program using the
following function:
setInteriorStyle(fs),
Where fs c an be hollow,s olid,or pattern .
Another value for Fill Style is Hatch, which is used to fill an area
with selected hatching patterns.2 types :
Diagonal Hatch Fill and Diagonal Cross Hatch Fill.
Area Fill Attributes
The color for a solid interior or for a hollow area outline is chosen
with :
setInteriorColorIndex(fc) where fc is the desired color code.
Other fill options include specifications for the edge type, edge
width edge color of a region.
Pattern Fill
We select fill patterns with
setInteriorStyleIndex(pi), where pi specifies a table position
For fill style pattern, tables entries can be created on individual
output devices with :
setPatternRepresentation (ws,pi,nx,ny,cp)
Where,
pi is pattern index number,
ws is the workstation code,
Cp is the 2d array of color codes with nx columns and ny rows.

computergraphics-chapter4-140412075158-phpapp02.pptx

  • 1.
    Attributes of Output Primitives Structure: Definition Line Attribute Curve Attribute Color and Grayscale Level Area Filled Attribute Text and Characters
  • 2.
    The way aprimitive is to be displayed is referred to as an Attribute Parameter. Some attribute parameters include color ,size etc. Different ways to incorporate attribute changes :  Extend the parameter list associated with each primitive  Maintain a system list of current attribute values and use separate functions to set attributes. Introduction
  • 3.
    Attributes of Line .Type . Width . Color . Pen & Brush
  • 4.
    Type :  Solid Dotted – very short dash with spacing equal to or greater than dash itself  Dashed – displayed by generating an inter dash spacing Dash Dotted –combination of the earlier two To set line type attribute in PHIGS Application, setLineType(lt) can be used. Lt can be -1,2,3,4 Attributes of Line
  • 5.
    Raster Line algorithmsdisplay line attributes by plotting pixel spans. Pixel count for the span and inter span length and inter span spacing can be specified using the mask . Ex. 111100011110001111 Plotting dashes with fixed number of pixels result in unequal-length dashes for different line orientations. Horizontal line looks small when compared to a vertical line. For dash lines to remain constant, we should adjust the pix span el count for the solid span and inter space span according to the slope of the line. Attributes of Line
  • 6.
    Line Width Specify inpixels and proportion of a standard line width. Thicker line can be produced by. . Adding extra pixel vertically when |m| < 1 . Adding extra pixel horizontally when |m| > 1 We can set the width of a line using setLineWidthScaleFactor(lw); Where lw is assigned a positive number.
  • 7.
    Line Width Issues: Line havedifferent thickness on the slope Problem with . End of the line (Use Line Caps) . Joining the two lines (polygon)
  • 8.
  • 9.
  • 10.
    Pen and BrushOptions The selected “pen” or “brush” determine the way a line will be drawn. Pens and brushes have size, shape, color and pattern attribute. Pixel mask is applied in both of them.
  • 11.
    Line Color A polylineprocedure displays a line in current color by setting this color value in the frame buffer at pixel locations along the line path using the set Pixel function. setPolyLineColorIndex(lc) A line drawn with background color in invisible.
  • 12.
    Curve Attributes Similar toline : type + width Thicker curves can be produced by: 1. Plotting additional pixel 2. Filling the space between two concentric circles. 3. Using thicker pen or brush
  • 13.
  • 14.
  • 15.
    Color and GreyScaleLevels Color  General Purpose raster scan systems provide a variety of colors while random scan monitors provide very few.  Colors are represented by colors codes which are positive integers.  Color information is stored in frame buffer or in separate table and use pixel values as index to the color table.  Two ways to store color information : 1. Direct 2. Indirect
  • 16.
    Direct : ColorLookup Table
  • 17.
  • 18.
    GrayScale Apply for monitorthat have no color Shades of grey (white->light grey->dark grey->black) Color code mapped onto grayscale codes 2 bits can give 4 level of grayscale 8 bits per pixel will allow 256 combination Dividing the actual code with 256 will give range of 0 and 1 Ex: Color code in color display is 118 To map to nearest grayscale then 118/256 = 0.45  light gray
  • 19.
    Area Fill Attributes Optionfor filling a defined region is whether solid , pattern and colors. Fill Styles Three basic fill styles are: 1. Hollow with color border 2. Solid 3. Patterened
  • 20.
  • 21.
    Area Fill Attributes Abasic fill style can be assigned in a PHIGS program using the following function: setInteriorStyle(fs), Where fs c an be hollow,s olid,or pattern . Another value for Fill Style is Hatch, which is used to fill an area with selected hatching patterns.2 types : Diagonal Hatch Fill and Diagonal Cross Hatch Fill.
  • 22.
    Area Fill Attributes Thecolor for a solid interior or for a hollow area outline is chosen with : setInteriorColorIndex(fc) where fc is the desired color code. Other fill options include specifications for the edge type, edge width edge color of a region.
  • 23.
    Pattern Fill We selectfill patterns with setInteriorStyleIndex(pi), where pi specifies a table position For fill style pattern, tables entries can be created on individual output devices with : setPatternRepresentation (ws,pi,nx,ny,cp) Where, pi is pattern index number, ws is the workstation code, Cp is the 2d array of color codes with nx columns and ny rows.