JP2861044B2 - Graphic processing unit - Google Patents

Graphic processing unit

Info

Publication number
JP2861044B2
JP2861044B2 JP1117332A JP11733289A JP2861044B2 JP 2861044 B2 JP2861044 B2 JP 2861044B2 JP 1117332 A JP1117332 A JP 1117332A JP 11733289 A JP11733289 A JP 11733289A JP 2861044 B2 JP2861044 B2 JP 2861044B2
Authority
JP
Japan
Prior art keywords
line segment
data
end point
line
coordinate
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
JP1117332A
Other languages
Japanese (ja)
Other versions
JPH02297681A (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.)
Fujifilm Business Innovation Corp
Original Assignee
Fuji Xerox Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fuji Xerox Co Ltd filed Critical Fuji Xerox Co Ltd
Priority to JP1117332A priority Critical patent/JP2861044B2/en
Publication of JPH02297681A publication Critical patent/JPH02297681A/en
Application granted granted Critical
Publication of JP2861044B2 publication Critical patent/JP2861044B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Image Generation (AREA)
  • Controls And Circuits For Display Device (AREA)

Description

【発明の詳細な説明】 「産業上の利用分野」 本発明は、重なり合う複数の曲線を含んだ任意図形で
囲まれる閉領域の内部を正確に塗り潰すための図形処理
装置に関する。
Description: BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a graphic processing apparatus for accurately filling an inside of a closed area surrounded by an arbitrary graphic including a plurality of overlapping curves.

「従来の技術」 直線あるいは曲線を組み合わせて任意の図形を作成し
たとき、その図形内部を塗り潰すことが必要になる場合
がある。従来は、曲線を含む図形を塗り潰すとき、表示
用メモリ等の記憶手段に輪郭線を描画した後、この内容
を読み取ることによって、塗り潰す範囲を決定してい
た。
2. Description of the Related Art When an arbitrary figure is created by combining straight lines or curves, it may be necessary to fill the inside of the figure. Conventionally, when a figure including a curve is painted, an outline is drawn in a storage means such as a display memory, and then the contents are read to determine a painting area.

第27図はこの従来における塗り潰し方法を説明するた
めのものである。走査線11について述べると、表示用メ
モリを最初の単位区間12から順に単位区間13を単位とし
て読み取る。そして、輪郭線が配置されている単位区間
14および15のデータを記憶することにより、塗り潰す範
囲を決定して、これらの単位区間の塗り潰し処理を行う
ものであった。
FIG. 27 is a view for explaining this conventional painting method. Describing the scanning line 11, the display memory is read in units of the unit section 13 in order from the first unit section 12. And the unit section where the contour line is arranged
By storing the data of 14 and 15, the range to be painted is determined, and the painting process of these unit sections is performed.

この場合、最初に読み取った単位区間14を始点とし、
この次に読み取った単位区間15を終点とし、この間の区
間を塗り潰す。同様に、次の走査線についても、輪郭線
が配置された最初の単位区間を始点とし、以下前記した
処理を繰り返すものである。
In this case, the unit section 14 read first is used as a starting point,
The next read unit section 15 is set as the end point, and the section between them is painted out. Similarly, for the next scanning line, the first unit section in which the contour line is arranged is set as a starting point, and the above-described processing is repeated thereafter.

「発明が解決しようとする課題」 しかし、この方法では、重なり合った複数の曲線を含
む任意図形で囲まれる閉領域の内部を正確に判定して塗
り潰すことが困難である。
[Problem to be Solved by the Invention] However, with this method, it is difficult to accurately determine and fill the inside of a closed region surrounded by an arbitrary figure including a plurality of overlapping curves.

例えば、第28図に示すような、“す”という文字を輪
郭線で表現し、第29図に示すようにこの内部をすべて塗
り潰すものとする。この際、第30図に示すような輪郭線
で表現される1つの閉じた図形を塗り潰すのに、前記し
た従来の方法を用いると、図形の重なり合った部分が生
じる。この結果、第31図に示すような塗り潰しが行わ
れ、塗り残しの部分が幾つか生じてしまう。
For example, as shown in FIG. 28, the character "su" is represented by an outline, and the inside of the character is completely painted out as shown in FIG. At this time, if the above-described conventional method is used to fill one closed figure represented by a contour line as shown in FIG. 30, overlapping parts of the figure occur. As a result, painting is performed as shown in FIG. 31, and some unpainted portions occur.

以上、ひらがなの一例について示したが、同様の問題
は、曲線を含む輪郭線により表現される漢字、ひらがな
等の文字の字体やその他の図形を塗り潰す場合に同様に
発生する。
Although an example of Hiragana has been described above, a similar problem similarly occurs when a font of a character such as a kanji or a Hiragana represented by a contour line including a curve or another figure is filled.

そこで、本発明の目的は、複数の曲線を含む任意図形
が重なっていても、これらの任意図形によって囲まれた
閉領域を正確に塗り潰すことのできる図形処理装置を提
供することにある。
SUMMARY OF THE INVENTION It is an object of the present invention to provide a graphic processing apparatus capable of accurately filling a closed area surrounded by arbitrary figures including a plurality of curves even if the figures overlap.

「課題を解決するための手段」 請求項1記載の発明では、(イ)閉図形を構成する線
分であって所定の座標軸の一方向にのみ変化する線分ご
とに線分の変化する方向と線分を構成する座標点とを含
む線分データを登録する線分データ登録手段と、(ロ)
この線分データ登録手段に登録された2つの線分データ
を座標軸において順次比較し、両線分の方向が同一かつ
一方の線分の端点の値と他方の線分の端点の値が同一の
場合、一方の線分の端点の値を他方の線分の端点の値と
重複しないように変更する端点変更手段と、(ハ)この
端点変更手段により変更された線分データを用い、座標
軸と直交する方向にこの図形を1ラインずつ走査して塗
り潰す塗り潰し手段とを図形処理装置に具備させる。
[Means for Solving the Problems] According to the invention described in claim 1, (a) the direction in which the line segment changes for each line segment that constitutes a closed figure and changes only in one direction of a predetermined coordinate axis Line segment data registration means for registering line segment data including a coordinate point constituting the line segment and (b)
The two line segment data registered in the line segment data registration means are sequentially compared on the coordinate axis, and the direction of both line segments is the same, and the value of the end point of one line segment and the value of the end point of the other line segment are the same. In this case, the end point changing means for changing the value of the end point of one line segment so as not to overlap the value of the end point of the other line segment, and (c) using the line segment data changed by the end point changing means, The graphic processing device is provided with a filling means for scanning and filling the graphic line by line in the direction orthogonal to the drawing direction.

すなわち、請求項1記載の発明では閉図形を構成する
各線分について、それらの線分の変化する方向と線分を
構成する座標点とを含む線分データを線分データ登録手
段に登録した後、これらの線分データを順次比較し、両
線分の方向が同一で一方の線分の端点の値と他方の線分
の端点の値が同一の場合、これらの値が重複しないよう
に変更する。そして、この変更された線分データを用い
て、座標軸と直交する方向に図形を1ラインずつ走査し
て塗り潰すようにしている。
In other words, according to the first aspect of the present invention, for each line segment forming the closed figure, after registering the line segment data including the direction in which the line segment changes and the coordinate points forming the line segment in the line segment data registration means. These line segment data are sequentially compared, and when the direction of both line segments is the same and the end point value of one line segment is the same as the end point value of the other line segment, the values are changed so that these values do not overlap. I do. Then, using the changed line segment data, the figure is scanned line by line in the direction orthogonal to the coordinate axes and filled.

また請求項2記載の発明では、請求項1記載の図形処
理装置でデータ登録手段は複数の閉図形の線分データを
登録するとともに、端点変更手段は各閉図形ごとに端点
の値を変更するものであり、塗り潰し手段は複数の閉図
形の線分データを用いて複数の閉図形の塗り潰しを一括
して行うことを特徴としている。
According to a second aspect of the present invention, in the graphic processing apparatus according to the first aspect, the data registering means registers line segment data of a plurality of closed figures, and the end point changing means changes an end point value for each closed figure. The filling means is characterized in that a plurality of closed figures are collectively filled using line segment data of a plurality of closed figures.

更に請求項3記載の発明では、請求項1または請求項
2記載の図形処理装置で端点変更手段は、線分データの
順次比較において最初に用いた線分と最後に用いた線分
の方向が同一かつ最初の線分の端点の値が最後の線分の
端点の値と同一の場合、一方の線分の端点の値を他方の
線分の値と重複しないように変更することを特徴として
いる。
According to a third aspect of the present invention, in the graphic processing device according to the first or second aspect, the end point changing means determines whether the direction of the first used line segment and the direction of the last used line segment in the sequential comparison of the line segment data are different. If the value of the end point of the same and the first line segment is the same as the value of the end point of the last line segment, the value of the end point of one line segment is changed so as not to overlap with the value of the other line segment. I have.

