JPH09102048A - Picture processor - Google Patents

Picture processor

Info

Publication number
JPH09102048A
JPH09102048A JP25599995A JP25599995A JPH09102048A JP H09102048 A JPH09102048 A JP H09102048A JP 25599995 A JP25599995 A JP 25599995A JP 25599995 A JP25599995 A JP 25599995A JP H09102048 A JPH09102048 A JP H09102048A
Authority
JP
Japan
Prior art keywords
sub
polygon
scan line
pixel
scan lines
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.)
Pending
Application number
JP25599995A
Other languages
Japanese (ja)
Inventor
Keiko Mizojiri
桂子 溝尻
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP25599995A priority Critical patent/JPH09102048A/en
Publication of JPH09102048A publication Critical patent/JPH09102048A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Generation (AREA)

Abstract

PROBLEM TO BE SOLVED: To obtain an area for deciding gradation at high speed with a small circuit scale by obtaining an approximate area rate from the total of distances in a polygon, which is calculated based on the edges of the polygon and the crossing points of sub-scan lines. SOLUTION: A right/]eftcrossing point calculation means 101 takes in the coordinates of the apexes of the polygon and calculates the crossing point coordinates of the sub-scan lines obtained by dividing a scan line and the right/ left edges of the polygon. A distance calculation means 102 calculates the distances of the sub-scan lines in the polygon in a picture element in order from the picture element at the extremely left of the respective scan lines based on the crossing point. An area rate calculation means 103 adds up the distances of the sub-scan lines for the respective picture elements and divides the total value by the number of the sub-scan lines so as to obtain the approximate area rate. Thus, the approximate area rate for anti-aliasing can be obtained at high speed.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】本発明は、コンピュータグラフィ
ックスにおいて、図形の描画処理に際し、画像処理を行
う画像生成処理装置、特に、多角形の塗りつぶし描画に
おけるエリアシングを除去するアンチエリアシング処理
を行う画像生成処理装置に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an image generation processing apparatus for performing image processing when drawing a figure in computer graphics, and more particularly to an anti-aliasing processing for removing aliasing in a polygonal filled drawing. The present invention relates to an image generation processing device.

【0002】[0002]

【従来の技術】コンピュータグラフィックスの分野で
は、図形を画素(ピクセル)の集まりとして扱う。した
がって、多角形の塗りつぶしにおいては、図17に示す
ように、斜め線がギザギザになるという問題がある。こ
れをジャギーまたはエリアシングと呼ぶ。
2. Description of the Related Art In the field of computer graphics, a graphic is treated as a group of pixels. Therefore, in the polygonal filling, as shown in FIG. 17, there is a problem that the diagonal line becomes jagged. This is called jaggies or aliasing.

【0003】この問題を解決するのが、アンチエリアシ
ングと呼ばれ、多角形の各辺の近傍の画素の階調(輝
度、色等の強さ)を変えて表示することで視覚的になめ
らかにする技法である。
A solution to this problem is called anti-aliasing, which is visually smooth by changing the gradation (brightness, intensity of color, etc.) of pixels near each side of the polygon. It is a technique to make.

【0004】従来、アンチエリアシングにあっては、画
素(ピクセル)をさらに縦横にそれぞれn×m個に細分
したサブピクセルを想定し、そのサブピクセルn×m個
のうち、多角形が覆っている、または通過しているサブ
ピクセルが何個あるかを調べ、その個数のn×m個に対
する割合によって面積を近似し、階調を決定する方法が
あった。例えば、図18は画素を4×4=16個に分割
した例である。多角形が覆っている、または通過してい
るサブピクセルは、図18に示す通り14個となるた
め、多角形の画素に占める面積率は、約14/16=
0.875と近似できる。したがって、この画素の階調
aは、多角形の階調をb、背景の階調をcとすると、次
の(数1)で表わされる。
Conventionally, in anti-aliasing, it is assumed that pixels (pixels) are further subdivided into vertical and horizontal subdivisions into n × m sub-pixels. There is a method of determining the gradation by checking the number of sub-pixels that are passing or passing, and approximating the area by the ratio of the number of sub-pixels to n × m. For example, FIG. 18 is an example in which the pixel is divided into 4 × 4 = 16. Since there are 14 sub-pixels which the polygon covers or passes through, as shown in FIG. 18, the area ratio of the pixels of the polygon is about 14/16 =
It can be approximated to 0.875. Therefore, the gradation a of this pixel is expressed by the following (Equation 1) where the gradation of the polygon is b and the gradation of the background is c.

【0005】[0005]

【数1】 また、従来、別の方法として、図19〜図22に示すよ
うに、画素の境界と多角形の辺の交点P1、P2を元に
座標近似点を利用したルックアップテーブルで面積を近
似し、階調を決定する方法もあった。例えば、図19に
示す例では、画素の境界と多角形の辺の交点はP1、P
2である。P1、P2を画素の周辺を例えば16に分割
した点で近似すると、それぞれQ3、Q13となる。Q
3、Q13を元に図21に示すようなルックアップテー
ブルを参照すると、面積率は0.750となる。また、
図20に示すように、画素内に頂点があった場合には、
画素の境界と多角形の辺との交点P1、P2及び内部の
頂点P3を、画素を16に分割した正方形の頂点で近似
すると、Q4、Q8、Q20となる。Q4、Q8、Q2
0を元に図22に示すような図21とは別のルックアッ
プテーブルを参照すると、面積率は0.344となる。
したがって、この画素の階調は、(数1)と同様に求め
られる。
(Equation 1) In addition, as another conventional method, as shown in FIGS. 19 to 22, the area is approximated by a lookup table using coordinate approximation points based on intersections P1 and P2 of boundaries of pixels and sides of a polygon. There was also a method of determining the gradation. For example, in the example shown in FIG. 19, the intersections of the pixel boundaries and the sides of the polygon are P1 and P.
2. When P1 and P2 are approximated by dividing the periphery of the pixel into, for example, 16 points, they become Q3 and Q13, respectively. Q
Referring to the lookup table as shown in FIG. 21 based on Q3 and Q13, the area ratio is 0.750. Also,
As shown in FIG. 20, when there is a vertex in a pixel,
When the intersections P1 and P2 of the boundaries of the pixels and the sides of the polygon and the internal vertex P3 are approximated by the vertices of a square obtained by dividing the pixel into 16, the results are Q4, Q8 and Q20. Q4, Q8, Q2
Referring to a lookup table different from that shown in FIG. 21 based on 0, the area ratio is 0.344.
Therefore, the gradation of this pixel is obtained similarly to (Equation 1).

