JPS60243772A - Method for painting out inside of loop on display device - Google Patents

Method for painting out inside of loop on display device

Info

Publication number
JPS60243772A
JPS60243772A JP59099482A JP9948284A JPS60243772A JP S60243772 A JPS60243772 A JP S60243772A JP 59099482 A JP59099482 A JP 59099482A JP 9948284 A JP9948284 A JP 9948284A JP S60243772 A JPS60243772 A JP S60243772A
Authority
JP
Japan
Prior art keywords
point
boundary
closed curve
value
loop
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.)
Granted
Application number
JP59099482A
Other languages
Japanese (ja)
Other versions
JPH0319991B2 (en
Inventor
Seiichi Konishi
小西 清一
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.)
Yokogawa Electric Corp
Original Assignee
Yokogawa Hokushin Electric 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 Yokogawa Hokushin Electric Corp filed Critical Yokogawa Hokushin Electric Corp
Priority to JP59099482A priority Critical patent/JPS60243772A/en
Publication of JPS60243772A publication Critical patent/JPS60243772A/en
Publication of JPH0319991B2 publication Critical patent/JPH0319991B2/ja
Granted legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/40Filling a planar surface by adding surface attributes, e.g. colour or texture

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Controls And Circuits For Display Device (AREA)
  • Digital Computer Display Output (AREA)
  • Image Generation (AREA)

Abstract

PURPOSE:To paint out efficiently the inside of a loop with simple constitution by checking the vertical change of border points every detection of a new border point and painting-out points on the basis of the checked result. CONSTITUTION:When a painting-out request is applied to an optional point (Xb, Ya) in an area surrounded by a loop L1, the intersected point (Xa, Yb) between a horizontal line passing the point and the closed curve L1 are detected as a starting point at first, then while moving the loop L1 in the clockwise direction Ar1 e.g., the horizontal line is successively painted out. When the painter is returned to the starting point (Xa, Ya) after one cycle, the painting-out in the area of the loop L1 will be completed.

Description

【発明の詳細な説明】 〈産業上の利用分野〉 本発明は、画像の輪郭線を表わす閉曲線データが表示メ
モリに書込まれたラスクスキャン型表示装置において、
前記閉曲線領域内の塗りつぶしを簡単なハードウェア構
成で効率良く行うことが出来る塗りつぶし方式に関する
DETAILED DESCRIPTION OF THE INVENTION <Industrial Application Field> The present invention provides a rask scan type display device in which closed curve data representing the outline of an image is written in a display memory.
The present invention relates to a filling method that can efficiently fill in the closed curve area with a simple hardware configuration.

〈従来技術〉 ラスクスキャン型表示装置において、例えば、第1図で
示すような、境界をOで表わされた閉曲線の領域内にS
で表わされる塗りつぶし要求が与えられた場合、これを
開始点として前記閉曲線領域内の点を第2図の・で示す
ように塗りつぶされる。
<Prior art> In a rusk scan type display device, for example, as shown in FIG.
When a filling request expressed by is given, points within the closed curve area are filled in as shown by . in FIG. 2, using this as a starting point.

この塗りつぶし方式として、例えば、1982年度にA
ddison−Wesley pub。
For example, in 1982, A
ddison-wesley pub.

Go、より出版された、J、D、Fo I ey。Published by J. D. FoIey.

A、D、Dam共箸”Fundamenta l so
f Interactive Comput −er 
Graphics”P、448〜451に記載されてい
るような方式が知られている。
A, D, Dam common chopsticks”Fundamental so
fInteractive Compute-er
A method such as that described in "Graphics" P, 448-451 is known.