また、請求項4記載の図形処理装置では、座標軸と直
交する方向に図形の塗り潰し処理を行うためのマスクデ
ータを備え、塗り潰し手段はこのマスクデータを用いて
図形の塗り潰しを行うことを特徴としている。
Further, in the graphic processing device according to the present invention, the graphic processing apparatus is provided with mask data for performing a graphic filling process in a direction orthogonal to the coordinate axes, and the filling means performs the graphic filling using the mask data. .

図1は本発明を別の観点からとらえたものである。こ
の図に示すように、曲線を辿っていったときの方向が所
定の座標軸の一方向にのみ変化しこれと逆方向には変化
しないような範囲でそれぞれ区切られた複数の単位曲線
から構成された図形を、座標点の集合に変換する座標点
変換手段21と、この座標点変換手段21によって変換され
た座標点のうち単位曲線の接合位置で重複した点が存在
する場合にはこれを重複しないように処理する接合位置
座標点処理手段22と、前記した単位曲線のそれぞれにつ
いて前記した座標軸のどの方向に変化している曲線であ
るかを判別する方向判別手段23と、接合位置座標点処理
手段22によって処理された後の座標点の集合に対して方
向判別手段23の判別結果に応じて前記した座標軸と直交
する座標軸方向にこの図形を1ラインずつ走査して塗り
潰す塗り潰し手段24とを図形処理装置に具備させること
も考えられる。また、曲線を辿っていったときの方向が
所定の座標軸の一方向にのみ変化しこれと逆方向には変
化しないような範囲でそれぞれ区切られた複数の単位曲
線から構成された図形を、座標点の集合に変換する座標
点変換手段21と、この座標点変換手段21によって変換さ
れた座標点のうち前記した単位曲線の接合位置で重複し
た点が存在する場合にはこれを所定の座標軸方向に所定
量だけシフトさせる接合位置座標点シフト手段25と、前
記した単位曲線のそれぞれについて座標軸のどの方向に
変化している曲線であるかを判別する方向判別手段23
と、前記した座標軸と直交する方向に図形の塗り潰し処
理を行うためのマスクデータを作成するマスクデータ作
成手段26と、接合位置座標点シフト手段25によって処理
された後の座標点の集合に対して方向判別手段23の判別
結果に応じて前記した座標軸と直交する座標軸方向にこ
の図形を1ラインずつ走査してマスクデータを用いて塗
り潰す塗り潰し手段24とを図形処理装置に具備させるこ
とも考えられる。また、塗り潰そうとする曲線を単位曲
線ごとに座標点の集合に変換し、塗り潰しが残らないよ
うにこれらの単位曲線ごとの座標点相互の重複した点を
シフトさせる等によって調整し、単位曲線が例えばY軸
におけるプラス方向に増加しているか減少しているかに
応じて1ラインずつ走査して塗り潰しを行う。このと
き、マスクデータを用いて塗り潰しを行うことも有効で
ある。
FIG. 1 illustrates the present invention from another viewpoint. As shown in this figure, the unit is composed of a plurality of unit curves separated in a range such that the direction when following the curve changes only in one direction of a predetermined coordinate axis and does not change in the opposite direction. The coordinate point conversion means 21 for converting the figure into a set of coordinate points, and, when there is a duplicate point at the joint position of the unit curve among the coordinate points converted by the coordinate point conversion means 21, this is repeated. Joint position coordinate point processing means 22 for processing so as not to perform processing; direction discriminating means 23 for judging in which direction of the coordinate axis the curve changes for each of the unit curves; and joint position coordinate point processing. The filling means 24 scans this figure one line at a time in a coordinate axis direction orthogonal to the above-mentioned coordinate axes in accordance with the determination result of the direction determining means 23 with respect to the set of coordinate points processed by the means 22. Also conceivable to provided to the graphics processing apparatus. Also, a figure composed of a plurality of unit curves separated in a range such that the direction when following the curve changes only in one direction of a predetermined coordinate axis and does not change in the opposite direction is defined as a coordinate. A coordinate point converting means 21 for converting into a set of points, and, when there is an overlapping point at the joining position of the unit curve among the coordinate points converted by the coordinate point converting means 21, And a direction discriminating means 23 for discriminating in which direction of the coordinate axis each of the unit curves is changing.
A mask data creating unit 26 for creating mask data for performing a process of filling a figure in a direction orthogonal to the coordinate axes described above, and a set of coordinate points processed by the joint position coordinate point shifting unit 25. It is also conceivable that the graphic processing apparatus is provided with a filling means 24 for scanning this figure one line at a time in a coordinate axis direction orthogonal to the above-mentioned coordinate axis in accordance with the determination result of the direction determining means 23 and filling it with mask data. . In addition, the curve to be filled is converted into a set of coordinate points for each unit curve, and the coordinate points of each of these unit curves are adjusted by shifting overlapping points so that no fill remains. Is scanned line by line depending on whether the value is increasing or decreasing in the positive direction on the Y-axis, for example, to perform painting. At this time, it is also effective to paint using the mask data.

「実施例」 以下、実施例につき本発明を詳細に説明する。"Example" Hereinafter, the present invention will be described in detail with reference to examples.

第2図は、本発明の一実施例における図形処理装置の
回路構成の概要を表わしたものである。
FIG. 2 shows an outline of a circuit configuration of a graphic processing apparatus according to an embodiment of the present invention.

この図形処理装置は、次のような各部から構成されて
いる。
This graphic processing device comprises the following units.

(1)データ入力装置31: 塗り潰す図形の座標点を入力するためのキーボード31
−1およびポインティング・デバイスとしてのマウス31
−2によって構成されている。
(1) Data input device 31: keyboard 31 for inputting coordinate points of a figure to be filled
-1 and mouse 31 as a pointing device
-2.

(2)輪郭線データ管理部32: 複数の閉じた図形のデータを管理しておく場所であ
る。データ入力装置31によって塗り潰す図形の座標点が
入力されると、これが輪郭線データ管理部32に格納され
る。
(2) Contour line data management unit 32: A place where data of a plurality of closed figures is managed. When a coordinate point of a figure to be filled is input by the data input device 31, this is stored in the outline data management unit 32.

(3)灰色パターンデータ用マスク・データ作成部33: ここで灰色パターンデータとは、信号“1"と信号“0"
を並べる並べ方によって所望の濃度の灰色を表現するデ
ータである。灰色パターンデータ用マスク・データ作成
部33は、灰色パターンデータを基にしてマスク・データ
を作成する。
(3) Gray pattern data mask data creation unit 33: Here, the gray pattern data is a signal “1” and a signal “0”.
Are data expressing gray of a desired density according to the arrangement method. The gray pattern data mask data creation unit 33 creates mask data based on the gray pattern data.

(4)描画用マスクデータ管理部34: 描画用のマスクデータを保管する部分である。灰色パ
ターンデータ用マスク・データ作成部33で作成したマス
クデータの保管も行う。
(4) Drawing mask data management unit 34: This is a part for storing mask data for drawing. The mask data created by the mask data creating unit 33 for gray pattern data is also stored.

(5)輪郭線データ変換部35: 輪郭線データ管理部32に格納されている図形データを
描画の処理を行い易いように変換する部分である。
(5) Contour data conversion unit 35: This is a unit that converts graphic data stored in the contour data management unit 32 so that drawing processing can be performed easily.

(6)輪郭線データ制御部36: 図形を塗り潰すのに不都合のないように線分と線分の
接合点を操作する部分である。
(6) Contour line data control unit 36: This is a part for operating a joint between line segments so that there is no inconvenience in filling a figure.

(7)描画処理部37: 描画処理部37は、作成されたマスクデータを取り出し
て、塗り潰しの処理を行う部分である。描画処理部37は
次の3つの部分から構成されている。
(7) Drawing processing unit 37: The drawing processing unit 37 is a part that takes out the created mask data and performs a filling process. The drawing processing unit 37 is composed of the following three parts.

走査線データ作成部37−1。 Scanning line data generator 37-1.

描画領域判定部37−2。 Drawing area determination unit 37-2.

描画データ加工部37−3。 Drawing data processing unit 37-3.

(8)描画領域記憶部38: 表示用の記憶領域である。(8) Drawing area storage unit 38: This is a storage area for display.

(9)表示装置39。(9) Display device 39.

塗り潰された図形等の各種表示を行う部分であり、CR
Tディスプレイやレーザプリンタ等の出力装置で構成さ
れる。
This part is used to display various types of filled figures, etc.
It is composed of an output device such as a T display and a laser printer.

