SlideShare a Scribd company logo
1 of 33
30/9/2008 Lecture 2 1
Computer Graphics
Department of nskinfo-i education
&
www.nsksofttech.com
CS2401
TOPIC: Attributes of output
primitives
30/9/2008 Lecture 2 2
UNIT-1
Attribute of Output Primitives
CS2401-Computer Graphics
30/9/2008 Lecture 2 3
Attribute of Output Primitives
• Definition
• Line Attribute
• Curve Attribute
• COLOR AND GRAY SCALE LEVEL
• AREA FILLED ATTRIBUTE
• Text and Characters
30/9/2008 Lecture 2 4
Attributes of Output Primitives
Definition
Parameter that affects the way a primitive will be
displayed
Line Attribute
. Type
. Width
. Color
. Pen & Brush
30/9/2008 Lecture 2 5
Line Attribute
Type
. Solid
. Dotted – very short dash with spacing equal to
or greater than dash itself
. Dashed – displayed by generating an interdash
spacing
Pixel count for the span and interspan length is specified
by the mask . Ex. 111100011110001111
Note : Fixed pixel with dashes can produce unequal length
dashes. It depend on line orientation. So, need to adjust the
number of plotted pixels for different slopes.
30/9/2008 Lecture 2 6
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
. End of the line
. Joining the two lines (polygon)
30/9/2008 Lecture 2 7
Line Attribute
Width
30/9/2008 Lecture 2 8
Attributes of Output Primitives
30/9/2008 Lecture 2 9
Attributes of Output Primitives
30/9/2008 Lecture 2 10
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.
. Pixel mask is applied in both of them.
30/9/2008 Lecture 2 11
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 12
Curve Attribute
Width
30/9/2008 Lecture 2 13
COLOR AND GRAY SCALE LEVEL
Color
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
30/9/2008 Lecture 2 14
COLOR
Direct
30/9/2008 Lecture 2 15
COLOR
Indirect
30/9/2008 Lecture 2 16
COLOR
Exercise:
What is the size of frame buffer required for the following cases:
Case 1 (Direct): Resolution of 1024 * 1024 with 24 bits per
pixel
Case 2 (Indirect): Same resolution with 8 bit per pixel that
indexed out of 16 million available colors
Conclusion
CLUT is good for storage but cant give a very high resolution
picture.
30/9/2008 Lecture 2 17
COLOR Lookup Table
30/9/2008 Lecture 2 18
COLOR Lookup Table
30/9/2008 Lecture 2 19
GRAY SCALE LEVEL
.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
30/9/2008 Lecture 2 20
AREA FILLED ATTRIBUTE
. Option for filling a defined region is whether solid , pattern and colors.
Fill Styles
. Three basic fill styles are:
. hollow with color border.. interior color is same with
background
30/9/2008 Lecture 2 21
AREA FILLED ATTRIBUTE
. filled with a solid color .. color up to and including the border
pattern .. control by other table
30/9/2008 Lecture 2 22
AREA FILLED ATTRIBUTE
30/9/2008 Lecture 2 23
AREA FILLED ATTRIBUTE
. Color-Blended Fill Region
-Soft-fill
- P = tF + (1-t)B where 0 < t < 1
If t < 0.5 , background color contributes more to the
interior color of the region than does the fill color.
30/9/2008 Lecture 2 24
Filled-Area Primitives
30/9/2008 Lecture 2 25
Filled-Area Primitives
30/9/2008 Lecture 2 26
Filled-Area Primitives
30/9/2008 Lecture 2 27
Filled-Area Primitives
30/9/2008 Lecture 2 28
Filled-Area Primitives
30/9/2008 Lecture 2 29
Text and Characters
Text and Characters
•Very important output primitive
• Many pictures require text
• Two general techniques used
– Bitmapped (raster)
– Stroked (outline)
30/9/2008 Lecture 2 30
Text and Characters (Bitmapped (raster))
Each character represented (stored) as a 2-D array
– Each element corresponds to a pixel in a rectangular
“character cell”
– Simplest: each element is a bit (1=pixel on, 0=pixel off)
00111000
01101100
11000110
11000110
11111110
11000110
11000110
00000000
30/9/2008 Lecture 2 31
Text and Characters (Stroked (outline))
Each character represented (stored) as
a series of line segments
– sometimes as more complex primitives
Parameters needed to draw each stroke
– endpoint coordinates for line segments
30/9/2008 Lecture 2 32
Characters Characteristics
Characteristics of Bitmapped Characters
• Each character in set requires same amount of memory
to store
• Characters can only be scaled by integer scaling factors
• "Blocky" appearance
• Difficult to rotate characters by arbitrary angles
• Fast (BitBLT)
Characteristics of Stroked Characters
• Number of stokes (storage space) depends on complexity
of character
• Each stroke must be scan converted more time to display
• Easily scaled and rotated arbitrarily
• – just transform each stroke
30/9/2008 Lecture 2 33
Bundled Attributes
When each function reference a single attribute that specify exactly
how primitive to be displayed ; then its called
individual (unbundled attribute).
.Bundled attributes is where a set of attributes value can be chosen
by specifying the appropriate index table.
.The table for each primitive that defines group of attribute values is
called bundled table.
.Attribute that can be bundled are:
. Bundled Line Attribute
. Bundled Area-Fill Attribute
. Bundled Text Attribute
. Bundled Marker Attribute

