Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
UNIT-II
1. UNIT - II
❖Line Drawing Algorithm
❖Loading the Frame Buffer
❖Line Function
❖Circle-Generating Algorithm
❖Line attributes
❖Curve attributes
❖Colour and gray scale levels
❖Area fill attributes
❖Character attributes
❖Bundled attributes
❖Inquiry functions
2. LINE DRAWING ALGORITHM
❖The Cartesian slope-intercept equation for a straight line is {display style Y=mx
+b } With m representing the slope of the line and b as the y intercept. Given that
the two endpoints of the line segment are specified at positions {display style
(x1,y1)} and {display style (x2,y2)}. We can determine values for the slope m and
y intercept b with the following calculations, {display style m=(y2-y1)/(x2-
x1)} so, {display style b=y1-m.x1}.
3.
4. DDA ALGORITHM
❖DDA stands for Digital Differential Analyzer. It is an incremental method of scan
conversion of line.
❖Advantage:
❖It is a faster method than method of using direct use of line equation.
❖This method does not use multiplication theorem.
❖It allows us to detect the change in the value of x and y ,so plotting of same point
twice is not possible.
❖This method gives overflow indication when a point is repositioned.
❖It is an easy method because each step involves just two additions.
5. DISADVANTAGE
❖It involves floating point additions rounding off is done. Accumulations
of round off error cause accumulation of error.
❖Rounding off operations and floating point operations consumes a lot
of time.
❖It is more suitable for generating line using the software. But it is less
suited for hardware implementation.
6.
7. BREHENSAM LINE DRAWING
❖Bresenham's line algorithm is a line drawing algorithm that determines the points of an n-
dimensional raster that should be selected in order to form a close approximation to a straight
line between two points.
❖ It is commonly used to draw line primitives in a bitmap image (e.g. on a computer screen), as it
uses only integer addition, subtraction and bit shifting, all of which are very cheap operations in
standard computer architectures.
❖ It is an incremental error algorithm. It is one of the earliest algorithms developed in the field
of computer graphics. An extension to the original algorithm may be used for drawing circles.
8. LOADING FRAME BUFFER
❖A framebuffer (frame buffer, or sometimes framestore) is a portion of random-
access memory (RAM) containing a bitmap that drives a video display. It is
a memory buffercontaining a complete frame of data.Modern video cards contain
framebuffer circuitry in their cores. This circuitry converts an in-memory bitmap
into a video signal that can be displayed on a computer monitor.
9.
10.
11. LINE FUNCTION
❖Line function is the one which is directly involved in the core work of an
organization. It involves the primary activities such as manufacturing, selling,
purchasing etc which are required to meet the business objectives.
❖Operations, marketing, and sales are the examples of line functions.
❖Implementation of the polyline procedure is accomplished by first performing a
series of co ordinate transformation, then making a sequence of calls to a device-
level line-drawing routine.
12. CIRCLE GENERATING ALGORITHM
❖Drawing a circle on the screen is a little complex
than drawing a line. There are two popular algorithms
for generating a circle − Bresenham’s
Algorithm and Midpoint Circle Algorithm. These
algorithms are based on the idea of determining the
subsequent points required to draw the circle. Let us
discuss the algorithms in detail −
❖The equation of circle is X2+Y2=r2,X2+Y2=r2, where
r is radius.
13. ALGORITHM
❖Step 1 − Get the coordinates of the center of the circle and radius, and store them in x, y, and R
respectively. Set P=0 and Q=R.
❖Step 2 − Set decision parameter D = 3 – 2R.
❖Step 3 − Repeat through step-8 while P ≤ Q.
❖Step 4 − Call Draw Circle X,Y,P,QX,Y,P,Q.
❖Step 5 − Increment the value of P.
❖Step 6 − If D < 0 then D = D + 4P + 6.
❖Step 7 − Else Set R = R - 1, D = D + 4P−QP−Q + 10.
❖Step 8 − Call Draw Circle X,Y,P,QX,Y,P,Q.
14.
15.
16.
17. ATTRIBUTES: LINE, CURVE, AREA FILL, TEXT
❖Basic attributes of a straight line segment are its type, its width, and its colour. In some
graphics packages, lines can also be displayed using selected pen or brush options.
❖Line-type attribute - solid lines, dashed lines, and dotted lines.
❖We modify a line drawing algorithm to generate such lines by setting the length and spacing of
displayed solid
❖To set line type attributes in a PHICS application program, a user invokes the function
setline type (It)
❖ where parameter I t is assigned a positive integer value of 1,2,3, or 4 to generate lines that are,
respectively, solid, dashed, dotted, or dash-dotted.