JP2806185B2 - Polygon filling device - Google Patents

Polygon filling device

Info

Publication number
JP2806185B2
JP2806185B2 JP4314475A JP31447592A JP2806185B2 JP 2806185 B2 JP2806185 B2 JP 2806185B2 JP 4314475 A JP4314475 A JP 4314475A JP 31447592 A JP31447592 A JP 31447592A JP 2806185 B2 JP2806185 B2 JP 2806185B2
Authority
JP
Japan
Prior art keywords
polygon
coordinate
processing
vertex
straight line
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 - Lifetime
Application number
JP4314475A
Other languages
Japanese (ja)
Other versions
JPH06162212A (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.)
NEC Corp
Original Assignee
NEC Corp
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 NEC Corp filed Critical NEC Corp
Priority to JP4314475A priority Critical patent/JP2806185B2/en
Publication of JPH06162212A publication Critical patent/JPH06162212A/en
Application granted granted Critical
Publication of JP2806185B2 publication Critical patent/JP2806185B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Image Generation (AREA)

Description

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

【0001】[0001]

【産業上の利用分野】本発明はコンピュータ・ダラフィ
ックスの分野における、多角形の内部を塗りつぶす装置
に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a device for filling the inside of a polygon in the field of computer DallaFix.

【0002】[0002]

【従来の技術】従来から多角形の内部を塗りつぶす方式
として、多くのアルゴリズムが提案されてきている。な
かでも非常に単純な方式として、エッジフィル・アルゴ
リズムがある。以下、このエッジフィル・アルゴリズム
による多角形の内部を塗りつぶす方式を図面を用いて説
明する。
2. Description of the Related Art Conventionally, many algorithms have been proposed as a method for filling the inside of a polygon. One of the very simple methods is the edge fill algorithm. Hereinafter, a method of filling the inside of a polygon by the edge fill algorithm will be described with reference to the drawings.

【0003】図7は従来の内部塗りつぶし方式の構成を
示すブロック図,図8は図7の処理フロー図である。図
7で1は頂点座標テーブル、2は台形内座標発生手段、
6はデータ反転ライト手段、7は1ビット/ピクセルで
構成される画像メモリである。
FIG. 7 is a block diagram showing the configuration of a conventional internal painting method, and FIG. 8 is a processing flowchart of FIG. In FIG. 7, 1 is a vertex coordinate table, 2 is a trapezoidal coordinate generating means,
Reference numeral 6 denotes a data inversion writing means, and reference numeral 7 denotes an image memory composed of 1 bit / pixel.

【0004】画像メモリ7は1ビット/ピクセルで構成
されるメモリであり、画像データをビット・イメージで
記憶する。頂点座標デーブル1は、多角形の頂点の座標
を記憶しているが、各座標は各辺の接続に合わせ順番に
記憶されているものとする。台形内座標発生手段2は、
頂点座標テーブル1から各辺を構成する2つの頂点座標
を順次取り出し、その2つの頂点から多角形の近傍に定
義されたY方向座標軸と平行な直線へ水平線を引くこと
が得られる台形の内部の点の座標を順次算出する。
The image memory 7 is a memory composed of 1 bit / pixel, and stores image data in a bit image. The vertex coordinate table 1 stores the coordinates of the vertices of the polygon, and it is assumed that each coordinate is stored in order according to the connection of each side. The trapezoidal coordinate generation means 2
The coordinates of two vertices constituting each side are sequentially extracted from the vertex coordinate table 1, and a horizontal line is drawn from the two vertices to a straight line parallel to the Y-direction coordinate axis defined near the polygon. The coordinates of the points are calculated sequentially.

【0005】この処理は、まず2つの頂点で指定される
辺上の点の座標を順次発生する。この座標発生には、
(Digital Differential Ana
lyzer)アルゴリズムを用いるのが一般的である。
DDAアルゴリズムに関しては既に公知の事実であるの
で、「実践コンピュータグラフックス」(日刊工業新聞
社)等を参照されたい。次に、発生された辺上の点か
ら、Y方向座標軸に平行な直線へ水平に引いた直線上の
点の座標を順次発生する。これら一連の処理を、辺上の
全ての点について繰り返す。データ反転ライト手段6は
台形内座標発生手段2で発生された座標に対応する画像
メモリ7のデータを反転する。
In this processing, first, coordinates of points on a side specified by two vertexes are sequentially generated. For this coordinate generation,
(Digital Differential Ana
(lyzer) algorithm.
Since the DDA algorithm is a known fact, refer to "Practical Computer Graphics" (Nikkan Kogyo Shimbun) or the like. Next, coordinates of points on a straight line drawn horizontally from a point on the generated side to a straight line parallel to the Y-direction coordinate axis are sequentially generated. This series of processing is repeated for all points on the side. The data inversion writing means 6 inverts data in the image memory 7 corresponding to the coordinates generated by the coordinate generation means 2 in the trapezoid.

【0006】これらは、図8のフローチャートに従って
処理される。図において、ステップ12,13,31,
32,22,23の処理は台形内座標発生手段2で行わ
れる処理であり、ステップ33の処理はデータ反転ライ
ト手段6で行われる処理である。
These are processed according to the flowchart of FIG. In the figure, steps 12, 13, 31, and
The processes of 32, 22, and 23 are processes performed by the trapezoid-in-coordinate generation unit 2, and the process of step 33 is a process performed by the data inversion writing unit 6.

【0007】ここでは、図9に示すような、星型の多角
形P1P2P3P4P5の内部を塗りつぶす場合を取り
上げる。また、頂点座標テーブル1にはこの多角形の頂
点P1P2P3P4P5の座標が順番に記憶されてお
り、それぞれの座標P1(X1,Y1)、P2(X2,
Y2),…、P5(X5,Y5)で表わす。さらに、こ
の多角形の近傍にY座標軸と平行な直線Lが定義されて
おり、この直線のX座標はX0とする。
Here, a case where the inside of a star-shaped polygon P1P2P3P4P5 as shown in FIG. 9 is painted will be described. The coordinates of the vertices P1P2P3P4P5 of the polygon are stored in the vertex coordinate table 1 in order, and the coordinates P1 (X1, Y1), P2 (X2,
Y2),..., P5 (X5, Y5). Further, a straight line L parallel to the Y coordinate axis is defined near the polygon, and the X coordinate of this straight line is X0.

【0008】まず、ステップ11で初期化を行い、画像
メモリ7の中で、本処理に必要な領域を全て’0’に初
期化する。また、ここでは5角形の図形を取扱うのでN
=5、頂点のカウント用変数をn=1とする。
First, initialization is performed in step 11, and all the areas required for this processing in the image memory 7 are initialized to "0". In this case, since a pentagonal figure is handled, N
= 5, and the variable for counting the vertices is n = 1.

【0009】次に、ステップ12で頂点座標テーブル1
から順番に2つの座標P1(X1,Y1),P2(X
2,Y2)を取出す。取出された2つの座標のY座標を
ステップ13で比較する。Y1=Y2ならばステップ2
3へ処理を移し、Y1=Y2でないならば以下の処理を
する。ステップ31で直線P1P2上の点を1点ずつ順
次発生する。前述したように、この発生にはDDAアル
ゴルズムを用いる。この点をPm(Xm,Ym)とする
(図4(a)参照)。
Next, at step 12, the vertex coordinate table 1
, Two coordinates P1 (X1, Y1), P2 (X
2, Y2). In step 13, the Y coordinate of the two coordinates taken out is compared. Step 2 if Y1 = Y2
3 and the following processing is performed if Y1 = Y2 is not satisfied. In step 31, points on the straight line P1P2 are sequentially generated one by one. As described above, the DDA algorithm is used for this generation. This point is defined as Pm (Xm, Ym) (see FIG. 4A).

【0010】次のステップ32でXをX0に初期化した
後、ステップ33で、画像メモリ7上の点P(X,Y
m)のデータを反転する。次のステップ22でXをイン
クリメントしながらステップ33の処理をX≦Xmの間
繰り返す。この結果、Pmから直線lに引いた水平線上
の点が反転される。
After initializing X to X0 in the next step 32, in a step 33, a point P (X, Y
Invert the data of m). In the next step 22, the processing of step 33 is repeated while incrementing X while X ≦ Xm. As a result, the point on the horizontal line drawn from Pm to the straight line 1 is inverted.

【0011】さらに、ステップ31〜33,22までの
処理を直線P1P2上の全ての点について順次行うこと
で、てP1、P2それぞれから直線Lに水平線を引いて
できる台形内部の全ての点が反転される。
Further, by sequentially performing the processing of steps 31 to 33 and 22 for all points on the straight line P1P2, all the points inside the trapezoid formed by drawing a horizontal line from the respective P1 and P2 to the straight line L are inverted. Is done.

【0012】ステップ23でnをインクリメントし、n
=Nまで、ステップ12〜22までの処理を繰返すこと
で、多角形の全ての辺についてこれらの処理が行われ
る。ここで、n=Nとなったとき、n+1=6となって
しまうので、この場合、n+1は1として扱う。
In step 23, n is incremented and n
By repeating the processing of steps 12 to 22 until = N, these processings are performed for all sides of the polygon. Here, when n = N, n + 1 = 6. Therefore, in this case, n + 1 is treated as 1.

【0013】以上の処理による画像メモリ7上のデータ
の変化を、図9(a)〜(f)に示す。この図からわか
るように、角辺と直線Lとで形成される台形内部の点を
反転していくと、最終的に図9(f)のようになる。実
際の塗りつぶしは、本データをもとに’1’の領域のみ
塗りつぶしパターンの描画処理をすることで、多角形内
部を塗りつぶすことができる。
FIGS. 9A to 9F show changes in data in the image memory 7 due to the above processing. As can be seen from this figure, when the points inside the trapezoid formed by the corners and the straight line L are reversed, the result finally becomes as shown in FIG. 9 (f). In actual filling, the inside of the polygon can be filled by performing the drawing processing of the filling pattern only for the region of “1” based on the present data.

【0014】[0014]

【発明が解決しようとする課題】上述した多角形内部の
塗つぶし方法には、図10(a)、(b)に示すよう
に、イーブン・オッド・ルールとノンゼロ・ワインディ
ング・ルールの2つの塗りつぶし方法がある。図9で説
明したエッジフィル・アルゴリズムによる塗りつぶし
は、イーブン・オッド・ルールを実現する塗りつぶしで
あるが、多角形内部に閉じた空間が存在した場合、その
中は塗りつぶすことはできない。
As shown in FIGS. 10 (a) and 10 (b), the above-mentioned method for filling the inside of a polygon includes two fillings, an even-odd rule and a non-zero winding rule. There is a way. The fill by the edge fill algorithm described with reference to FIG. 9 is a fill that implements the even-odd rule. However, if there is a closed space inside the polygon, it cannot be filled.

【0015】近年、文字を外形データで定義し、その中
を塗りつぶすことで、文字を生成するアウトライン・フ
ォント処理や、X−Window、Postscrip
tなどのコンピュータ・グラフィックス処理において、
イーブン・オッド/ノンゼロ・ワインディング・ルール
の両者による塗りつぶしが使用として定義され、これを
実現することが必要とされてきている。
In recent years, outline font processing for generating a character by defining a character with outline data and filling the inside of the character, X-Window, Postscript, etc.
In computer graphics processing such as t
Filling with both the even-odd / non-zero winding rules is defined as being used and needs to be achieved.

【0016】前述のエッジフィル・アルゴリズムは非常
に単純な方式として知られているが、ノンゼロ・ワイン
ディング・ルールに適用できない。したがって、近年の
コンピュータ・グラフィックス処理においては利用でき
ないとされている。
The above-described edge fill algorithm is known as a very simple method, but cannot be applied to a non-zero winding rule. Therefore, it cannot be used in recent computer graphics processing.

【0017】本発明の目的は、エッジフィル・アルゴリ
ズムの単純な処理を生かし、ノンゼロ・ワインディング
・ルールを実現できるようにした多角形内部塗りつぶし
装置を抵抗することにある。
It is an object of the present invention to resist the internal polygon filling device which makes use of the simple processing of the edge fill algorithm to realize a non-zero winding rule.

【0018】[0018]

【課題を解決するための手段】本発明の多角形塗りつぶ
し装置の構成は、nビット/ピクセル(nは自然数)で
構成される画像メモリと、塗りつぶしを行う多角形の頂
点座標を記憶する頂点座標テーブルと、この頂点座標テ
ーブルに従って前記多角形の各辺の方向ベクトルを判定
する方向ベクトル判定手段と、前記多角形の1つの頂点
を通るY方向座標軸を1つの直線定義し前記多角形の
各辺を構成する2つの頂点座標から前記直線まで水平線
を引くことで得られる台形内部の点の座標を発生する台
形内座標発生手段と、この台形内座標発生手段で発生さ
れた台形内部の点に対し前記方向ベクトル判定手段の判
定結果に従って算術演算を行い前記画像メモリへ書き込
みを行う算術演算ライト手段とを備えることを特徴とす
る。
The polygon filling device of the present invention comprises an image memory composed of n bits / pixel (n is a natural number), and vertex coordinates for storing vertex coordinates of the polygon to be filled. Table, direction vector determining means for determining a direction vector of each side of the polygon according to the vertex coordinate table, and one vertex of the polygon
Coordinate generating means for generating coordinates of points inside a trapezoid obtained by drawing a horizontal line from two vertex coordinates constituting each side of the polygon to the straight line and defining a Y-direction coordinate axis passing through as one straight line And arithmetic operation writing means for performing an arithmetic operation on a point inside the trapezoid generated by the coordinate generation means in the trapezoid in accordance with the result of judgment by the direction vector judgment means and writing the result in the image memory. .

【0019】[0019]

【実施例】図1は本発明に関連する多角形塗りつぶし
の構成を示すブロック図、図2は図1の処理を説明す
るフロー図である。図中、1頂点座標テーブル、2は台
形内座標発生手段、3は方向ベクトル判定手段、4は算
術演算ライト手段、5はnビット/ピクセルで構成され
る画像メモリである。頂点座標テーブル1、台形内座標
発生手段2は図7と同じ構成のものである。
DETAILED DESCRIPTION FIG. 1 is filled-polygon instrumentation relevant to the present invention
Block diagram showing the configuration of a location, FIG. 2 is a flowchart describing the processing of FIG. In the drawing, one vertex coordinate table, 2 a trapezoidal coordinate generating means, 3 a direction vector judging means, 4 an arithmetic operation writing means, and 5 an image memory composed of n bits / pixel. The vertex coordinate table 1 and the trapezoidal coordinate generating means 2 have the same configuration as in FIG.

【0020】画像メモリ5はnビット/ピクセル(nは
自然数)で構成されるメモリであり、画像データを1ピ
クセルに対しnビットの多値データとしてビット・イメ
ージで記憶することができる。方向ベクトル判定手段3
は、頂点座標テーブル1から2つの頂点座標から、多角
形の各辺のY方向ベクトルを判定する。
The image memory 5 is a memory composed of n bits / pixel (n is a natural number), and can store image data as a bit image as n-bit multi-value data for one pixel. Direction vector determination means 3
Determines the Y-direction vector of each side of the polygon from the two vertex coordinates from the vertex coordinate table 1.

【0021】算術演算ライト手段4は、台形内座標発生
手段2で発生された座標に対応する画像メモリ5のデー
タに対し、方向ベクトル判定手段3による判定結果によ
り次の処理を行う。Y方向ベクトルが正の辺の場合、そ
の辺をもとに発生された台形内部の点に対する画像メモ
リ5のデータを’+1’する。また、Y方向ベクトルが
負の辺の場合、その辺をもとに発生された台形内部の点
に対する画像メモリ5のデータを’−1’する。
The arithmetic operation writing means 4 performs the following processing on the data in the image memory 5 corresponding to the coordinates generated by the coordinate generating means 2 in the trapezoid, based on the result of determination by the direction vector determining means 3. If the Y direction vector is a positive side, the data in the image memory 5 for the point inside the trapezoid generated based on that side is incremented by "+1". When the Y direction vector is a negative side, the data in the image memory 5 for the point inside the trapezoid generated based on the side is set to "-1".

【0022】ここでも図3に示すような、星形の多角形
P1P2P3P4P5の内部を塗りつぶす場合を説明す
る。また、頂点座標テーブル1には多角形の頂点P1P
2P3P4P5の座標が順番に記憶されており、それぞ
れの座標をP1(X1,Y1),P2(X2,Y2),
…P5(X5,Y5)で表し、この多角形の近傍にY座
標軸と平行な直線Lが定義されており、この直線のX座
標はX0とする。
Here, a case where the inside of a star-shaped polygon P1P2P3P4P5 as shown in FIG. 3 is painted will be described. Also, the vertex coordinate table 1 contains the vertex P1P of the polygon.
The coordinates of 2P3P4P5 are stored in order, and the respective coordinates are P1 (X1, Y1), P2 (X2, Y2),
.. P5 (X5, Y5), a straight line L parallel to the Y coordinate axis is defined near this polygon, and the X coordinate of this straight line is X0.

【0023】まず、図2のステップ11による初期化
と、台形内座標発生手段2で行われるステップ12〜1
5,17,18による処理は従来技術と同じものであ
る。異なるのは、ステップ13,17の間に、方向ベク
トル判定手段3によるステップ14〜16の処理が入る
ことと、ステップ33が算術演算ライト手段4によるス
テップ19〜21の処理に変ったことである。ここで
は、方向ベクトル判定手段3と、算術演算ライト手段4
の処理について詳しく説明する。
First, the initialization in step 11 of FIG. 2 and the steps 12 to 1 performed by the trapezoidal coordinate generation means 2
The processing by 5, 17, 18 is the same as that of the prior art. The difference is that the processing of steps 14 to 16 by the direction vector determination means 3 is inserted between steps 13 and 17, and the processing of step 33 is changed to the processing of steps 19 to 21 by the arithmetic operation writing means 4. . Here, the direction vector determining means 3 and the arithmetic operation writing means 4
Will be described in detail.

【0024】ステップ13までは従来の説明と同様に処
理される。次のステップ14では、ステップ12で取出
された2つの頂点の座標Pn(Xn,Yn)、Pn+1
(Xn+1,Yn+1)に対し、Yn−Yn+1を計算
し、その結果が正か負かを判定する。この結果が正の場
合は、PnPn+1で形成される辺のY方向ベクトル負
であり、ステップ15に処理を移す。また、その結果が
負の場合は、PnPn+1で形成される辺のY方向ベク
トルは正であり、ステップ16に処理を移す。
The processing up to step 13 is performed in the same manner as in the conventional explanation. In the next step 14, the coordinates Pn (Xn, Yn) and Pn + 1 of the two vertices extracted in step 12
For (Xn + 1, Yn + 1), Yn-Yn + 1 is calculated, and it is determined whether the result is positive or negative. If the result is positive, the Y direction vector of the side formed by PnPn + 1 is negative, and the process proceeds to step S15. If the result is negative, the Y direction vector of the side formed by PnPn + 1 is positive, and the process proceeds to step S16.

【0025】ステップ15では、このY方向ベクトルを
記憶するための変数データに’−1’を代入し、ステッ
プ16では’+1’を代入する。ステップ17,18も
従来と同様に処理される。
In step 15, "-1" is substituted for the variable data for storing the Y direction vector, and in step 16, "+1" is substituted. Steps 17 and 18 are processed in the same manner as in the prior art.

【0026】そしてステップ19において、変数データ
の値を判定する。このデータが+1の場合は、ステップ
20に処理を移し、データが−1の場合はステップ21
に処理を移す。ステップ20では、画像メモリ7上の点
P(X,Ym)に対応するデータを+1し、ステップ2
1では、画像メモリ7上の点P(X,Ym)に対応する
データを−1する。
In step 19, the value of the variable data is determined. If this data is +1 the process proceeds to step 20; if the data is -1 then step 21
Transfer processing to In step 20, the data corresponding to the point P (X, Ym) on the image memory 7 is incremented by one, and
At 1, the data corresponding to the point P (X, Ym) on the image memory 7 is decremented by 1.

【0027】その後ステップ22でXをインクリメント
しながらステップ19〜21の処理をX≦Xmの間繰り
返す。この結果Pmから直線Lに引いた水平線上の点が
全て+1または−1される。また、ステップ17〜22
までの処理を直線PnPn+1上の全ての点について順
次行うことで、点Pn、Pn+1それぞれから直線Lに
水平線を引いてできる台形内部の全ての点が+1または
−1される。
Thereafter, the processing of steps 19 to 21 is repeated while incrementing X in step 22 while X ≦ Xm. As a result, all points on the horizontal line drawn from Pm to the straight line L are incremented by +1 or -1. Steps 17 to 22
The above process is sequentially performed on all points on the straight line PnPn + 1, so that all points in the trapezoid formed by drawing a horizontal line from each of the points Pn and Pn + 1 to the straight line L are incremented by +1 or -1.

【0028】さらにステップ12〜23までの処理を、
従来と同様に繰り返すことで、多角形の全ての辺につい
てこれらの処理を行うことができる。
Further, the processing of steps 12 to 23 is
These processes can be performed for all sides of the polygon by repeating the same process as in the related art.

【0029】以上の処理よる画像メモリ5上のデータの
変化を図3(a)〜(f)に示す。この図からわかるよ
うに、各辺と直線Lとで形成される台形内部の点を、方
向ベクトル判定手段3の判定結果にもとづき、’+1’
または’−1’で算術演算していくと、最終的に図3
(f)のようになる。実際の塗りぶしは、このデータを
もとに’0’以外の領域のみ塗りつぶしパターンの描画
処理をすることで、多角形内部を塗りつぶすことができ
る。
FIGS. 3A to 3F show changes in data on the image memory 5 due to the above processing. As can be seen from this figure, a point inside the trapezoid formed by each side and the straight line L is determined as '+1' based on the determination result of the direction vector determining means 3.
Or, when the arithmetic operation is performed with '-1', finally, FIG.
(F). In actual painting, the inside of the polygon can be painted by drawing a painting pattern only for an area other than '0' based on this data.

【0030】図4は本発明の一実施例の処理を説明する
フローチャート、図5は図4の台形内座標発生手段2の
処理を説明する座標図、図6は図4の処理を説明する座
標図である。本実施例の構成は、図1のブロックと同じ
であり、台形内座標発生手段2の処理のみ相違する。
FIG. 4 is a flowchart for explaining the process of Kazumi施例of the present invention, FIG 5 is a coordinate diagram for explaining the processing of the trapezoid in the coordinate generating means 2 in FIG. 4, FIG. 6 illustrates the process of FIG. 4 It is a coordinate diagram. The configuration of the present embodiment is the same as that of the block of FIG. 1 except for the processing of the trapezoidal coordinate generating means 2.

【0031】本実施例の台形内座標発生手段2の処理
は、図5(a)に示される。この処理は、ステップ17
〜22で示され、直線PnPn+1が必ず直線Lより右
側(X方向座標軸正方向側)になければならない。
FIG. 5 (a) shows the processing of the trapezoidal coordinate generating means 2 of this embodiment. This processing is performed in step 17
The straight line PnPn + 1 must always be on the right side of the straight line L (on the positive side in the X-direction coordinate axis).

【0032】この台形内座標発生手段2の処理では、図
に示すように、ステップ20,21とステップ22との
間に、ステップ24,25が追加されている。これによ
り、ステップ24ではXmとXoの大小比較を行い、X
o≦Xmなら第1の実施例と同様にステップ22でXを
インクリメントし、Xo>Xmなら、ステップ25でX
をデクリメントする。そしてXo>Xmの場合、ステッ
プ19〜25の間をX≧Xmの間繰り返す。この結果図
4(b)に示すような、直線PnPn+1と直線Lとが
交差した場合にも、両直線間の座標を発生することがで
きるようになる。
In the processing of the trapezoidal coordinate generation means 2, steps 24 and 25 are added between steps 20 and 21 and step 22, as shown in the figure. As a result, in step 24, the magnitudes of Xm and Xo are compared, and
If o ≦ Xm, X is incremented in step 22 as in the first embodiment, and if Xo> Xm, X is incremented in step 25.
Is decremented. If Xo> Xm, steps 19 to 25 are repeated while X ≧ Xm. As a result, even when the straight line PnPn + 1 and the straight line L intersect as shown in FIG. 4B, coordinates between the straight lines can be generated.

【0033】ここで、図1の場合と同様に、星型の多角
形P1P2P3P4P5の内部を塗りつぶす場合を考え
る。ここで、Y方向座標軸と平行な直線Lを図6に示す
ように、多角形の内部に定義する。前述のように、台形
内座標発生手段2は、多角形の各辺と直線Lが交差して
も処理を可能としたため、このような定義が可能とな
る。本多角形を図4のフローチャートに従って処理した
様子を図6(a)〜(f)に示し、図6(f)がその最
終結果である。図1の場合と同様に実際の塗りつぶし
は、本データをもとに’0’以外の領域のみ塗りつぶし
パターンの描画処理をすることで、多角形内部を塗りつ
ぶすことができる。
Here, as in the case of FIG. 1 , consider the case where the inside of the star-shaped polygon P1P2P3P4P5 is painted. Here, a straight line L parallel to the Y-direction coordinate axis is defined inside the polygon as shown in FIG. As described above, the trapezoid-in-coordinate generation unit 2 can perform processing even when the straight line L intersects with each side of the polygon, and thus such a definition is possible. FIGS. 6A to 6F show how the polygon is processed in accordance with the flowchart of FIG. 4, and FIG. 6F shows the final result. As in the case of FIG. 1, the inside of the polygon can be actually filled by performing a drawing process of a fill pattern only for an area other than “0” based on the present data.

【0034】本実施例によれば、図1の場合に比べ、多
角形外部に対する無駄なライト処理を減らすことがで
き、従って、図1の場合に比べ処理の高速化をはかるこ
とが可能である。
According to the present embodiment, compared with the case of FIG. 1, it is possible to reduce the unnecessary write processing for the polygon outside, therefore, it is possible to increase the speed of processing than the case of FIG. 1 .

【0035】[0035]

【発明の効果】以上説明したように本発明によれば、エ
ッジフィル・アルゴリズムの処理の単純さという特徴を
損なうことなく、ノンゼロ・ワインディング・ルールに
よる塗りつぶしを実現することができる。特に、算術演
算による描画手段と多値画像に対応したフレーム・メモ
リが用意された装置において、本方式は容易に実現で
き、エッジフィル・アルゴリズムでは不可能であったノ
ンゼロ・ワインディング・ルールによる塗りつぶしが可
能となる。
As described above, according to the present invention, it is possible to realize the filling by the non-zero winding rule without impairing the feature of the simplicity of the processing of the edge fill algorithm. In particular, this method can be easily realized in a device provided with a drawing means by arithmetic operation and a frame memory corresponding to a multi-valued image, and the non-zero winding rule, which was impossible with the edge fill algorithm, can be used. It becomes possible.

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

【図1】本発明に関連する多角形塗りつぶし装置の構成
示すブロック図。
FIG. 1 is a configuration of a polygon filling device related to the present invention.
Block diagram showing the.

【図2】図1の装置の処理を示すフローチャート。FIG. 2 is a flowchart showing a process of the apparatus of FIG. 1;

【図3】図1の装置における図形処理を順次説明する座
標図。
FIG. 3 is a coordinate diagram for sequentially explaining graphic processing in the apparatus of FIG. 1;

【図4】本発明の一実施例の処理を説明するフローチャ
ート。
FIG. 4 is a flowchart that describes the process of Kazumi施例of the present invention.

【図5】図4の実施例における台形内座標発生手段2の
処理を示す座標図。
FIG. 5 is a coordinate diagram showing processing of a trapezoidal coordinate generating means 2 in the embodiment of FIG. 4;

【図6】図4の実施例における図形処理を順次説明する
座標図。
FIG. 6 is a coordinate diagram for sequentially explaining graphic processing in the embodiment of FIG. 4;

【図7】従来の多角形塗りつぶし方式の構成要素を示す
ブロック図。
FIG. 7 is a block diagram showing components of a conventional polygon filling method.

【図8】図7を説明するフローチャート。FIG. 8 is a flowchart for explaining FIG. 7;

【図9】図7における図形処理を順次説明する座標図。FIG. 9 is a coordinate diagram for sequentially explaining the graphic processing in FIG. 7;

【図10】従来のイーブン・オッド・ルールとノンゼロ
・ワインディング・ルールの両方式による多角形の塗り
つぶし例を示す座標図。
FIG. 10 is a coordinate diagram showing an example of filling a polygon by both conventional even-odd rules and non-zero winding rules.

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

1 頂点座標テーブル 2 台形内座標発生手段 3 方向ベクトル判定手段 4 算術演算ライト手段 5 画像メモリ(nビット/ピクセル) 6 データ反転ライト手段 7 画像メモリ(1ビッと/ピクセル) 11〜25,31〜33 処理ステップ DESCRIPTION OF SYMBOLS 1 Vertex coordinate table 2 In-trapezoid coordinate generation means 3 Direction vector determination means 4 Arithmetic operation writing means 5 Image memory (n bits / pixel) 6 Data inversion writing means 7 Image memory (1 bit / pixel) 11-25, 31- 33 processing steps

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 nビット/ピクセル(nは自然数)で構
成される画像メモリと、塗りつぶしを行う多角形の頂点
座標を記憶する頂点座標テーブルと、この頂点座標テー
ブルに従って前記多角形の各辺の方向ベクトルを判定す
る方向ベクトル判定手段と、前記多角形の1つの頂点を
通るY方向座標軸を1つの直線定義し前記多角形の各
辺を構成する2つの頂点座標から前記直線まで水平線を
引くことで得られる台形内部の点の座標を発生する台形
内座標発生手段と、この台形内座標発生手段で発生され
た台形内部の点に対し前記方向ベクトル判定手段の判定
結果に従って算術演算を行い前記画像メモリへ書き込み
を行う算術演算ライト手段とを備えることを特徴とする
多角形塗りつぶし装置。
1. An image memory composed of n bits / pixel (n is a natural number), a vertex coordinate table for storing vertex coordinates of a polygon to be filled, and each side of the polygon according to the vertex coordinate table. Direction vector determining means for determining a direction vector, and one vertex of the polygon
And trapezoidal in the coordinate generating means for generating a trapezoidal internal point coordinates obtained by subtracting a horizontal line from the two vertex coordinates the Y-direction coordinate axis is defined as one straight line constituting the sides of the polygon to the straight line passing through Arithmetic write means for performing an arithmetic operation on a point inside the trapezoid generated by the coordinate generating means in the trapezoid according to the result of the determination by the direction vector determining means and writing the result into the image memory. Square filling device.
JP4314475A 1992-11-25 1992-11-25 Polygon filling device Expired - Lifetime JP2806185B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4314475A JP2806185B2 (en) 1992-11-25 1992-11-25 Polygon filling device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4314475A JP2806185B2 (en) 1992-11-25 1992-11-25 Polygon filling device

Publications (2)

Publication Number Publication Date
JPH06162212A JPH06162212A (en) 1994-06-10
JP2806185B2 true JP2806185B2 (en) 1998-09-30

Family

ID=18053775

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4314475A Expired - Lifetime JP2806185B2 (en) 1992-11-25 1992-11-25 Polygon filling device

Country Status (1)

Country Link
JP (1) JP2806185B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6504543B1 (en) 1999-01-06 2003-01-07 Matsushita Electric Industrial Co., Ltd. Polygon drawing method and polygon drawing apparatus

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1130666C (en) 1998-06-08 2003-12-10 松下电器产业株式会社 Graphic obliterator

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2782904B2 (en) * 1990-03-27 1998-08-06 日本電気株式会社 Polygon fill method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6504543B1 (en) 1999-01-06 2003-01-07 Matsushita Electric Industrial Co., Ltd. Polygon drawing method and polygon drawing apparatus

Also Published As

Publication number Publication date
JPH06162212A (en) 1994-06-10

Similar Documents

Publication Publication Date Title
Kirk Graphics Gems III (IBM Version): Ibm Version
EP0592770B1 (en) Method for filling of interior pixels within a polygon
EP0344686B1 (en) Clipping process and processor
JPH0660173A (en) Method and apparatus for reducing picture
JP2806185B2 (en) Polygon filling device
JPH01296389A (en) Method and device for processing graphic
JPH03119387A (en) Method and apparatus for forming contour of digital type surface
JPH01196677A (en) Pattern data preparing system
JP2770582B2 (en) Figure filling device
CN110070591B (en) Polygon filling method for computer drawing
US6515661B1 (en) Anti-aliasing buffer
JPS63305478A (en) Pattern information restoring device
US6380936B1 (en) System and method for inferring projective mappings
JP2005514675A (en) Method and apparatus for generating Mth order shapes in N-dimensional space
JPH02168361A (en) Pattern data preparing device to prepare coordinates data and processor
JP4214644B2 (en) 2D pattern generator
JP3191409B2 (en) Font data generator
JPH0816822A (en) Three-dimensional moving picture generation method
JP2782904B2 (en) Polygon fill method
JPH0785266A (en) Image rotating device
JP3799164B2 (en) Image processing method and image processing apparatus
JP3154343B2 (en) How to fill in polygonal shapes
JPH0350686A (en) Graphic processing system
JPH0431399B2 (en)
JPH0823741B2 (en) How to process vector characters or graphics

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 19980623