More Related Content

Similar to cs2401-cg-attributsofprimitives-unit1.ppt

Image representation
Image representationImage representation
Image representation
Rahul Dadwal
 
Introduction to computer graphics
Introduction to computer graphics Introduction to computer graphics
Introduction to computer graphics
Priyodarshini Dhar
 
Angel cunado_The Terrain Of KUF2
Angel cunado_The Terrain Of KUF2Angel cunado_The Terrain Of KUF2
Angel cunado_The Terrain Of KUF2
drandom
 
Topic 1 Data Representation
Topic 1 Data RepresentationTopic 1 Data Representation
Topic 1 Data Representation
ekul
 

Similar to cs2401-cg-attributsofprimitives-unit1.ppt (20)

B. SC CSIT Computer Graphics Unit 1.3 By Tekendra Nath Yogi
B. SC CSIT Computer Graphics Unit 1.3 By Tekendra Nath YogiB. SC CSIT Computer Graphics Unit 1.3 By Tekendra Nath Yogi
B. SC CSIT Computer Graphics Unit 1.3 By Tekendra Nath Yogi
 
Image representation
Image representationImage representation
Image representation
 
Digital image Processing.ppt
Digital image Processing.pptDigital image Processing.ppt
Digital image Processing.ppt
 
Digital Image Representation.ppt
Digital Image Representation.pptDigital Image Representation.ppt
Digital Image Representation.ppt
 
lect4-images.ppt
lect4-images.pptlect4-images.ppt
lect4-images.ppt
 
Shader X³: Image Space - Color Grading
Shader X³: Image Space - Color GradingShader X³: Image Space - Color Grading
Shader X³: Image Space - Color Grading
 
PPT s08-machine vision-s2
PPT s08-machine vision-s2PPT s08-machine vision-s2
PPT s08-machine vision-s2
 
image basics and image compression
image basics and image compressionimage basics and image compression
image basics and image compression
 
Compression Ii
Compression IiCompression Ii
Compression Ii
 
Compression Ii
Compression IiCompression Ii
Compression Ii
 
Introduction to computer graphics
Introduction to computer graphics Introduction to computer graphics
Introduction to computer graphics
 
Angel cunado_The Terrain Of KUF2
Angel cunado_The Terrain Of KUF2Angel cunado_The Terrain Of KUF2
Angel cunado_The Terrain Of KUF2
 
Network layer,ipv4, Classful Addressing,notations, Classless addressing,class...
Network layer,ipv4, Classful Addressing,notations, Classless addressing,class...Network layer,ipv4, Classful Addressing,notations, Classless addressing,class...
Network layer,ipv4, Classful Addressing,notations, Classless addressing,class...
 
CN Unit 3
CN Unit 3 CN Unit 3
CN Unit 3
 
Mpeg 2
Mpeg 2Mpeg 2
Mpeg 2
 
Topic 1 Data Representation
Topic 1 Data RepresentationTopic 1 Data Representation
Topic 1 Data Representation
 
Topic 1 Data Representation
Topic 1 Data RepresentationTopic 1 Data Representation
Topic 1 Data Representation
 
BarnieMAT
BarnieMATBarnieMAT
BarnieMAT
 
Mmclass4
Mmclass4Mmclass4
Mmclass4
 
Analysis of color image features extraction using texture methods
Analysis of color image features extraction using texture methodsAnalysis of color image features extraction using texture methods
Analysis of color image features extraction using texture methods
 

Recently uploaded

Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
MateoGardella
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 

Recently uploaded (20)

Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 

