Font Size: a A A

The Research On The Improvement Of Anti-aliasing Drawing Algorithm For Basic Graphics

Posted on:2019-04-10Degree:MasterType:Thesis
Country:ChinaCandidate:L LiFull Text:PDF
GTID:2348330569978312Subject:Electronic and communication engineering
Abstract/Summary:PDF Full Text Request
Straight lines,circles,and ellipses are the most basic raster graphics.The speed and quality of the algorithm directly affect the rendering efficiency of the whole graphics system.Although the GDI(Graphics Device Interface)of Windows has provided relevant drawing functions,using these functions directly still cannot meet the requirements of realistic graphics rendering.And the most typical example is the anti-aliasing of the basic graphics.The graphics are represented by a series of discrete pixels on Raster graphics displays,which will appear sharply jagged and affect the display effect.This kind of distortion caused by a discrete quantity representing a continuous quantity is called aliasing.Techniques for mitigating aliasing are known as anti-aliasing.At present,the research hotspot of computer graphics is to generate highly realistic graphics.Therefore,it is of great significance to study anti-aliasing algorithms for graphics.In this paper,we mainly calculate the position of the drawing point and the proportion of color distribution by using the 32-bit fixed-point decimal which express the initial value and increment of the mid-point in the real coordinates,so as to perform the anti aliasing of the straight lines,the circles and the ellipses.And then the rectangle clipping algorithm is used to speed up the anti aliasing of basic graphics.The main work of this paper is as follows:1.In order to achieve simple and fast anti-aliasing rendering of a straight line,this paper proposes an improved algorithm based on DDA and Wu algorithm.Firstly,according to the internal format of the computer floating-point number,the initial value and increment of the mid-point error term are expressed as 32-bit fixed-point decimal to achieve incremental integer operations;Then the updated integer part of the mid-point error term is extracted to determine the position of the pixel points,and the fractional part is used to determine the color mixing ratio of pixels;At last,the color of the pixel points is mixed with the background color,which quickly used by integer multiplication.Thereby it significantly improves the anti-aliasing drawing efficiency.The results show that the algorithm has good execution speed and smoothness.2.Based on the research and summary of the existing algorithm for drawing circles and ellipses,an improved algorithm based on midpoint algorithm is designed and implemented.First of all,the algorithm uses the Taylor formula to develop the dependent variable expression of a circle or an ellipse;then the algorithm uses the three-level difference method to achieve incremental operation,and be converted to the combination of only integer addition,integer subtraction and bit operations;Finally,the idea of improved line algorithm is used to determine the position of the pixel points and the color mixture of the circle or the ellipse,so as to achieve the anti-aliasing of the circle or the ellipse.The results show that the algorithm has greatly improved the drawing speed and smoothness.3.Actuallly,it is inevitable to perform the window clipping before drawing the basic graphics.This paper proposes an improved rectangle clipping algorithm.Above all,the algorithm transforms a point coordinate into a real coordinate by a coordinate system transformation;Then it uses the four boundary lines of the rectangular window to determine whether the line segment is completely outside the boundary line,when the four boundary lines can not be completely determined,then the four corners of the rectangular window are used to judge;Finally,using the intermediate results to calculate clipping further improves the speed of the algorithm.The results show that the algorithm reduces the repetitive calculation of graphics rendering and achieves the purpose of drawing lines quickly.
Keywords/Search Tags:Anti-aliasing, DDA algorithm, Wu algorithm, Mid-point algorithm, Rectangular clipping algorithm
PDF Full Text Request
Related items