なお、輪郭線データ管理部32等のその他の回路部分
は、プログラムや一時的な格納データを記憶するランダ
ム・アクセス・メモリや、データの記憶手段としての磁
気ディスク装置や光磁気ディスク装置のいずれか1つま
たは双方を使用するものである。
Other circuit parts such as the contour line data management unit 32 may be any of a random access memory for storing programs and temporary storage data, and any one of a magnetic disk device and a magneto-optical disk device as data storage means. One or both may be used.

この第2図を用いて、図形処理装置の概要を説明す
る。
The outline of the graphic processing apparatus will be described with reference to FIG.

オペレータは、まずデータ入力装置31を用いて、マウ
スにより図形の座標点の指示を行う。これにより、その
図形を構成する座標点が輪郭線データ管理部32に格納さ
れる。
First, the operator uses the data input device 31 to specify a coordinate point of a graphic with a mouse. As a result, the coordinate points constituting the figure are stored in the outline data management unit 32.

次に、指示された点によって構成される図形によって
囲まれた内側を塗り潰すのに使用するために、予め作成
されている幾つかの灰色パターンデータのうち所望のも
のをマウス31−2によって選択し、塗り潰し用のパター
ンデータを得る。
Next, a desired one of several gray pattern data prepared in advance is selected by the mouse 31-2 to use for filling the inside surrounded by the figure constituted by the designated points. Then, pattern data for filling is obtained.

このパターンデータを灰色パターンデータ用のマスク
データ作成部33で、描画用マスクデータ管理部34に格納
してある第3図に示すような描画用のデータ42〜44を使
用して、描画用のパターンデータを作成する。灰色パタ
ーンデータは本実施例で32×32ビットのデータ構成のも
のとする。
This pattern data is used by a mask data creating unit 33 for gray pattern data by using drawing data 42 to 44 as shown in FIG. Create pattern data. The gray pattern data has a data structure of 32 × 32 bits in this embodiment.

描画用のパターンデータは、輪郭線データ変換部35で
各線分、または曲線の座標点を示す点列データに変換さ
れ、図形を塗り潰すのに不都合のないように輪郭線デー
タ制御部36で線分と線分の接合点が操作される。
The pattern data for drawing is converted by the outline data conversion unit 35 into point sequence data indicating the coordinate points of each line segment or curve, and the outline data control unit 36 controls the line data so that there is no problem in filling the figure. The junction between the segment and the line segment is manipulated.

この後、描画処理部37で処理が行われる。 Thereafter, the processing is performed by the drawing processing unit 37.

描画処理部37では、走査線データ作成部37−1が、輪
郭線データ制御部36で作成されたデータを基に走査線と
の交点を求め、このデータを管理する。
In the drawing processing unit 37, the scanning line data creation unit 37-1 determines the intersection with the scanning line based on the data created by the contour data control unit 36, and manages this data.

描画領域判定部37−2は、この交点と、このとき走査
線と交差した線分の向きを基に、塗り潰す範囲を決定す
る。
The drawing area determination unit 37-2 determines the range to be filled based on the intersection and the direction of the line segment that intersects the scanning line at this time.

塗り潰す範囲が決定されたら、描画データ加工部37−
3は描画用マスクデータ管理部34に格納されているマス
クデータを取り出し、これを描画領域記憶部38へ置く。
When the area to be filled is determined, the drawing data processing unit 37-
3 extracts the mask data stored in the drawing mask data management unit 34 and stores it in the drawing area storage unit 38.

描画処理部37における37−1〜37−3の処理が走査に
対象である範囲まで繰り返されると、塗り潰し処理が完
了する。
When the processes of 37-1 to 37-3 in the drawing processing unit 37 are repeated up to the range targeted for scanning, the painting process is completed.

この処理によって、塗り潰された図形が描画領域記憶
部38に描画され、この内容が表示装置39によって出力さ
れる。
With this processing, the filled figure is drawn in the drawing area storage unit 38, and the contents are output by the display device 39.

ところで、マスクデータ管理部34は第3図に示す描画
領域管理テーブル41を備えており、このテーブルに示す
内容を管理する。この描画領域管理テーブル41に示す内
容について、以下に順を追って説明する。
Incidentally, the mask data management unit 34 has a drawing area management table 41 shown in FIG. 3, and manages the contents shown in this table. The contents shown in the drawing area management table 41 will be sequentially described below.

ここで使用されるマスクデータ管理部34に格納されて
いる黒インクデータ42は第4図および第5図に示すデー
タであり、白インクデータ43は第6図および第7図に示
すデータである。
The black ink data 42 stored in the mask data management unit 34 used here is the data shown in FIGS. 4 and 5, and the white ink data 43 is the data shown in FIGS. 6 and 7. .

これらのデータは始点用、終点用ともに32×32のデー
タ構成で表わす。ここで、第4図、第5図、第6図、第
7図に示される斜線部はビット“1"(オン)を示し、空
白部はビット“0"(オフ)を示す。
These data are represented by a 32 × 32 data structure for both the start point and the end point. Here, the hatched portions shown in FIG. 4, FIG. 5, FIG. 6, and FIG. 7 indicate the bit “1” (ON), and the blank portions indicate the bit “0” (OFF).

これらのデータを使用して、灰色インクデータ44は第
8図に示すように、灰色パターンデータ1ライン分を始
点用32×32ビット、終点用32×32ビットのマスクデータ
を表現し、このマスクデータを16ライン分作成する。
Using these data, the gray ink data 44 expresses one line of the gray pattern data as 32 × 32 bits for the start point and 32 × 32 bits for the end point as shown in FIG. Create 16 lines of data.

第9図はマスクデータの作成方法を示したものであ
る。灰色パターンデータ(同図a)と黒インクデータ42
(同図b)の論理積をとってマスクデータ(同図c)が
作成される。
FIG. 9 shows a method of creating mask data. Gray pattern data (a in the same figure) and black ink data 42
The mask data (FIG. 3C) is created by taking the logical product of (FIG. 3B).

このマスクデータ作成の考え方は、特開昭58−191064
号公報に記載されているものに類似している。ただし、
この公報に記載された技術ではマスクデータを毎回作成
するが、本発明ではデータを一度作成するだけで、描画
時にマスクデータ管理部34からマスクデータを取り出し
て処理する点が異なる。
The concept of creating the mask data is disclosed in
Is similar to that described in Japanese Patent Publication No. However,
Although the technique described in this publication creates mask data every time, the present invention differs only in that the data is created only once and the mask data is taken out from the mask data management unit 34 and processed at the time of drawing.

この第3図で描画領域45は描画記憶部38を指してい
て、描画領域予約テーブル41には、この描画領域45の存
在する場所が示されている。
In FIG. 3, the drawing area 45 points to the drawing storage unit 38, and the drawing area reservation table 41 indicates the location where the drawing area 45 exists.

以下、図形の塗り潰し処理について具体的に説明す
る。
Hereinafter, the figure filling process will be specifically described.

まず、輪郭線データ管理部32に格納されている図形デ
ータを描画の処理を行い易いように変換する。この処理
は輪郭線データ変換部35で行う。
First, the graphic data stored in the outline data management unit 32 is converted so that the drawing process can be easily performed. This processing is performed by the outline data conversion unit 35.

ここで、作成されたデータを線分データと呼ぶことに
する。
Here, the created data is referred to as line segment data.

線分データは、ダブル・ステップ・インクリメンタル
・ジェネレーションまたはブレッセンハムのアルゴリズ
ムを用いて、ドット単位の座標値を示す点列データに変
換したものである。線分データを第10図Cに示す。ここ
で、ドットの数とは座標点の数をいい、傾きを示すフラ
グとはY座標について上向きか下向きかを示すフラグで
ある。
The line segment data is converted into point sequence data indicating coordinate values in dot units using a double-step incremental generation or Bressenham algorithm. The line segment data is shown in FIG. 10C. Here, the number of dots refers to the number of coordinate points, and the flag indicating the inclination is a flag indicating whether the Y coordinate is upward or downward.

この第10図で、同図Aは始点と終点を結んだ線分を示
す。この線分のデータが同図Bに示すドット単位の座標
値に変換される。同図Dは、同図Bに示した線分データ
が表示装置で表示される様子を表わしたものである。
In FIG. 10, FIG. A shows a line segment connecting the start point and the end point. The data of this line segment is converted into coordinate values in dot units shown in FIG. FIG. D shows a state in which the line segment data shown in FIG. B is displayed on a display device.