【0006】ルックアップテーブルを用いた方法では、
上記のように近似面積率を求めるため、ルックアップテ
ーブルに通常、メモリを使用する。
In the method using the lookup table,
A memory is usually used for the look-up table in order to obtain the approximate area ratio as described above.

【0007】[0007]

【発明が解決しようとする課題】上記のような従来例の
方式のうち、サブピクセルを想定した方法では、細分化
したサブピクセル毎に多角形が覆っているか、または通
過しているかの判断が必要出あるため、サブピクセルの
数だけ演算時間がかかる(n×mに細分化した場合、n
×m倍)という問題があった。
Among the methods of the conventional examples as described above, in the method assuming a sub-pixel, it is possible to judge whether the polygon covers or passes through each sub-pixel. Since it is necessary, it takes as much calculation time as the number of sub-pixels (if subdivided into n × m, n
Xm times).

【0008】一方、ルックアップテーブルによる方式で
は、ルックアップテーブルのためのメモリが必要とな
り、回路規模が増大したり、図20に示すように画素内
に多角形の頂点が存在する場合に処理が複雑になるなど
の問題があった。
On the other hand, the look-up table method requires a memory for the look-up table, which increases the circuit scale and can be processed when a polygonal vertex exists in a pixel as shown in FIG. There was a problem that it became complicated.

【0009】本発明は、これらの従来の問題を解決する
もので、階調決定のための面積を求める際に高速に、か
つ少ない回路規模で求めることができるようにした画像
処理装置を提供することを目的とするものである。
The present invention solves these conventional problems, and provides an image processing apparatus capable of obtaining an area for determining gradations at high speed and with a small circuit scale. That is the purpose.

【0010】[0010]

【課題を解決するための手段】上記目的を達成するため
に、本発明の画像生成処理装置は、多角形の頂点の座標
データを取り込み、スキャンラインを横方向に分割した
サブスキャンラインと多角形の左右稜線との交点座標を
算出する左右交点算出手段と、スキャンラインに沿って
各画素毎に多角形に含まれるサブスキャンラインの距離
を求める距離算出手段と、画素毎にサブスキャンライン
の距離を合計し、サブスキャンライン数で割ることによ
り面積率を求める面積率算出手段とを備えたものであ
る。
In order to achieve the above object, an image generation processing apparatus of the present invention takes in coordinate data of polygon vertices and divides a scan line in a horizontal direction into a sub scan line and a polygon. The left and right intersection calculation means for calculating the coordinates of the intersection with the right and left ridge lines, the distance calculation means for calculating the distance of the sub-scan line included in the polygon for each pixel along the scan line, and the distance of the sub-scan line for each pixel And an area ratio calculation means for calculating the area ratio by summing the above and dividing by the number of sub-scan lines.

【0011】[0011]

【作用】本発明は、上記の構成により、多角形の頂点を
取り込み、多角形の左右稜線とサブスキャンラインとの
左右交点を算出し、その交点を元に各スキャンラインの
最も左の画素から順に画素内におけるサブスキャンライ
ンの多角形内部の距離を算出し、画素毎にその合計をサ
ブスキャンライン数で割ることにより近似面積率を求め
る。
According to the present invention, with the above configuration, the vertices of a polygon are taken in, the left and right intersections of the left and right ridges of the polygon and the sub-scan lines are calculated, and the leftmost pixel of each scan line is calculated based on the intersections. The approximate area ratio is obtained by sequentially calculating the distance inside the polygon of the sub-scan line in each pixel and dividing the total for each pixel by the number of sub-scan lines.

【0012】[0012]

【実施例】以下、本発明の一実施例について図1〜図1
6を参照しながら説明する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT An embodiment of the present invention will be described below with reference to FIGS.
This will be described with reference to FIG.

【0013】図1は本発明の一実施例における画像処理
装置を示すブロック図である。図1において、101は
多角形の頂点座標を取り込み、多角形の左右稜線とサブ
スキャンラインとの左右交点を算出する左右交点算出手
段、102はスキャンラインに沿って各画素毎に多角形
に含まれるサブスキャンラインの距離を求める距離算出
手段、103は画素毎にサブスキャンラインの距離を合
計し、サブスキャンライン数で割ることにより面積率を
求める面積率算出手段である。
FIG. 1 is a block diagram showing an image processing apparatus according to an embodiment of the present invention. In FIG. 1, reference numeral 101 denotes a left-right intersection calculating unit that takes in the coordinates of the vertices of the polygon and calculates the left-right intersection between the left and right edges of the polygon and the sub-scan line, and 102 is included in the polygon for each pixel along the scan line. The distance calculation means 103 calculates the distance of the sub-scan lines, and the area calculation means 103 calculates the area ratio by summing the distances of the sub-scan lines for each pixel and dividing by the number of sub-scan lines.

