SlideShare a Scribd company logo
1 of 49
Filled Area Primitives
NEHRUREVATHY
DEPARTMENT OF BCA
Filled Area Primitives:
• Region filling is the process of filling image or
region.
• Filling can be of boundary or interior region.
• Boundary Fill algorithms are used to fill the
boundary.
• Flood-fill algorithm are used to fill the interior.
Filled Area Primitives-Example:
Boundary Filled Algorithm:
• This algorithm uses the recursive method.
• First of all, a starting pixel called as the seed is
considered.
• The algorithm checks boundary pixel or
adjacent pixels are colored or not.
• If the adjacent pixel is already filled or colored
then leave it, otherwise fill it.
• The filling is done using four connected or
eight connected approaches.
Boundary Filled Algorithm:
N
S
E WC
NNE
E
SE S SW
WC
NW
Boundary Filled Algorithm-Two
Approaches:
• 1.Four connected approaches: In this approach,
left, right, above, below pixels are tested.
• 2. Eight connected approaches: In this approach,
left, right, above, below and four diagonals are
selected.
• Boundary can be checked by seeing pixels from
left and right first.
• Then pixels are checked by seeing pixels from top
to bottom.
• The algorithm takes time and memory because
some recursive calls are needed.
Problem with recursive boundary fill
algorithm:
• It may not fill regions sometimes correctly when
some interior pixel is already filled with color.
• The algorithm will check this boundary pixel for
filling and will found already filled so recursive
process will terminate.
• This may vary because of another interior pixel
unfilled.
• So check all pixels color before applying the
algorithm.
Algorithm:
Procedure fill (x, y, color, color1: integer)
int c;
c=getpixel (x, y);
if (c!=color) (c!=color1)
{
setpixel (x, y, color)
fill (x+1, y, color, color 1);
fill (x-1, y, color, color 1);
fill (x, y+1, color, color 1);
fill (x, y-1, color, color 1);
}
Flood Fill Algorithm
• In this method, a point or seed which is inside region is
selected.
• This point is called a seed point.
• Then four connected approaches or eight connected
approaches is used to fill with specified color.
• The flood fill algorithm has many characters similar to
boundary fill.
• But this method is more suitable for filling multiple
colors boundary.
• When boundary is of many colors and interior is to be
filled with one color we use this algorithm.
Flood Fill Algorithm
• In fill algorithm, we start from a specified
interior point (x, y) and reassign all pixel
values are currently set to a given interior
color with the desired color.
• Using either a 4-connected or 8-connected
approaches, we then step through pixel
positions until all interior points have been
repainted.
Algorithm:
Procedure floodfill (x, y, fill_color, old_color: integer)
{
If (getpixel (x, y)=old_color)
{
setpixel (x, y, fill_color);
fill (x+1, y, fill_color, old_color); // Four-Connected
fill (x-1, y, fill_color, old_color);
fill (x, y+1, fill_color, old_color);
fill (x, y-1, fill_color, old_color);
}
}
8-Connected Flood Fill Algorithm
floodfill(x+1,y,old,newcol);
floodfill(x-1,y,old,newcol);
floodfill(x,y+1,old,newcol);
floodfill(x,y-1,old,newcol);
floodfill(x+1,y+1,old,newcol);
floodfill(x-1,y+1,old,newcol);
floodfill(x+1,y-1,old,newcol);
floodfill(x-1,y-1,old,newcol);
Flood Fill Algorithm-Example:
Disadvantage:
• Very slow algorithm
• May be fail for large polygons
• Initial pixel required more knowledge about
surrounding pixels.
ATTRIBUTES OF OUTPUT
PRIMITIVES
ATTRIBUTES OF OUTPUT PRIMITIVES
• Any parameter that affect the way a
parameter is to be displayed is referred to as
an attribute parameter.
• Example attribute parameter are color
specification,size,position,orientation and so
on.
• some attributes are:
1.Line Attributes
ATTRIBUTES OF OUTPUT PRIMITIVES
2.Curve Attributes
3.Color and Grayscale levels
4.Area Fill Attributes
5.Character Attributes
6.Marker Attributes
1.Line Attributes
• Basic attributes of a st. Line segment are:
1.Line Type
2.Line Width
3.Pen and Brush Options
4.Line Color
1.Line Type – Line Attributes:
• Four types:
# Solid Lines( )
# Dashed Lines (------------)
# Dotted Lines (.................)
# Dashed Dotted Lines(-.-.-.-.-.-.-.-)
• Syntax:
setlinetype(lt);
Where, lt - takes 4 values(positive integer numbers)
1.Line Type – Example:
• Parameter lt,
1- Solid Lines
2- Dashed Lines
3- Dotted Lines
4- Dashed Dotted Lines
• Example:
setlinetype(2);
setline(100,200,300,200);
------------------------
2.Line Width-Line Attributes:
• Thickness of the line.
• Syntax:
setlinewidthscalefactor(lw);
• Parameter lw indicates width of the line to be
displayed.
• Three values:
1 Standard line width
0.5 Half of the Standard line width
>1 Thicker than the Standard line width
Disadvantage- very thick line:
• Use Line Cap—to adjust the shape of the line
ends to give them a better appearance by
adding line caps.
• Three types of line cap:
1.Butt Cap
2.Round Cap
3.Projecting Square Cap
Line Cap – Types:
1.Butt Cap:
It is obtained by adjusting the end positions of
the components parallel lines so that the thick
line is displayed with square end.
Line Cap – Types:
2.Round Cap
It is obtained by adding semicircle to butt cap.
Line Cap – Types:
3.Projected Square Cap
It is us to extend the line and add the butt
cap.
Three Methods for smoothly joining
two line segments:
1.Miter Join: Join two segments by extending
outer boundaries.
2.Round Join: Joining two segment by circular
boundary.
3.Bevel Join: Joining two segments by butt cap.
1.Miter Join 2.Round Join 3.Bevel Join
3.Pen and Brush Options
# Lines can be displayed with pen or
brush selections.
#Options in this category include
shape,size and color
4.Line Color
• Number of color choices depends on the
number of bits.
• Syntax:
setcolor(lc);
• Example: setcolor(0); black
2.CURVE ATTRIBUTES
• Parameter for curve attributes are same as
those for line segments.
• Curves displayed with varying
colors,widths,dot-dashed pattern and pen or
brush options.
3.Color and Grayscale Levels
• Two types of system:
1.Raster Scan System(any number of color)
2.Random Scan System(limited color)
• Color Options:
# Color information is stored in the frame buffer in two ways:
1.Store the color code directly into the
frame buffer.
# Suitable only for high resoultion system.
# very expensive
Each time if we access the frame buffer for choosing the
colors,frame buffer cost will be increased.
Color and Grayscale Levels
2.maintains the color table
# suitable for low resolution system
# very cheap
# use the color code in a separate table and
use pixel as an index into this table.
Color and Grayscale Levels
# Color Codes:
• 3bit per pixel
• Ex: 0 0 0
leftmost middle control rightmost
Control red green control blue
INTENSITY LEVEL
Color and Grayscale Levels
• Each color codes has been controlled by RGB
mode.
• Color Table:
# The table which is used to store color values
in a color look up table.
# Also called as video lookup table.
# Frame buffer values are now used as an
index into color table.
Color and Grayscale Levels
• Color Representation:
To represent the colors use the following
syntax:
setcolorrepresentation(ws,c,colorpts)
where,
ws---workstation
c---colorindex
colorpts---3bits of colors
Color and Grayscale Levels
Advantages:
1.uses 256 or 512 different colors.
2.color table is unique
3.reduce the repeated colors
4.reduce the frame buffer storage
Gray Scale Levels
• Gray(2 bits)
• Grayscale(3 bits) black+white=gray
• No color capability
• Shaded gray or grayscale colors
• Values 0 to 1
• Intensity codes for a four level Gray scale
system:
Gray Scale Levels—2bits
Gray Scale Levels—3bits
FRAME BUFFER VALUE 3 BITS BINARY CODE COLORS
0 000 BLACK
1 001 DARK BLACK
2 010 LIGHT BLACK
3 011 DARK GRAY
4 100 LIGHT GRAY
5 101 DARK WHITE
6 110 LIGHT WHITE
7 111 WHITE
4.Character Attributes
• Character Attributes: The appearance of
displayed characters is controlled by attributes
such as font, size, colour and orientation.
• Attributes can be set both for entire character
strings and for individual characters, known as
Marker symbols.
Character Attributes-Text Attributes
1. Text Attributes:
• There are many text options available, such
as font, colour, size, spacing, and orientation.
• Text Style:
The characters in a selected font can also be
displayed in various underlining styles (solid,
dotted, dashed, double), in bold, in italics,
shadow style, etc.
Example: setTextFont(tf)
Character Attributes-Text Attributes
• Text Color:
Control of text color is managed with: Example:
setTextColorIndex(tc)
where tc specifies an allowable color code
• Text Size:
We can adjust text size by changing the overall
dimensions, i.e., width and height, of characters
or by changing only the width.
Example: setCharacterHeight(ch)
• The width of the text can be set by
setCharacterExpansionFactor(cw)
where,cw---scales the body width of a
character.
• Spacing between characters is controlled
separately with
• Ex: setCharacterSpacing(cs)
Ex:
setCharacterUpVector(upvector)
• Text Orientation: The
text can be displayed at
various angles, known
as orientation.
• Character strings can be
arranged vertically or
horizontally.
• A text orientated by 45
degrees in anticlockwise
and clockwise direction
Text Path:
#Character strings are arranged vertically or
horizontally.
#This is known as Text Path.
#Text path can be right, left, up or down.
• Ex:setTextPath(tp)
Ex:
setTextAlignment(h,v)
Text Alignment:
• This attribute
specifies how text is
to be positioned.
• Vertical alignment
can be top, cap,
half, base and
bottom.
• Similarly, horizontal
alignment can be
left, centre and
right.
------------------------TOP
-----------------------CAP
-----------------------HALF
-----------------------BASE
----------------------BOTTO
LEFT CENTRE RIGHT
ALIGNMENT VALUES FOR A STRING
PRINCE
5.Marker Attributes
• It is a single character that can be displayed in
different colors and in different sizes.
• To set the marker symbol,use:
setMarkerType(mt)
• It takes 5 values:
VALUE MARKERTYPE
1 Dot(.)
2 Vertical cross(+)
3 Asterisk(*)
4 Circle(0)
5 Diagonal cross(x)
Marker Attributes
• To set the marker size,use
setMarkerSizeScaleFactor(ms)
• Marker color is specified with
setPolyMarkerColorIndex(mc)
use the color code
VALUE MEANING
VALUE>1 Character Enlargement
VALUE<1 Reduce the marker size

More Related Content

What's hot

Attributes of Output Primitives
Attributes of Output PrimitivesAttributes of Output Primitives
Attributes of Output PrimitivesRenita Santhmayora
 
Output primitives in Computer Graphics
Output primitives in Computer GraphicsOutput primitives in Computer Graphics
Output primitives in Computer GraphicsKamal Acharya
 
Random scan displays and raster scan displays
Random scan displays and raster scan displaysRandom scan displays and raster scan displays
Random scan displays and raster scan displaysSomya Bagai
 
2 d viewing computer graphics
2 d viewing computer graphics2 d viewing computer graphics
2 d viewing computer graphicsKALESHWAR KUMAR
 
3D transformation in computer graphics
3D transformation in computer graphics3D transformation in computer graphics
3D transformation in computer graphicsSHIVANI SONI
 
2D transformation (Computer Graphics)
2D transformation (Computer Graphics)2D transformation (Computer Graphics)
2D transformation (Computer Graphics)Timbal Mayank
 
Intro to scan conversion
Intro to scan conversionIntro to scan conversion
Intro to scan conversionMohd Arif
 
2D viewing & clipping
2D viewing & clipping2D viewing & clipping
2D viewing & clippingMdAlAmin187
 
3D Transformation
3D Transformation3D Transformation
3D TransformationSwatiHans10
 
The sutherland hodgeman polygon clipping algorithm
The sutherland hodgeman polygon clipping algorithmThe sutherland hodgeman polygon clipping algorithm
The sutherland hodgeman polygon clipping algorithmMani Kanth
 
Computer graphics notes
Computer graphics notesComputer graphics notes
Computer graphics notessmruti sarangi
 
Liang- Barsky Algorithm, Polygon clipping & pipeline clipping of polygons
Liang- Barsky Algorithm, Polygon clipping & pipeline clipping of polygonsLiang- Barsky Algorithm, Polygon clipping & pipeline clipping of polygons
Liang- Barsky Algorithm, Polygon clipping & pipeline clipping of polygonsLahiru Danushka
 
Attributes of output Primitive
Attributes of output Primitive Attributes of output Primitive
Attributes of output Primitive SachiniGunawardana
 
B-spline
B-spline B-spline
B-spline nmahi96
 
Polygon clipping
Polygon clippingPolygon clipping
Polygon clippingAnkit Garg
 
Line drawing algo.
Line drawing algo.Line drawing algo.
Line drawing algo.Mohd Arif
 
3D Graphics : Computer Graphics Fundamentals
3D Graphics : Computer Graphics Fundamentals3D Graphics : Computer Graphics Fundamentals
3D Graphics : Computer Graphics FundamentalsMuhammed Afsal Villan
 
Attributes of output primitives( curve attributes & area fill attributes)
Attributes of output primitives( curve attributes & area fill attributes)Attributes of output primitives( curve attributes & area fill attributes)
Attributes of output primitives( curve attributes & area fill attributes)shalinikarunakaran1
 

What's hot (20)

Attributes of Output Primitives
Attributes of Output PrimitivesAttributes of Output Primitives
Attributes of Output Primitives
 
Output primitives in Computer Graphics
Output primitives in Computer GraphicsOutput primitives in Computer Graphics
Output primitives in Computer Graphics
 
Random scan displays and raster scan displays
Random scan displays and raster scan displaysRandom scan displays and raster scan displays
Random scan displays and raster scan displays
 
BRESENHAM’S LINE DRAWING ALGORITHM
BRESENHAM’S  LINE DRAWING ALGORITHMBRESENHAM’S  LINE DRAWING ALGORITHM
BRESENHAM’S LINE DRAWING ALGORITHM
 
2 d viewing computer graphics
2 d viewing computer graphics2 d viewing computer graphics
2 d viewing computer graphics
 
3D transformation in computer graphics
3D transformation in computer graphics3D transformation in computer graphics
3D transformation in computer graphics
 
2D transformation (Computer Graphics)
2D transformation (Computer Graphics)2D transformation (Computer Graphics)
2D transformation (Computer Graphics)
 
Intro to scan conversion
Intro to scan conversionIntro to scan conversion
Intro to scan conversion
 
2D viewing & clipping
2D viewing & clipping2D viewing & clipping
2D viewing & clipping
 
3D Transformation
3D Transformation3D Transformation
3D Transformation
 
The sutherland hodgeman polygon clipping algorithm
The sutherland hodgeman polygon clipping algorithmThe sutherland hodgeman polygon clipping algorithm
The sutherland hodgeman polygon clipping algorithm
 
Computer graphics notes
Computer graphics notesComputer graphics notes
Computer graphics notes
 
Liang- Barsky Algorithm, Polygon clipping & pipeline clipping of polygons
Liang- Barsky Algorithm, Polygon clipping & pipeline clipping of polygonsLiang- Barsky Algorithm, Polygon clipping & pipeline clipping of polygons
Liang- Barsky Algorithm, Polygon clipping & pipeline clipping of polygons
 
Attributes of output Primitive
Attributes of output Primitive Attributes of output Primitive
Attributes of output Primitive
 
Boundary fill algm
Boundary fill algmBoundary fill algm
Boundary fill algm
 
B-spline
B-spline B-spline
B-spline
 
Polygon clipping
Polygon clippingPolygon clipping
Polygon clipping
 
Line drawing algo.
Line drawing algo.Line drawing algo.
Line drawing algo.
 
3D Graphics : Computer Graphics Fundamentals
3D Graphics : Computer Graphics Fundamentals3D Graphics : Computer Graphics Fundamentals
3D Graphics : Computer Graphics Fundamentals
 
Attributes of output primitives( curve attributes & area fill attributes)
Attributes of output primitives( curve attributes & area fill attributes)Attributes of output primitives( curve attributes & area fill attributes)
Attributes of output primitives( curve attributes & area fill attributes)
 

Similar to ATTRIBUTES OF OUTPUT PRIMITIVES IN COMPUTER GRAPHICS

Polygon filling algorithm
Polygon filling algorithmPolygon filling algorithm
Polygon filling algorithmAparna Joshi
 
Exploratory Data Analysis
Exploratory Data AnalysisExploratory Data Analysis
Exploratory Data AnalysisUmair Shafique
 
CSS tutorial chapter 2
CSS tutorial chapter 2CSS tutorial chapter 2
CSS tutorial chapter 2jeweltutin
 
line attributes.pptx
line attributes.pptxline attributes.pptx
line attributes.pptxRubaNagarajan
 
Code generation in Compiler Design
Code generation in Compiler DesignCode generation in Compiler Design
Code generation in Compiler DesignKuppusamy P
 
B tree ,B plus and graph
B tree ,B plus and graph B tree ,B plus and graph
B tree ,B plus and graph RaaviKapoor
 
Unit VI - Graphs.ppt
Unit VI - Graphs.pptUnit VI - Graphs.ppt
Unit VI - Graphs.pptHODElex
 
OpenCV presentation series- part 2
OpenCV presentation series- part 2OpenCV presentation series- part 2
OpenCV presentation series- part 2Sairam Adithya
 
CS4443 - Modern Programming Language - I Lecture (2)
CS4443 - Modern Programming Language - I  Lecture (2)CS4443 - Modern Programming Language - I  Lecture (2)
CS4443 - Modern Programming Language - I Lecture (2)Dilawar Khan
 
5 ARRAYS AND STRINGSjiuojhiooioiiouioi.pptx
5 ARRAYS AND STRINGSjiuojhiooioiiouioi.pptx5 ARRAYS AND STRINGSjiuojhiooioiiouioi.pptx
5 ARRAYS AND STRINGSjiuojhiooioiiouioi.pptxteddiyfentaw
 

Similar to ATTRIBUTES OF OUTPUT PRIMITIVES IN COMPUTER GRAPHICS (20)

attribute.pptx
attribute.pptxattribute.pptx
attribute.pptx
 
Polygon filling algorithm
Polygon filling algorithmPolygon filling algorithm
Polygon filling algorithm
 
Exploratory Data Analysis
Exploratory Data AnalysisExploratory Data Analysis
Exploratory Data Analysis
 
CSS tutorial chapter 2
CSS tutorial chapter 2CSS tutorial chapter 2
CSS tutorial chapter 2
 
14485616.ppt
14485616.ppt14485616.ppt
14485616.ppt
 
line attributes.pptx
line attributes.pptxline attributes.pptx
line attributes.pptx
 
Arrays Basics
Arrays BasicsArrays Basics
Arrays Basics
 
MATLAB PLOT.pdf
MATLAB PLOT.pdfMATLAB PLOT.pdf
MATLAB PLOT.pdf
 
Jpeg
JpegJpeg
Jpeg
 
Mvs adas
Mvs adasMvs adas
Mvs adas
 
Code generation in Compiler Design
Code generation in Compiler DesignCode generation in Compiler Design
Code generation in Compiler Design
 
B tree ,B plus and graph
B tree ,B plus and graph B tree ,B plus and graph
B tree ,B plus and graph
 
ASSIGMENT.PY.pptx
ASSIGMENT.PY.pptxASSIGMENT.PY.pptx
ASSIGMENT.PY.pptx
 
Unit VI - Graphs.ppt
Unit VI - Graphs.pptUnit VI - Graphs.ppt
Unit VI - Graphs.ppt
 
OpenCV presentation series- part 2
OpenCV presentation series- part 2OpenCV presentation series- part 2
OpenCV presentation series- part 2
 
Presentation.pptx
Presentation.pptxPresentation.pptx
Presentation.pptx
 
CS4443 - Modern Programming Language - I Lecture (2)
CS4443 - Modern Programming Language - I  Lecture (2)CS4443 - Modern Programming Language - I  Lecture (2)
CS4443 - Modern Programming Language - I Lecture (2)
 
2. Chap 1.pptx
2. Chap 1.pptx2. Chap 1.pptx
2. Chap 1.pptx
 
enum_namespace.ppt
enum_namespace.pptenum_namespace.ppt
enum_namespace.ppt
 
5 ARRAYS AND STRINGSjiuojhiooioiiouioi.pptx
5 ARRAYS AND STRINGSjiuojhiooioiiouioi.pptx5 ARRAYS AND STRINGSjiuojhiooioiiouioi.pptx
5 ARRAYS AND STRINGSjiuojhiooioiiouioi.pptx
 

More from nehrurevathy

Revision 3 updated
Revision 3 updatedRevision 3 updated
Revision 3 updatednehrurevathy
 
CATHODE RAY TUBE IN COMPUTER GRAPHICS
CATHODE RAY TUBE IN COMPUTER GRAPHICSCATHODE RAY TUBE IN COMPUTER GRAPHICS
CATHODE RAY TUBE IN COMPUTER GRAPHICSnehrurevathy
 
Bresenham's line drawing algorithm
Bresenham's line drawing algorithmBresenham's line drawing algorithm
Bresenham's line drawing algorithmnehrurevathy
 
Lline Drawing Algorithm
Lline Drawing AlgorithmLline Drawing Algorithm
Lline Drawing Algorithmnehrurevathy
 
2D- Transformation
2D- Transformation2D- Transformation
2D- Transformationnehrurevathy
 
COLOR CRT MONITORS IN COMPUTER GRAPHICS
COLOR CRT MONITORS IN COMPUTER GRAPHICSCOLOR CRT MONITORS IN COMPUTER GRAPHICS
COLOR CRT MONITORS IN COMPUTER GRAPHICSnehrurevathy
 

More from nehrurevathy (7)

Clipping
ClippingClipping
Clipping
 
Revision 3 updated
Revision 3 updatedRevision 3 updated
Revision 3 updated
 
CATHODE RAY TUBE IN COMPUTER GRAPHICS
CATHODE RAY TUBE IN COMPUTER GRAPHICSCATHODE RAY TUBE IN COMPUTER GRAPHICS
CATHODE RAY TUBE IN COMPUTER GRAPHICS
 
Bresenham's line drawing algorithm
Bresenham's line drawing algorithmBresenham's line drawing algorithm
Bresenham's line drawing algorithm
 
Lline Drawing Algorithm
Lline Drawing AlgorithmLline Drawing Algorithm
Lline Drawing Algorithm
 
2D- Transformation
2D- Transformation2D- Transformation
2D- Transformation
 
COLOR CRT MONITORS IN COMPUTER GRAPHICS
COLOR CRT MONITORS IN COMPUTER GRAPHICSCOLOR CRT MONITORS IN COMPUTER GRAPHICS
COLOR CRT MONITORS IN COMPUTER GRAPHICS
 

Recently uploaded

Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 

Recently uploaded (20)

Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 