なお、X軸に平行な線分については、この平行な線分
の前後の線分データにより、この部分を塗り潰すことが
できるので、本実施例ではこれを処理の対象としていな
い。したがって、X軸に平行な線分データは作成しない
ようになっている。
Note that, with respect to a line segment parallel to the X-axis, this portion can be painted out by line segment data before and after the parallel line segment, and therefore, is not subjected to processing in this embodiment. Therefore, line segment data parallel to the X axis is not created.

ところで、線分データ管理テーブルは、線分データの
作成と同時に、この線分データと1対1の関係にあるよ
うに作成される。このため、線分データの数と同数の線
分データ管理テーブルが作成される。これを第11図に示
す。
Incidentally, the line segment data management table is created so as to have a one-to-one relationship with the line segment data simultaneously with the creation of the line segment data. Therefore, the same number of line segment data management tables as the number of line segment data are created. This is shown in FIG.

ここで、Y座標に対する線分の方向について説明す
る。
Here, the direction of the line segment with respect to the Y coordinate will be described.

輪郭線の構成線分について、線分の始点のY座標をYB
I、線分の終点のY座標をYEIとして表わすと、YBI<YEI
のとき、線分の方向を+1とし、YBI>YEIのとき線分の
方向を−1とする。これを線分データ管理テーブル122
−1に示す“wf"に記入する。
YB of the start point of the line segment is YB
If I, the Y coordinate of the end point of the line segment is expressed as YEI, YBI <YEI
In this case, the direction of the line segment is set to +1. When YBI> YEI, the direction of the line segment is set to -1. This is stored in the line segment data management table 122.
Fill in "wf" shown in -1.

この線分データ管理テーブル122−1には、この他の
情報を含んでいる。この線分データ管理テーブル122−
1に示す“sgn"は線分データ121−1の座標値の配列上
を移動する方向を+1、−1のいずれかで示す。
This line segment data management table 122-1 includes other information. This line segment data management table 122−
"Sgn" shown in 1 indicates the direction of moving on the array of coordinate values of the line segment data 121-1 by either +1 or -1.

“pt_adrには第11図に示すように、線分データの始点
のデータアドレスを記入して、“ep_adr"には線分デー
タの終点のデータアドレスを記入する。
As shown in FIG. 11, the data address of the start point of the line segment data is entered in “pt_adr”, and the data address of the end point of the line segment data is entered in “ep_adr”.

“bfr_y"は線分データの始点“pt_adr"のY座標の値
を記入する。
“Bfr_y” is the value of the Y coordinate of the start point “pt_adr” of the line segment data.

そして、輪郭線データ制御部36は描画領域判定部37−
2で描画範囲を決定し易いように、線分データにある制
御を加えるものである。
Then, the contour line data control unit 36 outputs the drawing area determination unit 37-
In step 2, certain control is added to the line segment data so that the drawing range can be easily determined.

この制御について、第12図に示す七角形の凹凸の図形
を例にとって説明する。
This control will be described with reference to a figure of a heptagonal concave and convex shown in FIG. 12 as an example.

ここで、線分データの始点のY座標をYB2、線分デー
タの終点のY座標をYE2として表わすことにする。
Here, the Y coordinate of the start point of the line segment data is represented as YB2, and the Y coordinate of the end point of the line segment data is represented as YE2.

この七角形の線分を示す矢印がすべて上向きに向いて
いるのは、線分データに変換する際に、すべての線分デ
ータが、YB2<YE2となるような線分データに変換したこ
とを示している。
The reason why all the arrows indicating the heptagonal line segments point upward is that all the line segment data was converted to line segment data such that YB2 <YE2 when converting to line segment data. Is shown.

そして、この七角形の凹凸の図形を塗り潰す場合、Y
座標aを走査するとき、線分131の終点、線分132の始
点、線分136上の点の3つが存在し、これらをX座標に
ついて昇順に分類するため、塗り潰し範囲を線分131の
終点、線分132の始点としてしまい、線分136上の点まで
の範囲が塗り残されてしまう。
Then, when this heptagonal uneven figure is painted, Y
When scanning the coordinate a, there are three points, the end point of the line segment 131, the start point of the line segment 132, and the point on the line segment 136. , The start point of the line segment 132, and the range up to the point on the line segment 136 is left unpainted.

これを改善するため、第13図に示すように、線分141
の線分データ管理テーブルの“wf"と次の線分142の線分
データ管理テーブルの“wf"が1であり、かつ線分141の
YE2と次の線分142のYB2が等しい場合、線分141の終点14
3をY−1の座標値144にずらす操作を行う。
In order to improve this, as shown in FIG.
"Wf" of the line segment data management table of the line segment 142 and "wf" of the line segment data management table of the next line segment 142 are 1, and
If YE2 is equal to YB2 of the next line segment 142, end point 14 of line segment 141
An operation of shifting 3 to the coordinate value 144 of Y-1 is performed.

この操作を線分131と線分132に当てはめると、線分13
1の終点YE2をY−1の座標値にずらす操作を行う。
When this operation is applied to line segments 131 and 132, line 13
An operation of shifting the end point YE2 of 1 to the coordinate value of Y-1 is performed.

また、線分135の線分データ管理テーブルの“wfと次
の線分136の線分データ管理テーブルの“wf"が−1であ
り、かつ線分135のYB2と次の線分136のYE2が等しい場
合、線分136の終点YE2をY−1の座標値にずらす操作も
行う。
Also, “wf” of the line segment data management table of the line segment 135 and “wf” of the line segment data management table of the next line segment 136 are −1, and YB2 of the line segment 135 and YE2 of the next line segment 136 Are equal to each other, an operation of shifting the end point YE2 of the line segment 136 to the coordinate value of Y-1 is also performed.

この操作により、第12図に示すaを走査するときに
は、線分132の始点、線分136上の点の2つの点となるの
で、第14図に示すように塗り残しが発生することなく処
理できる。
By this operation, when scanning a shown in FIG. 12, two points, the starting point of the line segment 132 and the point on the line segment 136, are obtained. it can.

この操作を行うことにより、1走査で抽出される点は
すべて偶数となる。
By performing this operation, all the points extracted in one scan become even numbers.

なお、上述したこの処理を輪郭線データ変換部35と輪
郭線データ制御部36の処理は1図形ごとに行われ、図形
の数だけ輪郭線データ変換部35と輪郭線データ制御部36
の処理を行うものである。
The above-described processing is performed by the contour data conversion unit 35 and the contour data control unit 36 for each figure, and the number of the contour data conversion units 35 and the contour data control units 36 is equal to the number of figures.
Is performed.

次に描画処理部37について説明する。 Next, the drawing processing unit 37 will be described.

まず、走査線データ作成部37−1において、線分デー
タ管理テーブルにある“bfr_y"は現在、線分データ上を
走査しているY座標の値が記入されているもので、この
値は線分データのドットのY座標値がY+1の座標値に
なるまで線分データ上を走査するという処理を行うため
に、Y+1の座標値が走査されたときに、線分データ上
の走査を一時停止させるために使用する。このとき、
“bfr_y"の値をY+1とする。
First, in the scanning line data creation unit 37-1, "bfr_y" in the line segment data management table is the one in which the value of the Y coordinate currently scanning the line segment data is written. In order to perform a process of scanning on the line segment data until the Y coordinate value of the dot of the minute data becomes the coordinate value of Y + 1, the scanning on the line segment data is temporarily stopped when the coordinate value of Y + 1 is scanned. Use to make it. At this time,
The value of “bfr_y” is set to Y + 1.

そして、このテーブルにある“pt_adr"に現在線分デ
ータ上を走査している場所を示すアドレスが記入され、
“ep_adr"には線分データの終点を示すアドレスが記入
されている。
Then, an address indicating the location where the current line segment data is scanned is written in “pt_adr” in this table,
In “ep_adr”, an address indicating the end point of the line segment data is written.

このデータを基に、描画領域判定部37−2では、複数
の閉じた図形を塗り潰すための範囲で決定する。
Based on this data, the drawing area determination unit 37-2 determines a range for filling a plurality of closed figures.

この範囲決定の処理をし易いように、走査線データ作
成部37−1には、走査した線分データのドットのY座標
値が同一である範囲を1つの線で示すために始点(“bg
n_pt")と終点(“end_pt")により表現する。
In order to facilitate the process of determining the range, the scanning line data generation unit 37-1 uses the starting point (“bgg”) to indicate the range where the Y coordinate values of the dots of the scanned line segment data are the same as one line.
n_pt ") and the end point (" end_pt ").