【0014】以上のように構成された画像処理装置が実
現する近似面積算出方法の概要を説明する。
An outline of the approximate area calculation method realized by the image processing apparatus configured as described above will be described.

【0015】図2は多角形と画素、スキャンライン、サ
ブスキャンラインの関連を表わした図である。図2にお
いて、207、208は多角形の稜線の一部を示す。ま
た図2の横方向の実線、例えば、201、202はスキ
ャンラインの境界を示し、同じく横方向の破線、例え
ば、203、204はサブスキャンラインの境界を示
す。サブスキャンラインの本数は任意であり、多ければ
多いほど正確な面積率を得ることができる。また、サブ
スキャンラインの本数は2の乗数で表わされる数とする
ことにより、割算回路に必要な回路面積を削減すること
ができる。ここではサブスキャンラインの本数を4本と
する。また、図2の縦横の実線で囲まれた範囲は1つ1
つの画素を示す。例えば、205は画素(0,0)、2
06は画素(0,1)である。以下の説明では、X軸は
右方向を正方向、Y軸は下方向を正方向と呼ぶものとす
る。
FIG. 2 is a diagram showing the relationship among polygons, pixels, scan lines, and sub-scan lines. In FIG. 2, reference numerals 207 and 208 denote part of polygonal ridge lines. In FIG. 2, horizontal solid lines, for example, 201 and 202 indicate boundaries of scan lines, and broken lines in the horizontal direction, for example, 203 and 204 indicate boundaries of sub-scan lines. The number of sub-scan lines is arbitrary, and the larger the number, the more accurate the area ratio can be obtained. Further, by setting the number of sub-scan lines to a number represented by a power of 2, the circuit area required for the division circuit can be reduced. Here, the number of sub-scan lines is four. In addition, the range surrounded by the vertical and horizontal solid lines in FIG.
Shows one pixel. For example, 205 is a pixel (0, 0), 2
06 is a pixel (0, 1). In the following description, the X-axis is called the right direction in the positive direction, and the Y-axis is called the downward direction in the positive direction.

【0016】左右交点算出手段101では、サブスキャ
ンラインの中心線(例えば、図2の209)、またはサ
ブスキャンラインの下の境界線(例えば、図2の21
0)と多角形の左右稜線との交点を求める。サブスキャ
ンラインの中心との交点例を図3に、サブスキャンライ
ンの下の境界線の交点例を図4に示す。
In the left / right intersection calculating means 101, the center line of the sub-scan line (eg, 209 in FIG. 2) or the boundary line below the sub-scan line (eg, 21 in FIG. 2).
0) and the left and right edges of the polygon are found. An example of the intersection with the center of the sub-scan line is shown in FIG. 3, and an example of the intersection of the boundary line below the sub-scan line is shown in FIG.

【0017】図3に示すように、サブスキャンラインの
中心と多角形の左右稜線との交点を求め、以降の処理を
行うと、より精度の高い面積率を求めることができる。
As shown in FIG. 3, by obtaining the intersection of the center of the sub-scan line and the left and right ridges of the polygon and performing the subsequent processing, a more accurate area ratio can be obtained.

【0018】また、図4に示すように、サブスキャンラ
インの下の境界線多角形の左右稜線との交点を求め、以
降の処理を行うと、2番目のサブスキャンラインの下の
境界線がスキャンラインの中心線と重なるため、求めた
交点座標を映像データの算出等にも流用することがで
き、回路の有効利用を図ることができる。
Further, as shown in FIG. 4, the boundary line below the sub-scan line and the intersection point with the left and right ridges of the polygon are obtained, and the subsequent processing is performed, so that the boundary line below the second sub-scan line becomes Since it overlaps with the center line of the scan line, the obtained intersection coordinates can be used for calculation of video data, etc., and the circuit can be effectively used.

【0019】ここではサブスキャンラインの下の境界線
との交点を求める方法について以下に説明する。
Here, a method for obtaining an intersection with the boundary line below the sub-scan line will be described below.

【0020】処理の流れを図5〜図7のPAD図に示
す。以下、図5〜図7に沿って左右交点算出手段101
の動作を説明する。 (交点算出準備:図5の501〜502)左右交点算出
手段101は、まず、図4に示す左右稜線の頂点データ
A(Xlu,Ylu)、B(Xld,Yld)、C(X
ru,Yru)、D(Xrd,Yrd)を取り込み、左
右稜線のそれぞれについてY座標に対するX座標の差分
dl,dr及び1/4dl,2/4dl,3/4dlを
算出する。これらの値は、次の(数2)、(数3)で算
出することができる。
The process flow is shown in the PAD diagrams of FIGS. The left-right intersection calculation means 101 will be described below with reference to FIGS.
Will be described. (Preparation of intersection calculation: 501 to 502 in FIG. 5) The left and right intersection calculation means 101, first, the vertex data A (Xlu, Ylu), B (Xld, Yld), C (X) of the left and right ridge lines shown in FIG.
ru, Yru) and D (Xrd, Yrd) are taken in to calculate the differences dl, dr and 1 / 4dl, 2 / 4dl, 3 / 4dl of the X coordinate with respect to the Y coordinate for each of the left and right ridge lines. These values can be calculated by the following (Equation 2) and (Equation 3).

【0021】[0021]

【数2】 (Equation 2)

【0022】[0022]

