JP4899957B2 - Anti-aliasing processing method and anti-aliasing processing apparatus - Google Patents

Anti-aliasing processing method and anti-aliasing processing apparatus Download PDF

Info

Publication number
JP4899957B2
JP4899957B2 JP2007066923A JP2007066923A JP4899957B2 JP 4899957 B2 JP4899957 B2 JP 4899957B2 JP 2007066923 A JP2007066923 A JP 2007066923A JP 2007066923 A JP2007066923 A JP 2007066923A JP 4899957 B2 JP4899957 B2 JP 4899957B2
Authority
JP
Japan
Prior art keywords
area
boundary line
pixel
axis
surrounded
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
Application number
JP2007066923A
Other languages
Japanese (ja)
Other versions
JP2008226132A (en
Inventor
俊 張
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.)
Fujitsu Semiconductor Ltd
Original Assignee
Fujitsu Semiconductor 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 Fujitsu Semiconductor Ltd filed Critical Fujitsu Semiconductor Ltd
Priority to JP2007066923A priority Critical patent/JP4899957B2/en
Publication of JP2008226132A publication Critical patent/JP2008226132A/en
Application granted granted Critical
Publication of JP4899957B2 publication Critical patent/JP4899957B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Generation (AREA)
  • Transforming Electric Information Into Light Information (AREA)

Description

本発明はアンチエイリアシング処理方法およびアンチエイリアシング処理装置に関し、特に、画素を横切る画像境界線と画素とで囲まれた面積に基づいてギザギザ現象を抑えるアンチエイリアシング処理方法およびアンチエイリアシング処理装置に関する。   The present invention relates to an anti-aliasing processing method and an anti-aliasing processing device, and more particularly to an anti-aliasing processing method and an anti-aliasing processing device that suppress a jagged phenomenon based on an area surrounded by an image boundary line and a pixel crossing a pixel.

コンピュータのCRT(Cathode Ray Tube)ディスプレイなどの表示装置でラインや三角形などの図形を表示する時に、斜め線が階段状のギザギザになることがある。
図9は、表示装置におけるギザギザ現象を示す模式図である。
When displaying a figure such as a line or a triangle on a display device such as a CRT (Cathode Ray Tube) display of a computer, the diagonal line may become a stepped jagged shape.
FIG. 9 is a schematic diagram illustrating a jagged phenomenon in the display device.

表示領域200は、図9に示すように、複数の画素(ピクセル)221によって構成されており、描画対象の境界線210が画素221を横切るように引かれている(ただし、境界線210の傾きkは、−1<k<0、または、0<k<1とする。)。この境界線210の下方(図9における境界線210から下側領域であって、着色が施されている領域)を描画領域220とし、描画領域220と境界線210との輪郭にて、階段状のギザギザ(ジャギー)部分が生じる。このギザギザ現象が生じると、出力される画像や文字などの輪郭がギザギザとなって、不鮮明に表示されるため、ギザギザ現象を抑える工夫がなされている。なお、1画素の大きさを1×1とする。   As shown in FIG. 9, the display area 200 is composed of a plurality of pixels (pixels) 221, and the drawing target boundary line 210 is drawn across the pixel 221 (however, the inclination of the boundary line 210 k is -1 <k <0 or 0 <k <1.) Below this boundary line 210 (the area below the boundary line 210 in FIG. 9 and colored) is a drawing area 220, and the outline of the drawing area 220 and the boundary line 210 is stepped. The jagged portion of jas. When this jagged phenomenon occurs, the contours of the output image and characters are jagged and are displayed indistinctly, so that the jagged phenomenon is devised to suppress the jagged phenomenon. Note that the size of one pixel is 1 × 1.

そこで、このようなギザギザ現象を抑えるためにアンチエイリアシングという技術が用いられている。
アンチエイリアシングとは、境界線と画素とで囲まれる図形の面積を基に、その面積割合をブレンド率として用いて、その図形の既存色と描画色とを合わせて(ブレンドして)、境界線の周囲にブレンドした色を配置する手法である。
Therefore, a technique called anti-aliasing is used to suppress such a jagged phenomenon.
Anti-aliasing is based on the area of the figure surrounded by the border line and pixels, and uses the area ratio as the blending rate to match (blend) the existing color of the figure with the drawing color. This is a method of placing a blended color around the.

以下に、ブレンド率について説明する。
図10は、ブレンド率について説明するための模式図である。
図10は、描画領域の画素を横切る描画対象の境界線を示しており、図10(A)では、1つの画素を、図10(B)では、2つの画素を横切る境界線である。なお、図10では、特に断りが無い限り、図9と同様の符号、1画素の大きさおよび傾きを利用することにする。
Below, a blend rate is demonstrated.
FIG. 10 is a schematic diagram for explaining the blend ratio.
FIG. 10 shows a boundary line to be drawn across the pixels in the drawing area. In FIG. 10A, the boundary line crosses one pixel, and in FIG. 10B, the boundary line crosses two pixels. In FIG. 10, unless otherwise specified, the same reference numerals as those in FIG. 9 and the size and inclination of one pixel are used.

図10(A)では、1つの画素221aを横切る境界線210の両端点を(Xα,Yα)、(Xα+1,Yα+1)(Yα>Yα+1)とする場合、各長さは以下のように表すことができる。なお、frac(Yα)はYαの小数部、kは境界線210の傾き、|k|は傾きkの絶対値を表す。 In FIG. 10A, both end points of the boundary line 210 crossing one pixel 221a are set to (X α , Y α ), (X α + 1 , Y α + 1 ) (Y α > Y α + 1 ). In this case, each length can be expressed as follows: Note that frac (Y α ) is a fractional part of Y α , k is the slope of the boundary line 210, and | k | is the absolute value of the slope k.

長さac=frac(Yα)、長さcd=1、長さa’b=|k|
従って、斜線部の面積Sαは、以下のように表すことができる。
α=frac(Yα)×1−1×|k|×(1/2)=frac(Yα)−|k|/2
このように算出した面積Sαが1画素当たりに占める割合はSαとなる。従って、この割合をブレンド率として、既存色と描画色とを、1−Sα:Sαとの割合でブレンドした色を用いて1画素を描画する。
Length ac = frac (Y α ), length cd = 1, length a′b = | k |
Therefore, the area S α of the shaded portion can be expressed as follows.
S α = frac (Y α ) × 1-1 × | k | × (1/2) = frac (Y α ) − | k | / 2
The ratio of the area S α calculated in this way to one pixel is S α . Accordingly, this percentage as a blend ratio, and the existing color and foreground color, 1-S alpha: to draw 1 pixel by using the color obtained by blending a proportion of the S alpha.

一方、図10(B)でも同様にして、画素221bを横切る境界線210の両端点を(Xβ,Yβ)、(Xβ+1,Yβ+1)(Yβ>Yβ+1)として、各長さは以下のように表すことができる。なお、frac(Yβ)はYβの小数部、kは境界線210の傾き、|k|は傾きkの絶対値を表す。 On the other hand, in the same way even FIG. 10 (B), the both end points of the boundary line 210 crossing the pixel 221b (X β, Y β) , (X β + 1, Y β + 1) (Y β> Y β + 1 ), Each length can be expressed as follows: Here, frac (Y β ) is a decimal part of Y β , k is the slope of the boundary line 210, and | k | is the absolute value of the slope k.