描画処理部37は、ワインディング方向(“wind_f")
を示す情報を管理する描画位置管理テーブル161を備え
ている。これを第15図に示す。
The drawing processing unit 37 determines the winding direction (“wind_f”).
Is provided with a drawing position management table 161 that manages information indicating the above. This is shown in FIG.

描画位置管理テーブル161も、線分データ管理テーブ
ルと同様に、線分データと1対1の関係にあるように作
成される。このため、線分データの数と同数個の描画位
置管理テーブル161が作成される。
The drawing position management table 161 is also created so as to have a one-to-one relationship with the line segment data, similarly to the line segment data management table. Therefore, the same number of drawing position management tables 161 as the number of line segment data are created.

次に、描画領域判定部37−2において、この描画位置
管理テーブル161を使用して、各線分データに対応する
描画位置管理テーブ161を始点のX座標値について昇順
を並べる。この後、第16図および第17図に示すように描
画位置管理テーブル161のワインディング方向を示す情
報の値を足していき、零となった時点で、この範囲にマ
スクデータを置く。
Next, the drawing area determination unit 37-2 uses the drawing position management table 161 to arrange the drawing position management table 161 corresponding to each line segment data in ascending order with respect to the X coordinate value of the starting point. Thereafter, as shown in FIGS. 16 and 17, the value of the information indicating the winding direction of the drawing position management table 161 is added, and when the value becomes zero, the mask data is placed in this range.

ここで塗り潰す範囲が決まったら、描画データ加工部
37−3で、この範囲を第3図に示す描画領域45に対応づ
けるマスクデータを描画用マスクデータ管理部34より抽
出する。
If the area to be filled is determined here, the drawing data processing unit
In 37-3, the mask data for associating this range with the drawing area 45 shown in FIG.

このマスクデータが抽出されると、第18図に示すよう
に描画領域記憶部38に書き込む。
When the mask data is extracted, it is written into the drawing area storage unit 38 as shown in FIG.

ここで、第18図に示す各マスクデータ192、193、194
は描画用マスクデータ管理部34より抽出可能であるが、
マスクデータ191は描画用マスクデータ管理部34より抽
出できない。
Here, each mask data 192, 193, 194 shown in FIG.
Can be extracted from the drawing mask data management unit 34,
The mask data 191 cannot be extracted from the drawing mask data management unit 34.

このため、第19図に示すように、描画用マスクデータ
管理部34に格納されている黒、白、灰色のインクデータ
いずれかの始点データ201と終点データ202を使用して、
これらのデータの論理積(白は論理和)をとることによ
り、マスクデータ191に対応するデータ203を作成する。
For this reason, as shown in FIG. 19, using the start point data 201 and the end point data 202 of any of the black, white, and gray ink data stored in the drawing mask data management unit 34,
The data 203 corresponding to the mask data 191 is created by calculating the logical product of these data (white is the logical sum).

この処理は、描画データ加工部37−3において行うも
のである。
This processing is performed in the drawing data processing unit 37-3.

このようにして、走査している図形の内部にマスクデ
ータを置いていく。この処理を描画範囲内において、上
記した処理を繰り返すことにより、塗り潰し処理を完了
するものである。
In this way, the mask data is placed inside the figure being scanned. This processing is completed within the drawing range by repeating the above processing.

そして、描画領域記憶部38に書き込まれた内容は、表
示装置によって出力される。
Then, the content written in the drawing area storage unit 38 is output by the display device.

ここで、“す”の字にある曲線部分をどのように処理
するのかについて、第20図に示す。
Here, FIG. 20 shows how to process the curved portion in the shape of the letter “SU”.

第20図aに示す“す”の字の曲線部分を楕円で表現す
るものとし、この楕円は時計回り、または反時計回りの
方向と始点、終点を持つ。
It is assumed that the curved portion of the letter "SU" shown in FIG. 20a is represented by an ellipse, and the ellipse has a clockwise or counterclockwise direction and a start point and an end point.

この楕円で表現した部分を第20図bに示すように、楕
円の極大、極小値の点により分割する処理を行う。
As shown in FIG. 20b, a process of dividing the portion represented by the ellipse by the points of the maximum and minimum values of the ellipse is performed.

この分割した部分を線分221〜228で示す。これらの線
分221〜228はある半径を持つ半円で構成されるものであ
る。
The divided portions are indicated by line segments 221 to 228. These line segments 221 to 228 are constituted by semicircles having a certain radius.

ここで、例を挙げて示すと線分221と他の線分222は同
一の半径を持つ半円を極小値で分割したものである。
Here, as an example, the line segment 221 and the other line segment 222 are obtained by dividing a semicircle having the same radius by a minimum value.

このように分割した半円をダブル・ステップ・インク
リメンタル・ジェネレーション(または、ブレッセンハ
ム)のアルゴリズムを用いて、線分データに変換するも
のである。
The semicircle thus divided is converted into line segment data using the algorithm of the double step incremental generation (or Bressenham).

このように処理することにより、線分データはY軸方
向に座標が増加するだけとなるので、この分割された各
々の半円を直線の線分と同様に扱うことができる。
By performing such processing, the line segment data only increases in the coordinate in the Y-axis direction, and thus each of the divided semicircles can be treated in the same manner as a straight line segment.

この結果、本発明において第29図に示すように塗り潰
すことが可能となる。
As a result, in the present invention, it is possible to paint as shown in FIG.

(処理手順) 第21図〜第26図は、第3図に示した図形処理装置で処
理する塗り潰し手順を示したものである。
(Processing Procedure) FIGS. 21 to 26 show a filling procedure performed by the graphic processing apparatus shown in FIG.

最初に輪郭線データ管理部32に図形データが入力して
あるとする。この輪郭線データ管理部32の処理を第21図
に示す。
First, it is assumed that graphic data has been input to the outline data management unit 32. FIG. 21 shows the processing of the contour line data management unit 32.

ここでは、図形データを線分データに変換するため
に、まず図形データが輪郭線データ管理部32に存在する
ことを確認する(ステップ;N)。
Here, in order to convert the graphic data into the line segment data, first, it is confirmed that the graphic data exists in the contour line data management unit 32 (Step; N).

次に、複数の図形データから1つの図形データを取り
出す(ステップ)。そして、図形を構成する線分があ
ることを確認して(ステップ;N)、この線分を1つ取
り出す(ステップ)。
Next, one graphic data is extracted from the plurality of graphic data (step). Then, it is confirmed that there is a line segment constituting the figure (step; N), and one of the line segments is taken out (step).

この線分がX軸に平行でないことを確認し(ステップ
;Y)、これを第10図に示す線分データに変換する(ス
テップ)。
Check that this line segment is not parallel to the X axis (step
; Y), which is converted into line segment data shown in FIG. 10 (step).

この変換は、ダブル・ステップ・インクリメンタル・
ジェネレーションというアルゴリズムを用いて点列のデ
ータに変換する。
This conversion is a double-step incremental
The data is converted into point sequence data using an algorithm called generation.

図形を構成する要素に円が含まれているときは、第20
図bに示すように極大点、または極小点があればその点
で円のデータを分割する。
If a circle is included in the elements that make up the figure,
If there is a maximum point or a minimum point as shown in FIG. B, the circle data is divided at that point.

このとき、線分がX軸に平行であるなら(ステップ
;N)、この線分を線分データに変換しない。これは、
この線分がなくても、この前後の線分データにより、こ
の部分の塗り潰しが可能であることによる。
At this time, if the line segment is parallel to the X axis (step
; N), this line segment is not converted to line segment data. this is,
This is because even if there is no line segment, it is possible to fill this portion with the line data before and after this line segment.

この後、ステップに戻り、図形を構成する線分がす
べて終了すると(ステップ;Y)、この閉じた図形の線
分データの接合部分の制御を行い(ステップ)、ステ
ップに戻る。
Thereafter, the process returns to the step, and when all the line segments constituting the figure are completed (step; Y), the joint of the line data of the closed figure is controlled (step), and the process returns to the step.

ここで、図形の数だけデータ変換の処理が終了すると
(ステップ;Y)、次にY軸方向の描画範囲を求める。
Here, when the data conversion process is completed for the number of figures (step; Y), a drawing range in the Y-axis direction is obtained.

まず、最初にすべての線分データについて処理したか
を確認し(ステップ;N)、図形の塗り潰し範囲を求め
(ステップ)、そして塗り潰し処理が行い易いよう
に、各線分データごとに第14図に示す線分データを管理
するテーブルを作成する(ステップ)。
First, it is checked whether all line segment data has been processed (step; N), the fill area of the figure is obtained (step), and each line data is shown in FIG. 14 so that the fill processing can be easily performed. A table for managing the indicated line segment data is created (step).

この後、ステップに戻り、すべての線分データにつ
いて上記処理が終了する(ステップ;Y)まで繰り返
す。
Thereafter, the process returns to the step, and repeats until the above processing is completed for all the line segment data (step; Y).

ここで、輪郭線データ制御部36について第22図を用い
て説明する。
Here, the outline data control unit 36 will be described with reference to FIG.

まず、すべての線分データについて処理したかを確認
し(第22図ステップ;N)、塗り残し部分が発生しない
ように第13図で示す処理を線分データについて行う。
First, it is confirmed whether or not all the line segment data has been processed (Step N in FIG. 22), and the process shown in FIG. 13 is performed on the line segment data so that the unpainted portion does not occur.

最初に取り出された線分データを線分データ1、次に
取り出された線分データを線分データ2とする。
The first extracted line segment data is referred to as line segment data 1, and the next extracted line segment data is referred to as line segment data 2.

このとき、ワインディング・フラグ(“wf")が1で
かつ線分データ1のYE2と線分データ2のYB2が等しいと
き(ステップ)、線分データ1の接合点YE2をY−1
の座標にずらす(ステップ)。
At this time, when the winding flag ("wf") is 1 and YE2 of the line segment data 1 is equal to YB2 of the line segment data 2 (step), the joining point YE2 of the line segment data 1 is set to Y-1.
(Step).

それ以外のとき(ステップ;N)、ワインディング・
フラグが−1でかつ、線分データ1のYB2と線分データ
2のYE2が等しいとき(ステップ;Y)、線分データ2
の終点YE2と線分データ2の終点YE2をY−1の座標にず
らす(ステップ)。
Otherwise (step; N), winding
When the flag is -1 and YB2 of the line segment data 1 is equal to YE2 of the line segment data 2 (step; Y), the line segment data 2
The end point YE2 of the line segment data 2 and the end point YE2 of the line segment data 2 are shifted to the coordinates of Y-1 (step).

そして、線分データ2を線分データ1とし、次の線分
データを線分データ2とし、ステップに戻る。
Then, the line segment data 2 is set as the line segment data 1, the next line segment data is set as the line segment data 2, and the process returns to the step.

この処理をすべての線分データについて行った後(ス
テップ;Y)、図形の開始点と終点の制御を行う。
After performing this process for all the line segment data (step; Y), the start and end points of the figure are controlled.

これは、閉じた図形であるため、この図形の開始点と
終点は同一の座標値である。
Since this is a closed graphic, the start point and the end point of this graphic have the same coordinate value.

この開始点を含む線分データを線分データ1とし、終
点を含む線分データを線分データ2とすると、ワインデ
ィング・フラグが1でかつ、線分データ1の始点の座標
(x,y)と線分データ2の終点の座標(x,y)が等しいと
き(ステップ;Y)、線分データ2の終点のY座標をY
−1の座標にずらす(ステップ)。
Assuming that the line segment data including the start point is line segment data 1 and the line segment data including the end point is line segment data 2, the winding flag is 1 and the coordinates (x, y) of the start point of the line segment data 1 When the coordinates (x, y) of the end point of the line segment data 2 are equal to each other (step; Y), the Y coordinate of the end point of the line segment data 2 is represented by Y
Shift to coordinates of -1 (step).

それ以外のとき(ステップ;N)、ワインディング・
フラグが−1でかつ、線分データ1の終点の座標(x,
y)と線分データ2の始点の座標(x,y)が等しいとき
(ステップ;Y)、線分データ2の接合点YE2をY−1
の座標にずらす(ステップ)。
Otherwise (step; N), winding
If the flag is −1 and the coordinates (x,
y) and the coordinates (x, y) of the start point of the line segment data 2 are equal (step; Y), the joining point YE2 of the line segment data 2 is set to Y-1.
(Step).

次に、第23図に示すように塗り潰し処理を行う。 Next, a filling process is performed as shown in FIG.

この塗り潰し処理は、第22図ステップによって求め
られた範囲でY座標の小さい値から走査を始める。
In this filling process, scanning is started from a small value of the Y coordinate in the range obtained by the step in FIG.

このため、ここで塗り潰し範囲の最大のY座標となっ
たかを確認(第23図ステップ;N)してから、走査線デ
ータ作成部37−1の処理を行い(ステップ)、次に描
画領域判定部37−2の処理を行う(ステップ)。この
走査線データ作成部37−1と描画領域判定部37−2の処
理を塗り積し範囲の最大のY座標となるまで(ステップ
;Y)繰り返すことにより、図形の塗り潰し処理を行う
ものである。
For this reason, it is checked here whether or not the maximum Y coordinate of the filling range has been reached (Step N in FIG. 23), and then the processing of the scanning line data creation unit 37-1 is performed (Step), and then the drawing area determination is performed. The processing of the unit 37-2 is performed (step). The processes of the scanning line data creation unit 37-1 and the drawing area determination unit 37-2 are painted until the maximum Y coordinate of the range is reached (step
; Y) The figure is filled by repeating the processing.

この走査線データ作成部37−1の処理について第24図
に示す。
FIG. 24 shows the processing of the scanning line data creation unit 37-1.

ここでは、図形を構成する線分データをすべて処理し
ていないことを確認し(第24図ステップ;N)、1線分
データを取り出す(ステップ)。
Here, it is confirmed that all the line segment data constituting the figure have not been processed (Step N in FIG. 24), and one line segment data is extracted (Step).

次に、線分データ管理テーブル(152−1)に格納さ
れているこの線分データのカレント座標を示す値を取り
出す(ステップ)。この値が走査線上にあり(ステッ
プ;Y)、今回の走査で最初に取り出されたのなら(ス
テップ;Y)、第15図に示す描画位置管理テーブル161
に始点として記入する(ステップ)。
Next, a value indicating the current coordinates of the line segment data stored in the line segment data management table (152-1) is extracted (step). If this value is on the scanning line (step; Y) and is extracted first in this scan (step; Y), the drawing position management table 161 shown in FIG.
As a starting point (step).

そして、この座標が線分データの終点であるとき(ス
テップ;Y)、このテーブルの終点に始点のデータを記
入し(ステップ)、この線分データの走査を終了す
る。
When this coordinate is the end point of the line segment data (step; Y), the data of the start point is entered at the end point of this table (step), and the scanning of the line segment data ends.

このとき、この座標が線分データの終点でないとき
(ステップ;N)、この線分データの次のドットの座標
値を取り出す(ステップ)。この値が走査線上にあり
(ステップ;Y)、今回の走査で最初に取り出されたも
のでないのなら(ステップ;N)、この線分データの次
のドットの座標値を取り出す(ステップ)。
At this time, if this coordinate is not the end point of the line segment data (step; N), the coordinate value of the next dot of this line segment data is extracted (step). If this value is on the scanning line (step; Y) and is not the first extracted in the current scan (step; N), the coordinate value of the next dot of this line segment data is extracted (step).

そして、走査している線分データのドットの座標値の
Y座標値が走査しているY座標よりも大きければ(ステ
ップ;N)、1つ前の座標値を第15図に示す161のテー
ブルに終点として記入して(ステップ)、この線分デ
ータの走査を終了する。
If the Y coordinate value of the coordinate value of the dot of the line segment data being scanned is larger than the Y coordinate being scanned (step; N), the immediately preceding coordinate value is stored in the 161 table shown in FIG. Is entered as the end point (step), and the scanning of the line segment data is completed.

そして、ステップに戻り、すべての線分データの処
理が終了したら(ステップ;Y)、走査線データ作成部
37−1の処理を終了する。
Then, returning to the step, when the processing of all the line segment data is completed (step; Y), the scanning line data creation unit
The process of 37-1 is ended.

以上の処理で走査線上に置かれるデータが作成できた
ことになる。
With the above processing, data to be placed on the scanning line has been created.

そして、描画領域判定部37−2に移る。この処理を第
25図に示す。
Then, the process proceeds to the drawing area determination unit 37-2. This process is
See Figure 25.

ここでは、走査線データ作成部37−1で作成されたデ
ータを始点のX座標値について昇順に並べる(第25図ス
テップ)。この分類にはクイックソート・アルゴリズ
ムを使用する。
Here, the data created by the scanning line data creation unit 37-1 are arranged in ascending order with respect to the X coordinate value of the starting point (FIG. 25 step). The quick sort algorithm is used for this classification.

次に、走査線上に置くデータが処理されていないこと
を確認し(ステップ;N)、このデータを昇順に1つ取
り出し(ステップ)、ワインディング・フラグをカウ
ンターにセットし、findフラグを零にセットする(ステ
ップ)。
Next, it is confirmed that the data to be placed on the scanning line is not processed (Step; N), one of the data is taken out in ascending order (Step), the winding flag is set to the counter, and the find flag is set to zero. (Step).

この後、findフラグが零であることを確認し(ステッ
プ;Y)、昇順に並べられたデータを順に1つ取り出し
(ステップ)、このデータのワインディング・フラグ
をカウンターに加える(ステップ)。
Thereafter, it is confirmed that the find flag is zero (step; Y), one piece of data arranged in ascending order is taken out in order (step), and the winding flag of this data is added to the counter (step).

このとき、もし、このカウンターが零でないのなら
(ステップ;N)、ステップの処理に戻り、カウンタ
ーが零であるなら(ステップ;Y)、描画データ加工部
37−3において、描画領域記憶部38に描画データを置く
(ステップ)。
At this time, if this counter is not zero (step; N), the process returns to the step, and if the counter is zero (step; Y), the drawing data processing unit
In step 37-3, the drawing data is stored in the drawing area storage unit 38 (step).

そして、findフラグを1にセットする(ステップ
)。この後、ステップの処理に戻る。
Then, the find flag is set to 1 (step). Thereafter, the process returns to the step.

このときfindフラグが1であるため(ステップ;
N)、ステップの処理に戻り、データがなくなるまで
(ステップ;Y)、処理を繰り返す。
At this time, since the find flag is 1 (step;
N), the process returns to the step, and the process is repeated until there is no more data (step; Y).

この処理中に含まれている描画データ加工部37−3の
処理について説明する。
The processing of the drawing data processing unit 37-3 included in this processing will be described.

この描画データ加工部37−3では、実際に描画領域記
憶部38に描画データを置く処理を行う。この処理手順を
第26図に示す。
The drawing data processing unit 37-3 performs a process of actually putting the drawing data in the drawing area storage unit 38. This processing procedure is shown in FIG.

ドット単位の座標値をワード単位の値に変換する(第
26図ステップ)。
Converts coordinate values in dot units to values in word units (No.
26 steps).

このとき描画される範囲が1ワード以内であるとき
(ステップ;Y)、始点用、終点用のマスク・データを
使用して、描画範囲が1ワードとなるデータを作成し、
このデータを描画領域に置く(ステップ)。
At this time, if the range to be drawn is within one word (step; Y), data for a drawing range of one word is created using the mask data for the start point and the end point,
This data is placed in the drawing area (step).

また、描画される範囲が1ワード以上であるとき(ス
テップ;N)、始点用のマスクデータを抽出し、このデ
ータを描画領域に置く(ステップ)。
Further, when the range to be drawn is one word or more (step; N), mask data for the starting point is extracted and this data is placed in the drawing area (step).

そして、終点のワード数になるまで(ステップ;
N)、第4図に示すマスクデータの配列0番目のデータ
を描画領域に置いていき(ステップ)、終点のワード
数になると(ステップ;Y)、このとき、終点用のマス
クデータを抽出し、このデータを描画領域に置く(ステ
ップ)。
Then, until the number of words at the end point is reached (step;
N), the 0th data of the mask data array shown in FIG. 4 is placed in the drawing area (step), and when the number of words at the end point is reached (step; Y), mask data for the end point is extracted at this time. This data is placed in the drawing area (step).

「発明の効果」 以上説明したように請求項1記載の発明によれば、閉
図形を構成する各線分について、それらの線分の変化す
る方向と線分を構成する座標点とを含む線分データを線
分データ登録手段に登録した後、これらの線分データを
順次比較し、両線分の方向が同一で一方の線分の端点の
値と他方の線分の端点の値が同一の場合、これらの値が
重複しないように一方の端点の値を変更し、この変更さ
れた線分データを用いて、座標軸と直交する方向に図形
を1ラインずつ走査して塗り潰すようにした。このた
め、複雑な形状の図形であっても塗り潰しを効率よく行
うことができるという効果がある。
[Effects of the Invention] As described above, according to the first aspect of the present invention, for each line segment constituting a closed figure, a line segment including a direction in which the line segment changes and a coordinate point constituting the line segment. After the data is registered in the line segment data registration means, these line segment data are sequentially compared, and the direction of both line segments is the same, and the value of the end point of one line segment and the value of the end point of the other line segment are the same. In such a case, the value of one end point is changed so that these values do not overlap, and the figure is scanned line by line in the direction orthogonal to the coordinate axes using the changed line segment data to fill it. Therefore, there is an effect that even a figure having a complicated shape can be efficiently filled.

また、請求項2記載の発明によれば、請求項1記載の
発明と同様の効果を得ることができる他、複数の閉図形
について一括して塗り潰しの処理を行うので、閉図形が
重複した複雑な図形の塗り潰しの処理を容易に行うこと
ができるという利点がある。
According to the second aspect of the present invention, the same effects as those of the first aspect of the invention can be obtained. In addition, since a plurality of closed figures are collectively filled, a complicated figure in which closed figures overlap can be obtained. There is an advantage that it is possible to easily perform the processing of filling a complicated figure.

更に請求項3記載の発明では、請求項1あるいは請求
項2記載の発明と同様の効果を得ることができる他、最
初の線分と最後の線分の端点の値を処理するようにした
ので、閉図形の任意の部分の線分を最初の線分とするこ
とが可能になり、処理が容易になるという効果がある。
Further, according to the third aspect of the present invention, the same effects as those of the first or second aspect can be obtained, and the values of the end points of the first line segment and the last line segment are processed. In addition, it is possible to set a line segment of an arbitrary portion of the closed figure as the first line segment, and there is an effect that processing becomes easy.

また請求項4記載の発明では、請求項1記載の発明と
同様の効果を得ることができる他、マスクデータを備
え、このマスクデータを用いて図形の塗り潰しを行うよ
うにしたので、図形の塗り潰しの処理を任意のパターン
を用いて行うことができるという利点がある。
According to the fourth aspect of the invention, the same effect as the first aspect of the invention can be obtained. In addition, since mask data is provided and the figure is filled using the mask data, the figure is filled. Can be performed using an arbitrary pattern.

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

第1図は本発明を別の観点で示した説明図、第2図〜第
26図は本発明の一実施例を説明するためのもので、この
うち第2図は図形処理装置の回路構成の概要を表わした
ブロック図、第3図は描画領域管理テーブルの内容を示
した説明図、第4図は開始点用の黒インクデータを示す
説明図、第5図は終止点用の黒インクデータを示す説明
図、第6図は開始点用の白インクデータを示す説明図、
第7図は終止点用の白インクデータを示す説明図、第8
図は灰色パターンデータの構成を示す説明図、第9図は
マスクデータの作成方法を示した説明図、第10図は線分
データを説明するためのもので、このうち同図Aは直線
のデータの平面図、同図Bはドット単位の座標値データ
の説明図、同図Cは線分データの説明図、同図Dは座標
値データの表示される様子を示す平面図、第11図は線分
データ管理テーブルの説明図、第12図は七角形の凹凸の
図形の制御を説明するための説明図、第13図は塗り残し
を防ぐための処理を示した説明図、第14図は座標値をず
らした後の七角形の凹凸の図形の塗り潰しの制御を説明
するための説明図、第15図は描画位置管理テーブルを示
した説明図、第16図および第17図は描画位置管理テーブ
ルのワインディング方向を示す情報の値の処理の様子を
示す説明図、第18図は描画領域記憶部への書き込みを示
す説明図、第19図はマスクデータに対応するデータの作
成方法を示す説明図、第20図は“す”の字にある曲線部
分の処理を示した説明図、第21図は輪郭線データ変換部
の動作を示した流れ図、第22図は輪郭線データ制御部の
動作を示した流れ図、第23図は描画処理部の動作を示し
た流れ図、第24図は走査線データ作成部の動作を示した
流れ図、第25図は描画領域判定部の動作を示した流れ
図、第26図は描画データ加工部の動作を示した流れ図、
第27図は従来における塗り潰し方法を示した説明図、第
28図は“す”という文字を輪郭線で表わした説明図、第
29図は“す”という文字の理想的な塗り潰しの状態を示
す説明図、第30図は1つの曲線の内部の塗り潰しを説明
するための説明図、第31図は塗り残しの生じる様子を示
した説明図である。 21……座標点変換手段、 22……接合位置座標点処理手段、 23……方向判別手段、24……塗り潰し手段、 25……接合位置座標点シフト手段、 26……マスクデータ作成手段、 32……輪郭線データ管理部、 33……灰色パターンデータ用マスク・データ作成部、 34……描画用マスクデータ管理部、 35……輪郭線データ変換部、 36……輪郭線データ制御部、 37……描画処理部、 37−1……走査線データ作成部、 37−2……描画領域判定部、 37−3……描画データ加工部、 41……描画領域管理テーブル、 45……描画領域、121……線分データ、 122……線分データ管理テーブル、 131〜136、141、142、221〜228……線分、 191〜194……マスクデータ、 201……始点データ、202……終点データ、 203……データ。
FIG. 1 is an explanatory view showing the present invention from another viewpoint, and FIGS.
FIG. 26 is for explaining one embodiment of the present invention, of which FIG. 2 is a block diagram showing an outline of the circuit configuration of the graphic processing apparatus, and FIG. 3 shows the contents of a drawing area management table. FIG. 4 is an explanatory diagram showing black ink data for a start point, FIG. 5 is an explanatory diagram showing black ink data for an end point, and FIG. 6 is an explanatory diagram showing white ink data for a start point. ,
FIG. 7 is an explanatory view showing end point white ink data, FIG.
FIG. 9 is an explanatory diagram showing the configuration of gray pattern data, FIG. 9 is an explanatory diagram showing a method of creating mask data, and FIG. 10 is for explaining line segment data, of which FIG. FIG. B is an explanatory view of coordinate value data in dot units, FIG. C is an explanatory view of line segment data, and FIG. D is a plan view showing how coordinate value data is displayed; FIG. Is an explanatory diagram of a line segment data management table, FIG. 12 is an explanatory diagram for explaining control of a figure of a heptagonal irregularity, FIG. 13 is an explanatory diagram showing a process for preventing unpainting, FIG. Is an explanatory diagram for explaining control of filling of a heptagonal uneven figure after shifting the coordinate values, FIG. 15 is an explanatory diagram showing a drawing position management table, and FIGS. 16 and 17 are drawing positions. FIG. 18 is an explanatory diagram showing a state of processing of a value of information indicating a winding direction of a management table. FIG. 19 is an explanatory diagram showing writing to an area storage unit, FIG. 19 is an explanatory diagram showing a method of creating data corresponding to mask data, FIG. 20 is an explanatory diagram showing processing of a curve portion in the “SU” shape, FIG. 21 is a flow chart showing the operation of the contour data conversion unit, FIG. 22 is a flow chart showing the operation of the contour data control unit, FIG. 23 is a flow chart showing the operation of the drawing processing unit, and FIG. 25 is a flowchart showing the operation of the scanning line data creating unit, FIG. 25 is a flowchart showing the operation of the drawing area determination unit, FIG. 26 is a flowchart showing the operation of the drawing data processing unit,
FIG. 27 is an explanatory view showing a conventional filling method, and FIG.
Fig. 28 is an explanatory diagram in which the character "su" is represented by a contour line.
FIG. 29 is an explanatory diagram showing an ideal fill state of the character "su", FIG. 30 is an explanatory diagram for explaining the fill inside one curve, and FIG. 31 is a diagram showing a state where unfilled portions occur. FIG. 21 coordinate point converting means 22 joint position coordinate point processing means 23 direction discriminating means 24 filling means 25 joint position coordinate point shifting means 26 mask data creating means 32 …… Contour line data management unit, 33 …… Mask data creation unit for gray pattern data, 34 …… Drawing mask data management unit, 35 …… Contour line data conversion unit, 36 …… Contour line data control unit, 37 ... Drawing processing unit 37-1 Scanning line data creation unit 37-2 Drawing area determination unit 37-3 Drawing data processing unit 41 Drawing area management table 45 Drawing area , 121 ... line segment data, 122 ... line segment data management table, 131 to 136, 141, 142, 221-228 ... line segment, 191 to 194 ... mask data, 201 ... start point data, 202 ... End point data, 203 …… Data.

Claims (4)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】閉図形を構成する線分であって所定の座標
軸の一方向にのみ変化する線分ごとに線分の変化する方
向と線分を構成する座標点とを含む線分データを登録す
る線分データ登録手段と、 この線分データ登録手段に登録された2つの線分データ
を前記座標軸において順次比較し、両線分の方向が同一
かつ一方の線分の端点の値と他方の線分の端点の値が同
一の場合、前記一方の線分の端点の値を前記他方の線分
の端点の値と重複しないように変更する端点変更手段
と、 この端点変更手段により変更された線分データを用い、
前記座標軸と直交する方向にこの図形を1ラインずつ走
査して塗り潰す塗り潰し手段 とを具備することを特徴とする図形処理装置。
1. Line data that includes a direction in which a line segment changes and a coordinate point that forms a line segment for each line segment that changes only in one direction of a predetermined coordinate axis and that constitutes a closed graphic. A line segment data registering means for registering, and two line segment data registered in the line segment data registering means are sequentially compared on the coordinate axis, and the direction of both line segments is the same and the value of the end point of one line segment and the other If the end points of the line segment have the same value, the end point changing means changes the end point value of the one line segment so as not to overlap with the end point value of the other line segment. Using the line segment data
A drawing means for scanning the figure one line at a time in a direction orthogonal to the coordinate axes to fill the figure.
【請求項2】前記データ登録手段は複数の閉図形の線分
データを登録するとともに、前記端点変更手段は各閉図
形ごとに端点の値を変更するものであり、前記塗り潰し
手段は複数の閉図形の線分データを用いて複数の閉図形
の塗り潰しを一括して行うことを特徴とする請求項1記
載の図形処理装置。
2. The data registering means registers line segment data of a plurality of closed figures, the end point changing means changes an end point value for each closed figure, and the filling means comprises a plurality of closed figures. 2. The graphic processing apparatus according to claim 1, wherein a plurality of closed figures are painted in a lump using the line segment data of the figure.
【請求項3】前記端点変更手段は、線分データの順次比
較において最初に用いた線分と最後に用いた線分の方向
が同一かつ最初の線分の端点の値が最後の線分の端点の
値と同一の場合、一方の線分の端点の値を他方の線分の
値と重複しないように変更することを特徴とする請求項
1または請求項2記載の図形処理装置。
3. The end point changing means, wherein in the sequential comparison of line segment data, the direction of the first used line segment is the same as the direction of the last used line segment, and the value of the end point of the first line segment is the last line segment. 3. The graphic processing apparatus according to claim 1, wherein when the value of the end point is the same, the value of the end point of one line segment is changed so as not to overlap with the value of the other line segment.
【請求項4】前記座標軸と直交する方向に図形の塗り潰
し処理を行うためのマスクデータを備え、前記塗り潰し
手段はこのマスクデータを用いて図形の塗り潰しを行う
ことを特徴とする請求項1記載の図形処理装置。
4. The apparatus according to claim 1, further comprising mask data for performing a process of filling a figure in a direction orthogonal to the coordinate axes, wherein the filling means performs filling of the figure using the mask data. Graphic processing unit.
JP1117332A 1989-05-12 1989-05-12 Graphic processing unit Expired - Fee Related JP2861044B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1117332A JP2861044B2 (en) 1989-05-12 1989-05-12 Graphic processing unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1117332A JP2861044B2 (en) 1989-05-12 1989-05-12 Graphic processing unit

Publications (2)

Publication Number Publication Date
JPH02297681A JPH02297681A (en) 1990-12-10
JP2861044B2 true JP2861044B2 (en) 1999-02-24

Family

ID=14709112

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1117332A Expired - Fee Related JP2861044B2 (en) 1989-05-12 1989-05-12 Graphic processing unit

Country Status (1)

Country Link
JP (1) JP2861044B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6642964B2 (en) * 2015-01-05 2020-02-12 キヤノン株式会社 Information processing apparatus, information processing method, and program

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6391788A (en) * 1986-10-06 1988-04-22 Fujitsu Ltd Graphic display system

Also Published As

Publication number Publication date
JPH02297681A (en) 1990-12-10

Similar Documents

Publication Publication Date Title
US5262760A (en) Modifying a graphics display image
KR0167618B1 (en) Character generating apparatus and method of the same
JPS63280388A (en) Algorism for filling image contour
US4779081A (en) Graphics in display unit
JP2964841B2 (en) Data converter
US5867172A (en) Thickened and thinned character generating device including elements for removing undesirably formed outline portions
EP0661669A2 (en) Character pattern generation apparatus and method
US5388166A (en) Image drawing apparatus
JP2861044B2 (en) Graphic processing unit
KR100212412B1 (en) Apparatus for generating character pattern
US6507344B2 (en) Figure processing apparatus, figure processing method, and storing medium
JP3146771B2 (en) Font rasterizing apparatus and method
KR100254659B1 (en) Character forming apparatus
CN1108589C (en) Ellipse filling graphics method
KR900004892B1 (en) Dot inter polation system
JP3082467B2 (en) Outline data processing device
JP3099556B2 (en) Data converter
KR900004948B1 (en) Under/side line pattern generating device
KR900004949B1 (en) Output controller of interpolation dot pattern
JP2835056B2 (en) High quality character pattern generation method
JP3350325B2 (en) Character output device
JP2771981B2 (en) High quality character pattern generation method
JP3536894B2 (en) Graphic processing unit
JP2854588B2 (en) Raster vector conversion method and line figure input device
JPH05108830A (en) Plotting device

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees