JPH07122904B2 - Closed area filling method - Google Patents
Closed area filling methodInfo
- Publication number
- JPH07122904B2 JPH07122904B2 JP7423887A JP7423887A JPH07122904B2 JP H07122904 B2 JPH07122904 B2 JP H07122904B2 JP 7423887 A JP7423887 A JP 7423887A JP 7423887 A JP7423887 A JP 7423887A JP H07122904 B2 JPH07122904 B2 JP H07122904B2
- Authority
- JP
- Japan
- Prior art keywords
- drawn
- closed area
- line segment
- filling
- closed
- 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
Links
Landscapes
- Image Generation (AREA)
Description
【発明の詳細な説明】 [発明の技術分野] 本発明は、グラフィックディスプレィを備えた情報処理
システムに於いて、上記グラフィックディスプレィ上に
描かれた任意の閉領域内を塗りつぶすための閉領域塗り
つぶし方法に関する。Description: TECHNICAL FIELD OF THE INVENTION The present invention relates to a closed area filling method for filling an arbitrary closed area drawn on the graphic display in an information processing system including a graphic display. Regarding
[発明の概要] 本発明は、閉領域内に少なくとも1本の補助線分を描
き、これらの補助線分上の一点から塗りつぶし処理を行
ない、これらの補助線分のそれぞれと交差する上記閉領
域内の全ての線分を消去した後、上記閉領域内を塗りつ
ぶすようにすることによって、既に描かれている線分に
左右されずに、閉領域内を完全に塗りつぶせるようにし
たものである。SUMMARY OF THE INVENTION According to the present invention, at least one auxiliary line segment is drawn in a closed region, a filling process is performed from one point on the auxiliary line segment, and the closed region intersects with each of the auxiliary line segments. After deleting all the line segments in the inside, the inside of the closed area is filled so that the inside of the closed area can be completely filled without being affected by the already drawn line segments. .
[従来の技術] グラフィックディスプレィを備えた情報処理システムに
於いては、種々のグラフィック処理が行われる。そのよ
うなグラフィック処理の一つとして、上記グラフィック
ディスプレィ上に描かれた任意の閉領域内を塗りつぶす
ことが行われる。[Prior Art] In an information processing system equipped with a graphic display, various graphic processes are performed. As one of such graphic processing, filling in an arbitrary closed area drawn on the graphic display is performed.
この塗りつぶしは、境界色,描画色,及び塗りつぶし開
始点をそれぞれ指定することによって行われる。例え
ば、『赤』の線分で描かれた四角形の中を『青』で塗り
つぶすには、境界色『赤』,描画色『青』,及び塗りつ
ぶし開始点として上記四角形内の1点とをそれぞれ指定
することによって行われる。This filling is performed by specifying the boundary color, the drawing color, and the filling start point. For example, in order to fill the inside of the rectangle drawn by the line segment of "red" with "blue", the boundary color "red", the drawing color "blue", and one point within the above rectangle as the filling start point are respectively It is done by specifying.
[発明が解決しようとする問題点] しかしながら、このような閉領域塗りつぶし方法では、
上記閉領域内に同色の線分が存在すると、その線分を境
界と見なし、そこで塗りつぶしが終了してしまうという
欠点を有している。[Problems to be Solved by the Invention] However, in such a closed region filling method,
If a line segment of the same color exists in the closed area, the line segment is regarded as a boundary and the filling ends there.
第5図(a)乃至(c)はそれぞれグラフィックディス
プレィの表示画面10を概略的に示している。ここで例え
ば第5図(a)に示すように、既に線分12,14が同一色
で描画されているとする。ここに、上記線分12,14と同
一色で所望の閉領域、例えば同図(b)に示すように四
角形16を描画する。そして、その四角形16をその色で点
SPより塗りつぶしを開始する。するとこの時、上記線分
12,14と上記四角形16とは同一色であるから、境界色判
断により塗りつぶしを実行すると、上記線分12,14が境
界となり、結果として、同図(c)に斜線のハッチング
で示す領域18しか塗りつぶされず、目的とした四角形領
域内の塗りつぶしが不完全に終わってしまう。5 (a) to 5 (c) each schematically show the display screen 10 of the graphic display. Here, for example, as shown in FIG. 5A, it is assumed that the line segments 12 and 14 have already been drawn in the same color. A desired closed region, for example, a quadrangle 16 as shown in FIG. 7B, is drawn in the same color as the line segments 12 and 14 here. Then, the square 16 is dotted with that color
Start filling from SP. Then, at this time, the above line segment
12, 14 and the quadrangle 16 have the same color, so when the filling is performed by the boundary color judgment, the line segments 12, 14 become boundaries, and as a result, the area 18 shown by hatching in FIG. Only the target area is filled, and the target area is completely filled.
このように、一般的に或る閉領域を描き、その中を塗り
つぶす場合には、同一色で既に描かれている線分によっ
ては、塗りつぶしが不完全に終了してしまうことがあ
る。As described above, in general, when a certain closed area is drawn and the inside of the area is filled, the filling may be incompletely completed depending on the line segment already drawn with the same color.
このような欠点を取除くための方法としては、従来は、
上記閉領域を形成する線分上の座標を全て記憶し、ある
いは計算によって求めて、直線で結んで行くことによっ
て塗りつぶしを完全に行うというものがある。しかし、
このような方法では、記憶するためあるいは計算するた
めのメモリが必要であり、また1ドット毎に計算するた
めに処理が遅くなる等の欠点を有している。As a method for removing such a defect, conventionally,
There is a method in which all the coordinates on the line segment forming the closed region are stored or calculated and then filled with a straight line to complete the filling. But,
Such a method requires a memory for storing or calculating, and has a drawback that the processing is delayed because the calculation is performed for each dot.
本発明は上記の点に鑑みて成されたもので、任意の閉領
域を描き、且つその閉領域内を塗りつぶす際に、既に描
かれている線分に左右されずに、上記閉領域内を完全に
塗りつぶすことを可能とする閉領域塗りつぶし方法を提
供することを目的とする。The present invention has been made in view of the above points, and when drawing an arbitrary closed area, and when filling the closed area, the inside of the closed area is not affected by the line segment already drawn. It is an object of the present invention to provide a closed area filling method that enables complete filling.
[問題点を解決するための手段] 第1図は本発明のフローチャートである。同図に於いて
ステップS1は、閉領域を、既に描かれている少なくとも
1本の線分がその領域内に含まれる所に、それらの線分
と同色で描き、且つその閉領域内をその色で塗りつぶす
場合に、上記閉領域内に、その閉領域を形成する複数の
線分上の任意の2点間を結ぶ補助線分を少なくとも1本
描くこと、ステップS2は上記補助線分のそれぞれと交差
する上記閉領域内の全ての線分を消去すること、ステッ
プS3は上記閉領域内を塗りつぶすことである。[Means for Solving Problems] FIG. 1 is a flowchart of the present invention. In the figure, step S1 draws a closed region in the same color as those line segments where at least one line segment already drawn is included in the region, and draws the closed region within the closed region. In the case of filling with a color, draw at least one auxiliary line segment connecting arbitrary two points on a plurality of line segments forming the closed region in the closed region, and step S2 is to perform each of the auxiliary line segments. Erasing all line segments in the closed region that intersect with, and step S3 is filling in the closed region.
[作用] 本発明の作用について説明すると、塗りつぶそうとする
閉領域内に少なくとも1本の補助線分を描き(ステップ
S1)、これらの補助線分それぞれと交差する上記閉領域
内の全ての線分を消去した後(ステップS2)、上記閉領
域内を塗りつぶす(ステップS3)。よって、任意の閉領
域を描き、且つその閉領域内を塗りつぶす際に、既に描
かれている線分に左右されずに、上記閉領域内を完全に
塗りつぶすことができるようになる。[Operation] The operation of the present invention will be described. At least one auxiliary line segment is drawn in the closed area to be filled (step
S1) After deleting all the line segments in the closed area that intersect with each of these auxiliary line segments (step S2), the closed area is filled (step S3). Therefore, when an arbitrary closed area is drawn and the inside of the closed area is filled, the inside of the closed area can be completely filled without being influenced by the line segment already drawn.
[実施例] 以下図面を参照して本発明の一実施例を説明する。説明
を簡単にするために、ここでは1ビット/画素とし、任
意の閉図形を四角形とし、且つその閉図形の中に引く補
助線分の数を1本として、本発明の動作を第2図のフロ
ーチャート及び第3図(a)乃至(e)の表示例を参照
して説明する。[Embodiment] An embodiment of the present invention will be described below with reference to the drawings. In order to simplify the explanation, here, the operation of the present invention is performed with 1 bit / pixel, an arbitrary closed figure being a quadrangle, and one auxiliary line segment drawn in the closed figure. This will be described with reference to the flowchart of FIG. 3 and the display examples of FIGS.
即ち、第3図(a)に示すように、グラフィックディス
プレィの表示画面10には、既に色A(図中実線で示す)
で線分12,14が描画されているものとする。ここで先
ず、第3図(b)に示すように、描画したい四角形16内
に補助線分20(例えば対角線)を色Aで描画する(ステ
ップS21)。次に、四角形を上記色Aとは異なる色B
(図中点線で示す)で描画する(ステップS22)。そし
て、この描画した補助線分(対角線)20上の一点より、
境界色『B』,描画色『B』で塗りつぶし処理を実行す
る(ステップS23)。すると、塗りつぶし処理は、上記
補助線分(対角線)20に沿って実行され、この補助線分
(対角線)20と交差する線分12,14に対しても行われ
る。この塗りつぶし処理は、色Bで描画された四角形16
との交点まで実行される。結果として、上記四角形16内
に描画された補助線分(対角線)20と交差する線分は、
第3図(c)に示すように、全て色Bで描画される(消
去される)。That is, as shown in FIG. 3A, the color A (shown by the solid line in the figure) is already displayed on the display screen 10 of the graphic display.
It is assumed that line segments 12 and 14 are drawn with. First, as shown in FIG. 3B, an auxiliary line segment 20 (for example, a diagonal line) is drawn in the color A in the quadrangle 16 to be drawn (step S21). Next, the square is set to a color B different from the above color A.
Drawing is performed (indicated by a dotted line in the figure) (step S22). And from one point on this drawn auxiliary line segment (diagonal line) 20,
A filling process is executed with the boundary color "B" and the drawing color "B" (step S23). Then, the filling process is executed along the auxiliary line segment (diagonal line) 20 and is also performed on the line segments 12 and 14 that intersect with the auxiliary line segment (diagonal line) 20. This filling process is performed by the rectangle 16 drawn in color B.
It is executed up to the intersection with. As a result, the line segment that intersects the auxiliary line segment (diagonal line) 20 drawn in the rectangle 16 is
As shown in FIG. 3 (c), all are drawn (erased) in color B.
次に、第3図(d)に示すように、上記四角形16を、色
Aで描画する(ステップS24)。そして、この四角形16
内の1点SPより境界色『A』,描画色『A』で塗りつぶ
しを開始する(ステップS25)。これによって、第3図
(e)に示すように、上記四角形16内が完全に塗りつぶ
されることができる。Next, as shown in FIG. 3D, the quadrangle 16 is drawn in the color A (step S24). And this square 16
Filling with the boundary color "A" and the drawing color "A" is started from one of the points SP (step S25). As a result, as shown in FIG. 3 (e), the inside of the quadrangle 16 can be completely filled.
ここまでは、説明を簡単にするために、補助線分として
対角線1本の場合を説明した。しかしながら、補助線分
として対角線1本だけであると、その補助線分と交差し
ない線分が存在する可能性が高い。よって、閉領域の形
に応じて、交差しない線分が存在する確率が低くなるよ
うに、複数の補助線分を引くことが好ましい。例えば、
四角形の場合には、補助線分として対角線2本,対辺の
中点を結ぶ線分2本等を引けば良い。Up to this point, in order to simplify the description, the case where one diagonal line is used as the auxiliary line segment has been described. However, if there is only one diagonal line as an auxiliary line segment, there is a high possibility that a line segment that does not intersect with the auxiliary line segment exists. Therefore, depending on the shape of the closed region, it is preferable to draw a plurality of auxiliary line segments so that the probability of existence of line segments that do not intersect decreases. For example,
In the case of a quadrangle, two diagonal lines and two line segments connecting the midpoints of opposite sides may be drawn as auxiliary line segments.
なお、上記のような方法を実施するための装置として
は、第4図に示すような構成のものを用いれば良い。即
ち、同図に於いて1は閉領域に応じて描画する補助線分
の座標及び本数を判断するための線分判断部,2は線分,
図形等を描画するための描画処理部,3は描画された閉領
域を塗りつぶすための塗りつぶし処理部,4はメモリであ
る。An apparatus for carrying out the above method may have the structure shown in FIG. That is, in the figure, 1 is a line segment determination unit for determining the coordinates and number of auxiliary line segments to be drawn according to the closed region, 2 is a line segment,
A drawing processing unit for drawing a figure and the like, 3 is a filling processing unit for filling the drawn closed region, and 4 is a memory.
また、上記実施例では塗りつぶしを行う場合の応用例に
ついて説明したが、単に閉領域内の線分の消去について
も、本発明は利用できる。Further, in the above-mentioned embodiment, the application example in the case of performing the filling is explained, but the present invention can be applied to the simple erasure of the line segment in the closed area.
このように、任意の閉領域内に意識的に少なくとも1本
の補助線分を引くことにより、これらの補助線分と交差
する線分を消去できるので、この任意閉領域内の塗りつ
ぶしが、既に描かれている図形に左右されずに完全に行
われることができる。In this way, by intentionally drawing at least one auxiliary line segment in an arbitrary closed region, the line segment that intersects these auxiliary line segments can be erased. It can be done completely independent of the graphic being drawn.
[発明の効果] 以上詳述したように本発明によれば、任意の閉領域を描
き、且つその閉領域内を塗りつぶす際に、既に描かれて
いる線分に左右されずに、上記閉領域内を完全に塗りつ
ぶすことを可能とする閉領域塗りつぶし方法を提供する
ことができる。[Effects of the Invention] As described in detail above, according to the present invention, when an arbitrary closed region is drawn and the closed region is filled, the closed region is not affected by the line segment already drawn. It is possible to provide a closed area filling method that allows the inside to be completely filled.
第1図は本発明の閉領域塗りつぶし方法のフローチャー
ト、第2図は本発明の閉領域塗りつぶし方法の一実施例
のフローチャート、第3図(a)乃至(e)はそれぞれ
上記実施例の動作を説明するための表示例を示す図、第
4図は本発明の閉領域塗りつぶし方法を実施するための
構成の一例を示す図、第5図(a)乃至(c)はそれぞ
れ従来の閉領域塗りつぶし方法を説明するための表示例
を示す図である。 10……表示画面、12,14……線分、16……四角形、20…
…補助線分(対角線)、S1〜S3……フローチャート。FIG. 1 is a flow chart of the closed area filling method of the present invention, FIG. 2 is a flow chart of an embodiment of the closed area filling method of the present invention, and FIGS. 3 (a) to 3 (e) show the operation of the above embodiment. FIG. 4 is a diagram showing a display example for explanation, FIG. 4 is a diagram showing an example of a configuration for carrying out the closed region filling method of the present invention, and FIGS. 5 (a) to 5 (c) are conventional closed region filling It is a figure which shows the example of a display for demonstrating a method. 10 …… Display screen, 12,14 …… Line segment, 16 …… Rectangle, 20…
… Auxiliary line segment (diagonal line), S1 to S3 …… Flow chart.
Claims (1)
本の線分がその領域内に含まれる所に、それらの線分と
同色で描き、且つその閉領域内をその色で塗りつぶす場
合に、上記閉領域内に、その閉領域を形成する複数の線
分上の任意の2点を結ぶ補助線分を少なくとも1本描
き、これらの補助線分それぞれと交差する上記閉領域内
の全ての線分を消去した後、上記閉領域内を塗りつぶす
ことを特徴とする閉領域塗りつぶし方法。1. A closed area, at least one of which has already been drawn.
When the line segments of the book are included in the area and drawn in the same color as those line segments, and when the closed area is filled with the color, a plurality of closed areas are formed in the closed area. Draw at least one auxiliary line segment that connects any two points on the line segment, erase all line segments in the closed area that intersect with each of these auxiliary line segments, and then fill in the closed area. Characterized closed area filling method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP7423887A JPH07122904B2 (en) | 1987-03-30 | 1987-03-30 | Closed area filling method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP7423887A JPH07122904B2 (en) | 1987-03-30 | 1987-03-30 | Closed area filling method |
Publications (2)
Publication Number | Publication Date |
---|---|
JPS63241672A JPS63241672A (en) | 1988-10-06 |
JPH07122904B2 true JPH07122904B2 (en) | 1995-12-25 |
Family
ID=13541379
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP7423887A Expired - Lifetime JPH07122904B2 (en) | 1987-03-30 | 1987-03-30 | Closed area filling method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH07122904B2 (en) |
-
1987
- 1987-03-30 JP JP7423887A patent/JPH07122904B2/en not_active Expired - Lifetime
Also Published As
Publication number | Publication date |
---|---|
JPS63241672A (en) | 1988-10-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP2001265314A (en) | Display system, data display method, shadowed character font generating method, and recording medium | |
JP3995114B2 (en) | Switch image display method | |
JPS6253820B2 (en) | ||
US4748442A (en) | Visual displaying | |
JP2639517B2 (en) | Image area color processing method | |
JPH07122904B2 (en) | Closed area filling method | |
US4656468A (en) | Pattern data processing apparatus | |
JPH0767136B2 (en) | Image processing device | |
JP4323101B2 (en) | Polygonal geometry clipping device | |
JPH06223199A (en) | Image composing device | |
JP2634905B2 (en) | How to paint shapes | |
JP2856243B2 (en) | Checkered pattern automatic creation apparatus and method | |
JP3483333B2 (en) | Graphic processing method and apparatus | |
JPH0554151B2 (en) | ||
JPS63228383A (en) | Picture processing system | |
JPH03224071A (en) | Line thinning system for binary image | |
JP3072949B2 (en) | Document editing system | |
JPS6326773A (en) | Display processing method for graphic information | |
JPS61267096A (en) | Smear drawing display unit for polygonal graphic | |
JPS63223984A (en) | Painting-out system for overlapping graphic | |
JPH0816809A (en) | Drawing system | |
JPS62262191A (en) | Drawing system for closed area of display device | |
JPH02260074A (en) | Graphic display device | |
JPH01100857A (en) | Charged particle beam lithography equipment | |
JPS63255780A (en) | Painting-out method for digital linear graphic |