この文献に示されている第1の方式は、閉曲線によって
囲まれた領域内の任意の点に塗りつぶし要求が与えられ
た場合、要求された画素を中心にこれに4方(左、右、
上、下隣り)、或は8方(左、右、上、下、斜め隣り)
より隣接する画素を一定のルールに従ってチェックし、
塗りつぶすべき画素を順次特定していくものである。
The first method shown in this document is that when a filling request is given to an arbitrary point within an area surrounded by a closed curve, the requested pixel is centered around the requested pixel and is applied in four directions (left, right,
(adjacent above, below), or 8 directions (left, right, above, below, diagonally adjacent)
Check for more adjacent pixels according to certain rules,
The pixels to be filled in are sequentially identified.

第3図は、このような方式によって塗りつぶしが行われ
て行く状態を示す説明図である。0で表わされる閉曲線
の領域内にSで表わされる塗りつぶし要求が与えられた
場合、8点を開始点として、回帰的定義に従った処理が
繰り返し行われ、塗りつぶすべき画素が順次特定されて
行く。本具体例の場合、開始点Sより下側に1,2と移
動し、下側の境界点に当って左方に折れ、上側に3.4
・・・7と折り返し、上側の境界点に当って左方に折れ
、更に、下側に8.9.A、B・・・というように、一
定の順序で塗りつぶしが行われる。
FIG. 3 is an explanatory diagram showing a state in which filling is performed using such a method. When a filling request, represented by S, is given within a closed curve region represented by 0, processing according to the recursive definition is performed repeatedly starting at 8 points, and pixels to be filled are sequentially identified. In the case of this specific example, it moves downward from the starting point S by 1 and 2, hits the lower boundary point, bends to the left, and moves upward by 3.4.
...Turns back to 7, hits the upper boundary point, bends to the left, and then goes to the lower side with 8.9. Filling is performed in a fixed order, such as A, B, and so on.

この文献に示された第2の方式は、前記閉曲線で囲まれ
た領域内に塗りつぶし要求が与えられた場合、これに隣
接する水平方向の画素を順次塗りつぶして行く方法であ
る。この場合、塗りつぶしが終了したあと、次に塗りつ
ぶしを行う部分を探し出すべく、塗りつぶしが行なわれ
た水平線に隣接する上側及び下側の水平線が走査される
。これによって得られたデータはスタックに蓄積され、
これらデータの中から次に塗りつぶすべき部分が選択さ
れて、これを塗りつぶすようようにしている。
The second method disclosed in this document is a method in which, when a filling request is given within an area surrounded by the closed curve, pixels in the horizontal direction adjacent to the area are sequentially filled. In this case, after filling is completed, the upper and lower horizontal lines adjacent to the filled horizontal line are scanned to find the next portion to be filled. The data obtained by this is accumulated in the stack,
The next part to be filled in is selected from among these data, and this is then filled in.

第4図乃至第6図は、このような方式によって塗りつぶ
しが行われて行(状態を示す説明図である。、第54図
において、Sで表された塗りつぶし要求が与えられた場
合、これに隣接する水平方向の画素が、・で示すように
、順次塗りつぶされて行く。この後、塗りつぶされた水
平線に隣接する上側及び下側の水平線が走査され、これ
らに関するデータがスタックに蓄積される。第4図中、
1゜2はこれらデータのスタックWI丹を代表的に表し
たものである。本具体例の場合、画素グループ2が次に
塗りつぶされるべき水平部分として選択され、Fi5図
に示すようにこの部分が塗りつぶされる。
4 to 6 are explanatory diagrams showing the state of rows (rows) filled in using this method. In FIG. 54, when a filling request represented by S is given, Adjacent horizontal pixels are filled in sequentially, as shown by . After this, the upper and lower horizontal lines adjacent to the filled horizontal line are scanned, and the data regarding these is accumulated in the stack. In Figure 4,
1°2 is a representative representation of the stack of these data. In this specific example, pixel group 2 is selected as the next horizontal portion to be filled in, and this portion is filled in as shown in Figure Fi5.

この後、第4図における場合と同様、塗りつぶしが完了
した水平線に隣接するL側及び下側の水平線が走査され
、次に塗りつぶしを行う部分が特定され、第6図に示す
ように、第5図における画素グループ2が塗りつぶされ
る。
After this, as in the case of FIG. 4, the L side and lower horizontal lines adjacent to the horizontal line that has been filled in are scanned to identify the area to be filled next, and as shown in FIG. Pixel group 2 in the figure is filled in.

しかしながら、これら従来方式において、第1の方式の
場合、夫々の手続は簡単であるが、画素一つ一つについ
て、回帰的定義に従った処理を繰り返し実行する必要が
あり、時間が掛る欠点があった。更に、メモリスペース
が限られているような場合、スタックがオーバフローし
てしまう欠点があった。
However, in the case of the first method, although the respective procedures are simple, it is necessary to repeatedly perform processing according to the recursive definition for each pixel, which takes time. there were. Furthermore, when memory space is limited, the stack may overflow.

また、第2の方式では、前記閉曲線の領域内の全ての画
素を2度走査する必要があり、時間が掛る欠点がある他
、次に塗りつぶしを行う部分を探し出す為、塗りつぶし
が完了した水平線に隣接する水平線の走査を行わなけれ
ばならず、この走査によるデータのmは前記閉曲線によ
って作られる図形の形態によって著しく変化するので、
複雑な形態の図形にも正しく対処出来るようにする為に
は充分大きなメモリを用意する必要があった。
In addition, in the second method, it is necessary to scan all pixels within the area of the closed curve twice, which is time-consuming. In addition, in order to find the next part to be filled, the horizontal line that has been filled is Adjacent horizontal lines must be scanned, and the data m from this scan changes significantly depending on the form of the figure created by the closed curve.
In order to be able to correctly handle even complex shapes, it was necessary to provide a sufficiently large memory.

く目的〉 本発明の目的は、画像の輪郭線を表ゎ′!J111曲線
データが予め表示メモリに書込まれたラスクスキャン型
表示装置において、前記閉曲線の領域内の塗りつ4−シ
を簡単なハードウェア構成で効率良く行える塗りつぶし
方式を実現jることにある。
Purpose> The purpose of the present invention is to represent the outline of an image! The object of the present invention is to realize a filling method that can efficiently perform filling in the area of the closed curve with a simple hardware configuration in a rask scan type display device in which J111 curve data is written in a display memory in advance.

〈発明の構成〉 本発明の構成は、画像の輪郭線を表わす閉曲線データが
書込まれたラスクスキャン型表示装置において、前記閉
曲線領域内の任意の点に塗りつぶし要求が与えられたと
き、この点を水平方向に移動させて前記閉曲線と交わる
点をめ、これを開始点としてこの点に隣接する画素を時
計回り、或は反時計回りに走査して前記閉曲線との交点
をめ、これを新たな境界点として先の場合と同様な走査
を行い更に新たな境界点を検出する動作を、前記閉曲線
上を辿って前記開始点まで繰り返し行うと共に、前記境
界点の検出毎に、この境界点の垂直方向の変化傾向が特
定の方向にある場合、この境界点から水平に前記閉曲線
と交わる点まで塗りつぶし、前記閉曲線で囲まれる領域
を塗りつぶすようにしたことことにある。
<Configuration of the Invention> The configuration of the present invention is such that in a rask scan type display device in which closed curve data representing the outline of an image is written, when a request to fill in any point within the closed curve area is given, this point is Move in the horizontal direction to find a point where it intersects with the closed curve, use this as a starting point, scan the pixels adjacent to this point clockwise or counterclockwise to find the point of intersection with the closed curve, and then scan this point anew. The operation of scanning the same boundary point as in the previous case and detecting a new boundary point is repeated along the closed curve to the starting point, and each time the boundary point is detected, the operation of detecting a new boundary point is repeated. When the vertical change tendency is in a specific direction, the area is filled in from this boundary point horizontally to the point where it intersects with the closed curve, and the area surrounded by the closed curve is filled in.

〈実施例〉 先ず、本発明による塗りつぶし方式の原理について第7
図及び第8図に従い説明を行う。水平、垂直方向の座標
位置をXn、Ynで表わす。第7図で示すような、閉曲
11LIによって囲まれた領域内の任意の点(X、b、
Ya)に塗りつぶし要求が与えられた場合、この点を通
る水平線と閉曲線L1との交点(xa、Ya)を先ず見
付け、この点を開始点とする。この点から、閉曲線L1
を例えば時1回り方向Ar1に移動しながら、水平線を
Xで順次塗りつぶして行く。−周して開始点(Xa、Y
F3)に戻ったところで閉曲線L1の領域内の塗りつぶ
しは完了する。
<Example> First, the principle of the filling method according to the present invention will be explained in the seventh section.
The explanation will be given according to the drawings and FIG. The horizontal and vertical coordinate positions are represented by Xn and Yn. Any point (X, b,
When a request to fill in Ya) is given, first find the intersection (xa, Ya) between the horizontal line passing through this point and the closed curve L1, and use this point as the starting point. From this point, the closed curve L1
For example, while moving in the direction Ar1 around the clock, the horizontal line is sequentially filled with X's. - Go around and start point (Xa, Y
When the process returns to F3), filling in the area of the closed curve L1 is completed.

閉曲線L1上をを時計回り方向Ar1に進んで行く過程
を第8図に従し)説明づる。第8図は第7図に示す閉曲
線L1の部分を拡大して示したもので、黒点で表わされ
た開始点(Xa、Ya)を中心にこれに8方より隣接す
る画素が示されている。
The process of moving along the closed curve L1 in the clockwise direction Ar1 will be explained with reference to FIG. FIG. 8 is an enlarged view of the closed curve L1 shown in FIG. 7, with the starting point (Xa, Ya) represented by a black dot as the center, and pixels adjacent to it from eight directions are shown. There is.