長さei=frac(Yβ)、長さij=frac(Yβ)/|k|、長さjk=1−(frac(Yβ)/|k|)、長さkf=|k|−frac(Yβ
従って、斜線部の面積Sβ1(上部の三角形ejiの面積)および面積Sβ2(下部の五角形ijfghの面積)は、以下のようにして表すことができる。
Length ei = frac (Y β), the length ij = frac (Y β) / | k |, the length jk = 1- (frac (Y β ) / | k |), the length kf = | k | - frac (Y β )
Accordingly, the area S β1 (the area of the upper triangle ej) and the area S β2 (the area of the lower pentagon ijfgh) of the shaded portion can be expressed as follows.

β1=1/2×(frac(Yβ)/|k|)×frac(Yβ)=(frac(Yβ))2/2|k|
β2=1−1/2×(1−(frac(Yβ)/|k|))×(|k|−frac(Yβ))=1−(|k|−frac(Yβ))2/2|k|
この場合も同様にして算出した面積を利用してブレンド率にて既存色と描画色とをブレンドした色を用いて1画素を描画する。
S β1 = 1/2 × ( frac (Y β) / | k |) × frac (Y β) = (frac (Y β)) 2/2 | k |
S β2 = 1−1 / 2 × (1- (frac (Y β ) / | k |)) × (| k | -frac (Y β )) = 1− (| k | −frac (Y β )) 2/2 | k |
Also in this case, one pixel is drawn using a color obtained by blending the existing color and the drawing color at the blend rate using the area calculated in the same manner.

従って、このようなアルゴリズム(Bresenhamアルゴリズム)に従うと、描画領域の面積を算出することができる。
ところが、このようなBresenhamアルゴリズムでは、演算が複雑で、計算量が膨大となって処理時間がかかってしまうために、境界線と画素とで囲まれる面積を、近似を用いて算出する方法などが用いられた(例えば、特許文献1参照。)。
Therefore, according to such an algorithm (Bresenham algorithm), the area of the drawing region can be calculated.
However, in such Bresenham algorithm, the calculation is complicated, the calculation amount is enormous, and processing time is required. Therefore, there is a method of calculating the area surrounded by the boundary line and the pixel using approximation. Used (see, for example, Patent Document 1).

図11は、従来のブレンド率に用いる面積算出方法を説明する模式図である。
図11では、ブレンド率に用いる面積の算出に近似を利用している。なお、特に断りが無い限り、図9,10と同様の符号、1画素の大きさおよび傾きを利用することにする。また、図11では、境界線210の画素222aを横切る両端点を(Xα1,Yα1)、(Xα1+1,Yα1+1)、点d=(0,0)とする。
FIG. 11 is a schematic diagram for explaining an area calculation method used for a conventional blend ratio.
In FIG. 11, approximation is used to calculate the area used for the blend ratio. Unless otherwise specified, the same reference numerals as those in FIGS. 9 and 10 and the size and inclination of one pixel are used. Further, in FIG. 11, the end points crossing the pixel 222a of the boundary line 210 are ( Xα1 , Yα1 ), ( Xα1 + 1 , Yα1 + 1 ), and a point d = (0, 0).

図11(A)では、境界線210がy軸方向に画素222a境界にて平行する2線のみと交差しているため、四角形efcdの面積Sαは、以下のように表すことができる。
α=(Yα1+Yα1+1)/2
すなわち、これは境界線210の中心点から画素222aのx軸への最短距離を示しているために、ブレンド率に用いる面積として、長さji(=Laとする)を利用することができる。従って、境界線210の中心点から画素のx軸への最短距離を面積と見なして、図11(B),(C)についても以下に引き続き説明を続ける。
In FIG. 11A, since the boundary line 210 intersects with only two lines parallel to each other at the boundary of the pixel 222a in the y-axis direction, the area S α of the quadrangle efcd can be expressed as follows.
S α = (Y α1 + Y α1 + 1 ) / 2
That is, since this indicates the shortest distance from the center point of the boundary line 210 to the x-axis of the pixel 222a, the length ji (= La) can be used as the area used for the blend rate. Accordingly, the shortest distance from the center point of the boundary line 210 to the x-axis of the pixel is regarded as an area, and the description of FIGS. 11B and 11C is continued below.

次に、図11(B)では、境界線210が、画素222b境界のy軸方向に平行する2線と交差するとともに、画素222b境界のx軸方向に平行な線とも交差し、長さalが長さad/2よりも小さい場合を例に挙げてある。そして、境界線210の中心点から画素のx軸までの最短距離jiをLbとする。このとき、三角形elaの面積を0、五角形alfcdの面積をLbとすることで、境界線210と画素222bとで囲まれる面積efcdとした。   Next, in FIG. 11B, the boundary line 210 intersects with two lines parallel to the y-axis direction of the pixel 222b boundary and also intersects with a line parallel to the x-axis direction of the pixel 222b boundary to obtain a length al. Is taken as an example when the length is smaller than the length ad / 2. The shortest distance ji from the center point of the boundary line 210 to the x-axis of the pixel is Lb. At this time, the area efcd surrounded by the boundary line 210 and the pixel 222b was obtained by setting the area of the triangle ela to 0 and the area of the pentagon alfcd to Lb.

また、図11(C)も同様に、画素222c境界のy軸方向に平行する2線と交差するとともに、画素222c境界のx軸方向に平行な線とも交差し、この例では、長さalが長さad/2よりも大きい場合を例に挙げてある。そして、境界線210の中心点から画素のx軸までの最短距離jiをLcとする。このとき、三角形elaの面積をLc、五角形alfcdの面積を1とすることで、境界線210と画素222cとで囲まれる面積efcdとした。   Similarly, FIG. 11C also intersects with two lines parallel to the y-axis direction of the boundary of the pixel 222c and also intersects with a line parallel to the x-axis direction of the boundary of the pixel 222c. Is taken as an example when the length is larger than the length ad / 2. The shortest distance ji from the center point of the boundary line 210 to the x-axis of the pixel is Lc. At this time, the area efcd surrounded by the boundary line 210 and the pixel 222c was obtained by setting the area of the triangle ela to Lc and the area of the pentagonal alfcd to 1.

以上のようにして、境界線と画素とで囲まれる面積を近似することで、複雑な演算を簡略化して、アンチエイリアシング処理を行うことができた。
特開平9−245181号公報
As described above, by approximating the area surrounded by the boundary line and the pixels, it is possible to simplify the complex calculation and perform the anti-aliasing processing.
JP-A-9-245181

しかし、上記特許文献のように、境界線と画素とで囲まれる面積の算出に近似を用いると、正確な面積を算出することができないために、高精度のブレンド率が得られないという問題点があった。   However, as in the above-mentioned patent document, if approximation is used to calculate the area surrounded by the boundary line and the pixel, the accurate area cannot be calculated, so that a high-accuracy blend rate cannot be obtained. was there.

本発明はこのような点に鑑みてなされたものであり、境界線と画素とで囲まれる面積を正確かつ高速に算出することができるアンチエイリアシング処理方法およびその処理装置を提供することを目的とする。   The present invention has been made in view of such a point, and an object thereof is to provide an anti-aliasing processing method and a processing apparatus capable of calculating an area surrounded by a boundary line and a pixel accurately and at high speed. To do.

本発明では上記課題を解決するために、画素を横切る描画領域の境界線と画素とで囲まれた面積に基づいてギザギザ現象を抑えるアンチエイリアシング処理方法において、図1に示すように、表示領域にx,y軸方向が設けられ、方向に従って配置された画素の辺と交点を有する境界線の両端の2点を入力する工程(S11)と、2点により、境界線の傾き値を算出する工程(S12)と、境界線がx軸もしくはy軸と平行であれば、境界線と画素とで囲まれる方形の面積を算出する工程(S14)と、境界線がx軸もしくはy軸と平行でなく、さらに、等間隔の交点のうち隣接する交点間に辺と別の交点が無ければ、境界線と1つの画素とで囲まれる四角形の面積(S18)と、別の交点が有れば、境界線と1つの画素とで囲まれる三角形の面積(S19)と、境界線と2つの画素とで囲まれる四角形の面積(S20)と、境界線と2つの画素とで囲まれる四角形から三角形を除いた多角形の面積(S21)と、を出力する工程と、を有することを特徴とするアンチエイリアシング処理方法が提供される。   In the present invention, in order to solve the above problem, in the anti-aliasing processing method for suppressing the jagged phenomenon based on the area surrounded by the boundary line of the drawing area crossing the pixel and the pixel, as shown in FIG. A step (S11) of inputting two points at both ends of a boundary line that is provided with x and y axis directions and has intersections with the sides of pixels arranged according to the direction, and a step of calculating a slope value of the boundary line from the two points (S12) If the boundary line is parallel to the x-axis or y-axis, a step (S14) of calculating a square area surrounded by the boundary line and the pixel, and the boundary line parallel to the x-axis or y-axis Furthermore, if there is no other intersection with the side between adjacent intersections among equally spaced intersections, if there is a square area (S18) surrounded by the boundary line and one pixel and another intersection, A triangle surrounded by a border and one pixel An area (S19), a square area (S20) surrounded by the boundary line and the two pixels, and a polygonal area (S21) obtained by removing the triangle from the quadrangle surrounded by the boundary line and the two pixels. And an output step. An antialiasing processing method is provided.

このようなアンチエイリアシング処理方法によれば、表示領域に設けられたx,y軸方向に従って配置された画素の辺と交点を有する境界線の両端の2点が入力されて、境界線がx軸またはy軸と平行であれば、境界線と画素とで囲まれる方形の面積が出力され、境界線がx軸またはy軸と平行でなく、さらに、等間隔の交点のうち隣接する交点間に辺と別の交点が無ければ、境界線と1つの画素とで囲まれる四角形の面積と、別の交点が有れば、境界線と1つの画素とで囲まれる三角形の面積と、境界線と2つの画素とで囲まれる四角形の面積と、境界線と2つの画素とで囲まれる四角形から三角形を除いた多角形の面積とが、出力される。   According to such an anti-aliasing processing method, two points at both ends of the boundary line having intersections with the sides of the pixels arranged in the x and y axis directions provided in the display area are input, and the boundary line becomes the x axis. Alternatively, if it is parallel to the y axis, a square area surrounded by the boundary line and the pixel is output, the boundary line is not parallel to the x axis or the y axis, and further, between adjacent intersections at equal intervals. If there is no other intersection with the side, the area of the rectangle surrounded by the boundary line and one pixel, and if there is another intersection, the area of the triangle surrounded by the boundary line and one pixel, and the boundary line A square area surrounded by the two pixels and a polygonal area obtained by removing the triangle from the square surrounded by the boundary line and the two pixels are output.

また、上記課題を解決するために、画素を横切る描画領域の境界線と前記画素とで囲まれた面積に基づいてギザギザ現象を抑えるアンチエイリアシング処理装置において、表示領域にx,y軸方向が設けられ、前記方向に従って配置された前記画素の辺と交点を有する前記境界線の両端の2点を入力する手段と、前記2点により、前記境界線の傾き値を算出する手段と、前記境界線が前記x軸もしくは前記y軸と平行であれば、前記境界線と前記画素とで囲まれる方形の前記面積を算出する手段と、前記境界線が前記x軸もしくは前記y軸と平行でなく、さらに、等間隔の前記交点のうち隣接する前記交点間に前記辺と別の交点が無ければ、前記境界線と1つの前記画素とで囲まれる四角形の前記面積と、前記別の交点が有れば、前記境界線と1つの前記画素とで囲まれる三角形の前記面積と、前記境界線と2つの前記画素とで囲まれる四角形の前記面積と、前記境界線と2つの前記画素とで囲まれる四角形から前記三角形を除いた多角形の前記面積と、を出力する手段と、を有することを特徴とするアンチエイリアシング処理装置が提供される。   In order to solve the above-described problem, an x- and y-axis directions are provided in a display area in an anti-aliasing processing apparatus that suppresses a jagged phenomenon based on an area surrounded by a boundary line of a drawing area that crosses a pixel and the pixel. Means for inputting two points at both ends of the boundary line having intersections with sides of the pixels arranged according to the direction, means for calculating an inclination value of the boundary line by the two points, and the boundary line Is parallel to the x-axis or the y-axis, means for calculating the area of the rectangle surrounded by the boundary line and the pixel, and the boundary line is not parallel to the x-axis or the y-axis, Furthermore, if there is no other intersection with the side between the adjacent intersections among the equally spaced intersections, the square area surrounded by the boundary line and the one pixel and the other intersection are present. For example, the boundary line The triangle is excluded from the area of the triangle surrounded by the one pixel, the area of the rectangle surrounded by the boundary line and the two pixels, and the rectangle surrounded by the boundary line and the two pixels. There is provided an anti-aliasing processing device comprising means for outputting the area of the polygon.

このようなアンチエイリアシング処理装置によれば、表示領域に設けられたx,y軸方向に従って配置された画素の辺と交点を有する境界線の両端の2点が入力されて、境界線がx軸またはy軸と平行であれば、境界線と画素とで囲まれる方形の面積が出力され、境界線がx軸またはy軸と平行でなく、さらに、等間隔の隣接する交点間に辺と別の交点が無ければ、境界線と1つの画素とで囲まれる四角形の面積と、別の交点が有れば、境界線と1つの画素とで囲まれる三角形の面積と、境界線と2つの画素とで囲まれる四角形の面積と、境界線と2つの画素とで囲まれる四角形から三角形を除いた多角形の面積とが、出力される。   According to such an anti-aliasing processing device, two points on both ends of a boundary line having intersections with sides of pixels arranged in the x and y axis directions provided in the display area are input, and the boundary line is converted to the x axis. Or if it is parallel to the y-axis, the square area surrounded by the boundary line and the pixel is output, the boundary line is not parallel to the x-axis or y-axis, and is separated from the adjacent intersections at equal intervals. If there is no intersection, the area of a rectangle surrounded by the boundary line and one pixel, and if there is another intersection, the area of a triangle surrounded by the boundary line and one pixel, and the boundary line and two pixels And the area of a polygon obtained by removing the triangle from the quadrangle surrounded by the boundary line and the two pixels are output.

本発明では、表示領域に設けられたx,y軸方向に従って配置された画素の辺と交点を有する境界線の両端の2点を入力して、境界線がx軸またはy軸と平行であれば、境界線と画素とで囲まれる方形の面積を出力して、境界線がx軸またはy軸と平行でなく、さらに、等間隔の交点のうち隣接する交点間に辺と別の交点が無ければ、境界線と1つの画素とで囲まれる四角形の面積と、別の交点が有れば、境界線と1つの画素とで囲まれる三角形の面積と、境界線と2つの画素とで囲まれる四角形の面積と、境界線と2つの画素とで囲まれる四角形から三角形を除いた多角形の面積とを出力するようにした。これにより、境界線と画素とで囲まれる面積を正確に算出でき、また、複雑だった演算を簡略化でき、算出に要する時間を短縮することができる。   In the present invention, two points on both ends of a boundary line having intersections with the sides of pixels arranged in the x and y axis directions provided in the display area are input, and the boundary line is parallel to the x axis or the y axis. For example, the square area surrounded by the boundary line and the pixel is output, and the boundary line is not parallel to the x-axis or the y-axis. If there is not, the area of the rectangle surrounded by the boundary line and one pixel, and if there is another intersection, the area of the triangle surrounded by the boundary line and one pixel, and the boundary line and the two pixels The area of the quadrangle and the area of the polygon excluding the triangle from the quadrangle surrounded by the boundary line and the two pixels are output. Thereby, the area surrounded by the boundary line and the pixels can be calculated accurately, complicated calculations can be simplified, and the time required for the calculation can be shortened.

以下、本発明の実施の形態を、図面を参照して詳細に説明する。ただし、本発明の技術的範囲はこれらの実施の形態に限定されるものではない。
まず、本発明の概要について説明し、その後に実施の形態について説明する。なお、本実施の形態では、既述の通り、1画素の大きさは1×1として説明を行うこととする。
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. However, the technical scope of the present invention is not limited to these embodiments.
First, an outline of the present invention will be described, and then an embodiment will be described. In the present embodiment, as described above, the size of one pixel is assumed to be 1 × 1.

図1は、本発明の処理フローの概要図であって、図2は、境界線が表示された表示領域の模式図である。
フローチャート図10は、本発明の処理の概要を説明したものであり、表示領域に、x,y軸方向が設定され、それぞれの方向に1画素が敷き詰められるように構成されて、描画領域の境界線が引かれて、この境界線の傾きに応じ、境界線と画素とで囲まれる面積を高精度かつ高速に算出することができる。
FIG. 1 is a schematic diagram of a processing flow of the present invention, and FIG. 2 is a schematic diagram of a display area in which a boundary line is displayed.
FIG. 10 is a flowchart for explaining the outline of the processing according to the present invention. The x and y axis directions are set in the display area, and one pixel is laid out in each direction. A line is drawn, and the area surrounded by the boundary line and the pixel can be calculated with high accuracy and high speed according to the inclination of the boundary line.

以下、本発明の概要を、フローチャート図10に沿って図2と合わせて説明する。
[ステップS11] 境界線の両端となる2点を入力する。
図2では、境界線の両端として、境界線31aであれば、(x1,y1)および(x1,y1’)、境界線31bであれば、(x2,y2)および(x2’,y2)、境界線31cであれば、(x3,y3)および(x4,y4)が両端の2点とする。
Hereinafter, the outline of the present invention will be described with reference to FIG.
[Step S11] Two points that are both ends of the boundary line are input.
In FIG. 2, as the both ends of the boundary line, (x1, y1) and (x1, y1 ′) if the boundary line 31a, (x2, y2) and (x2 ′, y2) if the boundary line 31b, For the boundary line 31c, (x3, y3) and (x4, y4) are two points at both ends.

[ステップS12] 入力した2点から、境界線の傾きを算出する。
図2の境界線31cであれば、傾きkは、k=(y3−y4)/(x3−x4)で算出することができる。
[Step S12] The slope of the boundary line is calculated from the two input points.
In the case of the boundary line 31c in FIG. 2, the slope k can be calculated by k = (y3-y4) / (x3-x4).

[ステップS13] 境界線が、x軸またはy軸のいずれかと平行であるか否かを判断する。
ステップS12により傾きを算出した結果、図2に示すように、境界線の傾きが無限大もしくは0、すなわち、境界線がy軸またはx軸のいずれかと平行であれば(境界線31a,31b)、ステップS14へ進められ、境界線の傾きがそれ以外、すなわち、x軸またはy軸ともに平行でなければ(境界線31c)、ステップS15へ進められる。
[Step S13] It is determined whether the boundary line is parallel to either the x-axis or the y-axis.
As a result of calculating the inclination in step S12, as shown in FIG. 2, if the inclination of the boundary line is infinite or 0, that is, the boundary line is parallel to either the y-axis or the x-axis (boundary lines 31a and 31b). The process proceeds to step S14, and if the gradient of the boundary line is other than that, that is, if it is not parallel to the x axis or the y axis (boundary line 31c), the process proceeds to step S15.

[ステップS14] 入力した境界線の両端の2点から、境界線と画素とで囲まれる方形の面積を算出して出力する。
図2に示すように、境界線31aとy軸とが平行の時は、境界線31aの両端の2点は(x1,y1)、(x1,y1’)であるため、境界線31aの長さを|y1−y1’|、境界線とy軸との幅を|x1|とできる。また、境界線31bとx軸とが平行の時は、境界線31bの両端の2点は(x2,y2)、(x2’,y2)であるため、境界線31bの長さを|x2−x2’|、境界線とx軸との幅を|y2|とできる。以上から、容易に境界線31a,31bと画素とで囲まれた領域を算出することができる。
[Step S14] From two points at both ends of the input boundary line, a square area surrounded by the boundary line and the pixel is calculated and output.
As shown in FIG. 2, when the boundary line 31a and the y-axis are parallel, the two points at both ends of the boundary line 31a are (x1, y1) and (x1, y1 ′), so the length of the boundary line 31a | Y1−y1 ′ | and the width between the boundary line and the y-axis can be | x1 |. When the boundary line 31b and the x-axis are parallel, the two points at both ends of the boundary line 31b are (x2, y2) and (x2 ′, y2), so the length of the boundary line 31b is set to | x2−. x2 ′ |, and the width between the boundary line and the x-axis can be | y2 |. From the above, it is possible to easily calculate a region surrounded by the boundary lines 31a and 31b and the pixels.

なお、描画領域が、境界線31a,31bの左右もしくは上下のいずれかに存在するかによって、幅を適宜、1−|x1|や1−|y2|として面積を算出する必要がある。
[ステップS15] 境界線が、x軸またはy軸と平行でない場合、境界線と画素との交点をチェックして、初期設定を行う。
It should be noted that the area needs to be calculated by appropriately setting the width as 1- | x1 | or 1- | y2 | depending on whether the drawing area exists on the left or right or upper and lower sides of the boundary lines 31a and 31b.
[Step S15] If the boundary line is not parallel to the x-axis or the y-axis, the intersection between the boundary line and the pixel is checked and an initial setting is made.

初期設定では、図2に示すように、境界線31cと画素との交点をチェックして、四角形abdcの面積である初期四角形面積、三角形aicの面積である初期三角形面積などをあらかじめ算出しておく。   In the initial setting, as shown in FIG. 2, the intersection of the boundary line 31c and the pixel is checked, and the initial quadrangular area that is the area of the quadrangle abdc, the initial triangular area that is the area of the triangle aic, and the like are calculated in advance. .

[ステップS16] チェックした境界線と画素との交点を選択する。なお、処理を行って、前回選択した点のx軸方向に1移動した隣接点を順に選択することとする。
図2では、例えば、最初に点a(x3,y3)を選択する。次回ステップS16へ進められると、次は、x軸方向に1移動した点bを選択し、同様にして、次は点e,点j…を選択するといった具合に、一方向に順に1移動した隣接点を選択する。
[Step S16] An intersection between the checked boundary line and the pixel is selected. It should be noted that processing is performed, and adjacent points that have moved by 1 in the x-axis direction of the previously selected point are sequentially selected.
In FIG. 2, for example, the point a (x3, y3) is first selected. When the process proceeds to the next step S16, next, the point b moved by 1 in the x-axis direction is selected, and in the same manner, the point e, the point j, etc. are selected next. Select an adjacent point.

[ステップS17] ステップS16で選択した点とその隣接点との間に、画素との交点があるかを判断する。交点がなければステップS18へ進められ、交点があればステップS19へ進められる。なお、このような交点の存在領域を「変換領域」や「変換点」などと以下呼ぶこととする。   [Step S17] It is determined whether there is an intersection with the pixel between the point selected in step S16 and its adjacent point. If there is no intersection, the process proceeds to step S18, and if there is an intersection, the process proceeds to step S19. Note that such an intersection existence region is hereinafter referred to as a “conversion region” or a “conversion point”.

図2では、例えば、ステップS17で選択した点aと、この隣接点である点bとの間に画素との交点が無いため、この場合はステップS18へ進められる。
一方、ステップS17で点eを選択したとすると、この隣接点である点jとの間に、画素との交点として点iが有り、変換点であるため、この場合はステップS19へ進められる。
In FIG. 2, for example, since there is no intersection with the pixel between the point a selected in step S17 and the adjacent point b, the process proceeds to step S18 in this case.
On the other hand, if the point e is selected in step S17, there is a point i as an intersection with the pixel between the adjacent point j and it is a conversion point. In this case, the process proceeds to step S19.

[ステップS18] ステップS16で選択した点およびその隣接点によって画素を囲む面積を算出して、出力する。
ところで、境界線と画素とで囲まれる面積について以下に説明を行う。
[Step S18] The area surrounding the pixel by the point selected in Step S16 and its adjacent points is calculated and output.
By the way, the area surrounded by the boundary line and the pixel will be described below.

図2において、四角形abdcの面積は、既に説明したように、Sabdc=(|ac|+|bd|)/2と表現することができる。ただし、|ac|および|bd|は、acおよびbdの長さである。 In FIG. 2, the area of the quadrangle abdc can be expressed as S abdc = (| ac | + | bd |) / 2 as already described. However, | ac | and | bd | are the lengths of ac and bd.

一方、四角形befdの面積も同様にして、Sbefd=(|bd|+|ef|)/2と表現することができる。ただし、|bd|および|ef|は、bdおよびefの長さである。 On the other hand, the area of the square befd can be similarly expressed as S befd = (| bd | + | ef |) / 2. However, | bd | and | ef | are the lengths of bd and ef.

このとき、これらの面積の差は、Sabdc−Sbefd=(|ac|−|ef|)/2と表現することができ、これは、境界線31の傾き|k|に相当する値である。
この性質を利用して、まず、選択する点aと隣接点の点bとによって囲まれる四角形abdcの面積SabdcはステップS15で算出した初期四角形面積であって、次に選択する点bと隣接点の点eとによって囲まれる四角形befdの面積Sbefdは、Sabdc−|k|と表現することができる。
In this case, the difference between these area, S abdc -S befd = (| ac | - | ef |) / 2 and can be represented, which is the slope of the boundary line 31 | with a value equivalent to | k is there.
Using this property, first, the area S abdc of the quadrangle abdc surrounded by the point a to be selected and the point b of the adjacent point is the initial square area calculated in step S15 and is adjacent to the point b to be selected next. area S befd square befd surrounded by the point e point, S abdc - | k | and can be expressed.

[ステップS19] ステップS17で、境界線と画素との交点である変換点がある場合、選択した点と交点とによる変換点における三角形の面積を算出し、出力する。
図2では、例えば、選択した点eと隣接点の点jとの交点に点iがあることから、変換点の三角形eifを算出し、出力する。また、この算出方法としては、ステップS15にて得られた三角形aicの初期三角形面積から、ステップS18で算出される四角形を足し合わせた四角形aefcの面積を差し引くことによって変換点の三角形eifの面積が算出される。
[Step S19] If there is a conversion point that is the intersection of the boundary line and the pixel in step S17, the area of the triangle at the conversion point by the selected point and the intersection is calculated and output.
In FIG. 2, for example, since there is a point i at the intersection of the selected point e and the adjacent point j, the triangle eif of the conversion point is calculated and output. Further, as this calculation method, the area of the triangle eif of the conversion point is obtained by subtracting the area of the quadrangle aefc obtained by adding the quadrangle calculated in step S18 from the initial triangular area of the triangle aic obtained in step S15. Calculated.

[ステップS20] ステップS17で、境界線と画素との交点である変換点がある場合、選択した点と、その隣接点とによって囲まれる画素の変換点における四角形の面積を算出し、出力する。   [Step S20] If there is a conversion point that is the intersection of the boundary line and the pixel in step S17, the area of the rectangle at the conversion point of the pixel surrounded by the selected point and its adjacent points is calculated and output.

図2では、選択した点eの隣接点の点jとで囲まれる、変換点における四角形ejkgの面積を算出し、出力する。
[ステップS21] ステップS17で、境界線と画素との交点である変換点がある場合、ステップS20で算出した変換点における四角形の面積から、ステップS19で算出した変換点における三角形の面積を差し引くことによって、変換点における五角形の面積を算出し、出力する。
In FIG. 2, the area of the square ejkg at the transformation point surrounded by the point j adjacent to the selected point e is calculated and output.
[Step S21] When there is a conversion point that is the intersection of the boundary line and the pixel in step S17, the area of the triangle at the conversion point calculated in step S19 is subtracted from the area of the quadrangle at the conversion point calculated in step S20. To calculate and output the pentagonal area at the transformation point.

図2では、四角形ejkgから三角形eifの面積を差し引くことによって、五角形fijkgの面積を算出し、出力する。
[ステップS22] 選択した点の隣接点にさらに隣接点があるか否かを判断する。他に隣接点が有れば、ステップS16へ進められ、他に隣接点が無ければ、処理が終了する。
In FIG. 2, the area of the pentagonal fijkg is calculated and output by subtracting the area of the triangle eif from the square ejkg.
[Step S22] It is determined whether there is an adjacent point in the adjacent point of the selected point. If there are other adjacent points, the process proceeds to step S16. If there are no other adjacent points, the process ends.

図2では、例えば、選択した点lの隣接点である点nにさらに隣接点はないため、この場合は、処理が終了する。
以上のようにして、境界線と画素とで囲まれる面積を正確に算出でき、また、面積の算出に、面積から傾きを差し引くことを繰り返すことによって複雑だった演算を簡略化でき、算出に要する時間を短縮することができる。従って、高速かつ正確に算出された面積をブレンド率として用いることによって、高精度のアンチエイリアシング処理を行うことが可能となる。
In FIG. 2, for example, since there is no further adjacent point to the point n that is the adjacent point of the selected point l, in this case, the process ends.
As described above, the area surrounded by the boundary line and the pixel can be accurately calculated, and complicated calculation can be simplified by repeatedly subtracting the slope from the area to calculate the area. Time can be shortened. Therefore, it is possible to perform highly accurate anti-aliasing processing by using the area calculated at high speed and accurately as the blend ratio.

以下に、本発明を利用した実施の形態について、図面を参照にして説明する。
本実施の形態は、ユーザからアンチエイリアシング処理装置に描画領域の境界線の両端の2点を入力することによって、アンチエイリアシング処理のブレンド率として用いられる面積を算出することができる。
Embodiments using the present invention will be described below with reference to the drawings.
In the present embodiment, the area used as the blending ratio of the anti-aliasing process can be calculated by inputting two points at both ends of the boundary line of the drawing area from the user to the anti-aliasing processing apparatus.

図3は、アンチエイリアシング処理装置の機能を示すブロック図である。
アンチエイリアシング処理装置40は、初期値データ部41、面積値データ部42、傾き値算出部43、初期設定部44および面積算出部45から構成されている。
FIG. 3 is a block diagram illustrating functions of the anti-aliasing processing apparatus.
The anti-aliasing processing device 40 includes an initial value data unit 41, an area value data unit 42, an inclination value calculation unit 43, an initial setting unit 44, and an area calculation unit 45.

初期値データ部41は、あらかじめ初期設定が行われた、境界線と画素とで囲まれる四角形および三角形の面積値などのデータを格納する。なお、初期設定で算出される四角形および三角形の面積については、後に挙げる具体例の中でその詳細を説明する。   The initial value data unit 41 stores data such as area values of a quadrangle and a triangle that are initially set in advance and are surrounded by a boundary line and pixels. In addition, about the area of the quadrangle | tetragon and triangle calculated by initial setting, the detail is demonstrated in the specific example given later.

面積値データ部42は、アンチエイリアシング処理装置によって算出された境界線と画素とで囲まれる面積値のデータを格納する。
傾き値算出部43は、入力された境界線の両端の2点によって、境界線の傾きを算出する。
The area value data unit 42 stores area value data surrounded by the boundary line and the pixel calculated by the anti-aliasing processing device.
The inclination value calculation unit 43 calculates the inclination of the boundary line based on two points at both ends of the input boundary line.

初期設定部44は、傾き値算出部43で算出された傾きに従って、境界線がx軸およびy軸と平行でない場合、境界線と画素とで囲まれる四角形および三角形の面積を算出し、算出した面積値を初期値データ部41へ格納する。   When the boundary line is not parallel to the x-axis and the y-axis, the initial setting unit 44 calculates and calculates the area of the rectangle and the triangle surrounded by the boundary line and the pixel according to the inclination calculated by the inclination value calculation unit 43. The area value is stored in the initial value data unit 41.

面積算出部45は、さらに、方形算出部45a、四角形算出部45b、三角形算出部45cおよび五角形算出部45dを有する。
方形算出部45aは、傾き値算出部43にて算出された傾きを有する境界線がx軸またはy軸に平行である場合、境界線の両端の2点を用いて、境界線と画素とで囲まれる方形の面積を算出する。
The area calculation unit 45 further includes a square calculation unit 45a, a quadrangle calculation unit 45b, a triangle calculation unit 45c, and a pentagon calculation unit 45d.
When the boundary line having the inclination calculated by the inclination value calculation unit 43 is parallel to the x-axis or the y-axis, the square calculation unit 45a uses the two points at both ends of the boundary line to generate a boundary line and a pixel. Calculate the area of the enclosed square.

四角形算出部45bは、境界線がx軸およびy軸と平行でない場合、境界線と画素とで囲まれる四角形や変換点における四角形の面積を算出する。なお、面積算出方法として、初期設定部44で得られた初期四角形に隣接する、境界線と1画素とで囲まれる領域の面積は、初期四角形の面積から、境界線の傾き値を差し引くことによって算出することができ、同様に、得られた四角形の面積から傾きを差し引くことによって、隣接する四角形の面積を算出することができる。また、変換点における四角形の面積は、変換点における三角形に隣接する四角形の面積に1を加えて傾き値を差し引くことによって算出することができる。   When the boundary line is not parallel to the x-axis and the y-axis, the quadrangle calculation unit 45b calculates the area of the quadrangle surrounded by the boundary line and the pixel or the square at the conversion point. As an area calculation method, the area of the region surrounded by the boundary line and one pixel adjacent to the initial rectangle obtained by the initial setting unit 44 is obtained by subtracting the inclination value of the boundary line from the area of the initial rectangle. Similarly, the area of the adjacent quadrangle can be calculated by subtracting the slope from the area of the obtained quadrangle. The area of the quadrangle at the conversion point can be calculated by adding 1 to the area of the quadrangle adjacent to the triangle at the conversion point and subtracting the slope value.

三角形算出部45cは、境界線がx軸およびy軸と平行でない場合、境界線と画素とで囲まれる変換点における三角形の面積を算出する。算出には、初期設定部44で得られた初期三角形の面積から、四角形算出部45bで算出された四角形が足し合わせた面積を差し引くことによって、変換点における三角形の面積を算出することができる。   When the boundary line is not parallel to the x axis and the y axis, the triangle calculation unit 45c calculates the area of the triangle at the conversion point surrounded by the boundary line and the pixel. For the calculation, the area of the triangle at the conversion point can be calculated by subtracting the area added by the quadrangle calculated by the quadrangle calculation unit 45b from the area of the initial triangle obtained by the initial setting unit 44.

五角形算出部45dは、境界線がx軸もしくはy軸と平行でない場合、境界線と画素とで囲まれる変換点における五角形の面積を算出する。算出には、四角形算出部45bで得られ変換点における四角形から、三角形算出部45cで算出された変換点における三角形の面積を差し引くことによって、五角形の面積を算出することができる。   When the boundary line is not parallel to the x axis or the y axis, the pentagon calculation unit 45d calculates the area of the pentagon at the conversion point surrounded by the boundary line and the pixel. For calculation, the area of the pentagon can be calculated by subtracting the area of the triangle at the conversion point calculated by the triangle calculation unit 45c from the square at the conversion point obtained by the rectangle calculation unit 45b.

このようにして、算出された面積が面積値データ部42へ格納される。
次に、アンチエイリアシング処理装置40によって、境界線と画素とで囲まれる面積を算出する処理について説明する。
In this way, the calculated area is stored in the area value data unit 42.
Next, processing for calculating the area surrounded by the boundary line and the pixels by the anti-aliasing processing device 40 will be described.

図4は、本発明の実施の形態におけるアンチエイリアシング処理の面積算出処理を示すフローチャート、図6は、本実施の形態における傾きを有する描画領域の境界線が表示された表示領域の模式図である。   FIG. 4 is a flowchart showing the area calculation process of the anti-aliasing process in the embodiment of the present invention, and FIG. 6 is a schematic diagram of the display area in which the boundary line of the drawing area having an inclination in the present embodiment is displayed. .

図4は、アンチエイリアシング処理装置40における境界線と画素とで囲まれる面積算出処理の流れについて示しており、図6は、表示領域70に傾きを有する境界線71が画素を横切るように描画されたところを示している。なお、境界線71の下側を描画領域とする。   FIG. 4 shows the flow of the area calculation process surrounded by the boundary line and the pixel in the anti-aliasing processing device 40, and FIG. 6 is drawn so that the boundary line 71 having an inclination in the display area 70 crosses the pixel. It shows the place. The lower side of the boundary line 71 is a drawing area.

以下、アンチエイリアシング処理装置40による面積算出処理についてフローチャート図50に沿って、図6を用いながら説明する。
[ステップS51] ユーザによって、境界線の両端となる2点が傾き値算出部43へ入力される。
Hereinafter, the area calculation processing by the anti-aliasing processing device 40 will be described with reference to FIG.
[Step S <b> 51] Two points that are both ends of the boundary line are input to the slope value calculation unit 43 by the user.

入力される2点の例として、図6に示されるような点A(X1,Y1)および点B(Xn,Yn)などがある。
[ステップS52] 傾き値算出部43が、入力された2点から境界線の傾きを算出する。
Examples of the two input points include point A (X1, Y1) and point B (Xn, Yn) as shown in FIG.
[Step S52] The slope value calculation unit 43 calculates the slope of the boundary line from the two input points.

既に説明したとおり、算出される傾きは、ゼロ、無限大およびそれ以外の3つの場合について得られる。
[ステップS53] 傾き値算出部43は、得られた傾きがゼロ、すなわち、x軸と平行であるか否かを判断する。x軸と平行であれば、ステップS54へ進められ、x軸と平行でなければ、ステップS56へ進められる。
As already described, the calculated slopes are obtained for three cases: zero, infinity, and other cases.
[Step S <b> 53] The inclination value calculation unit 43 determines whether the obtained inclination is zero, that is, whether it is parallel to the x-axis. If it is parallel to the x axis, the process proceeds to step S54. If it is not parallel to the x axis, the process proceeds to step S56.

[ステップS54] x軸と平行であれば、面積算出部45の方形算出部45aが、入力された2点から、境界線の横の長さおよびx軸から境界線までの縦の長さを算出して、それらを掛けることによって、境界線と画素とで囲まれる描画領域の面積を算出する。なお、描画領域が、x軸に平行な境界線の上下のいずれかに存在するかによって、縦の高さを、1から、入力されたyの値を引いた値を利用するなど、適宜対応する必要がある。   [Step S54] If it is parallel to the x axis, the square calculation unit 45a of the area calculation unit 45 calculates the horizontal length of the boundary line and the vertical length from the x axis to the boundary line from the two input points. By calculating and multiplying them, the area of the drawing region surrounded by the boundary line and the pixel is calculated. Depending on whether the drawing area exists above or below the boundary line parallel to the x axis, the vertical height is appropriately adjusted by, for example, using a value obtained by subtracting the input y value from 1. There is a need to.

[ステップS55] ステップS54で算出された方形の面積を、方形算出部45aが面積値データ部42へ格納する。
[ステップS56] 傾き値算出部43は、得られた傾きが無限大、すなわち、y軸と平行であるか否かを判断する。y軸と平行であれば、ステップS57へ進められ、y軸と平行でなければ、ステップS59へ進められる。
[Step S55] The square area calculated in step S54 is stored in the area value data section 42 by the square calculation unit 45a.
[Step S56] The slope value calculation unit 43 determines whether or not the obtained slope is infinite, that is, parallel to the y-axis. If it is parallel to the y axis, the process proceeds to step S57, and if not parallel to the y axis, the process proceeds to step S59.

[ステップS57] y軸と平行であれば、面積算出部45の方形算出部45aが、入力された2点から、境界線の縦の長さおよびy軸から境界線までの横の長さを算出して、それらを掛けることによって、境界線と画素とで囲まれる描画領域の面積を算出する。なお、描画領域が、y軸に平行な境界線の左右のいずれかに存在するかによって、横の長さを、1から、入力されたxの値を引いた値を利用するなど、適宜対応する必要がある。   [Step S57] If parallel to the y-axis, the square calculation unit 45a of the area calculation unit 45 calculates the vertical length of the boundary line and the horizontal length from the y-axis to the boundary line from the two input points. By calculating and multiplying them, the area of the drawing region surrounded by the boundary line and the pixel is calculated. Depending on whether the drawing area exists on the left or right side of the boundary line parallel to the y-axis, the horizontal length is appropriately adjusted by using a value obtained by subtracting the input x value from 1. There is a need to.

[ステップS58] ステップS57で算出された方形の面積を、方形算出部45aが面積値データ部42へ格納する。
[ステップS59] 境界線がx軸およびy軸ともに平行でない場合、初期設定部44が、後の面積算出に必要となる部分の面積をあらかじめ算出し、算出した面積値などのデータを初期値データ部41へ格納する。
[Step S58] The square area calculated in step S57 is stored in the area value data section 42 by the square calculation unit 45a.
[Step S59] When the boundary line is not parallel to both the x-axis and the y-axis, the initial setting unit 44 calculates in advance the area of a portion necessary for the subsequent area calculation, and sets the calculated area value and other data as initial value data. Stored in the unit 41.

境界線が傾きを有する場合として、図6に示すように、初期値として、四角形ABB1A1、三角形ADA1、三角形FKF1の面積をあらかじめ算出し、初期値データ部41へ格納する。   In the case where the boundary line has an inclination, as shown in FIG. 6, the areas of the quadrangle ABB1A1, the triangle ADA1, and the triangle FKF1 are calculated in advance and stored in the initial value data unit 41 as shown in FIG.

なお、本実施の形態における境界線71の傾きkは、−1<k<0、または、0<k<1とする。
[ステップS60] 面積算出部45の四角形算出部45b、三角形算出部45cおよび五角形算出部45dによって、境界線と画素とで囲まれる描画領域の面積を算出する。
Note that the slope k of the boundary line 71 in the present embodiment is -1 <k <0 or 0 <k <1.
[Step S60] The area of the drawing region surrounded by the boundary line and the pixels is calculated by the quadrangle calculation unit 45b, the triangle calculation unit 45c, and the pentagon calculation unit 45d of the area calculation unit 45.

なお、ステップS60の処理の詳細については後ほど説明する。
[ステップS61] 面積算出部45が、全ての描画領域の面積が面積値データ部42へ格納して処理が終了する。
Details of the process in step S60 will be described later.
[Step S61] The area calculation unit 45 stores the areas of all the drawing regions in the area value data unit 42, and the process ends.

そして、ステップS60で行われる処理について以下に説明する。
図5は、本発明の実施の形態におけるアンチエイリアシング処理の面積算出処理の詳細を示すフローチャートである。以下、同様に図4,6を用いながら説明する。
And the process performed by step S60 is demonstrated below.
FIG. 5 is a flowchart showing details of the area calculation process of the anti-aliasing process in the embodiment of the present invention. Hereinafter, description will be made in the same manner with reference to FIGS.

ステップS59にて、初期設定部44において、図6の境界線71と画素との交点をチェックして、既に説明したような面積を算出する。なお、A(X1,Y1)のX1に1ずつ加え、境界線71上と画素との交点の隣接点を、B(X2,Y2)、C(X3,Y3)、…、N(Xn,Yn)とする。   In step S59, the initial setting unit 44 checks the intersection between the boundary line 71 and the pixel in FIG. 6 and calculates the area as described above. Note that one by one is added to X1 of A (X1, Y1), and adjacent points of intersections between the boundary line 71 and the pixels are defined as B (X2, Y2), C (X3, Y3),..., N (Xn, Yn). ).