【数3】 これらは後の交点算出のために予め求めておくものであ
り、1/4dl及び1/4dr、2/4dl及び2/4
dr、3/4dl及び3/4dr、dl及びdrは、そ
れぞれサブスキャンライン1、2、3、4本分に対する
X座標の差分となる。 (はじめのスキャンラインでの交点座標算出:図5の5
03)まず、上側の端点のY座標Ylu(=Yru)よ
り大きく、それに最も近い1スキャンラインの4分割で
ある0.25単位の数を求める。これをY座標初期値Y
startとする(図6の509)。図8〜図11にY
startがそれぞれ0.75、0、0.25、0.5
であった場合の例を示す。次に、Y=Ystartでの
多角形とサブスキャンラインの下の境界線との左右交点
X座標Xlstart、Xrstartを算出する(図
6の510,511)。Xlstart、Xrstar
tは、次の(数4)として算出することができる。
(Equation 3) These are obtained in advance for the subsequent calculation of the intersection, and are 1 / 4dl and 1 / 4dr, 2 / 4dl and 2/4.
dr, 3/4 dl and 3/4 dr, dl and dr are the differences in the X coordinate with respect to the sub scan lines 1, 2, 3, and 4, respectively. (Calculation of intersection coordinates on the first scan line: 5 in FIG. 5)
03) First, the number of 0.25 units, which is larger than the Y coordinate Ylu (= Yru) of the upper end point and is the closest to one scan line, is calculated. This is the Y coordinate initial value Y
It is set to start (509 in FIG. 6). Y in FIGS.
start is 0.75, 0, 0.25, 0.5 respectively
The following is an example of the case. Next, X-coordinates Xlstart and Xrstart of left and right intersection points of the polygon at Y = Ystart and the boundary line below the sub-scan line are calculated (510 and 511 in FIG. 6). Xlstart, Xrstar
t can be calculated as the following (Equation 4).

【0023】[0023]

【数4】 これらのYstart、Xlstart、Xrstar
tを元に、各サブスキャンラインの下の境界線と多角形
の左右稜線との交点を順に求める。
(Equation 4) These Ystart, Xlstart, Xrstar
Based on t, the intersection points of the boundary line under each sub-scan line and the left and right ridge lines of the polygon are sequentially obtained.

【0024】まず、初めのスキャンラインでは、Yst
artの小数点以下の値により4つの場合に分けて処理
する。Ystartの小数点以下が0.75の場合、す
なわち、図8の場合にはそれぞれの交点座標は、次の
(数5)、(数6)、(数7)で算出することができる
(図6の512)。
First, in the first scan line, Yst
Depending on the value after the decimal point of art, processing is performed in four cases. When the decimal point of Ystart is 0.75, that is, in the case of FIG. 8, each intersection coordinate can be calculated by the following (Equation 5), (Equation 6), (Equation 7) (FIG. 6). 512).

【0025】[0025]

【数5】 (Equation 5)

【0026】[0026]

【数6】 (Equation 6)

【0027】[0027]

【数7】 また、Ystartの小数点以下が0の場合、すなわ
ち、図9の場合にはそれぞれの交点座標は、次の(数
8)、(数9)、(数10)で算出することができる。
(Equation 7) Further, when the decimal point of Ystart is 0, that is, in the case of FIG. 9, each intersection coordinate can be calculated by the following (Equation 8), (Equation 9), (Equation 10).

【0028】[0028]

【数8】 (Equation 8)

【0029】[0029]

【数9】 (Equation 9)

【0030】[0030]

【数10】 このとき、Y1=Ylu,X11=Xr1=Xluとし
ておく(図6の514)。
(Equation 10) At this time, Y1 = Ylu and X11 = Xr1 = Xlu are set (514 in FIG. 6).

【0031】また、Ystartの小数点以下が0.2
5の場合、すなわち、図10の場合にはそれぞれの交点
座標は、次の(数11)、(数12)、(数13)で算
出することができる(図6の515)。
The decimal point of Ystart is 0.2.
In the case of 5, that is, in the case of FIG. 10, the respective intersection coordinates can be calculated by the following (Equation 11), (Equation 12) and (Equation 13) (515 in FIG. 6).

【0032】[0032]

【数11】 [Equation 11]

【0033】[0033]

【数12】 (Equation 12)

【0034】[0034]

【数13】 このとき、Y1=Y2=Ylu,Xl1=Xr1=Xl
2=Xr2=Xluとしておく(図6の516)。
(Equation 13) At this time, Y1 = Y2 = Ylu, Xl1 = Xr1 = Xl
2 = Xr2 = Xlu is set (516 in FIG. 6).

【0035】また、Ystartの小数点以下が0.5
の場合、すなわち、図11の場合にはそれぞれの交点座
標は、次の(数14)で算出することができる。
The value after the decimal point of Ystart is 0.5.
In the case of, that is, in the case of FIG. 11, each intersection coordinate can be calculated by the following (Equation 14).

【0036】[0036]

【数14】 このとき、Y1=Y2=Y3=Ylu,Xl1=Xr1
=Xl2=Xr2=Xl3=Xr3=Xluとしてお
く。 (次のスキャンラインでの交点座標算出:図5の50
7、508)このようにして1本のスキャンラインにつ
いて各サブスキャンラインの下の境界線と多角形の稜線
との左右交点座標(Xl1,Y1)〜(Xl4,Y
4)、(Xr1,Y1)〜(Xr4,Y4)を算出した
後、左右交点算出手段101は距離算出手段102に対
して左右交点座標を出力し、2番目のスキャンラインの
処理に移る(ステップ507)。
[Equation 14] At this time, Y1 = Y2 = Y3 = Ylu, Xl1 = Xr1
= Xl2 = Xr2 = Xl3 = Xr3 = Xlu. (Calculation of intersection coordinates on the next scan line: 50 in FIG. 5)
7, 508) Thus, for one scan line, the coordinates (X11, Y1) to (X14, Y1) to (X14, Y1) of left and right intersection points of the boundary line below each sub-scan line and the ridge line of the polygon.
4), after calculating (Xr1, Y1) to (Xr4, Y4), the left / right intersection calculating means 101 outputs the left / right intersection coordinates to the distance calculating means 102, and shifts to the processing of the second scan line (step). 507).

【0037】2番目のスキャンラインにおいては、前の
スキャンラインの左右交点座標のうち、最も下のサブス
キャンラインの下の境界線との左右交点座標(Xl4
p,Xr4Pと表わす)を元に各サブスキャンラインの
下の境界線と多角形の稜線との左右交点座標を次の(数
15)、(数16)、(数17)で算出することができ
る(508)。
In the second scan line, of the left-right intersection coordinates of the previous scan line, the left-right intersection point coordinates (Xl4) with the lower boundary line of the lowermost sub-scan line.
Based on (p, Xr4P), the horizontal intersection coordinates of the boundary line under each sub-scan line and the ridge of the polygon can be calculated by the following (Equation 15), (Equation 16), (Equation 17). Yes (508).

【0038】[0038]

【数15】 (Equation 15)

【0039】[0039]

【数16】 (Equation 16)

【0040】[0040]

【数17】 3番目以降のスキャンラインでも、同様に各サブスキャ
ンラインの下の境界線と多角形の稜線との交点を算出す
ることができる。ただし、多角形の頂点が存在するスキ
ャンラインに対する対策として、左右交点のY座標と左
右稜線の下端Y座標との比較を行い、左右交点のY座標
の方が左右稜線の下端Y座標より大きかった場合、次の
稜線データを取り込むという処理を行う。以下にその処
理手順について述べる。 (座標比較、交点座標書換え:図5の506、図7)多
角形の頂点が存在するスキャンラインを見つけるため
に、各スキャンラインにおいてのY1〜Y4,Xl1〜
Xl4,Xr1〜Xr4の算出の際にY1〜Y4と左右
稜線の下端Y座標との比較を行う。Y1〜Y4のすべて
が左右稜線の両方の下端Y座標より小さかったときには
(左右稜線の下端より上にあるときには)処理を続行
し、Y1〜Y4のいずれかが左右いずれかの稜線の下端
Y座標よりも大きかったときには次の稜線を取り込み、
一番初めのスキャンラインと同様の処理を行う。例え
ば、図12に示すようにY1>Yldのとき(図7の5
21)、左右交点算出手段101は次の稜線の端点デー
タを取り込み、(数2)と同様に差分1/4dl、2/
4dl、3/4dl,dlを算出しなおす。Ystar
t=Y1であることは明白であり、(数4)と同様にX
lstartを算出しなおすことができる。また、Xl
1〜Xl4は(数6)と同様に算出しなおすことができ
る(図7の524)。
[Equation 17] For the third and subsequent scan lines, the intersection of the boundary line under each sub-scan line and the polygonal ridge line can be calculated in the same manner. However, as a countermeasure against a scan line having polygonal vertices, the Y coordinate of the left and right intersections is compared with the lower end Y coordinate of the left and right ridges, and the Y coordinate of the left and right intersections is larger than the lower end Y coordinate of the left and right ridges. In this case, the process of fetching the next edge data is performed. The processing procedure will be described below. (Comparison of coordinates, rewriting of intersection coordinates: 506 in FIG. 5, FIG. 7) In order to find a scan line in which a vertex of a polygon exists, Y1 to Y4 and X11 to each scan line are detected.
When calculating X14 and Xr1 to Xr4, Y1 to Y4 are compared with the lower end Y coordinates of the left and right ridges. When all of Y1 to Y4 are smaller than the lower end Y coordinates of both left and right ridges (when they are above the lower end of the left and right ridges), the process is continued, and any one of Y1 to Y4 is the lower end Y coordinate of the right or left ridge. If it is larger than, capture the next ridge,
The same process as the first scan line is performed. For example, as shown in FIG. 12, when Y1> Yld (5 in FIG.
21), the left-right intersection calculating means 101 takes in the end point data of the next ridge line, and the difference 1 / 4dl, 2 /
Recalculate 4dl, 3 / 4dl, and dl. Ystar
It is clear that t = Y1, and X is the same as in (Equation 4).
lstart can be recalculated. Also, Xl
1 to X14 can be recalculated in the same manner as (Equation 6) (524 in FIG. 7).

【0041】また、図13に示すように、Y2>Yld
のとき(図7の526)、Xl1はそのままで、Xl2
〜Xl4のみ上記と同様に算出しなおすことができる
(図7の529)。その他の場合についての説明は省略
する。
Further, as shown in FIG. 13, Y2> Yld
(526 in FIG. 7), X11 remains unchanged and X12
Only ~ X14 can be recalculated in the same manner as above (529 in FIG. 7). Descriptions of other cases are omitted.

【0042】また、図14に示すように、次に取り込む
稜線のないとき、すなわち、多角形の最下端の頂点にお
いては、例えば、Y3>Yld(Y3<Yrdでもあ
る)の場合、Y3〜Y4はYld,Xl3〜Xl4及び
Xr3〜Xr4はXldとしておき、その多角形につい
ての左右交点算出手段101の処理は終了する(図7の
532)。
Further, as shown in FIG. 14, when there is no ridgeline to be taken in next, that is, at the lowermost vertex of the polygon, for example, in the case of Y3> Yld (Y3 <Yrd is also true), Y3 to Y4. Is set to Yld, Xl3 to Xl4 and Xr3 to Xr4 are set to Xld, and the processing of the left-right intersection calculating means 101 for the polygon is completed (532 in FIG. 7).