cs2401-cg-attributsofprimitives-unit1.ppt

  • 1. 30/9/2008 Lecture 2 1 Computer Graphics Department of nskinfo-i education & www.nsksofttech.com CS2401 TOPIC: Attributes of output primitives
  • 2. 30/9/2008 Lecture 2 2 UNIT-1 Attribute of Output Primitives CS2401-Computer Graphics
  • 3. 30/9/2008 Lecture 2 3 Attribute of Output Primitives • Definition • Line Attribute • Curve Attribute • COLOR AND GRAY SCALE LEVEL • AREA FILLED ATTRIBUTE • Text and Characters
  • 4. 30/9/2008 Lecture 2 4 Attributes of Output Primitives Definition Parameter that affects the way a primitive will be displayed Line Attribute . Type . Width . Color . Pen & Brush
  • 5. 30/9/2008 Lecture 2 5 Line Attribute Type . Solid . Dotted – very short dash with spacing equal to or greater than dash itself . Dashed – displayed by generating an interdash spacing Pixel count for the span and interspan length is specified by the mask . Ex. 111100011110001111 Note : Fixed pixel with dashes can produce unequal length dashes. It depend on line orientation. So, need to adjust the number of plotted pixels for different slopes.
  • 6. 30/9/2008 Lecture 2 6 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 . End of the line . Joining the two lines (polygon)
  • 7. 30/9/2008 Lecture 2 7 Line Attribute Width
  • 8. 30/9/2008 Lecture 2 8 Attributes of Output Primitives
  • 9. 30/9/2008 Lecture 2 9 Attributes of Output Primitives
  • 10. 30/9/2008 Lecture 2 10 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. . Pixel mask is applied in both of them.
  • 11. 30/9/2008 Lecture 2 11 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
  • 12. 30/9/2008 Lecture 2 12 Curve Attribute Width
  • 13. 30/9/2008 Lecture 2 13 COLOR AND GRAY SCALE LEVEL Color 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
  • 14. 30/9/2008 Lecture 2 14 COLOR Direct
  • 15. 30/9/2008 Lecture 2 15 COLOR Indirect
  • 16. 30/9/2008 Lecture 2 16 COLOR Exercise: What is the size of frame buffer required for the following cases: Case 1 (Direct): Resolution of 1024 * 1024 with 24 bits per pixel Case 2 (Indirect): Same resolution with 8 bit per pixel that indexed out of 16 million available colors Conclusion CLUT is good for storage but cant give a very high resolution picture.
  • 17. 30/9/2008 Lecture 2 17 COLOR Lookup Table
  • 18. 30/9/2008 Lecture 2 18 COLOR Lookup Table
  • 19. 30/9/2008 Lecture 2 19 GRAY SCALE LEVEL .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
  • 20. 30/9/2008 Lecture 2 20 AREA FILLED ATTRIBUTE . Option for filling a defined region is whether solid , pattern and colors. Fill Styles . Three basic fill styles are: . hollow with color border.. interior color is same with background
  • 21. 30/9/2008 Lecture 2 21 AREA FILLED ATTRIBUTE . filled with a solid color .. color up to and including the border pattern .. control by other table
  • 22. 30/9/2008 Lecture 2 22 AREA FILLED ATTRIBUTE
  • 23. 30/9/2008 Lecture 2 23 AREA FILLED ATTRIBUTE . Color-Blended Fill Region -Soft-fill - P = tF + (1-t)B where 0 < t < 1 If t < 0.5 , background color contributes more to the interior color of the region than does the fill color.
  • 24. 30/9/2008 Lecture 2 24 Filled-Area Primitives
  • 25. 30/9/2008 Lecture 2 25 Filled-Area Primitives
  • 26. 30/9/2008 Lecture 2 26 Filled-Area Primitives
  • 27. 30/9/2008 Lecture 2 27 Filled-Area Primitives
  • 28. 30/9/2008 Lecture 2 28 Filled-Area Primitives
  • 29. 30/9/2008 Lecture 2 29 Text and Characters Text and Characters •Very important output primitive • Many pictures require text • Two general techniques used – Bitmapped (raster) – Stroked (outline)
  • 30. 30/9/2008 Lecture 2 30 Text and Characters (Bitmapped (raster)) Each character represented (stored) as a 2-D array – Each element corresponds to a pixel in a rectangular “character cell” – Simplest: each element is a bit (1=pixel on, 0=pixel off) 00111000 01101100 11000110 11000110 11111110 11000110 11000110 00000000
  • 31. 30/9/2008 Lecture 2 31 Text and Characters (Stroked (outline)) Each character represented (stored) as a series of line segments – sometimes as more complex primitives Parameters needed to draw each stroke – endpoint coordinates for line segments
  • 32. 30/9/2008 Lecture 2 32 Characters Characteristics Characteristics of Bitmapped Characters • Each character in set requires same amount of memory to store • Characters can only be scaled by integer scaling factors • "Blocky" appearance • Difficult to rotate characters by arbitrary angles • Fast (BitBLT) Characteristics of Stroked Characters • Number of stokes (storage space) depends on complexity of character • Each stroke must be scan converted more time to display • Easily scaled and rotated arbitrarily • – just transform each stroke
  • 33. 30/9/2008 Lecture 2 33 Bundled Attributes When each function reference a single attribute that specify exactly how primitive to be displayed ; then its called individual (unbundled attribute). .Bundled attributes is where a set of attributes value can be chosen by specifying the appropriate index table. .The table for each primitive that defines group of attribute values is called bundled table. .Attribute that can be bundled are: . Bundled Line Attribute . Bundled Area-Fill Attribute . Bundled Text Attribute . Bundled Marker Attribute