Sei sulla pagina 1di 35

Computer Science III B.

Sc CS Sem : VI Year 2019 - 2020

Subject: Graphics and Multimedia

Google Classroom : oefqdki Subject code: 63A

Attributes of Output Primitives


Unit 1: Area Fill Attribute, Character Attribute
Dr.M.Manimaran,
Associate Professor,
Department Computer Science, SKACAS

oefqdki - Graphics & Multimedia Unit I Output Primitives 1


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

SNAP TALK / ATTENDANCE

oefqdki - Graphics & Multimedia Unit I Output Primitives 2


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

Lecture Agenda
• Area Fill Attributes

Fill Styles

Pattern Fill

Soft Fill

• Character Attributes

Text Attribute

Marker Attributes

oefqdki - Graphics & Multimedia Unit I Output Primitives 3


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

EXPECTED OUTCOME
After studying this class, you should be able to:

• To understand the concepts of Area Fill Attributes

• To understand the concepts of Fill Styles

• To understand the concepts of Pattern Fill

• To understand the concepts of Soft Fill

• To understand the concepts of Character Attributes

• To understand the concepts of Text Attribute

• To understand the concepts of Marker Attributes

oefqdki - Graphics & Multimedia Unit I Output Primitives 4


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

Area fill Attributes


• Options for filling a defined region include a choice between a
solid color or a pattern fill and choices for particular colors
and patterns

oefqdki - Graphics & Multimedia Unit I Output Primitives 5


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

Area fill Attributes


FILL:
• In the first case we may specify a gray shade (0-255), RGB
color (r/g/b all in the 0-255 range or in hexadecimal#rrggbb)
• HSV color (hue-saturation-value in the 0-360, 0-1, 0-1
range), CMYK color (cyan/magenta/yellow/black, each
ranging from 0-100%), or a valid color name; in that respect it
is similar to specifying the pen color settings .

oefqdki - Graphics & Multimedia Unit I Output Primitives 6


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

Area fill Attributes


FILL:
There are three fill styles:
• Hollow with color border
• Filled with solid color
• Filled with specific pattern or design.

oefqdki - Graphics & Multimedia Unit I Output Primitives 7


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

Area fill Attributes


Hollow With Color Border
• The basic fill style is selected in the PHIGS
application program as
setInteriorStyle (fs)

• where fs is normally applied to the polygon areas it can


also implemented to fill region with curved boundaries

oefqdki - Graphics & Multimedia Unit I Output Primitives 8


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

Area fill Attributes


Filled with solid color
• It is used to display the single color uptoincluding the
borders of the region.
Function:
SetInteriorColorIndex(Fc)
• Where the fill color parameter fc is to set the desired
color code.

oefqdki - Graphics & Multimedia Unit I Output Primitives 9


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

Area fill Attributes


Pattern Fill
• Select fill pattern with
• Set interior Style Index(pi)

oefqdki - Graphics & Multimedia Unit I Output Primitives 10


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

Area fill Attributes


Pattern Fill
• Where the pattern index parameter pi specified to the
table position.
• The following are the set of statements to fill the
area defined in the fill area command.
setInteriorStyle(pattern);
setInteriorStyleIndex(2);
fillarea(n,points);

oefqdki - Graphics & Multimedia Unit I Output Primitives 11


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

Area fill Attributes

oefqdki - Graphics & Multimedia Unit I Output Primitives 12


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

Area fill Attributes


The process of filling a rectangular pattern called tiling.
The rectangular fill pattern is sometimes called as tiling
pattern

oefqdki - Graphics & Multimedia Unit I Output Primitives 13


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

Area fill Attributes


Soft fill
• The modified boundary fill and flood fill procedures
that are applied to repaint area so that the fill color is
combined with the background color is referred to as
soft fill and tint fill algorithm.

oefqdki - Graphics & Multimedia Unit I Output Primitives 14


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

Area fill Attributes


• Using linear soft fill algorithm repaints the area that was
originally painted by merging the foreground color F
with the single background color B ,where F!= B.
• Assuming that we know the values of F and B we
have to determine how these colors originally combined
with current color contents of the frame buffer.

oefqdki - Graphics & Multimedia Unit I Output Primitives 15


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

Area fill Attributes


• The current RGB color P of each pixel within a area is
defined as

P=tF+(1-t)B

• Where T is the transperancy factor between o and 1 for


each pixel.the value of the T is less than 0.5,the
background color contributes more to interior color.

oefqdki - Graphics & Multimedia Unit I Output Primitives 16


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

Character & Text Attributes


• The appearance of displayed character is controlled by
attributes such as font, size, color and orientation.
Text Attributes
• The choice of font or type face is set of characters with a
particular design style as courier, Helvetica, times
roman, and various symbol groups.
• setTextFont(tf)
• setTextColourIndex(tc)
• SetCharacterHeight (ch)

oefqdki - Graphics & Multimedia Unit I Output Primitives 17


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

Character & Text Attributes


• SetCharacterExpansionFactor(cw)

• setCharacterSpacing(cs)

oefqdki - Graphics & Multimedia Unit I Output Primitives 18


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

Character & Text Attributes


• setCharacterUpVector(upvect)

• setTextPath (tp)
• setTextAlignment (h,v)
• setTextPrecision (tpr)

oefqdki - Graphics & Multimedia Unit I Output Primitives 19


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

Key Points
– Soft fill
– Pattern fill
– Text attributes
– Area fill attributes
– Character attributes

oefqdki - Graphics & Multimedia Unit I Output Primitives 20


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

MCQ
1. A basic fill style is selected in a PHIGS program with the
function
a) setInteriorStyle (fs)
b) setStyle (fs)
c) SetfillStyle (fs)
d) setInteriorStyleIndex (fs)