【0043】なお、Y1〜Y4と左右稜線の下端Y座標
との比較は、Y1〜Y4の算出と同時に行うことによ
り、処理時間の増大を防ぐことができる。
It should be noted that the comparison of Y1 to Y4 and the Y coordinates of the lower ends of the left and right ridges can be prevented at the same time as the calculation of Y1 to Y4, thereby preventing an increase in processing time.

【0044】次に、図1の距離算出手段102の動作に
ついて図15、図16を用いて説明する。距離算出手段
102ではスキャンライン毎に左右交点算出手段101
より4つのサブスキャンラインの下の境界線と多角形の
左右稜線との交点座標(Xl1,Y1)〜(Xl4〜Y
4)、(Xr1,Y1)〜(Xr4,Y4)を受け取
り、最も左の画素から順にサブスキャンラインの下の境
界線の画素内の距離を算出する。
Next, the operation of the distance calculating means 102 of FIG. 1 will be described with reference to FIGS. 15 and 16. The distance calculation means 102 calculates the left-right intersection point calculation means 101 for each scan line.
Coordinates (Xl1, Y1) to (Xl4 to Y) of intersections between the boundary lines below the four sub-scan lines and the left and right edge lines of the polygon.
4), (Xr1, Y1) to (Xr4, Y4) are received, and the distance within the pixel of the boundary line below the sub-scan line is calculated in order from the leftmost pixel.

【0045】まず初めに、取り扱うべき画素(以下、注
目画素と呼ぶ)を求める(802)。注目画素は、Xl
1〜Xl4のうち、最も小さい値を含む画素とする。
First, a pixel to be handled (hereinafter referred to as a target pixel) is obtained (802). The pixel of interest is Xl
The pixel including the smallest value among 1 to X14 is set.

【0046】次に、注目画素における各サブスキャンラ
インの下の境界線の距離L1〜L4を算出する。L1
は、Xl1が注目画素に含まれている場合に次のように
算出する。Xl1が注目画素に含まれている場合、Xr
1が注目画素に含まれているかどうかを調べ、Xr1も
注目画素に含まれていた場合(場合Aと定義する)、次
の(数18)で算出する(804)。
Next, the distances L1 to L4 of the boundary lines below each sub-scan line in the target pixel are calculated. L1
Is calculated as follows when Xl1 is included in the pixel of interest. If Xl1 is included in the pixel of interest, Xr
It is checked whether or not 1 is included in the pixel of interest, and if Xr1 is also included in the pixel of interest (defined as case A), the following (Equation 18) is used to calculate (804).

【0047】[0047]

【数18】 それ以外の場合(場合Bと定義する)、画素の右端のX
座標をXntcrとすると、次の(数19)で算出する
ことができる(806)。
(Equation 18) Otherwise (defined as Case B), X at the right end of the pixel
If the coordinates are Xntcr, then it can be calculated by the following (Equation 19) (806).

【0048】[0048]

【数19】 また、場合Bにおいては、L1算出後、Xl1をXl1
=Xntcrtoと置き換える(807)。(場合Aに
おいてはXl1は置き換えない)。Xl1が注目画素に
含まれていない場合、L1=0とする(808)。L2
〜L4についても同様に算出する。
[Equation 19] In case B, after calculating L1, Xl1 is changed to Xl1.
= Xntcrto (807). (In case A, X11 is not replaced). If Xl1 is not included in the target pixel, L1 = 0 is set (808). L2
The same applies to L4.

【0049】このように1つの画素のL1〜L4を算出
した後、距離算出手段102はL1〜L4を面積算出手
段103に対して出力し(824)、注目画素を右隣の
画素に移して(825)、先ほど置き換えたXl1〜X
l4,Xr1〜Xr4を使用して同様にL1〜L4を求
める。
After calculating L1 to L4 of one pixel in this way, the distance calculating means 102 outputs L1 to L4 to the area calculating means 103 (824), and the pixel of interest is moved to the pixel on the right side. (825), X11 to X that were replaced earlier
L1 to L4 are similarly obtained by using 14 and Xr1 to Xr4.

【0050】ここで、距離算出手段102では、カウン
タAを持ち、各スキャンラインの処理の初めにカウンタ
Aをリセットする(801)。場合Aの処理(Xl1と
Xr1が同じ画素内にあった場合)毎にカウンタを1ず
つカウントアップし(805、509、814、81
9)、カウンタが4になった画素で処理を止め、次のス
キャンラインの処理に移ることにより、無駄を省くこと
ができる(803)。次に、図1の面積算出手段103
の動作について説明する。面積算出手段103では、各
画素毎に距離算出手段102より画素内におけるサブス
キャンラインの下の境界線の距離L1〜L4のデータを
受取り、近似面積率αを算出する。αは次の(数20)
で算出することができる。
Here, the distance calculating means 102 has a counter A and resets the counter A at the beginning of the processing of each scan line (801). In each case A (when Xl1 and Xr1 are in the same pixel), the counter is incremented by 1 (805, 509, 814, 81).
9), the processing can be stopped at the pixel where the counter becomes 4, and the processing can be shifted to the processing of the next scan line, whereby waste can be eliminated (803). Next, the area calculation means 103 in FIG.
Will be described. The area calculation means 103 receives the data of the distances L1 to L4 of the boundary line below the sub-scan line in the pixel from the distance calculation means 102 for each pixel, and calculates the approximate area ratio α. α is the following (Equation 20)
Can be calculated.

【0051】[0051]

