SlideShare a Scribd company logo
Attributes of Output Primitives
Structure :
Definition
Line Attribute
Curve Attribute
Color and Grayscale Level
Area Filled Attribute
Text and Characters
Attributes
Influence the way a primitive is displayed
Two main ways of introducing attributes:
1) added to primitive’s parameter list
e.g. setPixel(x, y, color)
2) a list of current attributes (to be updated
when changed)
e.g setColor(color); setPixel(x, y);
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
Attributes for lines
Lines (and curves) are normally infinitely thin
• type
– dashed, dotted, solid, dot-dashed, …
– pixel mask, e.g. 11100110011
• width
– problem with the joins; line caps are used to adjust shape
• pen/brush shape
• color (intensity)
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 as attribute
Each color has a numerical value, or intensity, based on
some color model.
A color model typically consists of three primary colors,
in the case of displays Red, Green and Blue (RGB)
For each primary color an intensity can be given, either
0-255 (integer) or 0-1 (float) yielding the final color
256 different levels of each primary color means
3x8=24 bits of information to store
Color representations
Two different ways of storing a color value:
1) a direct color value storage/pixel
2) indirectly via a color look-up table
index/pixel (typically 256 or 512 different
colors in the table)
Color and GrayScale 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
Gray Scale
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. Patterned
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.
Attributes for area fill
• fill style
– hollow, solid, pattern, hatch fill, …
• color
• pattern
– tiling
Tiling
Tiling = filling surfaces (polygons) with a rectangular
pattern
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.
Attributes for characters/strings
• style
• font (typeface)
• color
• size (width/height)
• orientation
• path
• spacing
• alignment
Text attributes
Text attributes, cont’d
Text attributes, cont’d
Text attributes, cont’d
Antialiasing
Aliasing ≈ the fact that exact points are
approximated by fixed pixel positions
Antialiasing = a technique that compensates for
this (more than one intensity level/pixel is
required)
Antialiasing, a method
A polygon will be studied (as an example).
Area sampling (prefiltering): a pixel that is only partly
included in the exact polygon, will be given an
intensity that is proportional to the extent of the
pixel area that is covered by the true polygon
Area sampling
P = polygon intensity
B = background intensity
f = the extent of the pixel
area covered by the true
polygon
pixel intensity =
P*f + B*(1 - f)
Note! Time consuming to
calculate f

More Related Content

PPTX
computergraphics-chapter4-140412075158-phpapp02.pptx
PPTX
Computer graphics chapter 4
DOC
Attributes of output primitives unit ii
PPTX
attribute.pptx
PDF
Matlab_Pract_lect5details about matlab.pdf
PPTX
Attributes of output primitive(line attributes)
PPTX
Attributes of Output Primitives
PPTX
Unit 2 open gl .pptx
computergraphics-chapter4-140412075158-phpapp02.pptx
Computer graphics chapter 4
Attributes of output primitives unit ii
attribute.pptx
Matlab_Pract_lect5details about matlab.pdf
Attributes of output primitive(line attributes)
Attributes of Output Primitives
Unit 2 open gl .pptx

Similar to Attributes of Output Primitives Computer Graphhics.pptx (20)

PPTX
ATTRIBUTES OF OUTPUT PRIMITIVES IN COMPUTER GRAPHICS
PPTX
DA_THEORY_PPT DA_THEORY_PPT DA_THEORY_PPT
PPT
cs2401-cg-attributsofprimitives-unit1.ppt
PPTX
Graphics software standards
PPTX
L#2 Multimedia systems telecomunicztion.pptx
PPTX
Lecture_3.pptx
PPTX
Multimedia graphics and image data representation
PPTX
line attributes.pptx
PPTX
Exploratory Data Analysis
PPT
Data Representatio151651325861223156.ppt
PPTX
Multimedia Systems- bitmap and vector images-part 5.pptx
PPTX
PDF
HTML5 Canvas
PPTX
Digital Coding of Images.pptx
PPTX
SCENE TEXT RECOGNITION IN MOBILE APPLICATION BY CHARACTER DESCRIPTOR AND STRU...
PPTX
Language Model.pptx
PPTX
Chapter 14: Box Model
PPTX
Lec02 03 rasterization
PPTX
Lec02 03 rasterization
PPTX
Data-and-Number-Representations CSE 101.pptx
ATTRIBUTES OF OUTPUT PRIMITIVES IN COMPUTER GRAPHICS
DA_THEORY_PPT DA_THEORY_PPT DA_THEORY_PPT
cs2401-cg-attributsofprimitives-unit1.ppt
Graphics software standards
L#2 Multimedia systems telecomunicztion.pptx
Lecture_3.pptx
Multimedia graphics and image data representation
line attributes.pptx
Exploratory Data Analysis
Data Representatio151651325861223156.ppt
Multimedia Systems- bitmap and vector images-part 5.pptx
HTML5 Canvas
Digital Coding of Images.pptx
SCENE TEXT RECOGNITION IN MOBILE APPLICATION BY CHARACTER DESCRIPTOR AND STRU...
Language Model.pptx
Chapter 14: Box Model
Lec02 03 rasterization
Lec02 03 rasterization
Data-and-Number-Representations CSE 101.pptx
Ad

More from SubburamSivakumar1 (9)

PPT
Basic fundamentals of Digital Image Processing.ppt
PPT
To dimensional clipping brief notes.ppt
PPT
Two dimensional_Transformations Notes.ppt
PPT
Introduction to Domain Calculus Notes.ppt
PPT
Introduction to Transaction Management Overview.ppt
PPT
Security and Authorization introductory notes.ppt
PPT
Introduction to Schema refinement lecture notes.ppt
PPT
Relational Algebra brief lecture notes for SQL.ppt
PPT
Introduction to SQL brief notes for academic.ppt
Basic fundamentals of Digital Image Processing.ppt
To dimensional clipping brief notes.ppt
Two dimensional_Transformations Notes.ppt
Introduction to Domain Calculus Notes.ppt
Introduction to Transaction Management Overview.ppt
Security and Authorization introductory notes.ppt
Introduction to Schema refinement lecture notes.ppt
Relational Algebra brief lecture notes for SQL.ppt
Introduction to SQL brief notes for academic.ppt
Ad

Recently uploaded (20)

PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
Pre independence Education in Inndia.pdf
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
Sports Quiz easy sports quiz sports quiz
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PPTX
Institutional Correction lecture only . . .
PDF
TR - Agricultural Crops Production NC III.pdf
PPTX
Lesson notes of climatology university.
PPTX
Pharma ospi slides which help in ospi learning
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
RMMM.pdf make it easy to upload and study
PPTX
PPH.pptx obstetrics and gynecology in nursing
PPTX
Final Presentation General Medicine 03-08-2024.pptx
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Pre independence Education in Inndia.pdf
Abdominal Access Techniques with Prof. Dr. R K Mishra
Sports Quiz easy sports quiz sports quiz
Module 4: Burden of Disease Tutorial Slides S2 2025
O5-L3 Freight Transport Ops (International) V1.pdf
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Microbial diseases, their pathogenesis and prophylaxis
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Institutional Correction lecture only . . .
TR - Agricultural Crops Production NC III.pdf
Lesson notes of climatology university.
Pharma ospi slides which help in ospi learning
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
RMMM.pdf make it easy to upload and study
PPH.pptx obstetrics and gynecology in nursing
Final Presentation General Medicine 03-08-2024.pptx

Attributes of Output Primitives Computer Graphhics.pptx

  • 1. Attributes of Output Primitives Structure : Definition Line Attribute Curve Attribute Color and Grayscale Level Area Filled Attribute Text and Characters
  • 2. Attributes Influence the way a primitive is displayed Two main ways of introducing attributes: 1) added to primitive’s parameter list e.g. setPixel(x, y, color) 2) a list of current attributes (to be updated when changed) e.g setColor(color); setPixel(x, y);
  • 3. 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
  • 4. Attributes of Line . Type . Width . Color . Pen & Brush
  • 5. Attributes for lines Lines (and curves) are normally infinitely thin • type – dashed, dotted, solid, dot-dashed, … – pixel mask, e.g. 11100110011 • width – problem with the joins; line caps are used to adjust shape • pen/brush shape • color (intensity)
  • 6. 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
  • 7. 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
  • 8. 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.
  • 9. Line Width Issues: Line have different thickness on the slope Problem with . End of the line (Use Line Caps) . Joining the two lines (polygon)
  • 12. 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.
  • 13. 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.
  • 14. 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
  • 17. Color as attribute Each color has a numerical value, or intensity, based on some color model. A color model typically consists of three primary colors, in the case of displays Red, Green and Blue (RGB) For each primary color an intensity can be given, either 0-255 (integer) or 0-1 (float) yielding the final color 256 different levels of each primary color means 3x8=24 bits of information to store
  • 18. Color representations Two different ways of storing a color value: 1) a direct color value storage/pixel 2) indirectly via a color look-up table index/pixel (typically 256 or 512 different colors in the table)
  • 19. Color and GrayScale 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
  • 20. Direct : Color Lookup Table
  • 22. Gray Scale 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
  • 23. 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. Patterned
  • 25. 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.
  • 26. Attributes for area fill • fill style – hollow, solid, pattern, hatch fill, … • color • pattern – tiling
  • 27. Tiling Tiling = filling surfaces (polygons) with a rectangular pattern
  • 28. 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.
  • 29. 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.
  • 30. Attributes for characters/strings • style • font (typeface) • color • size (width/height) • orientation • path • spacing • alignment
  • 35. Antialiasing Aliasing ≈ the fact that exact points are approximated by fixed pixel positions Antialiasing = a technique that compensates for this (more than one intensity level/pixel is required)
  • 36. Antialiasing, a method A polygon will be studied (as an example). Area sampling (prefiltering): a pixel that is only partly included in the exact polygon, will be given an intensity that is proportional to the extent of the pixel area that is covered by the true polygon
  • 37. Area sampling P = polygon intensity B = background intensity f = the extent of the pixel area covered by the true polygon pixel intensity = P*f + B*(1 - f) Note! Time consuming to calculate f