これらのうち、斜線の点は、閉曲線L1を構成する画素
で、この閉曲線は予め表示メモリに書込まれている。
Among these, the diagonally shaded points are pixels forming the closed curve L1, and this closed curve is written in the display memory in advance.

開始点(Xa、Ya)が決ると、この点を中心に反時計
回り方向Ar2に隣接する8つの画素のアドレスをチェ
ックする。閉曲線L1と最初に交わる点、即ち、(Xa
−1’、Ya+1)の点が新たな境界点として特定され
る。次にこれを新たな開始点として先の場合と同様な走
査を行い史に新たな境界点を検出して行く。このような
動作を繰り返し行うことによって、開始点(>(a、Y
a)まで閉曲線し1上を辿って行くことが出来る。
Once the starting point (Xa, Ya) is determined, the addresses of eight pixels adjacent to this point in the counterclockwise direction Ar2 are checked. The point that first intersects with the closed curve L1, that is, (Xa
-1', Ya+1) is specified as a new boundary point. Next, using this as a new starting point, scanning is performed in the same manner as in the previous case to detect new boundary points in the history. By repeating these operations, the starting point (>(a, Y
It is possible to trace the closed curve up to a) above 1.

更に、前記境界点が検出される毎にその前の境界点から
水平に閉曲線1−1と交わる点まで塗りつぶしが行われ
る。尚、この場合、同じ水平線が2度塗りつぶしが行わ
れないようにする為、前記境界点の垂直方向の変化傾向
が特定の方向にある場合、例えば、新たな境界点のYn
の値が前回の境界点のものと比べ増加しているときだ1
ノ水平線の塗りつぶしを行う。
Further, each time the boundary point is detected, filling is performed from the previous boundary point to the point horizontally intersecting the closed curve 1-1. In this case, in order to prevent the same horizontal line from being filled twice, if the vertical change tendency of the boundary point is in a specific direction, for example, Yn of the new boundary point
When the value of increases compared to that of the previous boundary point1
Fill in the horizontal line.

ところで、閉曲線L1の形状は第7図に示寸ような簡単
な形状ばかりとは限らない。複雑な閉曲線の場合も有り
得る。以下、このような場合の本発明の実施例について
説明を行う。第9図は複雑な閉曲線L2の部分を拡大し
て示したもので、黒並びに斜線の点はこの閉曲線を構成
づる画素を表わす。尚、以下の説明では、閉曲線L2上
の開始点を見付番プる行程、即ち、閉曲線L2内の任意
の点に塗りつぶし要求が出され、この点を通る水平線と
閉曲線L2との交点をめ、開始点とする行程についての
説明は省略されている。今、黒点の位置から矢印Ar3
方向に閉曲線L2上を進んで行くものとする。
By the way, the shape of the closed curve L1 is not necessarily a simple shape as shown in FIG. There may also be cases of complex closed curves. Examples of the present invention in such a case will be described below. FIG. 9 is an enlarged view of a portion of the complex closed curve L2, and black and diagonally shaded points represent pixels forming this closed curve. In the following explanation, the process of identifying the starting point on the closed curve L2, that is, a request to fill in an arbitrary point within the closed curve L2, and the intersection of the horizontal line passing through this point with the closed curve L2 is aimed. , a description of the process used as the starting point is omitted. Now, from the position of the sunspot, arrow Ar3
It is assumed that the vehicle travels along a closed curve L2 in the direction shown in FIG.

第10図は本発明の塗りつぶし方式を実行する為の制御
回路を、第11図はその動作を説明する為のフローヂャ
ートを示す。これらに従い、第9図における塗りつぶし
の状態を説明する。
FIG. 10 shows a control circuit for implementing the filling method of the present invention, and FIG. 11 shows a flowchart for explaining its operation. According to these, the filling state in FIG. 9 will be explained.

第10図において、ALLIは演算装置、AB及びDB
はデータバス、013は出力バスである。XはX値がR
EAD、WRITEされるレジスタ、YはY値がREA
D、WRITEされるレジスタ、Prx Iは閉曲線L
2上において、現在位置より一つ前の境界(閉曲線L2
>の左端のX471iがREAD、WRITEされるレ
ジスタ、prx rは現在位置より一つ前の境界の右端
のX値がREAD。
In FIG. 10, ALLI is an arithmetic unit, AB and DB
is a data bus, and 013 is an output bus. X has an X value of R
EAD, register to be WRITE, Y is Y value is REA
D, register to be WRITE, Prx I is closed curve L
2, the boundary one before the current position (closed curve L2
The leftmost X471i of > is the register to be read and written, prx r is the rightmost X value of the boundary immediately before the current position is READ.

WRITEされるレジスタ、CX lは現在位置の境界
の左端のX値がREAD、WRI Tl:されるレジス
タ、Cxr4.tm在位置の境界の右端のX値がRjE
AD、WRI TEされるレジスタ、Pryは現在位置
より一つ前の境界のy値がREAD。
The register to be WRITE, CX l, is the leftmost X value of the boundary of the current position is READ, WRI Tl: the register to be written, Cxr4. The rightmost X value of the boundary of the tm location is RjE
AD, WRI TE register, Pry, y value of the previous boundary from the current position is READ.

WRITEされるレジスタ、Cyは現在位置の境界のy
値がREAD、WRITEされるレジスタ、CNTRは
カウンタである。MEMは閉曲11L2に関するグラフ
ィック情報が記憶されたメモリ、CLOGは第11図に
お(ブる各種の論理演算を実行する為のコントロール・
ロジックである。
The register to be written to, Cy is the boundary y of the current position
The register CNTR in which values are read and written is a counter. MEM is a memory in which graphic information related to closing song 11L2 is stored, and CLOG is a control for executing various logical operations shown in Figure 11.
It's logic.

今、黒点の位置において、左端のxi (Cx l )
をα、右端のX値(CXr)をβ、yl(Gy)をγと
する。尚、第9図より明らかな通り、現在位置よ−リ一
つ前の境界の左端のX値(prx l )並びに右端の
X値(prxr)はβであり、一つ前の境界のyili
(Pry)はγ−1である。
Now, at the position of the sunspot, the leftmost xi (Cx l)
is α, the rightmost X value (CXr) is β, and yl (Gy) is γ. As is clear from Fig. 9, the leftmost X value (prxl) and the rightmost X value (prxr) of the boundary immediately before the current position are β, and yili of the previous boundary
(Pry) is γ-1.

二つの黒点の回りを反時計回りに隣接する画素のアドレ
スをチェックし、閉曲IIL2との交点を検出し、塗り
つぶしを行う行程について第11図のフローチャートに
従い説明を行う。ステップ(1)において、prxr+
1 <=β+1)がめられ、レジスタXに書込まれる。
The process of checking the addresses of pixels adjacent to the two black points in a counterclockwise direction, detecting the intersection with the closed curve IIL2, and filling them out will be described with reference to the flowchart of FIG. 11. In step (1), prxr+
1 <=β+1) and written to register X.

ステップ(2)において、Cy−,1<=r−1>がめ
られ、レジスタYに書込まれる。これらステップによっ
て、走査される画素の開始点が決まる。
In step (2), Cy-,1<=r-1> is determined and written to register Y. These steps determine the starting point of the scanned pixel.

ステップ(3)において、Cxr−prxr(−〇)が
められ、カウンタCNTRに記憶される。ステップ(4
)において、カウンタCN 1’ Rの値がOJX−1
mか判断される。この例では、0であるから、ステップ
(5)に進んで、ここで、×(−β+1>、Y(=γ−
1)が境界にあるか判断される。X、Yは境界にないか
ら、ステップ(6)に移り、カウンタCN T Rの値
から1を引いたものが新たなカウンタ値として記憶され
、ステップ(7)でX+1が新たな値としてレジスタX
に書込まれる。
In step (3), Cxr-prxr(-0) is determined and stored in counter CNTR. Step (4
), the value of counter CN 1' R is OJX-1
m is determined. In this example, it is 0, so proceed to step (5), where ×(-β+1>, Y(=γ-
It is determined whether 1) is on the boundary. Since X and Y are not on the boundary, the process moves to step (6), where the value of counter CNTR minus 1 is stored as a new counter value, and in step (7), X+1 is stored as the new value in register X.
written to.

この後、ステップ(4)に戻るが、本例の場合、カウン
タCNTRの値は−1となって、ループを抜は出て、ス
テップ(8)に移る。尚、ステップ(5)において、X
、Yが境界にある場合には、B以下の塗りつぶし、並び
に初期化のステップに移る。
Thereafter, the process returns to step (4), but in this example, the value of the counter CNTR becomes -1, the loop is exited, and the process moves to step (8). In addition, in step (5),
, Y are on the boundary, the process moves to the steps of filling B and below and initializing.

ステップ(8)でCxr+1(=β+1)がめられ、こ
れがレジスタXに書込まれ、ステップ(9)でCV+1
 (=γ+1)がめられ、これがレジスタYに書込まれ
、また、ステップ(10)テcx r−Cx I +2
 (=3)がめられ、これがカウンタCN T’ Rに
記憶される。これらステップと、これら以降のステップ
(11)〜(14)とは、右端の黒点(β、γ)のも斜
め上の画素(β+1.γ+1)から左方に走査する過程
に相当する。
In step (8), Cxr+1 (=β+1) is determined, this is written to register X, and in step (9), CV+1
(=γ+1) is written to register Y, and in step (10) cx r−Cx I +2
(=3), and this is stored in the counter CNT'R. These steps and subsequent steps (11) to (14) correspond to the process of scanning the black point (β, γ) at the right end to the left from the diagonally upper pixel (β+1.γ+1).

尚、黒点(β、γ)の右隣りの画素が飛ばされて前記右
斜め上の画素に移っているが、前記右隣りの画素は、一
つ前の境界点を検出する走査で、予め境界にないことが
確認されている(後出のB以下の初期化のステップを参
照)為、スキップされている。
Note that the pixel to the right of the black point (β, γ) is skipped and moved to the pixel diagonally above the right, but the pixel to the right was previously detected at the boundary by scanning to detect the previous boundary point. It has been confirmed that this is not present (see the initialization steps below B below), so it is skipped.

ステップ(11)において、カウンタCNTRの値が0
以上か判断される。この例では、3であるから、次のス
テップ(12)に進んで、ここで、×(−β+1> 、
 Y (−γ+1)が境界にあるか判断される。このと
きのX、Yは境界にないから、ステップ(13)に移り
、カウンタCN T Rの値から1を引いたものが新た
なカウンタ値として記憶され、ステップ(14)でX−
1が新たな値としてレジスタXに書込まれる。
In step (11), the value of counter CNTR is 0.
It will be judged if it is more than that. In this example, it is 3, so proceed to the next step (12) and here, ×(−β+1>,
It is determined whether Y (-γ+1) is on the boundary. Since X and Y at this time are not on the boundary, the process moves to step (13), and the value obtained by subtracting 1 from the value of counter CNTR is stored as a new counter value, and in step (14),
1 is written to register X as a new value.

この後、ステップ(11)に戻るが、本例の場合、この
ループを3回まわって、4回目に13以下のステップに
移って行く。
After this, the process returns to step (11), but in this example, this loop is repeated three times, and the process moves to steps 13 and below on the fourth time.

A以下のステツ、プは、右端の黒点の右斜め上の画素(
β+1.γ+1)からノ1端の黒点の左斜め上ノ画素(
α−1,γ+1)までの走査で境界が見付Gノられない
ときのステップを示ず。
The steps below A are the pixels diagonally to the upper right of the black dot at the right end (
β+1. From γ+1) to the diagonally upper left pixel of the black point at the edge of No1 (
The steps taken when the boundary is not found by scanning up to α-1, γ+1) are not shown.

第9図において点線で示した位置に境界があるような場
合、走査は左端の黒点から更に反時計回りに行う必要が
ある。ステップ<15)、(16)は走査の開始点(α
−1,γ−1)を定める為のものである。尚、開始点が
、左端の黒点の左隣りの画素を飛ばし、前記黒点の左斜
め下の画素(α−1,γ−1)からとなっているが、こ
れは、前記左隣りの画素は、一つ前の境界点を検出する
走査の過程で境界にないことがMt Alされている為
である。
If there is a boundary at the position indicated by the dotted line in FIG. 9, scanning must be performed further counterclockwise from the black point at the left end. Steps <15) and (16) are the scanning starting point (α
-1, γ-1). Note that the starting point skips the pixel to the left of the leftmost black dot and starts from the diagonally lower left pixel (α-1, γ-1) of the black dot. This is because the pixel to the left of the black dot is , this is because MtAl was determined not to be on the boundary during the scanning process to detect the previous boundary point.

ステップ(17)で、prXl−QX+が記憶され、ス
テップ(18)で、カウンタCN T Rの値が0以上
か判断される。次のステップ(19)で、X、Yが境界
にあるか判断され、境界にない場合にはステップ(20
)に移り、カウンタCNTRの値から1を引いたものが
新たなカウンタ値として記憶され、ステップ(21)に
おいて、X+1を新たな値として、レジスタXk、書込
まれる。
At step (17), prXl-QX+ is stored, and at step (18) it is determined whether the value of the counter CNTR is 0 or more. In the next step (19), it is determined whether X and Y are on the boundary, and if they are not on the boundary, step (20)
), the value of the counter CNTR minus 1 is stored as a new counter value, and in step (21), X+1 is written to the register Xk as the new value.

この後、ステップ(18)に戻るが、本例のように点線
の画素の位置が境界にある場合には、−回目でこのルー
プを抜は出てB以下のステップに移る。尚、ステップ(
18)でNOとなった場合は、閉曲線L2が不連続であ
ることになる。
Thereafter, the process returns to step (18), but if the position of the dotted pixel is on the boundary as in this example, this loop is exited at the -th time and the process moves to steps B and subsequent steps. Furthermore, the step (
If 18) is NO, it means that the closed curve L2 is discontinuous.

B以下のステップにおいて、ステップ(22)は塗りつ
ぶしのサブルーチンで、現在の境界(黒点の位置)のy
la(Cy)、一つ前の境界のy値(Pry)、今回の
走査によって検出された境界のy(直(Y)が比較され
、 P r y< CV < Yのとき、即ち、現在の境界
点の変化傾向が増加傾向にあるときに、右端の黒点の隣
りの位置(Cx r+ 1 、 Cy、)から右へ反対
側の境界まで塗りつぶしが行われる。
In the steps below B, step (22) is a filling subroutine, and the y of the current boundary (black point position) is
la (Cy), the y value of the previous boundary (Pry), and the y (direct (Y)) of the boundary detected by the current scan are compared, and when Pr y < CV < Y, that is, the current When the change tendency of the boundary points is increasing, filling is performed from the position (Cx r+ 1 , Cy,) next to the rightmost black point to the opposite boundary to the right.

ステップ(23)〜(32)は次の境界点を検出する走
査に先立ち行う初期化ステップである。
Steps (23) to (32) are initialization steps performed prior to scanning to detect the next boundary point.

ステップ(23)、(24)において、新たな境界の右
端のX値がめられる。右端がめられた場合、ステップ(
25)において、現在の境界の右端のX値(CXr)を
一つ前の境界の右端のX値に関するレジスタprXrに
書込み、ステップ(26)において、X−1(ステップ
(23)において、X+1→Xとされている。)をレジ
スタQxrに書込む。
In steps (23) and (24), the rightmost X value of the new boundary is determined. If the right edge is hit, step (
In step 25), the rightmost X value (CXr) of the current boundary is written to the register prXr relating to the rightmost X value of the previous boundary, and in step (26), X-1 (in step (23), X+1→ ) is written to register Qxr.

ステップ(27>、(28>において、新たな境界の左
端のX値がめられる。左端がめられた場合、ステップ(
29)において、現在の境界の左端のX値<CX + 
>を−゛〕前の境界の左端のX値に関するレジスタPr
x lに書込み、ステップ(30)において、X+1(
ステップ(27)において、X−1→×とされている。
In steps (27>, (28>), the X value of the left end of the new boundary is found. If the left end is found, step (
29), the leftmost X value of the current boundary < CX +
> -゛]Register Pr for the leftmost X value of the previous boundary
x l, and in step (30), write X+1(
In step (27), X-1→×.

)をレジスタCxlに書込む。) is written to register Cxl.

ステップ(31)、(32)において、y値の更新が行
われる。即ち、ステップ(31)において、現在の境界
のy値(cy>が一つ前の境界のylIfiに関するレ
ジスタPryに書込まれ、ステップ(32)において、
新たな境界のy値が現在の境界のy値に8Qするレジス
タCyに書込まれる。
In steps (31) and (32), the y value is updated. That is, in step (31), the y value (cy> of the current boundary) is written to the register Pry related to ylIfi of the previous boundary, and in step (32),
The new boundary y value is written to register Cy 8Q to the current boundary y value.

この後、ステップ(1)に戻って、新たな境界点の検出
の為の走査が行われる。
Thereafter, the process returns to step (1) and scanning is performed to detect a new boundary point.

このような動作を繰り返し行うことによって、黒点で示
′g′開始点まで閉曲線L2上を辿って行くことによっ
て、この閉曲線で囲まれる部分が塗りつぶされる。尚、
前記本発明の実施例では、境界点の回りを反時計回りに
走査して、新たな境界点を検出するようにしているが、
これに限らず、時51回りに走査して境界点を検出する
ようにしても良い。
By repeating these operations, the closed curve L2 is traced to the starting point 'g' indicated by the black dot, and the area surrounded by this closed curve is filled in. still,
In the embodiment of the present invention, a new boundary point is detected by scanning counterclockwise around the boundary point.
The present invention is not limited to this, and the boundary point may be detected by scanning around 51 hours.

く効果〉 本発明の塗りつぶし方式によれば、境界点の回りを走査
する為の記憶内容は、前記境界点の直前、現在、直後の
座標データであり、従来方式と比較して少なく、メモリ
スケールをその分、縮小することが出来る。更に、本発
明の方式によれば、境界点に隣接する小数の画素を走査
し、新たな境界点を見付け、直線を引(ものである為、
第1の従来方式で示したような、閉曲線内の全画素につ
いて回帰的定義に従った塗りつぶら処理を繰返し行うも
の、或は、第2の従来方式のように、塗りつぶしは水平
線単位で行うものの、次の塗りつぶしの準備の為に隣接
する水平線を一々走査しな【プれはならないものと比較
し、塗りつぶしに必要な時間を大幅に短縮することが出
来る。加えて、本発明の方式では、新たな境界点が検出
される毎に、境界点の垂直方向の変化傾向がチェックさ
れ、例えば、現在の境界点の変化傾向が増加傾向にある
ときにだけ、水平線の塗りつぶしを行うようにして、同
じ水平線が2r!1塗りつぶされないようにした為、時
間が更に節約出来る。
Effects> According to the filling method of the present invention, the memory contents for scanning around a boundary point are coordinate data immediately before, presently, and immediately after the boundary point, which is smaller than the conventional method, and the memory scale is small. can be reduced accordingly. Furthermore, according to the method of the present invention, a small number of pixels adjacent to a boundary point are scanned, a new boundary point is found, and a straight line is drawn (because
As shown in the first conventional method, the filling process is repeated according to the recursive definition for all pixels within a closed curve, or as in the second conventional method, filling is performed for each horizontal line. , the time required for filling can be greatly reduced compared to a system in which adjacent horizontal lines are not scanned one by one in preparation for the next filling. In addition, in the method of the present invention, the vertical change trend of the border point is checked every time a new border point is detected, e.g., only when the current border point trend is increasing. Fill in the horizontal line, and the same horizontal line is 2r! 1. Since it is not filled in, time can be further saved.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図乃至第6図は、従来の塗り−)ぶし方式の路のブ
ロック線図、第11図は本発明方式の動作を説明する為
の71コーチヤードで゛ある。 し1.L2・・・閉曲線、△l−LJ・・・演算装置、
X。 Y、Prx l、Prxr、Cx l、Cxr、C’/
。 Pry・・・レジスタ、MEM・・・グラフィック情報
を記憶す−るメモリ、CLOG・・・コントロール・ロ
ジック。 帛1図 第3図 0000000000000000000000000 0 0 0 ooooooooooooooooooo。 ooooooooooooooooooo。 諮5囚 ooooooooooooooooooo。 第7図 第8図 隼9図
1 to 6 are block diagrams of a road using the conventional paint-over method, and FIG. 11 is a 71-coach yard diagram for explaining the operation of the method of the present invention. 1. L2...Closed curve, △l-LJ... Arithmetic device,
X. Y, Prx l, Prxr, Cx l, Cxr, C'/
. Pry...Register, MEM...Memory for storing graphic information, CLOG...Control logic. Figure 1 Figure 3 0000000000000000000000000 0 0 0 ooooooooooooooooooooo. ooooooooooooooooooooo. 5th prisoner ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo Figure 7 Figure 8 Hayabusa Figure 9

Claims (1)

【特許請求の範囲】 画像の輪郭線を表わす閉曲線データが書込まれたラスメ
タスキャン型表示装置において、(a)前記閉曲線領域
内の任意の点に塗りつぶし要求が与えられたとき、この
点を水平方向に移動させて前記閉曲線と交わる点をめる
行程と、 (b)これを開始点としてこの点に隣接する画素を時開
回り、或は反時計回りに走査して前記閉曲線との交点を
め、これを新たな境界点として先の場合と同様な走査を
行い更に新たな境界点を検出する動作を、前記閉曲線上
を辿って前記開始点まで繰り返し行う行程と、 (C)!記境界点の検出毎に、この境界点の垂直方向の
変化傾向を検出する行程と、 (d)前記境界点の変化傾向が特定の方向にある場合、
この境界点から水平に前記閉曲線と交わる点まで塗りつ
ぶしを行う行程 とよりなる表示装置における閉曲線内塗りつぶし方式。
[Scope of Claims] In a last metascan type display device in which closed curve data representing the outline of an image is written, (a) when a request to fill in any point within the closed curve area is given, this point is (b) Using this as a starting point, pixels adjacent to this point are scanned clockwise or counterclockwise to find a point of intersection with the closed curve; (C)! (d) when the tendency of change of the boundary point is in a specific direction;
A method for filling inside a closed curve in a display device, which comprises a process of filling in horizontally from this boundary point to a point where it intersects with the closed curve.
JP59099482A 1984-05-17 1984-05-17 Method for painting out inside of loop on display device Granted JPS60243772A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP59099482A JPS60243772A (en) 1984-05-17 1984-05-17 Method for painting out inside of loop on display device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP59099482A JPS60243772A (en) 1984-05-17 1984-05-17 Method for painting out inside of loop on display device

Publications (2)

Publication Number Publication Date
JPS60243772A true JPS60243772A (en) 1985-12-03
JPH0319991B2 JPH0319991B2 (en) 1991-03-18

Family

ID=14248525

Family Applications (1)

Application Number Title Priority Date Filing Date
JP59099482A Granted JPS60243772A (en) 1984-05-17 1984-05-17 Method for painting out inside of loop on display device

Country Status (1)

Country Link
JP (1) JPS60243772A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5390817A (en) * 1977-01-21 1978-08-10 Hitachi Ltd Pattern generating method
JPS57157369A (en) * 1981-03-25 1982-09-28 Fujitsu Ltd Loop tracking processing system
JPS57199036A (en) * 1981-06-03 1982-12-06 Fuji Xerox Co Ltd Picture partial erasing device
JPS5947664A (en) * 1982-09-10 1984-03-17 Alps Electric Co Ltd Picture paint processing system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5390817A (en) * 1977-01-21 1978-08-10 Hitachi Ltd Pattern generating method
JPS57157369A (en) * 1981-03-25 1982-09-28 Fujitsu Ltd Loop tracking processing system
JPS57199036A (en) * 1981-06-03 1982-12-06 Fuji Xerox Co Ltd Picture partial erasing device
JPS5947664A (en) * 1982-09-10 1984-03-17 Alps Electric Co Ltd Picture paint processing system

Also Published As

Publication number Publication date
JPH0319991B2 (en) 1991-03-18

Similar Documents

Publication Publication Date Title
JPS60243772A (en) Method for painting out inside of loop on display device
CN115082592A (en) Curve generation method, system, computer equipment and storage medium
JPH09325750A (en) Picture processor and its method
JPH0668270A (en) Picture processing method and picture processor
JPS63305478A (en) Pattern information restoring device
JP3139805B2 (en) Image processing method and apparatus
JPH05258073A (en) Graphic painting-out device
AU2009222438A1 (en) Anti-aliased polygon rendering
JP2634905B2 (en) How to paint shapes
KR100719480B1 (en) Fast anti-aliasing method
US7667714B2 (en) Patterned polygon rendering apparatus
JP2614111B2 (en) A method for detecting the correlation between a straight line display element and a rectangular window
JP3521606B2 (en) Character reader
JP2773127B2 (en) Image editing method
JP2768370B2 (en) Drawing method
JP4320604B2 (en) Image processing method and image processing apparatus
JP3567728B2 (en) Image processing method and apparatus
JP4845043B2 (en) Drawing information processing apparatus, drawing information processing method, drawing information processing program, and computer-readable recording medium recording the drawing information processing program
JP2787487B2 (en) Circuit for determining the position of a line segment displayed and operated on a computer system
JPH0520466A (en) Method and device for processing picture
JP3603589B2 (en) Image processing method and apparatus
JPH0573693A (en) Outline paint out system
JPH09204536A (en) Graphics plotting method
JPS6282476A (en) Graphic processor
JPH1145083A (en) Image data processing device and system using the same