【数20】 以上説明してきたように、左右交点算出手段101によ
り、サブスキャンラインの中心線、またはサブスキャン
ラインの下の境界線と多角形の左右稜線との交点を求
め、続いて、その交点を元に距離算出手段102でサブ
スキャンラインの中心線、または下の境界線の画素内で
の距離を求め、面積算出手段103で画素毎にその合計
をサブスキャンライン数で割ることにより、少ない回路
規模で高速にアンチエリアシングのための近似面積率を
求めることができる。
(Equation 20) As described above, the left-right intersection calculating means 101 obtains the intersection between the center line of the sub-scan line or the boundary line below the sub-scan line and the left and right edges of the polygon, and then, based on the intersection. The distance calculating means 102 obtains the distance within the pixel of the center line of the sub-scan line or the lower boundary line, and the area calculating means 103 divides the total for each pixel by the number of sub-scan lines, thereby reducing the circuit scale. The approximate area ratio for antialiasing can be obtained at high speed.

【0052】[0052]

【発明の効果】以上説明したように本発明にれば、サブ
スキャンラインと多角形の左右稜線との交点を求め、続
いて、その交点を元に各サブスキャンラインの画素内で
の距離を求めて合計し、サブスキャンライン数で割るこ
とにより、少ない回路規模で高速にアンチエリアシング
のための近似面積率を求めることができる。
As described above, according to the present invention, the intersection between the sub-scan line and the left and right ridges of the polygon is obtained, and then the distance within each pixel of each sub-scan line is determined based on the intersection. By calculating and summing and dividing by the number of sub-scan lines, the approximate area ratio for anti-aliasing can be calculated at high speed with a small circuit scale.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明の一実施例における画像処理装置を示す
ブロック図
FIG. 1 is a block diagram showing an image processing apparatus according to an embodiment of the present invention.

【図2】同画像処理装置の動作説明用で、多角形と画
素、スキャンライン、サブスキャンラインの関連図
FIG. 2 is a relational diagram of a polygon, a pixel, a scan line, and a sub-scan line for explaining the operation of the image processing apparatus.

【図3】同画像処理装置の動作説明用で、サブスキャン
ラインの中心と多角形の左右稜線との交点例の説明図
FIG. 3 is an explanatory diagram of an example of an intersection between a center of a sub-scan line and left and right ridges of a polygon for explaining the operation of the image processing apparatus.

【図4】同画像処理装置の動作説明用で、サブスキャン
ラインの下の境界線と多角形の左右稜線との交点例の説
明図
FIG. 4 is an explanatory diagram of an example of an intersection between a boundary line below a sub-scan line and left and right ridge lines of a polygon for explaining the operation of the image processing apparatus.

【図5】同画像処理装置の動作説明用で、左右交点算出
方法を示すPAD図
FIG. 5 is a PAD diagram showing a left / right intersection calculation method for explaining the operation of the image processing apparatus.

【図6】同画像処理装置の動作説明用で、はじめのスキ
ャンラインの左右稜線の交点算出方法を示すPAD図
FIG. 6 is a PAD diagram showing a method of calculating an intersection of left and right ridge lines of a first scan line, for explaining the operation of the image processing apparatus.

【図7】同画像処理装置の動作説明用で、座標比較、交
点座標書換えの方法を示すPAD図
FIG. 7 is a PAD diagram showing a method of coordinate comparison and intersection coordinate rewriting for the purpose of explaining the operation of the image processing apparatus.

【図8】同画像処理装置の動作説明用で、Y座標初期値
(Ystart)とサブスキャンラインの関連図
FIG. 8 is a relational diagram of a Y coordinate initial value (Ystart) and a sub-scan line for explaining the operation of the image processing apparatus.

【図9】同画像処理装置の動作説明用で、Y座標初期値
(Ystart)とサブスキャンラインの関連図
FIG. 9 is a relational diagram of a Y-coordinate initial value (Ystart) and a sub-scan line for explaining the operation of the image processing apparatus.

【図10】同画像処理装置の動作説明用で、Y座標初期
値(Ystart)とサブスキャンラインの関連図
FIG. 10 is a relationship diagram of a Y-coordinate initial value (Ystart) and a sub-scan line for explaining the operation of the image processing apparatus.

【図11】同画像処理装置の動作説明用で、Y座標初期
値(Ystart)とサブスキャンラインの関連図
FIG. 11 is a relational diagram of a Y coordinate initial value (Ystart) and a sub-scan line for explaining the operation of the image processing apparatus.

【図12】同画像処理装置の動作説明用で、画素内に次
の頂点が存在する場合の例を示す説明図
FIG. 12 is an explanatory diagram showing an example of the case where the next vertex exists in a pixel for explaining the operation of the image processing apparatus.

【図13】同画像処理装置の動作説明用で、画素内に次
の頂点が存在する場合の例を示す説明図
FIG. 13 is an explanatory diagram showing an example of a case where a next vertex exists in a pixel for explaining the operation of the image processing apparatus.

【図14】同画像処理装置の動作説明用で、画素内に最
後の頂点が存在する場合の例を示す説明図
FIG. 14 is an explanatory diagram showing an example of a case where a final vertex exists in a pixel, for explaining the operation of the image processing apparatus.

【図15】同画像処理装置における距離算出方法を示す
PAD図
FIG. 15 is a PAD diagram showing a distance calculation method in the image processing apparatus.

【図16】同画像処理装置における距離算出の例を示す
説明図
FIG. 16 is an explanatory diagram showing an example of distance calculation in the image processing apparatus.

【図17】従来におけるジャギーの例を示す説明図FIG. 17 is an explanatory diagram showing an example of a conventional jaggy.

【図18】従来における画素を細分化する方法を説明す
るための例を示す説明図
FIG. 18 is an explanatory diagram showing an example for explaining a conventional pixel subdivision method.

【図19】従来におけるルックアップテーブルを用いた
方法を説明するための例を示す説明図
FIG. 19 is an explanatory diagram showing an example for explaining a conventional method using a lookup table.

【図20】従来におけるルックアップテーブルを用いた
方法を説明するための例を示す説明図
FIG. 20 is an explanatory diagram showing an example for explaining a conventional method using a lookup table.

【図21】従来におけるルックアップテーブルの例を示
す説明図
FIG. 21 is an explanatory diagram showing an example of a conventional lookup table.

【図22】従来におけるルックアップテーブルの例を示
す説明図
FIG. 22 is an explanatory diagram showing an example of a conventional lookup table.

【符号の説明】[Explanation of symbols]

1 左右交点算出手段 2 距離算出手段 3 面積率算出手段 1 left-right intersection calculation means 2 distance calculation means 3 area ratio calculation means

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 多角形の頂点の座標データを取り込み、
スキャンラインを横方向に分割したサブスキャンライン
と多角形の左右稜線との交点座標を算出する左右交点算
出手段と、スキャンラインに沿って各画素毎に多角形に
含まれるサブスキャンラインの距離を求める距離算出手
段と、画素毎にサブスキャンラインの距離を合計し、サ
ブスキャンライン数で割ることにより面積率を求める面
積率算出手段とを備えた画像処理装置。
1. Importing coordinate data of polygon vertices,
The horizontal intersection calculation means for calculating the intersection coordinates of the sub-scan line obtained by dividing the scan line in the horizontal direction and the left and right ridges of the polygon, and the distance between the sub-scan lines included in the polygon for each pixel along the scan line are calculated. An image processing apparatus comprising: a distance calculating unit for obtaining a distance; and an area ratio calculating unit for obtaining an area ratio by summing the distances of sub-scan lines for each pixel and dividing by the number of sub-scan lines.
JP25599995A 1995-10-03 1995-10-03 Picture processor Pending JPH09102048A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP25599995A JPH09102048A (en) 1995-10-03 1995-10-03 Picture processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP25599995A JPH09102048A (en) 1995-10-03 1995-10-03 Picture processor

Publications (1)

Publication Number Publication Date
JPH09102048A true JPH09102048A (en) 1997-04-15

Family

ID=17286504

Family Applications (1)

Application Number Title Priority Date Filing Date
JP25599995A Pending JPH09102048A (en) 1995-10-03 1995-10-03 Picture processor

Country Status (1)

Country Link
JP (1) JPH09102048A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2327178A (en) * 1997-07-02 1999-01-13 Hewlett Packard Co Anti-aliaising method using sub-sample pixels and corresponding sub-scan lines
JP2007299285A (en) * 2006-05-01 2007-11-15 Ricoh Co Ltd Handwritten character drawing method and program for causing computer to execute the method
JP2008009897A (en) * 2006-06-30 2008-01-17 Mitsubishi Electric Corp Vector graphic drawing device and program thereof
KR101025475B1 (en) * 2009-06-17 2011-04-04 계명대학교 산학협력단 Anti-aliasing Method and Apparatus

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2327178A (en) * 1997-07-02 1999-01-13 Hewlett Packard Co Anti-aliaising method using sub-sample pixels and corresponding sub-scan lines
US6057855A (en) * 1997-07-02 2000-05-02 Hewlett-Packard Company Method and apparatus for providing polygon pixel sub-sample information using incremental means
GB2327178B (en) * 1997-07-02 2002-03-20 Hewlett Packard Co Apparatus for providing polygon pixel sub-sample information using incremental means
JP2007299285A (en) * 2006-05-01 2007-11-15 Ricoh Co Ltd Handwritten character drawing method and program for causing computer to execute the method
JP2008009897A (en) * 2006-06-30 2008-01-17 Mitsubishi Electric Corp Vector graphic drawing device and program thereof
KR101025475B1 (en) * 2009-06-17 2011-04-04 계명대학교 산학협력단 Anti-aliasing Method and Apparatus

Similar Documents

Publication Publication Date Title
US7884825B2 (en) Drawing method, image generating device, and electronic information apparatus
EP3748584B1 (en) Gradient adjustment for texture mapping for multiple render targets with resolution that varies by screen location
EP3129976B1 (en) Varying effective resolution by screen location by altering rasterization parameters
JP3840014B2 (en) Scan conversion execution apparatus for graphics display system
JP2910979B2 (en) Method and apparatus for generating sub-pixel mask in computer graphic system
US7348996B2 (en) Method of and system for pixel sampling
US6329977B1 (en) Pre-filtered antialiased lines using distance functions
US6768491B2 (en) Barycentric centroid sampling method and apparatus
JP2003271987A (en) Method of determining percentage of pixel covered by primitive
JPH0660173A (en) Method and apparatus for reducing picture
US5280569A (en) Three dimensional model describing method
JP3547250B2 (en) Drawing method
JP3471115B2 (en) Image coordinate transformation method
JPH09102048A (en) Picture processor
JPH10275241A (en) Graphic processor
US5898440A (en) Method of and apparatus for processing graphics data
EP0127249B1 (en) Pattern data processing apparatus
US7170528B1 (en) Fast glyph rendering for vector based fonts
US6232986B1 (en) Three-dimensional graphics processing apparatus
CN111223142A (en) Vertex coordinate mapping method for GPU point rasterization point size odd-even configuration
JP3872056B2 (en) Drawing method
JPH05290177A (en) Polygonal anti-aliasing system
JP4320604B2 (en) Image processing method and image processing apparatus
JPH0944695A (en) Texture mapping method and texture mapping device
KR101666131B1 (en) Vector Font Rendering with considering sub-pixel pattern