以上の初期設定が完了して、下記処理が行われる。
[ステップS60a] Xiのi=1,2,…,n−1についてステップS60bからステップS60mの処理を繰り返す。
After the above initial setting is completed, the following processing is performed.
[Step S60a] The processing from Step S60b to Step S60m is repeated for i = 1, 2,..., N−1 of Xi.

[ステップS60b] 面積算出部45は、点Xiを選択し、選択したXiのi=1か否かを判断する。i=1であれば、ステップS60cへ進められ、i=1でなければ、ステップS60dへ進められる。   [Step S60b] The area calculation unit 45 selects a point Xi and determines whether i = 1 of the selected Xi. If i = 1, the process proceeds to step S60c, and if i = 1, the process proceeds to step S60d.

[ステップS60c] i=1、すなわち、A(X1,Y1)を選択すると、A(X1,Y1)と、その隣接点であるB(X2,Y2)と1画素とで囲まれる四角形ABB1A1の面積を、初期値データ部41から既に格納してある初期四角形面積を抽出し、出力する。   [Step S60c] When i = 1, that is, when A (X1, Y1) is selected, the area of a quadrangle ABB1A1 surrounded by A (X1, Y1), B (X2, Y2) that is an adjacent point, and one pixel. Are extracted from the initial value data portion 41 and the initial rectangular area already stored is output.

