CN101901590B - Method and system for anti-sawtooth polygonal rasterization - Google Patents
Method and system for anti-sawtooth polygonal rasterization Download PDFInfo
- Publication number
- CN101901590B CN101901590B CN 200910142114 CN200910142114A CN101901590B CN 101901590 B CN101901590 B CN 101901590B CN 200910142114 CN200910142114 CN 200910142114 CN 200910142114 A CN200910142114 A CN 200910142114A CN 101901590 B CN101901590 B CN 101901590B
- Authority
- CN
- China
- Prior art keywords
- polygon
- segment
- area
- rasterization
- rasterized
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Landscapes
- Image Generation (AREA)
Abstract
The invention discloses a method and a system for anti-aliased polygonal rasterization. The method for the anti-aliased polygonal rasterization comprises the following steps of: calculating a side equation of each side of a polygon by using vertex coordinates of the polygon; judging whether a rasterization segment which is used for rasterizing the polygon intersects with the polygon by using the side equation of each side, and if so, calculating the intersecting area of the rasterization segment and the polygon; and mixing the polygon and the display background of the polygon according to the intersecting area. By performing the anti-aliased polygonal rasterization, the method does not need to repeatedly sample the rasterization segment. Therefore, the needed calculation amount is effectively reduced.
Description
Technical field
The present invention relates to the graphics process field, relate more specifically to a kind of method and system of the polygonal gird for anti-sawtooth.
Background technology
The rasterizing of figure is a kind of processing procedure (that is, figure being carried out the processing procedure of pixelation) that polar plot is converted to bitmap.The task that polygon on the raster graphic display subsystem is scanned conversion is to determine to be positioned at the coordinate of the pixel of the polygon on the two-dimensional grating lattice.The pixel that illuminates fully on many line segments that comprise this polygon is similar to this polygonal notch cuttype pattern with generation.
Existing for anti-sawtooth (namely, what the technology of polygonal gird anti-notch cuttype pattern) adopted usually is the method for multiple sampling, namely, a plurality of points of rasterizing segment are sampled and calculated the sampled value of each sampled point, thereby then a plurality of sampled values are carried out the color value that filtering obtains the rasterizing segment.
Can be found out that by the above the technology of existing polygonal gird for anti-sawtooth is consuming time and calculation of complex not only, and when realizing with example, in hardware, will need the support of expensive additional hardware.If the raster graphic display subsystem is a sufficiently high subsystem of performance, then the technology of the above-mentioned polygonal gird that is used for anti-sawtooth can realize polygonal gird well.Yet, for graphic system cheaply, need to make compromise aspect the raster graphic Graphics Processing speed, to have the competitive power on the price.In this graphic system, the use of Reduced Instruction Set Computer (RISC) CPU (central processing unit) (CPU) will make the needed degrees of compromise in processor performance aspect minimum.But, use the polygonal gird method of traditional anti-sawtooth will make the graphic response in these graphic systems seem slow.So, need a kind of faster and calculate the relatively simple system and method that is used for the polygonal gird of anti-sawtooth than conventional art.
Summary of the invention
One or more problems in view of the above the invention provides a kind of method and system of the polygonal gird for anti-sawtooth.
The method of the polygonal gird that is used for anti-sawtooth according to an aspect of the present invention comprises: utilize polygonal apex coordinate to calculate the limit equation on polygonal each bar limit; Utilize the limit equation on each bar limit to judge for the rasterizing segment of polygon being carried out rasterizing whether intersect with polygon; If intersect, then computation grid segment and polygonal crossing area; And according to crossing area, the display background at polygon and polygon place is mixed.
The system of the polygonal gird that is used for anti-sawtooth according to a further aspect in the invention comprises: the equation computing unit is used for utilizing polygonal apex coordinate to calculate the limit equation on polygonal each bar limit; Intersect judging unit, be used for utilizing the limit equation on each bar limit to judge for the rasterizing segment of polygon being carried out rasterizing whether intersect with polygon; The area computing unit is used in the crossing situation of rasterizing segment and polygon computation grid segment and polygonal crossing area; And the figure mixed cell, be used for according to intersecting area the display background at polygon and polygon place being mixed.
Adopt the present invention to carry out the polygonal gird of anti-sawtooth, do not need the rasterizing segment is carried out multiple sampling, thereby effectively reduced required calculated amount.
Description of drawings
From below in conjunction with the present invention may be better understood the description of accompanying drawing to the specific embodiment of the present invention, wherein:
Fig. 1 shows the block diagram according to the system of the polygonal gird that is used for anti-sawtooth of the embodiment of the invention;
Fig. 2 shows the detailed diagram of the spider module in the system shown in Figure 1;
Fig. 3 shows the block diagram of the system of the polygonal gird that is used for according to another embodiment of the present invention anti-sawtooth;
Fig. 4 shows Fig. 1 carries out the main process of polygonal gird to the system of the polygonal gird for anti-sawtooth shown in Figure 2 process flow diagram;
Fig. 5 shows the polygonal contrast synoptic diagram that the method/system of the polygonal gird of polygon that the method/system of the polygonal gird of anti-sawtooth not draws and anti-sawtooth is drawn;
Fig. 6 shows the synoptic diagram of the various relations on rasterizing segment and a polygonal limit; And
Fig. 7 shows the synoptic diagram that rasterizing segment and polygon intersect and be positioned at the situation outside polygonal many limits.
Embodiment
The below will describe feature and the exemplary embodiment of various aspects of the present invention in detail.In the following detailed description, many details have been proposed, in order to complete understanding of the present invention is provided.But, it will be apparent to those skilled in the art that in the situation of some details that the present invention can be in not needing these details and implement.The below only is in order to provide better understanding of the present invention by example of the present invention is shown to the description of embodiment.Any concrete configuration and the algorithm that propose below the present invention never is limited to, but any modification, replacement and the improvement that have covered under the premise of without departing from the spirit of the present invention element, parts and algorithm.In the the accompanying drawings and the following description, known structure and technology are not shown, in order to avoid the present invention are caused unnecessary bluring.
Fig. 1 shows the block diagram according to the system of the polygonal gird that is used for anti-sawtooth of the embodiment of the invention.As shown in Figure 1, the system 100 that should be used for the polygonal gird of anti-sawtooth comprises: vertex information storer 102 is used for the polygonal apex coordinate that storage need to be carried out rasterizing; Conversion and projection module 104 are used for reading apex coordinate from the vertex information storer, and apex coordinate are projected on the device coordinate; Arrange and spider module 106, be used for the use device coordinate and find out the pixel (that is, the rasterizing segment) that is positioned at polygon, and calculate the display parameter (color/texture) of these pixels; Frame buffer 108 is used for the display parameter of these pixels are carried out buffer memory; And image display module 110, for the polygon after the show grid processing.
Particularly, conversion and projection module 104 read the polygonal apex coordinate that need to carry out rasterizing from vertex information storer 102, and apex coordinate is projected on the device coordinate; Setting and spider module 106 use device coordinates are found out the pixel that is positioned at polygon, and calculate the display parameter (color or texture) of these pixels, then with these parameter read-in frame buffers 108.At last, image display module 110 utilizes the polygon after parameter in the frame buffer is come show grid.
Fig. 2 shows setting in the system shown in Figure 1 and the detailed diagram of spider module.As shown in Figure 2, the setting unit 1062 in setting and the spider module 106 is obtained the apex coordinate on polygonal each summit, and uses these apex coordinates to calculate the limit equation on polygonal each bar limit.Setting unit 1062 with the coefficient information of the limit equation on each bar limit send to arrange and spider module 106 in traversal unit 1064 so that the traversal unit carries out following processing: judge according to the limit equation on polygonal each bar limit whether the rasterizing segment crossing with polygon; If intersect, then computation grid segment and polygonal crossing area; Utilize the apex coordinate of rasterizing segment that polygonal display parameter (for example, color/parametric texture) are carried out interpolation; And utilize the crossing area that calculates, the display parameter after the polygonal interpolation are mixed with the display parameter of display background.
Fig. 3 shows the system that is used for according to another embodiment of the present invention the polygonal gird of anti-sawtooth.As shown in Figure 3, the system 300 that should be used for the polygonal gird of anti-sawtooth comprises: equation computing unit 302 is used for utilizing polygonal apex coordinate to calculate the limit equation on polygonal each bar limit; Intersect judging unit 304, be used for utilizing the limit equation on each bar limit to judge for the rasterizing segment of polygon being carried out rasterizing whether intersect with polygon; Area computing unit 306 is used in the crossing situation of rasterizing segment and polygon computation grid segment and polygonal crossing area; And figure mixed cell 308, be used for according to intersecting area the display background at polygon and polygon place being mixed.Wherein, area computing unit 306 further comprises the first computing unit 3062 and the second computing unit 3064, and the first computing unit 3062 further comprises intersection edges acquiring unit 3062-2, calculation block setting unit 3062-4 and sheet basal area computing unit 3062-6.
Fig. 4 shows Fig. 1 carries out the main process of polygonal gird to the system of the polygonal gird that is used for anti-sawtooth shown in Figure 3 process flow diagram.As shown in Figure 4, this process comprises: S402, utilize polygonal apex coordinate to calculate the limit equation on polygonal each bar limit; S404 utilizes the limit equation on each bar limit to judge for the rasterizing segment of polygon being carried out rasterizing whether intersect with polygon; S406, if intersect, then computation grid segment and polygonal crossing area; And S408, according to crossing area, the display background at polygon and polygon place is mixed.
For example, step S402 can finish by the setting unit 1062 in the setting shown in Fig. 1 and Fig. 2 and the spider module 106, and step S404~S408 can finish by the traversal unit 1064 in the setting shown in Fig. 1 and Fig. 2 and the spider module 106.Perhaps, step S402~S408 can be finished by the equation computing unit 302 shown in Fig. 3, crossing judging unit 304, area computing unit 306 and figure mixed cell 308 respectively.
In the polygonal gird method of anti-sawtooth not, only judge whether the center of rasterizing segment is positioned at polygon.If be positioned at polygon, judge that then this rasterizing segment is for being drawn.In the polygonal gird method of anti-sawtooth, need to judge polygonal inside whether with the rasterizing segment in part crossing.Fig. 5 shows the polygonal contrast synoptic diagram that the method/system of the polygonal gird of polygon that the method/system of the polygonal gird of anti-sawtooth not draws and anti-sawtooth is drawn.As can be seen from the figure, the technology of the polygonal gird by adopting anti-sawtooth can make the more natural of polygonal border and background transition, thereby can avoid producing jagged edge effect.
The below specifically describes the detailed processing procedure of step S404~S408:
Step S404 utilizes the limit equation on each bar limit to judge for the rasterizing segment of polygon being carried out rasterizing whether intersect with polygon.Fig. 6 shows the synoptic diagram of the various relations on rasterizing segment and a polygonal limit.
The limit equation of supposing n limit shape (n 〉=3) is ei (x, y)=ai*x+bi*y+ci, (i=0,1,2 ..., n-1), the centre coordinate of rasterizing segment is (x, y), and four summits are V0 (x-0.5, y-0.5), V1 (x+0.5, y-0.5), V2 (x-0.5, y+0.5), V3 (x+0.5, y+0.5).When meeting the following conditions, judge that rasterizing segment and polygon intersect: the rasterizing segment is positioned in the polygonal bounding box (that is, comprising this polygonal minimum rectangle); For polygonal any limit, from four summits of rasterizing segment, select a summit Vt (xt, yt), this summit for the limit equation value ei (xt, yt) of this edge for just.Wherein, the selection of Vt (xt, yt) is that the coefficient (ai, bi) of the limit equation by this edge obtains.When ai>=0 and bi>=0, Vt=V3; When ai>=0 and bi<0, Vt=V1; When ai<0 and bi>=0, Vt=V2; And when ai<0 and bi<0, Vt=V0.Deterministic process is achieved as follows particularly:
for(i=0;i<n;i++=
{
if(a[i]≥0)dx=0.5;else dx=-0.5;
if(b[i]≥0)dy=0.5;else dy=-0.5;
xt=x+dx;
yt=y+dy;
if(a[i]*xt+b[i]*yt+c[i]≤0)return false;
}
return true;
S406, if intersect, then computation grid segment and polygonal crossing area.This step comprises 5 sub-steps:
1) part of finding out the rasterizing segment is positioned at its outer polygonal limit.This step for example can be finished by intersection edges acquiring unit 3062-2.
The limit equation of supposing n limit shape is ei (x, y)=ai*x+bi*y+ci, (i=0,1,2 ..., n-1), the coordinate at the center of rasterizing segment is (x, y), and four summits are V0 (x-0.5, y-0.5), V1 (x+0.5, y-0.5), V2 (x-0.5, y+0.5), V3 (x+0.5, y+0.5).From four summits of rasterizing segment, select a summit Vt (xt, yt), if this summit for the limit equation value of a certain limit ei not for just, judge that then this rasterizing segment has this edge ei zone in addition.Deterministic process is achieved as follows particularly:
if(a[i]≥0)dx=-0.5;else dx=0.5;
if(b[i]≥0)dy=-0.5;else dy=0.5;
xt=x+dx;
yt=y+dy;
if(a[i]*xt+b[i]*yt+c[i]≤0)return true;
else return false;
2) the rasterizing segment is set in step 1) in the calculation block of perimeter on the limit that draws.This step for example can be finished by calculation block setting unit 3062-4.
Suppose that the limit that the rasterizing segment has its perimeter is ei (x, y), and e[i] the x coordinate on two summits be xmin[i] and xmax[i] (xmin[i]<xmax[i]=.Four summits of calculation block are (xs, ys), (xs, ye), (xe, ys), (xe, ye).Wherein, if xmin[i] and xmax[i] be not positioned at the inside of rasterizing segment, then the position of calculation block is exactly the position at rasterizing segment place; If xmin[i] or xmax[i] be positioned at the inside of rasterizing segment, corresponding xs then, xe need to be modified to xmin[i] and xmax[i], concrete computation process is as follows:
if(xt==x+0.5)
{
if(xt>xmax[i])xs=xmax[i];else xs=xt;
if(x-0.5<xmin[i])xe=xmin[i];else xe=x-0.5;
}
else
{//xt==x-0.5
if(xt<xmin[i])xs=xmin[i];else xs=xt;
if(x+0.5>xmax[i])xe=xmax[i];else xe=x+0.5;
}
if(yt==y-0.5)
{ys=yt;ye=y+0.5};
else
{ys=yt;ye=y-0.5}
3) the computation grid segment is in step 1) in the area in zone of outside on the limit that draws.
Four summits of calculation block are V0 (xs, ys), V1 (xe, ys), V2 (xs, ye), V3 (xe, ye).The e[i of V0/V1/V2/V3] value is for e0[i]/e1[i]/e2[i]/e3[i].The area Soe[i of the perimeter in the rasterizing segment] as follows:
e0[i] | <0 | <0 | <0 | <0 | >=0 |
e1[i] | >=0 | <0 | <0 | >=0 | / |
e2[i] | >=0 | >=0 | <0 | <0 | / |
Soe[i] | |e0[i]/a|*|e0[i]/b|/2 | (|e0[i]/b|+|e1[i]/b|)/2 | 1-(|e3[i]/a|*|e3[i]/b|/2) | (|e0[i]/a|+|e2[i]/a|)/2 | 0 |
4) to the rasterizing segment in step 1) in the area summation of all perimeters on the limit that draws.
for(i=0;i<n;i++)
{
Sop+=Soe[i]
}
Wherein, if the most left polygonal or summit, the rightmost side is positioned at the rasterizing segment, then need cumulative perimeter.Fig. 7 shows the synoptic diagram that rasterizing segment and polygon intersect and be positioned at the situation outside polygonal many limits.
The x coordinate of supposing summit, the polygonal leftmost side is gxmin, the x coordinate on summit, the rightmost side is gxmax, (x-0.5<gxmin<x+0.5=, then the area on the gxmin left side (gxmin-x+0.5) needs additionally cumulative if gxmin is positioned at the rasterizing segment.Equally, (x-0.5<gxmax<x+0.5), then the area (x+0.5-gxmax) on gxmax the right needs additionally cumulative if gxmax is positioned at the rasterizing segment.
If(x-0.5<gxmin<x+0.5=Sop+=gxmin-x+0.5;
If(x-0.5<gxmax<x+0.5=Sop+=x+0.5-gxmax;
Substep 3) and 4) for example can be finished by sheet basal area computing unit 3062-6.From above for substep 1)~5) description can find out that these substeps are processing procedures that the computation grid segment is positioned at the area of the outer segment part of polygon, this process for example can be finished by the first computing unit 3062.
5) last, draw crossing area by equation coverage=1-Sop.This step for example can be finished by the second computing unit 3064.
S408 according to crossing area, mixes the display background at polygon and polygon place.Parameter after the polygonal interpolation is mixed with context parameter, to realize the effect of anti-sawtooth.Wherein, blending ratio is for intersecting area.
P=Pb*(1-Coverage)+Pi*Coverage;
Wherein, Pb is context parameter, and Pi is the parameter after the interpolation.
In sum, the polygonal girdization that adopts the present invention to carry out anti-sawtooth does not need the rasterizing segment is carried out multiple sampling, thereby has effectively reduced required calculated amount.
It should be noted that, above-described each module and/or each unit (for example can use the hardware of pre-programmed or firmware components, special IC (ASIC)) realizes, also can use to comprise erasable remove also data processing equipment or other relevant assembly realization of programmable ROM (read-only memory) (EEPROM).
It will be understood by those skilled in the art that also to have how optional embodiment and the improved procedure that can be used in the present invention embodiment, and above-mentioned embodiment and example only are the explanations of one or more embodiment.Therefore, scope of the present invention is only limited by appended claims.
Claims (8)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 200910142114 CN101901590B (en) | 2009-05-25 | 2009-05-25 | Method and system for anti-sawtooth polygonal rasterization |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 200910142114 CN101901590B (en) | 2009-05-25 | 2009-05-25 | Method and system for anti-sawtooth polygonal rasterization |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101901590A CN101901590A (en) | 2010-12-01 |
CN101901590B true CN101901590B (en) | 2013-01-16 |
Family
ID=43227084
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN 200910142114 Expired - Fee Related CN101901590B (en) | 2009-05-25 | 2009-05-25 | Method and system for anti-sawtooth polygonal rasterization |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101901590B (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102722902B (en) * | 2011-05-06 | 2016-05-04 | 新奥特(北京)视频技术有限公司 | Anti-aliasing the improving one's methods of rasterization stage in a kind of graph rendering streamline |
CN102737401A (en) * | 2011-05-06 | 2012-10-17 | 新奥特(北京)视频技术有限公司 | Triangular plate filling method in rasterization phase in graphic rendering |
CN102736947A (en) * | 2011-05-06 | 2012-10-17 | 新奥特(北京)视频技术有限公司 | Multithread realization method for rasterization stage in graphic rendering |
CN106709857B (en) * | 2016-11-22 | 2019-12-10 | 中国人民解放军理工大学 | method for calculating intersection area of any polygon based on probability statistics |
CN106530208B (en) * | 2016-11-22 | 2019-04-09 | 中国人民解放军理工大学 | A GPU-based method for calculating the intersection area of arbitrary polygons |
CN112070699A (en) * | 2020-09-07 | 2020-12-11 | 北京赛目科技有限公司 | Image burr removing method and related device |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1806259A (en) * | 2003-06-17 | 2006-07-19 | 皇家飞利浦电子股份有限公司 | Primitive edge pre-filtering |
CN1969299A (en) * | 2004-09-06 | 2007-05-23 | 松下电器产业株式会社 | Video generation device and video generation method |
CN101114380A (en) * | 2006-03-10 | 2008-01-30 | 株式会社东芝 | Image processing apparatus and image processing method |
-
2009
- 2009-05-25 CN CN 200910142114 patent/CN101901590B/en not_active Expired - Fee Related
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1806259A (en) * | 2003-06-17 | 2006-07-19 | 皇家飞利浦电子股份有限公司 | Primitive edge pre-filtering |
CN1969299A (en) * | 2004-09-06 | 2007-05-23 | 松下电器产业株式会社 | Video generation device and video generation method |
CN101114380A (en) * | 2006-03-10 | 2008-01-30 | 株式会社东芝 | Image processing apparatus and image processing method |
Also Published As
Publication number | Publication date |
---|---|
CN101901590A (en) | 2010-12-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
TWI552109B (en) | A method, a non-transitory computer-readable storage medium and a system for conservative rasterization of primitives using an error term | |
CN101901590B (en) | Method and system for anti-sawtooth polygonal rasterization | |
US9330495B2 (en) | Extending DX11 GPU for programmable vector graphics | |
US9311738B2 (en) | Path rendering by covering the path based on a generated stencil buffer | |
CN104268911B (en) | The method and apparatus of route in map making | |
US20060044312A1 (en) | Rendering outline fonts | |
JP4327105B2 (en) | Drawing method, image generation apparatus, and electronic information device | |
TW201435795A (en) | Consistent vertex snapping for variable resolution rendering | |
KR20150041057A (en) | Gpu-accelerated path rendering | |
US9754409B2 (en) | Method, apparatus and system for tessellating a parametric patch | |
US10540789B2 (en) | Line stylization through graphics processor unit (GPU) textures | |
KR101552827B1 (en) | Method Of Dividing Three-dimensional Object Model | |
US8743135B2 (en) | Graphics processing systems | |
US11087511B1 (en) | Automated vectorization of a raster image using a gradient mesh with arbitrary topology | |
US12112409B2 (en) | Method and system for pixelating vector graphic into image | |
CN111127299A (en) | Method and device for accelerating rasterization traversal and computer storage medium | |
US10937233B2 (en) | Graphics processing systems | |
CN101199428A (en) | A device and method for processing ultrasonic echo data | |
US12354207B2 (en) | Method and system for processing graphics in tile-based rendering mode | |
JP3892016B2 (en) | Image processing apparatus and image processing method | |
CN113674419B (en) | Three-dimensional display method and device for meteorological cloud data, electronic equipment and storage medium | |
JP5956875B2 (en) | Image processing apparatus and image processing method | |
CN112581352B (en) | Multi-GPU-oriented high-performance primitive split-screen grating method | |
JP5654070B2 (en) | Image processing apparatus, image processing method, and program | |
JP2010140101A (en) | Drawing device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20130116 Termination date: 20170525 |
|
CF01 | Termination of patent right due to non-payment of annual fee |