oefqdki - Graphics & Multimedia Unit I Output Primitives 21


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

MCQ
2. Which one is not a type of basic fill styles?
a) Hollow
b) solid color
c) Pattern
d) Dark

oefqdki - Graphics & Multimedia Unit I Output Primitives 22


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

MCQ
3. The process of filling an area with rectangular
pattern is called
a) Tiling
b) Linear fill
c) Tint-fill
d) Soft-fill

oefqdki - Graphics & Multimedia Unit I Output Primitives 23


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

MCQ ANSWERS
1) Answer: a
Explanation: We can select the basic fill style by using
setInteriorStyle (fs).
2) Answer: d
Explanation: Dark fill is not a type of basic fill style, rest
of them is the basic fill styles.
3) Answer: a
Explanation: Rectangular fill pattern is called tiling or
tiling pattern.

oefqdki - Graphics & Multimedia Unit I Output Primitives 24


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

UNIT-I QUESTIONS
SECTION A
1. The slope intercept line equation is given by ________.
2. Expand DDA.
3. _____is used for photo realistic images and for computer drawings.
4. _____ is a faster method for calculating pixel position.
5. The efficient raster line algorithm was developed by _________.
6. The circle is a frequently used component in ______&________.
7. The mid-point method, the circle function is given by ________.
8. The general equation of ellipse is stated as ________.
9. The eccentric circle of ellipse is called as __________.
10. For any circle point the distance relationship is expressed by
________.

oefqdki - Graphics & Multimedia Unit I Output Primitives 25


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

UNIT-I QUESTIONS
SECTION B
1. Explain about different types of line attributes.
2. Describe the various area fill attributes.
3. Write a note on color and gray scale level.
4. Explain about points and lines.
5. Write short notes on DDA algorithm.
6. Explain about line equations.
7. Explain about properties of circles.
8. Explain about properties of ellipse.
9. Write short notes on line width.
10. Write a short note on styles of fill attributes.

oefqdki - Graphics & Multimedia Unit I Output Primitives 26


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

UNIT-I QUESTIONS
SECTION C
1. With procedure explain the Bresenham’s line drawing algorithm.
2. Explain briefly about circle generating algorithm.
3. Briefly discuss the midpoint ellipse algorithm.
4. Describe about area fill attributes.
5. Explain briefly about DDA line drawing algorithm.
6. Discuss briefly the character attributes.
7. Explain the ellipse generating algorithm.
8. Discuss the midpoint circle algorithm in detail.
9. Explain briefly about properties of circle and ellipse generating
algorithm.
10. Explain briefly about line attributes.

oefqdki - Graphics & Multimedia Unit I Output Primitives 27


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

UNIT-I QUESTIONS
SECTION A(Previous year University QP)
1) Digital devices display a straight line segment by plotting discrete
points between ________ end points
a) Eight
b) Six
c) Four
d) Two
2) In Color raster system, the number of color choices available
depends on the amount of storage provided per pixel in the ____ buffer
a) Frame
b) Storage
c) System
d) Raster
oefqdki - Graphics & Multimedia Unit I Output Primitives 28
Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

UNIT-I QUESTIONS
SECTION B(Previous year University QP)

1) Write a not on the properties of circle


2) Discuss briefly about curve attributes

oefqdki - Graphics & Multimedia Unit I Output Primitives 29


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

UNIT-I QUESTIONS
SECTION C(Previous year University QP)

1) Explain the midpoint ellipse algorithm with suitable


algorithm
2) Describe about color and grayscale levels

oefqdki - Graphics & Multimedia Unit I Output Primitives 30


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

VIDEO URL
https://www.youtube.com/watch?v=yZIyWA08sJ4

oefqdki - Graphics & Multimedia Unit I Output Primitives 31


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

One mark URL


https://www.sanfoundry.com/computer-graphics-mcqs-
area-fill-attributes/

oefqdki - Graphics & Multimedia Unit I Output Primitives 32


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

Next Lecture
Unit –II 2D Geometric Transformations: Basic
Transformations – Matrix Representations

oefqdki - Graphics & Multimedia Unit I Output Primitives 33


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

DISCUSSIONS

oefqdki - Graphics & Multimedia Unit I Output Primitives 34


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

oefqdki - Graphics & Multimedia Unit I Output Primitives 35

Potrebbero piacerti anche