[ステップS60d] i=1ではない場合には、例えばB(X2,Y2)を選択すると、点Bと点Cとの間に画素との交点が有るかを判断する。交点が無ければ、ステップS60eへ進められ、交点があれば、ステップS60hへ進められる。   [Step S60d] When i = 1 is not satisfied, for example, when B (X2, Y2) is selected, it is determined whether or not there is an intersection with a pixel between point B and point C. If there is no intersection, the process proceeds to step S60e, and if there is an intersection, the process proceeds to step S60h.

B(X2,Y2)を選択した場合、隣接点のC(X3,Y3)との間には1画素との交点が無いため、ステップS60eへ進められる。一方、点Dを選択した場合、点Dと、その隣接点である点Fとの間には1画素との交点である点Eがあるために、ステップS60hへ進められる。   When B (X2, Y2) is selected, there is no intersection with one pixel between C (X3, Y3) of the adjacent point, and the process proceeds to step S60e. On the other hand, when the point D is selected, since there is a point E that is an intersection with one pixel between the point D and the adjacent point F, the process proceeds to step S60h.

[ステップS60e] 交点が無い場合、四角形算出部45bは、前に選択した点およびその隣接点と1画素とで囲まれる領域の面積(以後、先行面積や先行四角形などと呼ぶ。)を選択する。   [Step S60e] When there is no intersection, the quadrangle calculation unit 45b selects an area of a region surrounded by the previously selected point and its adjacent points and one pixel (hereinafter referred to as a preceding area or a leading rectangle). .

図6では、例えば、i=2の場合では、点Bの前に選択した点Aおよびその隣接点Bと1画素とで囲まれる領域である四角形ABB1A1の面積を選択する。
[ステップS60f] 四角形算出部45bは、ステップS60eで選択した先行面積から境界線71の傾きを差し引くことによって、選択した点とその隣接点と1画素とで囲まれる領域の面積が算出される。
In FIG. 6, for example, in the case of i = 2, the area of the quadrangle ABB1A1, which is an area surrounded by the point A selected before the point B and its adjacent point B and one pixel, is selected.
[Step S60f] The quadrangle calculation unit 45b calculates the area of the region surrounded by the selected point, its neighboring points, and one pixel by subtracting the slope of the boundary line 71 from the preceding area selected in Step S60e.

i=2を選択した場合、B(X2,Y2)とC(X3,Y3)と1画素とで囲まれる四角形BCC1B1の面積は、四角形ABB1A1の面積から境界線71の傾き値を差し引くことによって、算出することができる。   When i = 2 is selected, the area of the rectangle BCC1B1 surrounded by B (X2, Y2), C (X3, Y3) and one pixel is obtained by subtracting the slope value of the boundary 71 from the area of the rectangle ABB1A1. Can be calculated.

[ステップS60g] 四角形算出部45bは、ステップS60fで算出した面積値のデータを面積値データ部42へ格納する。
[ステップS60h] 交点がある場合、三角形算出部45cは、初期値データ部41から既に格納してある初期三角形面積を抽出し、初期三角形面積から、これまでの先行面積を足し合わせたものを差し引くことによって、変換点における三角形の面積を算出する。
[Step S60g] The quadrangle calculation unit 45b stores the area value data calculated in Step S60f in the area value data unit 42.
[Step S60h] When there is an intersection, the triangle calculation unit 45c extracts the initial triangle area already stored from the initial value data unit 41, and subtracts the sum of the previous preceding areas from the initial triangle area. Thus, the area of the triangle at the conversion point is calculated.

交点がある場合として、点Dを選択した場合、これまでの先行面積を足し合わせた四角形ADD1A1の面積を算出する。そして、初期値データ部41に既に格納されている三角形AEA1の面積を抽出し、三角形AEA1から四角形ADD1A1を差し引くことによって、変換点における三角形DED1の面積を算出することができる。   Assuming that there is an intersection, when the point D is selected, the area of the quadrilateral ADD1A1 obtained by adding up the previous preceding areas is calculated. Then, by extracting the area of the triangle AEA1 already stored in the initial value data section 41 and subtracting the quadrilateral ADD1A1 from the triangle AEA1, the area of the triangle DED1 at the conversion point can be calculated.

[ステップS60i] 三角形算出部45cは、ステップS60hで算出した三角形DED1の面積を面積値データ部42へ出力する。
[ステップS60j] 四角形算出部45bは、ステップS60hで算出した変換点における三角形の先行四角形の面積に1を加えて、境界線71の傾き値を差し引くことによって、ステップS60hで算出した変換点における三角形を含む変換点における四角形を算出する。
[Step S60i] The triangle calculation unit 45c outputs the area of the triangle DED1 calculated in step S60h to the area value data unit 42.
[Step S60j] The quadrangle calculation unit 45b adds 1 to the area of the preceding quadrilateral of the triangle at the conversion point calculated in step S60h, and subtracts the slope value of the boundary 71 to thereby calculate the triangle at the conversion point calculated in step S60h. The rectangle at the transformation point including is calculated.

図6において、四角形算出部45bは、ステップS60hで算出した変換点における三角形DED1を含む変換点における四角形DFF1D2の面積を、先行四角形である四角形CDD1C1に1を加えて(すなわち、四角形CDD2C2の面積の算出。)、傾き値を差し引くことによって変換点における四角形DFF1D2の面積を算出することができる。   In FIG. 6, the quadrangle calculation unit 45b adds 1 to the quadrangle CDD1C1 that is the preceding quadrangle at the conversion point including the triangle DED1 at the conversion point calculated in step S60h (that is, the area of the quadrangle CDD2C2). The area of the square DFF1D2 at the conversion point can be calculated by subtracting the slope value.

[ステップS60k] 四角形算出部45bは、ステップS60jで算出した変換点における四角形DFF1D2の面積を面積値データ部42に格納する。
[ステップS60l] 五角形算出部45dは、ステップS60jで算出した変換点における四角形からステップS60hで算出した変換点における三角形を差し引くことによって、境界線71と画素とで囲まれる変換点における五角形の面積を算出することができる。
[Step S60k] The quadrangle calculation unit 45b stores the area of the quadrangle DFF1D2 at the conversion point calculated in step S60j in the area value data unit 42.
[Step S601] The pentagon calculation unit 45d subtracts the triangle at the conversion point calculated at Step S60h from the quadrangle at the conversion point calculated at Step S60j, thereby obtaining the area of the pentagon at the conversion point surrounded by the boundary line 71 and the pixel. Can be calculated.

図6においては、変換点における四角形DFF1D2から変換点における三角形DED1を差し引くことによって、変換点における五角形D1EFF1D2の面積を算出することができる。   In FIG. 6, the area of the pentagon D1EFF1D2 at the conversion point can be calculated by subtracting the triangle DED1 at the conversion point from the quadrangle DFF1D2 at the conversion point.

[ステップS60m] 五角形算出部45dは、ステップS60lで算出した変換点における五角形の面積を面積値データ部42へ格納する。
これらの処理がi=1,2,…,n−1のすべてについて行われる。
[Step S60m] The pentagon calculation unit 45d stores the area of the pentagon at the conversion point calculated in step S601 in the area value data unit 42.
These processes are performed for all i = 1, 2,..., N−1.