ATTRIBUTES OF OUTPUT PRIMITIVES IN COMPUTER GRAPHICS

  • 2. Filled Area Primitives: • Region filling is the process of filling image or region. • Filling can be of boundary or interior region. • Boundary Fill algorithms are used to fill the boundary. • Flood-fill algorithm are used to fill the interior.
  • 4. Boundary Filled Algorithm: • This algorithm uses the recursive method. • First of all, a starting pixel called as the seed is considered. • The algorithm checks boundary pixel or adjacent pixels are colored or not. • If the adjacent pixel is already filled or colored then leave it, otherwise fill it. • The filling is done using four connected or eight connected approaches.
  • 5. Boundary Filled Algorithm: N S E WC NNE E SE S SW WC NW
  • 6. Boundary Filled Algorithm-Two Approaches: • 1.Four connected approaches: In this approach, left, right, above, below pixels are tested. • 2. Eight connected approaches: In this approach, left, right, above, below and four diagonals are selected. • Boundary can be checked by seeing pixels from left and right first. • Then pixels are checked by seeing pixels from top to bottom. • The algorithm takes time and memory because some recursive calls are needed.
  • 7. Problem with recursive boundary fill algorithm: • It may not fill regions sometimes correctly when some interior pixel is already filled with color. • The algorithm will check this boundary pixel for filling and will found already filled so recursive process will terminate. • This may vary because of another interior pixel unfilled. • So check all pixels color before applying the algorithm.
  • 8. Algorithm: Procedure fill (x, y, color, color1: integer) int c; c=getpixel (x, y); if (c!=color) (c!=color1) { setpixel (x, y, color) fill (x+1, y, color, color 1); fill (x-1, y, color, color 1); fill (x, y+1, color, color 1); fill (x, y-1, color, color 1); }
  • 9. Flood Fill Algorithm • In this method, a point or seed which is inside region is selected. • This point is called a seed point. • Then four connected approaches or eight connected approaches is used to fill with specified color. • The flood fill algorithm has many characters similar to boundary fill. • But this method is more suitable for filling multiple colors boundary. • When boundary is of many colors and interior is to be filled with one color we use this algorithm.
  • 10. Flood Fill Algorithm • In fill algorithm, we start from a specified interior point (x, y) and reassign all pixel values are currently set to a given interior color with the desired color. • Using either a 4-connected or 8-connected approaches, we then step through pixel positions until all interior points have been repainted.
  • 11. Algorithm: Procedure floodfill (x, y, fill_color, old_color: integer) { If (getpixel (x, y)=old_color) { setpixel (x, y, fill_color); fill (x+1, y, fill_color, old_color); // Four-Connected fill (x-1, y, fill_color, old_color); fill (x, y+1, fill_color, old_color); fill (x, y-1, fill_color, old_color); } }
  • 12. 8-Connected Flood Fill Algorithm floodfill(x+1,y,old,newcol); floodfill(x-1,y,old,newcol); floodfill(x,y+1,old,newcol); floodfill(x,y-1,old,newcol); floodfill(x+1,y+1,old,newcol); floodfill(x-1,y+1,old,newcol); floodfill(x+1,y-1,old,newcol); floodfill(x-1,y-1,old,newcol);
  • 14. Disadvantage: • Very slow algorithm • May be fail for large polygons • Initial pixel required more knowledge about surrounding pixels.
  • 16. ATTRIBUTES OF OUTPUT PRIMITIVES • Any parameter that affect the way a parameter is to be displayed is referred to as an attribute parameter. • Example attribute parameter are color specification,size,position,orientation and so on. • some attributes are: 1.Line Attributes
  • 17. ATTRIBUTES OF OUTPUT PRIMITIVES 2.Curve Attributes 3.Color and Grayscale levels 4.Area Fill Attributes 5.Character Attributes 6.Marker Attributes
  • 18. 1.Line Attributes • Basic attributes of a st. Line segment are: 1.Line Type 2.Line Width 3.Pen and Brush Options 4.Line Color
  • 19. 1.Line Type – Line Attributes: • Four types: # Solid Lines( ) # Dashed Lines (------------) # Dotted Lines (.................) # Dashed Dotted Lines(-.-.-.-.-.-.-.-) • Syntax: setlinetype(lt); Where, lt - takes 4 values(positive integer numbers)
  • 20. 1.Line Type – Example: • Parameter lt, 1- Solid Lines 2- Dashed Lines 3- Dotted Lines 4- Dashed Dotted Lines • Example: setlinetype(2); setline(100,200,300,200); ------------------------
  • 21. 2.Line Width-Line Attributes: • Thickness of the line. • Syntax: setlinewidthscalefactor(lw); • Parameter lw indicates width of the line to be displayed. • Three values: 1 Standard line width 0.5 Half of the Standard line width >1 Thicker than the Standard line width
  • 22. Disadvantage- very thick line: • Use Line Cap—to adjust the shape of the line ends to give them a better appearance by adding line caps. • Three types of line cap: 1.Butt Cap 2.Round Cap 3.Projecting Square Cap
  • 23. Line Cap – Types: 1.Butt Cap: It is obtained by adjusting the end positions of the components parallel lines so that the thick line is displayed with square end.
  • 24. Line Cap – Types: 2.Round Cap It is obtained by adding semicircle to butt cap.
  • 25. Line Cap – Types: 3.Projected Square Cap It is us to extend the line and add the butt cap.
  • 26. Three Methods for smoothly joining two line segments: 1.Miter Join: Join two segments by extending outer boundaries. 2.Round Join: Joining two segment by circular boundary. 3.Bevel Join: Joining two segments by butt cap.
  • 27. 1.Miter Join 2.Round Join 3.Bevel Join
  • 28. 3.Pen and Brush Options # Lines can be displayed with pen or brush selections. #Options in this category include shape,size and color
  • 29. 4.Line Color • Number of color choices depends on the number of bits. • Syntax: setcolor(lc); • Example: setcolor(0); black
  • 30. 2.CURVE ATTRIBUTES • Parameter for curve attributes are same as those for line segments. • Curves displayed with varying colors,widths,dot-dashed pattern and pen or brush options.
  • 31. 3.Color and Grayscale Levels • Two types of system: 1.Raster Scan System(any number of color) 2.Random Scan System(limited color) • Color Options: # Color information is stored in the frame buffer in two ways: 1.Store the color code directly into the frame buffer. # Suitable only for high resoultion system. # very expensive Each time if we access the frame buffer for choosing the colors,frame buffer cost will be increased.
  • 32. Color and Grayscale Levels 2.maintains the color table # suitable for low resolution system # very cheap # use the color code in a separate table and use pixel as an index into this table.
  • 33. Color and Grayscale Levels # Color Codes: • 3bit per pixel • Ex: 0 0 0 leftmost middle control rightmost Control red green control blue INTENSITY LEVEL
  • 34. Color and Grayscale Levels • Each color codes has been controlled by RGB mode. • Color Table: # The table which is used to store color values in a color look up table. # Also called as video lookup table. # Frame buffer values are now used as an index into color table.
  • 35. Color and Grayscale Levels • Color Representation: To represent the colors use the following syntax: setcolorrepresentation(ws,c,colorpts) where, ws---workstation c---colorindex colorpts---3bits of colors
  • 36. Color and Grayscale Levels Advantages: 1.uses 256 or 512 different colors. 2.color table is unique 3.reduce the repeated colors 4.reduce the frame buffer storage
  • 37. Gray Scale Levels • Gray(2 bits) • Grayscale(3 bits) black+white=gray • No color capability • Shaded gray or grayscale colors • Values 0 to 1 • Intensity codes for a four level Gray scale system:
  • 39. Gray Scale Levels—3bits FRAME BUFFER VALUE 3 BITS BINARY CODE COLORS 0 000 BLACK 1 001 DARK BLACK 2 010 LIGHT BLACK 3 011 DARK GRAY 4 100 LIGHT GRAY 5 101 DARK WHITE 6 110 LIGHT WHITE 7 111 WHITE
  • 40. 4.Character Attributes • Character Attributes: The appearance of displayed characters is controlled by attributes such as font, size, colour and orientation. • Attributes can be set both for entire character strings and for individual characters, known as Marker symbols.
  • 41. Character Attributes-Text Attributes 1. Text Attributes: • There are many text options available, such as font, colour, size, spacing, and orientation. • Text Style: The characters in a selected font can also be displayed in various underlining styles (solid, dotted, dashed, double), in bold, in italics, shadow style, etc. Example: setTextFont(tf)
  • 42. Character Attributes-Text Attributes • Text Color: Control of text color is managed with: Example: setTextColorIndex(tc) where tc specifies an allowable color code • Text Size: We can adjust text size by changing the overall dimensions, i.e., width and height, of characters or by changing only the width. Example: setCharacterHeight(ch)
  • 43. • The width of the text can be set by setCharacterExpansionFactor(cw) where,cw---scales the body width of a character.
  • 44. • Spacing between characters is controlled separately with • Ex: setCharacterSpacing(cs)
  • 45. Ex: setCharacterUpVector(upvector) • Text Orientation: The text can be displayed at various angles, known as orientation. • Character strings can be arranged vertically or horizontally. • A text orientated by 45 degrees in anticlockwise and clockwise direction
  • 46. Text Path: #Character strings are arranged vertically or horizontally. #This is known as Text Path. #Text path can be right, left, up or down. • Ex:setTextPath(tp)
  • 47. Ex: setTextAlignment(h,v) Text Alignment: • This attribute specifies how text is to be positioned. • Vertical alignment can be top, cap, half, base and bottom. • Similarly, horizontal alignment can be left, centre and right. ------------------------TOP -----------------------CAP -----------------------HALF -----------------------BASE ----------------------BOTTO LEFT CENTRE RIGHT ALIGNMENT VALUES FOR A STRING PRINCE
  • 48. 5.Marker Attributes • It is a single character that can be displayed in different colors and in different sizes. • To set the marker symbol,use: setMarkerType(mt) • It takes 5 values: VALUE MARKERTYPE 1 Dot(.) 2 Vertical cross(+) 3 Asterisk(*) 4 Circle(0) 5 Diagonal cross(x)
  • 49. Marker Attributes • To set the marker size,use setMarkerSizeScaleFactor(ms) • Marker color is specified with setPolyMarkerColorIndex(mc) use the color code VALUE MEANING VALUE>1 Character Enlargement VALUE<1 Reduce the marker size