Chapter 4 Attribute of Output Primitives 3092008 Lecture
Chapter 4 Attribute of Output Primitives 30/9/2008 Lecture 2 1
Attribute of Output Primitives • • • Definition Point Attribute Line Attribute Curve Attribute COLOR AND GRAY SCALE LEVEL AREA FILLED ATTRIBUTE 30/9/2008 Lecture 2 2
Attributes of Output Primitives • Definition Parameter that affects the way a primitive will be displayed Point Attribute • Color • Size 30/9/2008 Lecture 2 3
Line Attribute • Type • Width • Color • Pen & Brush 30/9/2008 Lecture 2 4
Line Attribute Type Solid Dotted – very short dash with spacing equal to or greater than dash itself Dashed – displayed by generating an inter dash spacing Pixel count for the span and inter span length is specified by the mask. Ex. 11110001111 30/9/2008 Lecture 2 5
Line Attribute 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 • Issues: Line have different thickness on the slope Problem with: 1. End of the line 30/9/2008 Lecture 2 2. Joining the two lines (polygon) 6
Line Attribute Width 30/9/2008 Lecture 2 7
Attributes of Output Primitives 30/9/2008 Lecture 2 8
Attributes of Output Primitives 30/9/2008 Lecture 2 9
Line Attribute Pen and Brush • • The selected “pen” or “brush” determine the way a line will be drawn. Pens and brushes have size, shape, color and pattern attribute. 30/9/2008 Lecture 2 10
Curve Attribute 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 30/9/2008 Lecture 2 11
Curve Attribute Width 30/9/2008 Lecture 2 12
COLOR AND GRAY SCALE LEVEL Color q Colors are represented by colors codes which are positive integers. q Color information is stored in frame buffer or in separate table and use pixel values as index to the color table. q Two ways to store color information : 1. Direct 2. Indirect 30/9/2008 Lecture 2 13
COLOR Direct 30/9/2008 Lecture 2 14
COLOR Indirect 30/9/2008 Lecture 2 15
COLOR Lookup Table 30/9/2008 Lecture 2 16
COLOR Lookup Table 30/9/2008 Lecture 2 17
GRAY SCALE LEVEL • Apply for monitor that have no color • Shades of grey (white->light grey->dark grey->black) • Color code mapped onto gray scale codes • 2 bits can give 4 level of gray scale • 8 bits per pixel will allow 256 combination (color) • Dividing the actual code with 255 will give range of 0 and 1 Ex: Color code in color display is 118 To map to nearest gray scale then 118/256 = 0. 45 30/9/2008 light gray Lecture 2 18
AREA FILLED ATTRIBUTE • Option for filling a defined region is whether solid/pattern and colors. Fill Styles: • Three basic fill styles are: 1. hollow with color border : interior color is same with background 30/9/2008 Lecture 2 19
AREA FILLED ATTRIBUTE 2. Filled with a solid color : color up to and including the border 3. Pattern control by other table/array 30/9/2008 Lecture 2 20
Character Attributes • • Font Size Color Orientation 30/9/2008 Lecture 2 21
- Slides: 21