以上の処理によって、境界線と画素とで囲まれる描画領域の面積が算出され、算出された面積はブレンド率として用いられる。
次に、実際に、図6から境界線と画素とで囲まれる領域の面積の算出処理を行うハードウェア装置について説明する。
With the above processing, the area of the drawing region surrounded by the boundary line and the pixel is calculated, and the calculated area is used as the blend rate.
Next, a hardware device that actually calculates the area of a region surrounded by a boundary line and pixels will be described with reference to FIG.

図7は、アンチエイリアシング処理装置の面積算出処理を行うハードウェア装置の構成図である。
図7のハードウェア装置80は、傾き判断部81、面積算出部82、初期設定部83、描画制御部84、加減算器(四角形)85a、加減算器(三角形)85b、加減算器(五角形)85c、マルチプレクサとして、mux86a,86b,86c,86d,86e,86f,86g、レジスタとして、reg87a,87b,87c,87dのブロックによって構成されている。
FIG. 7 is a configuration diagram of a hardware device that performs area calculation processing of the anti-aliasing processing device.
7 includes an inclination determination unit 81, an area calculation unit 82, an initial setting unit 83, a drawing control unit 84, an adder / subtracter (rectangle) 85a, an adder / subtractor (triangle) 85b, an adder / subtracter (pentagon) 85c, The multiplexer includes mux 86a, 86b, 86c, 86d, 86e, 86f, and 86g, and the register includes regs 87a, 87b, 87c, and 87d.

傾き判断部81は、入力された境界線の両端の2点から、境界線の傾きを算出し、境界線が、x軸もしくはy軸と平行であるか否かを判断する。
面積算出部82は、境界線がx軸もしくはy軸と平行である場合、境界線と画素とで囲まれる面積を算出する。
The inclination determination unit 81 calculates the inclination of the boundary line from two points at both ends of the input boundary line, and determines whether the boundary line is parallel to the x axis or the y axis.
When the boundary line is parallel to the x axis or the y axis, the area calculation unit 82 calculates the area surrounded by the boundary line and the pixel.

初期設定部83は、境界線がx軸もしくはy軸と平行でない場合、境界線と画素との交点を全てチェックし、あらかじめ、境界線と画素とで囲まれる四角形または三角形の領域の面積を算出する。   If the boundary line is not parallel to the x-axis or y-axis, the initial setting unit 83 checks all the intersections between the boundary line and the pixel and calculates the area of a quadrangular or triangular area surrounded by the boundary line and the pixel in advance. To do.

描画制御部84は、各機能を有するブロックに初期設定部83で算出した初期値を入力し、また、ブロックから出力されたデータを他のブロックに入力したりなどの、ハードウェア装置全体の制御を行う。   The drawing control unit 84 inputs the initial value calculated by the initial setting unit 83 to a block having each function, and inputs the data output from the block to another block. I do.

加減算器(四角形)85aは、境界線と画素とで囲まれる四角形や変換点における四角形の面積の算出処理のために、描画制御部84の制御に従って、入力した複数のデータを、足し合わせたり、差し引いたりしたデータを出力する。   The adder / subtracter (rectangle) 85a adds a plurality of input data according to the control of the drawing control unit 84 for the calculation process of the area enclosed by the boundary line and the pixel and the area of the rectangle at the conversion point, Output the subtracted data.

加減算器(三角形)85bは、境界線と画素とで囲まれる変換点における三角形の面積の算出処理のために、描画制御部84の制御に従って、入力した複数のデータを、足し合わせたり、差し引いたりしたデータを出力する。   The adder / subtractor (triangle) 85b adds or subtracts a plurality of input data in accordance with the control of the drawing control unit 84 in order to calculate the area of the triangle at the conversion point surrounded by the boundary line and the pixel. Output the data.

加減算器(五角形)85cは、境界線と画素とで囲まれる変換点における五角形の面積の算出処理のために、描画制御部84の制御に従って、入力した複数のデータを、足し合わせたり、差し引いたりしたデータを出力する。   An adder / subtracter (pentagon) 85c adds or subtracts a plurality of input data in accordance with the control of the drawing control unit 84 in order to calculate the area of the pentagon at the conversion point surrounded by the boundary line and the pixel. Output the data.

mux86a,86b,86c,86d,86e,86f,86gは、描画制御部84や加減算器から複数の信号データが入力され、描画制御部84の制御に従って、1つ信号が選択されて、加減算器などへ出力する。特に、mux86gには、各面積値のデータが入力される。   The muxes 86a, 86b, 86c, 86d, 86e, 86f, and 86g receive a plurality of signal data from the drawing control unit 84 and the adder / subtracter, select one signal according to the control of the drawing control unit 84, and the adder / subtracter. Output to. In particular, each area value data is input to the mux 86g.

reg87a,87b,87c,87dは、加減算器から入力された信号データを保持する。
以上の要素から構成されるハードウェア装置80を利用して、図4,5に沿って、実際に図6についての面積の算出について以下に説明を行う。
The regs 87a, 87b, 87c, and 87d hold the signal data input from the adder / subtracter.
The actual calculation of the area of FIG. 6 will be described below with reference to FIGS. 4 and 5 using the hardware device 80 constituted by the above elements.

まず、傾き判断部81は、入力された境界線の2点から境界線の傾きを算出する。算出結果から、境界線がx軸またはy軸と平行であるか否かを判断する。
面積算出部82は、境界線がx軸またはy軸と平行である場合、境界線と画素とで囲まれる方形の領域の面積を算出する(以上、ステップS51からステップS58の処理に相当。)。
First, the inclination determination unit 81 calculates the inclination of the boundary line from two points of the input boundary line. From the calculation result, it is determined whether the boundary line is parallel to the x-axis or the y-axis.
When the boundary line is parallel to the x-axis or the y-axis, the area calculation unit 82 calculates the area of a square region surrounded by the boundary line and the pixels (this corresponds to the processing from step S51 to step S58). .

初期設定部83は、境界線がx軸またはy軸と平行でない場合、境界線と画素との交点を全てチェックし、あらかじめ、境界線と画素とで囲まれる四角形ABB1A1、三角形AEA1および三角形FKF1の領域の面積を、それぞれ初期四角形面積、第1初期三角形面積および第2初期三角形面積として算出する(ステップS59)。   If the boundary line is not parallel to the x-axis or the y-axis, the initial setting unit 83 checks all the intersections between the boundary line and the pixel, and in advance, the rectangle ABB1A1, the triangle AEA1, and the triangle FKF1 surrounded by the boundary line and the pixel The area of each region is calculated as an initial square area, a first initial triangle area, and a second initial triangle area (step S59).

描画制御部84は、境界線と画素との交点を参照して、点Aを選択し、点Aと、これに隣接する点Bと1画素とで囲まれる四角形ABB1A1の面積である初期四角形面積をmux86gに入力する(ステップS60c)。   The drawing control unit 84 refers to the intersection of the boundary line and the pixel, selects the point A, and the initial square area that is the area of the square ABB1A1 surrounded by the point A, the point B adjacent to the point A, and one pixel. Is input to mux 86g (step S60c).

また、描画制御部84は、境界線の傾き値をmux86aに、初期四角形面積をmux86bに入力する。そして、加算減器(四角形)85aは、描画制御部84の制御に従って、初期四角形面積から傾き値を差し引いて、四角形BCC1B1の面積をreg87aに入力する。   In addition, the drawing control unit 84 inputs the slope value of the boundary line into the mux 86a and the initial square area into the mux 86b. Then, the adder / subtracter (rectangle) 85a subtracts the inclination value from the initial square area and inputs the area of the square BCC1B1 to the reg 87a under the control of the drawing control unit 84.

再び、描画制御部84は、reg87aの四角形BCC1B1の面積をmux86bに入力させて、次は、四角形BCC1B1の面積から傾き値を差し引いて四角形CDD1C1の面積を算出する。   The drawing control unit 84 again inputs the area of the quadrangle BCC1B1 of the reg 87a to the mux 86b, and next calculates the area of the quadrangle CDD1C1 by subtracting the slope value from the area of the quadrangle BCC1B1.

以上のようにして、加減算器(四角形)85aでは、描画制御部84の制御に従って、先行面積から傾き値を差し引くことを繰り返すことによって、境界線と画素とで囲まれる四角形の面積を算出する(ステップS60e〜ステップS60g)。   As described above, the adder / subtracter (rectangle) 85a calculates the area of the rectangle surrounded by the boundary line and the pixels by repeatedly subtracting the inclination value from the preceding area in accordance with the control of the drawing control unit 84 ( Step S60e to Step S60g).

なお、描画制御部84は、四角形DFF1D2の面積を算出するために、加減算器(四角形)85aに、先行面積である四角形CDD1C1に1を足し合わせて、傾き値を差し引かせて、四角形DFF1D2の面積を算出し、reg87aを介して、mux86fに入力させる(ステップS60j〜ステップS60k)。   In addition, the drawing control unit 84 adds 1 to the preceding area square CDD1C1 to the adder / subtractor (square) 85a to subtract the slope value and calculate the area of the square DFF1D2 in order to calculate the area of the square DFF1D2. Is input to the mux 86f via the reg 87a (steps S60j to S60k).

一方、描画制御部84は、初期四角形面積をmux86cに、第1初期三角形面積をmux86dに入力する。そして、加算減器(三角形)85bは、描画制御部84の制御に従って、第1初期三角形の三角形AEA1の面積からこれまでの先行面積の和である四角形ADD1A1の面積を差し引いて、三角形DED1の面積をreg87bに入力する。   On the other hand, the drawing control unit 84 inputs the initial square area to the mux 86c and the first initial triangular area to the mux 86d. The adder / subtractor (triangle) 85b subtracts the area of the quadrilateral ADD1A1 that is the sum of the preceding areas from the area of the triangle AEA1 of the first initial triangle according to the control of the drawing control unit 84, thereby obtaining the area of the triangle DED1. Is input to reg87b.

そして、描画制御部84は、reg87bから三角形DED1の面積をreg87cとmux86gとに入力する(ステップS60h〜ステップS60i)。
最後に、加減算器(五角形)85cは、描画制御部84の制御に従って五角形D1EFF1D2の面積を出力するために、mux86fの四角形DFF1D2からmux86eの三角形DED1を差し引いて、五角形D1EFF1D2の面積をreg87dに入力する。
Then, the drawing control unit 84 inputs the area of the triangle DED1 from reg 87b to reg 87c and mux 86g (steps S60h to S60i).
Finally, the adder / subtracter (pentagon) 85c subtracts the triangle DED1 of the mux 86e from the quadrilateral DFF1D2 of the mux 86f and inputs the area of the pentagon D1EFF1D2 to the reg 87d in order to output the area of the pentagon D1EFF1D2 according to the control of the drawing control unit 84. .

そして、描画制御部84は、reg87dから五角形D1EF1D2の面積をmux86gに入力する(ステップS60l〜ステップS60m)。
同様の処理を繰り返すことによって、残りの面積を算出することができる。
Then, the drawing control unit 84 inputs the area of the pentagon D1EF1D2 from the reg 87d to the mux 86g (steps S601 to S60m).
By repeating the same processing, the remaining area can be calculated.

以上のような、ハードウェア装置80を用いることによって、境界線と画素とで囲まれる面積を正確に算出できるだけでなく、加減算器を利用しているために、四角形の面積を算出しつつ、変換点における三角形の面積を算出することができるなど、処理の高速化にも寄与することが可能となる。   By using the hardware device 80 as described above, it is possible not only to accurately calculate the area surrounded by the boundary line and the pixels, but also by using the adder / subtractor, so that the conversion is performed while calculating the square area. For example, the area of a triangle at a point can be calculated, which can contribute to speeding up the processing.

次に、このような処理を行うためのソースコードの概略について説明する。
図8は、アンチエイリアシング処理の面積算出を行うためのソースコードの例である。
なお、ソースコード90は、関連する部分のみを表示したものであり、例えば、関数の戻り値などは省略して記載している。このソースコード90について以下に簡単に説明を行う。
Next, an outline of source code for performing such processing will be described.
FIG. 8 is an example of source code for calculating the area of the anti-aliasing process.
Note that the source code 90 displays only relevant parts, and for example, the return value of the function is omitted. The source code 90 will be briefly described below.

コード91では、傾きがx軸と平行である場合について、境界線と画素とで囲まれる領域の面積を算出する。
コード92では、傾きがy軸と平行である場合について、境界線と画素とで囲まれる領域の面積を算出する。
In the code 91, the area of the region surrounded by the boundary line and the pixel is calculated when the inclination is parallel to the x-axis.
In the code 92, the area of the region surrounded by the boundary line and the pixel is calculated when the inclination is parallel to the y-axis.

コード93では、x軸およびy軸とも平行でない場合について、初期設定を行うとともに、傾き、始点および終点を決定する。
コード94では、始点が終点よりもy軸上方に有る場合について、第1初期三角形AEA1、第2初期三角形FKF1および初期四角形ABB1A1の面積を算出する。
In the code 93, when the x-axis and the y-axis are not parallel, initial settings are made and the inclination, start point, and end point are determined.
In the code 94, the area of the first initial triangle AEA1, the second initial triangle FKF1, and the initial quadrangle ABB1A1 is calculated when the start point is located above the end point in the y-axis.

コード95では、初期四角形ABB1A1から傾き値を差し引くことによって、四角形BCC1B1を算出し、算出した四角形BCC1B1から傾き値を再び差し引くことによって、四角形CDD1C1が算出される。第1初期三角形AEA1からこれまでの四角形ADD1A1の和を差し引くことによって、三角形DED1が算出される。   In the code 95, the quadrangle BCC1B1 is calculated by subtracting the inclination value from the initial quadrangle ABB1A1, and the quadrangle CDD1C1 is calculated by subtracting the inclination value again from the calculated quadrangle BCC1B1. The triangle DED1 is calculated by subtracting the sum of the squares ADD1A1 so far from the first initial triangle AEA1.

コード96では、四角形CDD2C2から傾き値を差し引くことによって、四角形DFF1D2が算出される。算出された四角形DFF1D2から傾き値を差し引くことによって、五角形D1EFF1D2の面積が算出される。   In the code 96, the quadrangle DFF1D2 is calculated by subtracting the inclination value from the quadrangle CDD2C2. The area of the pentagon D1EFF1D2 is calculated by subtracting the slope value from the calculated quadrangle DFF1D2.

このような処理を繰り返すことによって、境界線と画素とで囲まれる領域の面積を算出することができる。
以上のようにして、境界線と画素とで囲まれる面積を正確に算出でき、また、面積の算出に、面積から傾きを差し引くことを繰り返すことによって複雑だった演算を簡略化でき、算出に要する時間を短縮することができる。従って、高速かつ正確に算出された面積をブレンド率として用いることによって、高精度のアンチエイリアシング処理を行うことが可能となる。
By repeating such processing, the area of the region surrounded by the boundary line and the pixel can be calculated.
As described above, the area surrounded by the boundary line and the pixel can be accurately calculated, and complicated calculation can be simplified by repeatedly subtracting the slope from the area to calculate the area. Time can be shortened. Therefore, it is possible to perform highly accurate anti-aliasing processing by using the area calculated at high speed and accurately as the blend ratio.

(付記1) 画素を横切る描画領域の境界線と前記画素とで囲まれた面積に基づいてギザギザ現象を抑えるアンチエイリアシング処理方法において、
表示領域にx,y軸方向が設けられ、前記方向に従って配置された前記画素の辺と交点を有する前記境界線の両端の2点を入力する工程と、
前記2点により、前記境界線の傾き値を算出する工程と、
前記境界線が前記x軸もしくは前記y軸と平行であれば、前記境界線と前記画素とで囲まれる方形の前記面積を算出する工程と、
前記境界線が前記x軸もしくは前記y軸と平行でなく、さらに、等間隔の前記交点のうち隣接する前記交点間に前記辺と別の交点が無ければ、前記境界線と1つの前記画素とで囲まれる四角形の前記面積と、前記別の交点が有れば、前記境界線と1つの前記画素とで囲まれる三角形の前記面積と、前記境界線と2つの前記画素とで囲まれる四角形の前記面積と、前記境界線と2つの前記画素とで囲まれる四角形から前記三角形を除いた多角形の前記面積と、を出力する工程と、
を有することを特徴とするアンチエイリアシング処理方法。
(Additional remark 1) In the anti-aliasing processing method which suppresses a jagged phenomenon based on the area enclosed by the boundary line of the drawing area which crosses a pixel, and the said pixel,
Inputting two points at both ends of the boundary line having an x and y axis direction in the display area and having an intersection with a side of the pixel arranged according to the direction;
Calculating an inclination value of the boundary line from the two points;
If the boundary line is parallel to the x-axis or the y-axis, calculating the area of the square surrounded by the boundary line and the pixel;
If the boundary line is not parallel to the x-axis or the y-axis, and there is no other intersection point with the side between the adjacent intersection points of the equally spaced intersection points, the boundary line and one pixel If there is the area of the quadrangle surrounded by and the another intersection, the area of the triangle surrounded by the boundary line and the one pixel, and the square of the quadrangle surrounded by the boundary line and the two pixels Outputting the area and the area of the polygon excluding the triangle from a quadrangle surrounded by the boundary line and the two pixels; and
An anti-aliasing processing method comprising:

(付記2) 前記境界線が前記x軸もしくは前記y軸と平行でない場合、あらかじめ、処理の最初に算出される、前記境界線と1つの前記画素とで囲まれる四角形および前記三角形を含む大三角形の前記面積を算出する工程をさらに有することを特徴とする付記1記載のアンチエイリアシング処理方法。   (Supplementary note 2) When the boundary line is not parallel to the x-axis or the y-axis, a large triangle including the triangle and the triangle enclosed by the boundary line and one pixel, which is calculated in advance at the beginning of processing The anti-aliasing processing method according to claim 1, further comprising a step of calculating the area.

(付記3) 前記境界線が前記x軸もしくは前記y軸と平行でない場合、前記傾き値が、−1より大きくゼロより小さく、または、ゼロより大きく1より小さいことを特徴とする付記1または2に記載のアンチエイリアシング処理方法。   (Supplementary note 3) Supplementary note 1 or 2, wherein when the boundary line is not parallel to the x-axis or the y-axis, the inclination value is larger than -1 and smaller than zero, or larger than zero and smaller than 1. An anti-aliasing processing method according to 1.

(付記4) 前記境界線と1つの前記画素との四角形の前記面積は、前記四角形と隣接する別の四角形である先行四角形の前記面積から前記傾き値を差し引くことによって算出されることを特徴とする付記1乃至3に記載のアンチエイリアシング処理方法。   (Supplementary note 4) The area of a quadrangle between the boundary line and one pixel is calculated by subtracting the slope value from the area of a preceding quadrilateral that is another quadrangle adjacent to the quadrangle. The anti-aliasing processing method according to any one of supplementary notes 1 to 3.

(付記5) 前記境界線と2つの前記画素との四角形の前記面積は、前記三角形の前記先行四角形の前記面積に1画素の面積を加えるとともに、前記傾き値を差し引くことによって算出されることを特徴とする付記1乃至4に記載のアンチエイリアシング処理方法。   (Supplementary Note 5) The area of the quadrangle between the boundary line and the two pixels is calculated by adding the area of one pixel to the area of the preceding quadrilateral of the triangle and subtracting the slope value. The anti-aliasing processing method according to any one of supplementary notes 1 to 4, which is characterized by the following.

(付記6) 画素を横切る描画領域の境界線と前記画素とで囲まれた面積に基づいてギザギザ現象を抑えるアンチエイリアシング処理装置において、
表示領域にx,y軸方向が設けられ、前記方向に従って配置された前記画素の辺と交点を有する前記境界線の両端の2点を入力する手段と、
前記2点により、前記境界線の傾き値を算出する手段と、
前記境界線が前記x軸もしくは前記y軸と平行であれば、前記境界線と前記画素とで囲まれる方形の前記面積を算出する手段と、
前記境界線が前記x軸もしくは前記y軸と平行でなく、さらに、等間隔の前記交点のうち隣接する前記交点間に前記辺と別の交点が無ければ、前記境界線と1つの前記画素とで囲まれる四角形の前記面積と、前記別の交点が有れば、前記境界線と1つの前記画素とで囲まれる三角形の前記面積と、前記境界線と2つの前記画素とで囲まれる四角形の前記面積と、前記境界線と2つの前記画素とで囲まれる四角形から前記三角形を除いた多角形の前記面積と、を出力する手段と、
を有することを特徴とするアンチエイリアシング処理装置。
(Additional remark 6) In the anti-aliasing processing apparatus which suppresses a jagged phenomenon based on the area enclosed by the boundary line of the drawing area which crosses a pixel, and the said pixel,
Means for inputting two points at both ends of the boundary line having x and y axis directions in the display area and having intersections with sides of the pixels arranged according to the direction;
Means for calculating an inclination value of the boundary line by the two points;
If the boundary line is parallel to the x-axis or the y-axis, means for calculating the area of the rectangle surrounded by the boundary line and the pixel;
If the boundary line is not parallel to the x-axis or the y-axis, and there is no other intersection point with the side between the adjacent intersection points of the equally spaced intersection points, the boundary line and one pixel If there is the area of the quadrangle surrounded by and the another intersection, the area of the triangle surrounded by the boundary line and the one pixel, and the square of the quadrangle surrounded by the boundary line and the two pixels Means for outputting the area and the area of the polygon excluding the triangle from the quadrangle surrounded by the boundary line and the two pixels;
An anti-aliasing processing apparatus comprising:

(付記7) 前記境界線が前記x軸もしくは前記y軸と平行でない場合、あらかじめ、処理の最初に算出される、前記境界線と1つの前記画素とで囲まれる四角形および前記三角形を含む大三角形の前記面積を算出する手段をさらに有することを特徴とする付記6記載のアンチエイリアシング処理装置。   (Supplementary note 7) When the boundary line is not parallel to the x-axis or the y-axis, a large triangle including the rectangle and the triangle enclosed by the boundary line and one pixel, which is calculated in advance at the beginning of processing The anti-aliasing processing apparatus according to appendix 6, further comprising means for calculating the area.

(付記8) 前記境界線が前記x軸もしくは前記y軸と平行でない場合、前記傾き値が、−1より大きくゼロより小さく、または、ゼロより大きく1より小さいことを特徴とする付記6または7に記載のアンチエイリアシング処理装置。   (Supplementary note 8) The supplementary note 6 or 7, wherein when the boundary line is not parallel to the x-axis or the y-axis, the slope value is larger than -1 and smaller than zero, or larger than zero and smaller than one. The anti-aliasing processing apparatus according to 1.

(付記9) 前記境界線と1つの前記画素との四角形の前記面積は、前記四角形と隣接する別の四角形である先行四角形の前記面積から前記傾き値を差し引くことによって算出されることを特徴とする付記6乃至8に記載のアンチエイリアシング処理装置。   (Supplementary Note 9) The area of a quadrangle between the boundary line and one pixel is calculated by subtracting the slope value from the area of a preceding quadrilateral that is another quadrangle adjacent to the quadrangle. The anti-aliasing processing device according to any one of appendices 6 to 8.

(付記10) 前記境界線と2つの前記画素との四角形の前記面積は、前記三角形の前記先行四角形の前記面積に1画素の面積を加えるとともに、前記傾き値を差し引くことによって算出されることを特徴とする付記6乃至9に記載のアンチエイリアシング処理装置。   (Supplementary Note 10) The area of the quadrangle between the boundary line and the two pixels is calculated by adding the area of one pixel to the area of the preceding quadrilateral of the triangle and subtracting the slope value. The anti-aliasing processing apparatus according to any one of appendices 6 to 9, which is characterized by the following.

本発明の処理フローの概要図である。It is a schematic diagram of the processing flow of this invention. 境界線が表示された表示領域の模式図である。It is a schematic diagram of the display area where the boundary line is displayed. アンチエイリアシング処理装置の機能を示すブロック図である。It is a block diagram which shows the function of an anti-aliasing processing apparatus. 本発明の実施の形態におけるアンチエイリアシング処理の面積算出処理を示すフローチャートである。It is a flowchart which shows the area calculation process of the anti-aliasing process in embodiment of this invention. 本発明の実施の形態におけるアンチエイリアシング処理の面積算出処理の詳細を示すフローチャートである。It is a flowchart which shows the detail of the area calculation process of the anti-aliasing process in embodiment of this invention. 本実施の形態における傾きを有する描画領域の境界線が表示された表示領域の模式図である。It is a schematic diagram of the display area in which the boundary line of the drawing area having an inclination in the present embodiment is displayed. アンチエイリアシング処理装置の面積算出処理を行うハードウェア装置の構成図である。It is a block diagram of the hardware apparatus which performs the area calculation process of an anti-aliasing processing apparatus. アンチエイリアシング処理の面積算出を行うためのソースコードの例である。It is an example of the source code for calculating the area of anti-aliasing processing. 表示装置におけるギザギザ現象を示す模式図である。It is a schematic diagram which shows the jagged phenomenon in a display apparatus. ブレンド率について説明するための模式図である。It is a schematic diagram for demonstrating a blend rate. 従来のブレンド率に用いる面積算出方法を説明する模式図である。It is a schematic diagram explaining the area calculation method used for the conventional blend rate.

符号の説明Explanation of symbols

40 アンチエイリアシング処理装置
41 初期値データ部
42 面積値データ部
43 傾き値算出部
44 初期設定部
45 面積算出部
45a 方形算出部
45b 四角形算出部
45c 三角形算出部
45d 五角形算出部
DESCRIPTION OF SYMBOLS 40 Anti-aliasing processing apparatus 41 Initial value data part 42 Area value data part 43 Inclination value calculation part 44 Initial setting part 45 Area calculation part 45a Rectangular calculation part 45b Rectangle calculation part 45c Triangle calculation part 45d Pentagon calculation part

Claims (5)

画素を横切る描画領域の境界線と前記画素とで囲まれた面積に基づいてギザギザ現象を抑えるアンチエイリアシング処理方法において、
情報処理装置が、
表示領域にx,y軸方向が設けられ、前記方向に従って配置された前記画素の辺と交点を有する前記境界線の両端の2点の座標の入力を受け付け
前記2点の座標を基に、前記境界線の傾き値を算出
前記境界線が前記x軸もしくは前記y軸と平行であれば、前記境界線と前記画素とで囲まれる方形の前記面積を算出して記憶手段に格納し
前記境界線が前記x軸もしくは前記y軸と平行でなく、さらに、等間隔の前記交点のうち隣接する前記交点間に前記辺と別の交点が無ければ、前記境界線と1つの前記画素とで囲まれる四角形の前記面積と、前記別の交点が有れば、前記境界線と1つの前記画素とで囲まれる三角形の前記面積と、前記境界線と前記別の交点に接する2つの前記画素とで囲まれる四角形の前記面積と、前記境界線と前記別の交点に接する2つの前記画素とで囲まれる四角形から前記三角形を除いた多角形の前記面積と、を出力して前記記憶手段に格納する
とを特徴とするアンチエイリアシング処理方法。
In the anti-aliasing processing method for suppressing the jagged phenomenon based on the area surrounded by the boundary line of the drawing region crossing the pixel and the pixel,
Information processing device
X, y-axis directions are provided in the display area, and input of coordinates of two points at both ends of the boundary line having an intersection with a side of the pixel arranged according to the direction is received ;
Based on the coordinates of the two points, it calculates a gradient value of the boundary line,
If the boundary line is parallel to the x-axis or the y-axis, the area of the rectangle surrounded by the boundary line and the pixel is calculated and stored in the storage means ,
If the boundary line is not parallel to the x-axis or the y-axis, and there is no other intersection point with the side between the adjacent intersection points of the equally spaced intersection points, the boundary line and one pixel If there is the area of the quadrangle surrounded by and the another intersection, the area of the triangle surrounded by the boundary line and the one pixel, and the two pixels in contact with the boundary and the other intersection And the area of the polygon excluding the triangle from the quadrangle surrounded by the two bordering pixels and the two pixels in contact with the other intersection , and outputs to the storage means Store ,
Anti-aliasing process wherein a call.
前記情報処理装置は、前記境界線が前記x軸もしくは前記y軸と平行でない場合、あらかじめ、処理の最初に算出される、前記境界線と1つの前記画素とで囲まれる四角形および前記三角形を含む大三角形の前記面積を算出することを特徴とする請求項1記載のアンチエイリアシング処理方法。 The information processing apparatus includes a quadrangle and a triangle enclosed by the boundary line and one pixel, which are calculated in advance at the beginning of processing when the boundary line is not parallel to the x-axis or the y-axis. anti-aliasing processing method according to claim 1, wherein the benzalkonium to calculate the area of the large triangle. 前記境界線と1つの前記画素との四角形の前記面積は、前記四角形と隣接する別の四角形である先行四角形の前記面積から前記傾き値の絶対値を差し引くことによって算出されることを特徴とする請求項1または2に記載のアンチエイリアシング処理方法。 The area of a quadrangle between the boundary line and one pixel is calculated by subtracting the absolute value of the slope value from the area of a preceding quadrilateral that is another quadrangle adjacent to the quadrangle. The anti-aliasing processing method according to claim 1 or 2. 前記境界線と2つの前記画素との四角形の前記面積は、前記三角形の前記先行四角形の前記面積に1画素の面積を加えるとともに、前記傾き値の絶対値を差し引くことによって算出されることを特徴とする請求項1乃至3に記載のアンチエイリアシング処理方法。 The area of the quadrangle between the boundary line and the two pixels is calculated by adding an area of one pixel to the area of the preceding square of the triangle and subtracting the absolute value of the slope value. The anti-aliasing processing method according to claim 1. 画素を横切る描画領域の境界線と前記画素とで囲まれた面積に基づいてギザギザ現象を抑えるアンチエイリアシング処理装置において、
表示領域にx,y軸方向が設けられ、前記方向に従って配置された前記画素の辺と交点を有する前記境界線の両端の2点を入力する手段と、
前記2点により、前記境界線の傾き値を算出する手段と、
前記境界線が前記x軸もしくは前記y軸と平行であれば、前記境界線と前記画素とで囲まれる方形の前記面積を算出する手段と、
前記境界線が前記x軸もしくは前記y軸と平行でなく、さらに、等間隔の前記交点のうち隣接する前記交点間に前記辺と別の交点が無ければ、前記境界線と1つの前記画素とで囲まれる四角形の前記面積と、前記別の交点が有れば、前記境界線と1つの前記画素とで囲まれる三角形の前記面積と、前記境界線と前記別の交点に接する2つの前記画素とで囲まれる四角形の前記面積と、前記境界線と前記別の交点に接する2つの前記画素とで囲まれる四角形から前記三角形を除いた多角形の前記面積と、を出力する手段と、
を有することを特徴とするアンチエイリアシング処理装置。

In the anti-aliasing processing apparatus that suppresses the jagged phenomenon based on the area surrounded by the boundary line of the drawing region that crosses the pixel and the pixel,
Means for inputting two points at both ends of the boundary line having x and y axis directions in the display area and having intersections with sides of the pixels arranged according to the direction;
Means for calculating an inclination value of the boundary line by the two points;
If the boundary line is parallel to the x-axis or the y-axis, means for calculating the area of the rectangle surrounded by the boundary line and the pixel;
If the boundary line is not parallel to the x-axis or the y-axis, and there is no other intersection point with the side between the adjacent intersection points of the equally spaced intersection points, the boundary line and one pixel If there is the area of the quadrangle surrounded by and the another intersection, the area of the triangle surrounded by the boundary line and the one pixel, and the two pixels in contact with the boundary and the other intersection Means for outputting the area of the quadrangle surrounded by and the area of the polygon excluding the triangle from the quadrangle surrounded by the boundary line and the two pixels in contact with the other intersection ;
An anti-aliasing processing apparatus comprising:

JP2007066923A 2007-03-15 2007-03-15 Anti-aliasing processing method and anti-aliasing processing apparatus Expired - Fee Related JP4899957B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007066923A JP4899957B2 (en) 2007-03-15 2007-03-15 Anti-aliasing processing method and anti-aliasing processing apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007066923A JP4899957B2 (en) 2007-03-15 2007-03-15 Anti-aliasing processing method and anti-aliasing processing apparatus

Publications (2)

Publication Number Publication Date
JP2008226132A JP2008226132A (en) 2008-09-25
JP4899957B2 true JP4899957B2 (en) 2012-03-21

Family

ID=39844628

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007066923A Expired - Fee Related JP4899957B2 (en) 2007-03-15 2007-03-15 Anti-aliasing processing method and anti-aliasing processing apparatus

Country Status (1)

Country Link
JP (1) JP4899957B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100994708B1 (en) 2009-06-19 2010-11-16 계명대학교 산학협력단 Method and apparatus of calculating area of figure in pixel and dividing pixel for anti-aliasing
KR102339710B1 (en) * 2020-04-16 2021-12-17 (주)트루엔 Method and electronic device for displaying video information

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10228537A (en) * 1997-02-13 1998-08-25 Matsushita Electric Ind Co Ltd Pixel area calculating device
JP4239846B2 (en) * 2004-02-13 2009-03-18 セイコーエプソン株式会社 Line drawing apparatus and line drawing method

Also Published As

Publication number Publication date
JP2008226132A (en) 2008-09-25

Similar Documents

Publication Publication Date Title
US8970448B2 (en) Systems, methods, and devices for manipulation of images on tiled displays
JP4125273B2 (en) Image processing apparatus and method, and program
US5555359A (en) Computer graphics anti-aliasing method using a partitioned look-up table
KR100723422B1 (en) Apparatus and method for rendering image data using sphere splating and computer readable media for storing computer program
US20160364892A1 (en) Font deformation method by changing dimensions of at least one partition of a frame surrounding a character
JP4899957B2 (en) Anti-aliasing processing method and anti-aliasing processing apparatus
US20070266307A1 (en) Auto-layout of shapes
JP4180043B2 (en) Three-dimensional graphic drawing processing device, image display device, three-dimensional graphic drawing processing method, control program for causing computer to execute the same, and computer-readable recording medium recording the same
JP4079268B2 (en) Character display device, character display method, character display program, and readable recording medium
JP2007087283A (en) Graphic drawing device and graphic drawing program
CN114842125A (en) Building rendering method and device, electronic equipment and program product
KR100705188B1 (en) A character font display method
US20100053194A1 (en) Data creating apparatus, drawing apparatus and controlling methods thereof, and recording media
KR20120069134A (en) Apparatus and method for enhancing aliasing in two dimension
Stasik et al. Improvements in upscaling of pixel art
JP4967934B2 (en) Image processing apparatus and program
JPH08329266A (en) Polygonal figure shaping device
KR20160115214A (en) Display apparatus and display method thereof
JP3170249B2 (en) Apparatus and method for deforming character / graphics
Ajorian et al. Fast image resizing for more efficient device adaptation
CN115485732A (en) Pixel alignment delineation with floating point layout
JP4816771B2 (en) Design data generator
TW479207B (en) Elimination method and module for 3D graphics
JP2020115293A (en) Work assistance device, work assistance method, program, and object detection model
JPH0282362A (en) Method for displaying emphasis

Legal Events

Date Code Title Description
A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20080730

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20091211

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20110725

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110809

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110926

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20111206

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20111219

R150 Certificate of patent or registration of utility model

Ref document number: 4899957

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20150113

Year of fee payment: 3

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees