JPS6131905B2 - - Google Patents

Info

Publication number
JPS6131905B2
JPS6131905B2 JP53083133A JP8313378A JPS6131905B2 JP S6131905 B2 JPS6131905 B2 JP S6131905B2 JP 53083133 A JP53083133 A JP 53083133A JP 8313378 A JP8313378 A JP 8313378A JP S6131905 B2 JPS6131905 B2 JP S6131905B2
Authority
JP
Japan
Prior art keywords
point
coordinate value
register
counter
points
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
Application number
JP53083133A
Other languages
Japanese (ja)
Other versions
JPS5510656A (en
Inventor
Nobuyuki Hasegawa
Yoshasu Kikuchi
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
Nippon Electric 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 Nippon Electric Co Ltd filed Critical Nippon Electric Co Ltd
Priority to JP8313378A priority Critical patent/JPS5510656A/en
Publication of JPS5510656A publication Critical patent/JPS5510656A/en
Publication of JPS6131905B2 publication Critical patent/JPS6131905B2/ja
Granted legal-status Critical Current

Links

Description

【発明の詳細な説明】 本発明は図形処理装置において線図形の内部を
塗りつぶしする方法に関するものである。
DETAILED DESCRIPTION OF THE INVENTION The present invention relates to a method for filling the inside of a line figure in a figure processing apparatus.

図形を黒く塗りつぶしするためには一般に図形
の画面を順次走査し、走査線が図形の輪郭線と交
差して次に交差するまでの間を黒とすることによ
り行うことが出来る。
Generally, a figure can be painted black by sequentially scanning the screen of the figure and painting the area between the scanning lines intersecting the outline of the figure and the next intersection as black.

しかし、この方法では第1図に示すような頂点
部100、突出した線分101、水平部分10
2、輪郭線の重なり103を含む図形においては
正しく塗りつぶしすることができない。
However, in this method, as shown in FIG.
2. A figure that includes overlapping outlines 103 cannot be filled in correctly.

また、塗りつぶしをするためには全画面の走査
を必要とするため処理時間が長くなるという問題
がある。
Furthermore, since it is necessary to scan the entire screen in order to fill it in, there is a problem in that the processing time becomes long.

本発明はこのような欠点をなくし、任意の線図
形に対して塗りつぶしを可能とすることを目的と
するものである。また塗りつぶしするための操作
は線図形の領域内のみの走査でよいので処理時間
が早い特徴を持つ。
It is an object of the present invention to eliminate such drawbacks and to make it possible to fill in any line figure. Furthermore, since the filling operation only requires scanning within the area of the line figure, the processing time is fast.

本発明に従がう図形塗りつぶし方法の原理を説
明すると次の通りである。
The principle of the figure filling method according to the present invention will be explained as follows.

線図形の連続する点列の座標を順次入力し、各
点に対して次の操作をする。入力点Xi,Yiの垂
直座標Yiに対応するレジスタの内容が空である
場合は入力点の水平座標Xiをそのレジスタに登
録し、前記対応するレジスタに既に水平座標Xg
が入つている場合は、入力点と同じ垂直座標Yi
上のレジスタ内の水平座標Xgと入力点の水平座
標Xiの間の点に対応する画像メモリ内のビツト
を反転し、前記対応するレジスタの内容を消去す
る。
Sequentially input the coordinates of a series of consecutive points on a line figure, and perform the following operations on each point. If the contents of the register corresponding to the vertical coordinate Yi of the input points Xi, Yi are empty, the horizontal coordinate Xi of the input point is registered in that register, and the horizontal coordinate Xg is already stored in the corresponding register.
If it contains, the same vertical coordinate Yi as the input point
The bit in the image memory corresponding to the point between the horizontal coordinate Xg in the upper register and the horizontal coordinate Xi of the input point is inverted, and the contents of the corresponding register are erased.

ただし、始点、水平点(直前の点と同一の垂直
座標を持つ点)、頂点(垂直座標が同じでない直
前の点および直後の点との垂直座標変化分の符号
が異なる点)については上記の操作は行なわず、
終点については上記の操作を行なう。
However, for starting points, horizontal points (points with the same vertical coordinates as the previous point), and vertices (points with different signs of changes in vertical coordinates from the previous and following points whose vertical coordinates are not the same), Do not perform any operations.
For the end point, perform the above operation.

以上述べた原理を例によつて説明する。第1図
(i)〜(ii)にその例を示す。(i)は点1〜点9の点列に
よつて囲まれる範囲を塗りつぶしする例である。
なお、各点の( )内に示す数字は座標値を示す
ものとする。まず点1(2,3)は始点であるの
で操作は行なわない。点2(3,4)については
垂直座標値4に対応するレジスタに水平座標値3
を登録する。点3(4,5)は垂直座標値が同じ
でない直前の点である点2(3,4)との垂直座
標変化分(5―4)と直後の点である点4(5,
4)との垂直座標変化分(4―5)との符号が異
なるため操作は行なわれない。点4(5,4)に
ついては垂直座標値4に対応するレジスタにすで
に点2(3,4)における水平座標値3なる値が
入つているので、レジスタ内の水平座標値3と点
4(5,4)の水平座標値5との間の点4,4の
ビツトを反転する。またそのレジスタ内の値を消
去する。以下点5(5,3)、点6(4,2)に
ついてはレジスタに水平座標を登録し、点7
(3,1)は点3(4,5)と同様に何もしな
い。点8(2,2)で点6(4,2)と点8
(2,2)の間の点3,2のビツト反転を行な
い、点9(2,3)は終点であるので必ず操作を
行ない点5(5,3)と点9(2,3)の間の点
すなわち(4,3),(3,3)のビツトを反転す
る。以上の操作により、点1〜点9の点列によつ
て囲まれる範囲の塗りつぶしが完了する。
The principle described above will be explained using an example. Figure 1
Examples are shown in (i) to (ii). (i) is an example in which the range surrounded by the point sequence of points 1 to 9 is filled in.
Note that the numbers shown in parentheses for each point indicate coordinate values. First, since point 1 (2, 3) is the starting point, no operation is performed. For point 2 (3, 4), the horizontal coordinate value 3 is stored in the register corresponding to the vertical coordinate value 4.
Register. Point 3 (4, 5) has a vertical coordinate change (5-4) from point 2 (3, 4), which is the previous point whose vertical coordinate values are not the same, and point 4 (5, 5, which is the point immediately after it).
4) and the vertical coordinate change (4-5) have different signs, so no operation is performed. Regarding point 4 (5, 4), the register corresponding to vertical coordinate value 4 already contains the horizontal coordinate value 3 at point 2 (3, 4), so the horizontal coordinate value 3 in the register and point 4 ( 5, 4) and the horizontal coordinate value 5 is inverted. Also erases the value in that register. For the following points 5 (5, 3) and 6 (4, 2), register the horizontal coordinates in the register, and then
(3,1) does nothing like point 3 (4,5). point 8 (2,2), point 6 (4,2) and point 8
Perform bit inversion of points 3, 2 between (2, 2), and since point 9 (2, 3) is the end point, be sure to perform the operation to invert points 5 (5, 3) and 9 (2, 3). The bits between the points (4, 3) and (3, 3) are inverted. By the above operations, filling of the range surrounded by the point sequence of points 1 to 9 is completed.

第1図(ii)は突出した線分(点2,3,4)およ
び水平部分(点5,6)(点8,9,10)を含
む例である。点2(3,5)では対応するレジス
タに水平座標値3を登録し、点3(3,6)は頂
点であるので操作は行なわない。
FIG. 1(ii) is an example including protruding line segments (points 2, 3, 4) and horizontal portions (points 5, 6) (points 8, 9, 10). At point 2 (3, 5), horizontal coordinate value 3 is registered in the corresponding register, and since point 3 (3, 6) is a vertex, no operation is performed.

点4(3,5)で点2と点4との間の点のビツ
ト反転をしようとするが、両点の間の点はないの
で実際には何も行なわれない。点5(4,4)は
対応するレジスタに水平座標値4を登録し、点6
(5,4)は直前の点である点5(4,4)と垂
直座標値が同じであるので操作は行なわない。点
7〜12については(i)および点5,6と同様に行
なう。
An attempt is made to invert the bits between points 2 and 4 at point 4 (3, 5), but since there is no point between the two points, nothing is actually done. Point 5 (4, 4) registers the horizontal coordinate value 4 in the corresponding register, and points 6
(5, 4) has the same vertical coordinate value as the immediately previous point, point 5 (4, 4), so no operation is performed. Points 7 to 12 are carried out in the same manner as (i) and points 5 and 6.

第1図(iii)は輪郭線が重なる場合の例である。こ
の場合は点1(2,2)、〜点7(2,2)の点
列による図形と点8(5,4)〜点14(5,
4)の点による点列による図形との2つの図形と
みて(i)と同様に操作する。
FIG. 1(iii) is an example where the contour lines overlap. In this case, a figure is formed by the sequence of points 1 (2, 2) to 7 (2, 2) and points 8 (5, 4) to 14 (5, 2).
4) Treat the figure as two figures with the figure consisting of a sequence of points, and operate in the same way as in (i).

したがつて、頂点部100、突出し線分、10
1、水平部分102、輪郭線の重なり103等が
組合せられたいかなる図形においても前述の通り
容易に塗りつぶしを行なうことが可能となるもの
である。
Therefore, the apex portion 100, the protruding line segment, 10
1. As described above, it is possible to easily fill in any figure in which horizontal portions 102, overlapping contours 103, etc. are combined.

本発明によれば水平垂直の格子点座標上に展開
する線図形の点列の座標情報を順次入力とし、そ
の現在の展開点Xi,Yiと次の展開点間の垂直方
向変化分と、その変化分が零以外の直前の垂直変
化分との符号が同じ場合に、その展開点の垂直座
標値Yiに対応するレジスタをアクセスし、その
レジスタにすでに座標値が書き込まれていない時
はその展開点の水平座標値Xiを書き込み、その
レジスタに座標値Xgが書き込まれていればその
座標値を消すと同時に、その座標値Xgと展開点
の水平座標値Xi間の画像〔Xg,YiとXi,Yiとの
間の点〕をアクセスし、その各点の画像の情報を
反転する図形ぬりつぶし方法が得られる。
According to the present invention, the coordinate information of a sequence of points of a line figure developed on horizontal and vertical grid point coordinates is input sequentially, and the vertical change between the current developed point Xi, Yi and the next developed point, and the If the change has the same sign as the previous vertical change that is not zero, access the register corresponding to the vertical coordinate value Yi of the expansion point, and if no coordinate value has already been written to that register, the expansion Write the horizontal coordinate value Xi of the point, delete the coordinate value if the coordinate value , Yi] and invert the information of the image at each point.

第2図により本発明の図形ぬりつぶし方法を具
体的に実現する装置の一実施例について説明す
る。
An embodiment of an apparatus that specifically implements the figure filling method of the present invention will be described with reference to FIG.

線図形発生機1は2次元のイメージメモリ2に
展開する線図形の座標点列情報を発生している。
具体的には最初1個の線図形の始点のX及びY座
標が夫々線3及び4より出力され、Xカウンタ5
及びYカウンタ6にセツトされる。以後、描画す
る線図形の軌跡に対応して、X方向に+1(右へ
1座標)、±0(その座標のまま)、−1(左へ1座
標)、Y方向に+1(上へ1座標)±0(その座標
のまま)、−1(下へ1座標)の点列座標の変化分
を示す信号が夫々線7,8,9,10,11,1
2より出力されている。Xカウンタ5及びYカウ
ンタ6はアツプダウンカウンタであり、夫々線
7,10に信号がある時には対応したカウンタ
5,6の内容を1だけ増加させ、逆に夫々線9,
12に信号がある時は対応するカウンタ5,6の
内容を1だけ減少させる様に動作する。これ等の
Xカウンタ5の値はゲート39を通して、又Yカ
ウンタ6の値は直接、イメージメモリ2のアドレ
スとなるので、イメージメモリ2上の対応格子点
にビツト1を書き込むことにより、順次線図形点
列を2次元イメージとして展開し得る。このイメ
ージメモリ2の内容は以後、ラスタTVスキヤン
状に読み出し、デイスプレイに出力表示すると
か、フアクシミリ等の端末へ伝送回線を通して伝
送する等の応用に用いることが可能であるが、そ
れに関連する回路は一般的なものであり特に図示
しない。
A line figure generator 1 generates coordinate point sequence information of a line figure developed in a two-dimensional image memory 2.
Specifically, the X and Y coordinates of the starting point of one line figure are output from lines 3 and 4, respectively, and the X counter 5
and is set in the Y counter 6. After that, corresponding to the locus of the line figure to be drawn, +1 (1 coordinate to the right), ±0 (keep the same coordinate), -1 (1 coordinate to the left) in the X direction, +1 (1 coordinate upward) in the Y direction. Coordinates) Signals indicating changes in the point sequence coordinates of ±0 (the coordinates remain as they are) and -1 (one coordinate downward) are lines 7, 8, 9, 10, 11, and 1, respectively.
It is output from 2. The X counter 5 and Y counter 6 are up-down counters, and when there is a signal on lines 7 and 10, respectively, the contents of the corresponding counters 5 and 6 are incremented by 1, and conversely, the contents of the corresponding counters 5 and 6 are increased by 1, and vice versa.
When there is a signal at 12, it operates to decrease the contents of the corresponding counters 5 and 6 by 1. These values of the X counter 5 pass through the gate 39, and the values of the Y counter 6 directly become the address of the image memory 2, so by writing bit 1 to the corresponding lattice point on the image memory 2, the line figure is sequentially A sequence of points can be developed as a two-dimensional image. The contents of this image memory 2 can be read out in raster TV scan form and used for applications such as displaying the output on a display, or transmitting it to a terminal such as a facsimile through a transmission line, but the related circuitry is This is a general item and is not particularly illustrated.

次に、本発明の特徴であるぬりつぶし方式に特
有な回路を説明する。前記線10,11,12の
信号は現在の展開点Xi,Yiと次の展開点とのY
(垂直)方向の変化分が出力されている。一方フ
リツプフロツプ13,14にはY(垂直)方向の
変化分のうち、その変化分が零(展開点列が水平
方向に移動した場合)以外の直前の変化分が蓄積
されている。即ち、Y方向の変化分が零の場合は
インバータ15がゲート16及び17を閉じフリ
ツプフロツプ13,14には何もセツトしない
が、Y方向の変化分が零以外の場合は、その変化
分が+1(上)ならフリツプフロツプ13に、、
変化分が−1(下)ならフリツプフロツプ14が
セツトされている。線18には、アンドゲート1
9に入力する線10とフリツプフロツプ13の両
方ともに信号が存在するか、あるいはアンドゲー
ト20に入力する線12とフリツプフロツプ14
の両方ともに信号が存在する場合に信号が出力さ
れる。即ち、線18には現在の展開点と次の展開
点とのY(垂直)方向の変化分と、Y(垂直)方
向変化分が零以外の直前の変化分とが同一方向に
なつた場合に信号が出力される。なお、フリツプ
フロツプ13,14は始点の情報が入力された時
点でリセツト(図示しない)されており、始点以
後の最初のY(垂直)方向変化分を示す信号が線
10又は12に出力される際はフリツプフロツプ
13又は14がセツトされるのみで、線18には
信号が出ない。
Next, a circuit specific to the fill-in method, which is a feature of the present invention, will be explained. The signals of the lines 10, 11, and 12 are Y between the current expansion points Xi, Yi and the next expansion point.
The change in the (vertical) direction is output. On the other hand, in the flip-flops 13 and 14, among the changes in the Y (vertical) direction, the immediately preceding changes other than zero (when the expansion point sequence moves in the horizontal direction) are stored. That is, if the change in the Y direction is zero, the inverter 15 closes the gates 16 and 17 and nothing is set in the flip-flops 13 and 14, but if the change in the Y direction is other than zero, the change is +1. (above), flip-flop 13,
If the change is -1 (down), flip-flop 14 is set. Line 18 has AND gate 1
A signal is present on both line 10 and flip-flop 13 inputting to AND gate 20, or on line 12 and flip-flop 14 inputting to AND gate 20.
A signal is output when both signals are present. In other words, line 18 shows the case where the change in the Y (vertical) direction between the current expansion point and the next expansion point and the previous change in the Y (vertical) direction where the change is other than zero are in the same direction. A signal is output. Note that the flip-flops 13 and 14 are reset (not shown) at the time the starting point information is input, and when a signal indicating the first change in the Y (vertical) direction after the starting point is output to the line 10 or 12. In this case, only flip-flop 13 or 14 is set, and no signal is output to line 18.

一方、レジスタ群21は少なくともY方向格子
点数に等しい数のレジスタにより構成されてお
り、最初(1枚の画像の展開前)に消去されてい
る。本実施例での消去状態はレジスタが零の状態
とし、このレジスタに書込むX座標値は1以上を
使用するものとする。このレジスタ群21からは
現在の展開点のY座標Yiに対応する内容が読み
出されており、その内容が消去状態、即ち零であ
れば、ゲート22より信号が出力されている。こ
の時前記線18の信号が出力されるとアンドゲー
ト23の信号がゲート(マルチプレクサ)24を
開き、現在の展開点の座標値Xiがレジスタ群2
1中の現在の展開点のY座標値Yiに対応するレ
ジスタに書き込まれる。また、このレジスタ群2
1の現在の展開点に対応するレジスタの内容が零
以外、即ちすでに何らかの座標値(例えばXgと
する)が書き込まれていれば、インバータ回路2
5によりインバートした方の信号が出ているの
で、この時前記線18に信号が出ればゲート26
によりフリツプフロツプ27をセツトし、ぬりつ
ぶし状態Sとなる。ぬりつぶし動作はレジスタ群
21の現在の展開点に対応するレジスタの内容
Xgをゲート(マルチプレクサ)28を通してア
ツプダウン形カウンタ29にセツトすると同時
に、そのレジスタ群21の現在の展開点に対応す
るレジスタをゲート(マルチプレクサ)30を開
いて零を書込むことにより、すなわち消去するこ
とより始まる。
On the other hand, the register group 21 is made up of registers whose number is at least equal to the number of grid points in the Y direction, and is erased initially (before one image is developed). In this embodiment, the erase state is a state in which the register is zero, and the X coordinate value written in this register is 1 or more. The contents corresponding to the Y coordinate Yi of the current expansion point are read from this register group 21, and if the contents are in an erased state, that is, zero, a signal is output from the gate 22. At this time, when the signal on the line 18 is output, the signal on the AND gate 23 opens the gate (multiplexer) 24, and the coordinate value Xi of the current expansion point is set in the register group 2.
1 is written to the register corresponding to the Y coordinate value Yi of the current expansion point. Also, this register group 2
If the contents of the register corresponding to the current expansion point of 1 are other than zero, that is, some coordinate value (for example, Xg) has already been written, the inverter circuit 2
Since the signal inverted by 5 is output, if the signal is output to the line 18 at this time, the signal is output to the gate 26.
The flip-flop 27 is set by this operation, and the filling state S is entered. The filling operation is based on the contents of the register corresponding to the current expansion point of register group 21.
Xg is set in the up-down counter 29 through the gate (multiplexer) 28, and at the same time, the register corresponding to the current expansion point of the register group 21 is opened by opening the gate (multiplexer) 30 and writing zero, that is, erasing it. It starts from.

カウンタ29にセツトされた内容Xgは現在の
展開点の座標値Xiと比較器311にて比較す
る。比較器31からはXg<Xiなら線32に、Xg
>Xiならば線33に信号が出力される。それ等
は夫々カウンタ29のアツプ端子及びダウン端子
に加えられているので、カウンタ29はXgより
順次Xiに近ずく方向にカウンタされて行き、カ
ウンタ21の値がXiと等しくなり線34に信号
が出て、ぬりつぶし状態Sを示すフリツプフロツ
プ27をリセツトするまで続く。
The content Xg set in the counter 29 is compared with the coordinate value Xi of the current expansion point by a comparator 311. From the comparator 31, if Xg<Xi, the line 32, Xg
>Xi, a signal is output on line 33. Since these are added to the UP and DOWN terminals of the counter 29, the counter 29 is counted in a direction that gradually approaches Xi from Xg until the value of the counter 21 becomes equal to Xi and a signal is sent to the line 34. This continues until the flip-flop 27 indicating the filling state S is reset.

カウンタ29がXgからXiまでカウントしてい
る間、ゲート(マルチプレクサ)35が開き、
(一方Yカウンタ6は、現在の展開点Yiのままで
あるので)イメージメモリ2中のXg,Yiから
Xi,Yiの間の格子点に対応する画素が順次アク
セスされ、その内容が読出され、さらにその内容
はインバータ36で各画素のビツトを反転して再
び書込まれる。
While the counter 29 is counting from Xg to Xi, the gate (multiplexer) 35 is opened.
(On the other hand, since the Y counter 6 remains at the current expansion point Yi)
Pixels corresponding to grid points between Xi and Yi are sequentially accessed, their contents are read out, and the contents are written again with the bits of each pixel inverted by an inverter 36.

以上、本実施例を構成する各回路の動作を機能
的面から説明したが、さらにタイミング関係を補
足説明する。この本実施例の回路は一種の同期回
路構成で動作し、例えば、システムクロツクが1
μsで、その間を200nsごとに5分割したタイミ
ングt1,t2,t3,t4,t5により動作するものとす
る。
The operation of each circuit constituting this embodiment has been described above from a functional perspective, and the timing relationship will be supplementarily explained. The circuit of this embodiment operates in a kind of synchronous circuit configuration, for example, when the system clock is
It is assumed that the operation is performed using timings t 1 , t 2 , t 3 , t 4 , and t 5 that are divided into five times every 200 ns.

線図形発生機1にはぬりつぶし以外の状態で
タイミングt1が入力しており、始点がセツトされ
た後は順次タイミングt1の時点で線7から10の
展開図形の点列情報が次の展開点の情報へと変化
し、線7から10へ出力されるが、ぬりつぶし状
態S中はその動作は一時停止している。ゲート1
9,20にはぬりつぶし以外の状態でt2が入力
しており、したがつて、アンドゲート19,20
のアンド条件が満足した場合、線18にタイミン
グt2で信号が出る。フリツプフロツプ13,,1
4はその直後のタイミングt3で更新される。
Timing t1 is input to the line figure generator 1 in a state other than coloring, and after the starting point is set, the point sequence information of the developed figure of lines 7 to 10 is sequentially input to the next development at timing t1 . The information changes to point information and is output from lines 7 to 10, but the operation is temporarily stopped during the filling state S. gate 1
t 2 is input to 9 and 20 in a state other than filling, so AND gates 19 and 20
If the AND condition is satisfied, a signal is output on line 18 at timing t2 . Flip-flop 13,,1
4 is updated at timing t3 immediately thereafter.

線18に信号が出た時、ゲート22より信号が
出ていれば、ゲート23を経由した信号がゲート
(マルチプレクサ)24を開け現在の展開点のX
(水平)座標をレジスタ群21に書き込む。その
後タイミングt4でXカウンタ5及びYカウンタ6
は次の展開点の値に変り、イメージメモリ2中の
次の展開点に対応するビツトを1にする。なぜな
ら、ぬりつぶし以外の状態ではインバータ36
の出力は1である。一方線18に信号が出た時、
ゲート22より信号が出ていなければフリツプフ
ロツプ27がセツトされ、ぬりつぶし状態Sとな
ると同時に、ゲート(マルチプレクサ)28と3
0を開く、アツプダウンカウンタ29へはぬりつ
ぶし状態Sの場合にタイミングt3が入力するの
で、その時点でカウンタ29の値XgはXiに近づ
く方向に増減(+1又は−1)され、そのカウン
タ29とYカウンタ6に対応するイメージメモリ
2中のビツトがタイミングt3(関係回路は略す)
で反転書込みされる。次のサイクルのタイミング
t1ではぬりつぶし状態Sであるため、線図形発生
機1等の内容は変らない。タイミングt3で再びカ
ウンタ29が増減しイメージメモリ2中のさらに
隣のビツトが反転書込される。同様にして各サイ
クルタイミングt3ごとにカウンタ29が増減し、
タイミングt5で反転書込みが順次行なわれる。タ
イミングt3でカウンタ29を増減した際Xカウン
タ5の現在展開点の値Xiと等しくなつたことが
比較器31で検出されるとフリツプフロツプ27
が直ちにリセツトされぬりつぶし以外の状態と
なる。したがつて今度はタイミングt4によりXカ
ウンタ5及びYカウンタ6が次の展開点の値に変
り、イメージメモリ2中の対応するビツトをタイ
ミングt5の時点で1にする。次のサイクルのタイ
ミングt1では線図形発生機1よりの点列情報がさ
らに一つ次の展開点の情報へと変化し、順次同様
な動作を繰返すことになる。
When a signal is output to the line 18, if a signal is output from the gate 22, the signal via the gate 23 opens the gate (multiplexer) 24 and outputs the current expansion point X.
Write the (horizontal) coordinates to the register group 21. After that, at timing t 4 , X counter 5 and Y counter 6
changes to the value of the next expansion point, and sets the bit corresponding to the next expansion point in the image memory 2 to 1. This is because in a state other than coloring, the inverter 36
The output of is 1. On the other hand, when a signal appeared on line 18,
If no signal is output from the gate 22, the flip-flop 27 is set and the filling state S is reached, and at the same time, the gates (multiplexers) 28 and 3 are set.
0, the up-down counter 29 is inputted at timing t 3 in the filling state S, so at that point the value Xg of the counter 29 is increased or decreased (+1 or -1) in the direction approaching Xi, The bit in image memory 2 corresponding to Y counter 6 is timing t 3 (related circuits are omitted)
is inverted and written. Timing of next cycle
At t 1, it is in the filling state S, so the contents of the line figure generator 1, etc. do not change. At timing t3 , the counter 29 increases or decreases again, and the adjacent bit in the image memory 2 is inverted and written. Similarly, the counter 29 increases or decreases at each cycle timing t3 ,
Inversion writing is performed sequentially at timing t5 . When the comparator 31 detects that when the counter 29 is increased or decreased to become equal to the value Xi of the current expansion point of the X counter 5 at timing t3, the flip-flop 27
is immediately reset to a state other than filling. Therefore, at timing t4 , the X counter 5 and Y counter 6 change to the values of the next expansion point, and the corresponding bits in the image memory 2 are set to 1 at timing t5 . At timing t1 of the next cycle, the point sequence information from the line figure generator 1 further changes to information on the next expansion point, and the same operation is repeated one after another.

この様にして、1個の線図形の座標点列の処理
を順次行ない、その線図形(一般には閉の多角
形)の終点に達した後、再び次の線図形の始点の
X,Y座標をXカウンタ5及びYカウンタ6にセ
ツトすることから繰返すことになる。さらに必要
な線図形群の全の処理が終了した時点で全てのタ
イミングt1からt5を止めるなどして、イメージメ
モリ2の内容を使用するサイクルに入る。
In this way, the sequence of coordinate points of one line figure is sequentially processed, and after reaching the end point of that line figure (generally a closed polygon), the X, Y coordinates of the starting point of the next line figure are processed again. The process is repeated by setting the value in the X counter 5 and the Y counter 6. Further, when all necessary line figure group processing is completed, all timings t 1 to t 5 are stopped, and a cycle is started in which the contents of the image memory 2 are used.

なお、本実施例の説明に当り、イメージメモリ
2やレジスタ21には読出し用のラツチ等が附加
されており、ある番地に情報を新しく書込んでも
その読出し出力が新しい内容に直ちに変つてしま
うことはないとしてある。
In explaining this embodiment, it should be noted that the image memory 2 and the register 21 are equipped with a readout latch, etc., so that even if new information is written to a certain address, the readout output will immediately change to the new content. There is no such thing.

また、本実施例の線図形発生機1は説明を解り
やすくするため始点の座標と1メツシユごとの変
化点列情報が順次出力されるもので説明した。し
かし、例えば、通常のXYレコーダへの信号の如
く、原点からの1メツシユごとの変化点列情報と
ペンアツプダウン信号が出る様な線図形発生機を
用いた場合は、始点の座標出力線4,5がなく、
代りに最初(原点に対応)X,Yカウンタ5,6
を零にリセツトし、ペンアツプ信号中はX,Yカ
ウンタ5,6の増減動作以外、イメージメモリ2
へのビツトの書込みを含む一切の動作を行なわ
ず、ペンダウン信号中のみ本回路の動作を有効に
すれば良い。また、他の例として、この線図形発
生機が座標入力タブレツトの様なもので、人間が
その上でペンを動かす等により、グラフイツクア
ートを構成して行く様な場合、一般にペンダウン
直後の最初のX,Y座標を始点情報とし、以後そ
の座標値が1メツシユ分変化する時刻(間隔は一
般に1ms以上)ごとに一連のタイミングt1からt5
を出し、もしその間にぬりつぶし状態Sがはさま
れば、その間タイミングを出しつづけぬりつぶし
以外の状態になつた直後のタイミングt5でタイ
ミング出力を一担停止する等の若干の回路を付加
することにより容易に実現できる。
Furthermore, in order to make the explanation easier to understand, the line figure generator 1 of this embodiment has been described as one in which the coordinates of the starting point and the change point sequence information for each mesh are sequentially output. However, for example, when using a line figure generator that outputs change point sequence information and pen up-down signals for each mesh from the origin, like a signal to a normal XY recorder, the coordinate output line 4 of the starting point ,5 is missing,
Instead, the first (corresponding to the origin) X, Y counters 5, 6
During the pen-up signal, except for the increase/decrease operation of the X and Y counters 5 and 6, the image memory 2
It is sufficient to enable the operation of this circuit only during the pen-down signal without performing any operation including writing bits to the pen-down signal. As another example, when this line figure generator is like a coordinate input tablet and a person composes graphic art by moving a pen on it, generally the The X, Y coordinates of are used as the starting point information, and thereafter, a series of timings t 1 to t 5 are performed every time the coordinate values change by one mesh (the interval is generally 1 ms or more).
By adding some circuitry, for example, if the filling state S is caught in between, the timing output will continue to be output during that time and the timing output will be temporarily stopped at timing t5 immediately after the state changes to a state other than filling. It can be easily achieved.

また、本実施例は2値図形(白/黒)の例で説
明したが、このぬりつぶし図形が濃淡イメージと
かカラーイメージであり、したがつて、イメージ
メモリ2中の各画素が複数のビツトで表現されて
いる場合、本実施例の2値図形からそのカラー指
定等に応じてカラーイメージメモリに再転送する
ほか本実施例のビツトを反転する操作を、背景を
指定する情報とぬりつぶし部分を指定する情報と
を入れ変えると言う様に置き変えることにより容
易に実現できる。また、本実施例中のX,Y及び
水平、垂直等の方向は便宜上規定して説明したも
のであり、これ等の方向を逆にしても本質的には
変らないのは当然である。
Furthermore, although this embodiment has been explained using an example of a binary figure (white/black), this filled-in figure is a shaded image or a color image, and therefore each pixel in the image memory 2 is expressed by multiple bits. If so, the binary figure of this embodiment is retransferred to the color image memory according to its color specification, etc., and the operation of inverting the bits of this embodiment is performed, and the information specifying the background and the filled part are specified. This can be easily achieved by replacing the information. Further, the directions such as X, Y, horizontal, and vertical in this embodiment are defined and explained for convenience, and it goes without saying that even if these directions are reversed, there is no change essentially.

以上説明した如く、本実施例は線図形発生機1
からの線図形情報をイメージメモリ2に展開する
X,Yカウンタ5,6の一連の回路に、レジスタ
21、カウンタ29、比較器31及び若干のフリ
ツプフロツプやゲート(マルチプレクサ)等を付
加することにより、図形のぬりつぶしが容易に行
なえる利点がある。
As explained above, in this embodiment, the line figure generator 1
By adding a register 21, a counter 29, a comparator 31, and some flip-flops, gates (multiplexers), etc. to the series of circuits of the X and Y counters 5 and 6 that develop the line figure information from the image memory 2 into the image memory 2, It has the advantage that you can easily fill in the shapes.

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

第1図(i)(ii)(iii)は本発明の図形塗りつぶし方法の
原理を説明するためのの描画説明図である。第2
図は本発明の図形ぬりつぶし方法を実現する具体
的実施回路の一例を示す回路図である。 図において、1は線図形発生機、2は画像メモ
リ、5はXカウンタ、6はYカウンタ、19,2
0はアンドゲート、21はレジスタ群、22はゲ
ート、29はアツプダウンカウンタ、31は比較
器、頂点部分100、突出した線分部分101、
水平部分102、輪郭線の重なり103、を示
す。
FIGS. 1(i), (ii), and (iii) are drawings for explaining the principle of the figure filling method of the present invention. Second
The figure is a circuit diagram showing an example of a specific implementation circuit for realizing the figure filling method of the present invention. In the figure, 1 is a line figure generator, 2 is an image memory, 5 is an X counter, 6 is a Y counter, 19, 2
0 is an AND gate, 21 is a register group, 22 is a gate, 29 is an up-down counter, 31 is a comparator, a vertex portion 100, a protruding line segment portion 101,
A horizontal portion 102 and an overlap 103 of contour lines are shown.

Claims (1)

【特許請求の範囲】 1 水平垂直の格子点座標上に展開する線図形の
点列の座標情報を順次入力とし、その現在の展開
点Xi,Yiと次の展開点間の垂直方向変化分と、
その変化分が零以外の直前の垂直変化分との符号
が同じ場合に、前記現在の展開点の垂直座標値
Yiに対応するレジスタをアクセスし、前記レジ
スタに座標値が書き込まれていない時は前記現在
の展開点の水平座標値Xiを書き込み、前記レジ
スタにすでに座標値Xgが書き込まれていればそ
の座標値Xgを消すと同時に、その座標値Xgと展
開点の水平座標値Xi間の画像〔Xg,YiとXi,Yi
との間の点〕をアクセスし、その各点の画像の情
報を反転することを特徴とする図形ぬりつぶし方
法。 2 水平垂直(以下XYとする)の格子点座標上
に展開する線図形の点列の座標情報を受け、2次
元画像メモリに図形を描画する装置において、前
後する展開点間のY変化分が零以外の直前の変化
方向信号を記憶する方向メモリと、次の展開点の
Y変化方向信号と前記方向メモリ出力の方向信号
との一致を検出し一致信号を出力するゲート回路
と、Y座標値によりアクセスされ記憶内容を出力
するレジスタ群と、前記一致信号を受け現在の展
開点Y座標値によりアクセスされた前記レジスタ
群の対応のレジスタの内容が予め設定された値の
時、前記対応レジスタへX座標値を記憶させ、前
記、対応レジスタの内容が前記予め設定された値
以外の時、前記内容を後記カウンタにセツトし、
かつ、前記対応レジスタに前記予め設定した値を
記憶させるセツト回路と、前記セツトされた値か
ら計数するカウンタと、前記カウンタの値を前記
現在展開点のX座標値まで順次1づつ計数制御す
る回路と、前記計数制御をしている間前記現在の
展開点Y座標値と前記カウンタが示すX座標値と
でアクセスされる前記2次元画像メモリの情報を
反転させる回路を有することを特徴とする図形ぬ
りつぶし装置。
[Claims] 1. Coordinate information of a sequence of points of a line figure developed on horizontal and vertical grid point coordinates is input sequentially, and the vertical change between the current developed points Xi, Yi and the next developed point is calculated. ,
If the change has the same sign as the previous non-zero vertical change, the vertical coordinate value of the current expansion point
Access the register corresponding to Yi, and if the coordinate value is not written in the register, write the horizontal coordinate value Xi of the current expansion point, and if the coordinate value Xg has already been written in the register, the coordinate value At the same time as erasing Xg, the image between its coordinate value Xg and the horizontal coordinate value Xi of the expansion point [Xg, Yi and Xi, Yi
A figure filling method characterized by accessing [points between] and inverting the image information of each point. 2. In a device that receives coordinate information of a sequence of points of a line figure developed on horizontal and vertical (hereinafter referred to as XY) grid point coordinates and draws the figure in a two-dimensional image memory, a direction memory that stores the immediately previous changing direction signal other than zero; a gate circuit that detects a match between the Y changing direction signal of the next development point and the direction signal output from the direction memory and outputs a matching signal; and a Y coordinate value. When the contents of the corresponding register of the register group accessed by and outputting the memory contents and the register group accessed by the current expansion point Y coordinate value in response to the coincidence signal are preset values, to the corresponding register. storing an X coordinate value, and when the content of the corresponding register is other than the preset value, setting the content to a counter described below;
and a set circuit that stores the preset value in the corresponding register, a counter that counts from the set value, and a circuit that sequentially controls the value of the counter to count one by one up to the X coordinate value of the current expansion point. and a circuit for inverting information in the two-dimensional image memory that is accessed using the current Y-coordinate value of the expansion point and the X-coordinate value indicated by the counter while performing the counting control. Coloring device.
JP8313378A 1978-07-07 1978-07-07 Method and device for painting out pattern Granted JPS5510656A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP8313378A JPS5510656A (en) 1978-07-07 1978-07-07 Method and device for painting out pattern

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP8313378A JPS5510656A (en) 1978-07-07 1978-07-07 Method and device for painting out pattern

Publications (2)

Publication Number Publication Date
JPS5510656A JPS5510656A (en) 1980-01-25
JPS6131905B2 true JPS6131905B2 (en) 1986-07-23

Family

ID=13793692

Family Applications (1)

Application Number Title Priority Date Filing Date
JP8313378A Granted JPS5510656A (en) 1978-07-07 1978-07-07 Method and device for painting out pattern

Country Status (1)

Country Link
JP (1) JPS5510656A (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS57101886A (en) * 1980-12-17 1982-06-24 Hitachi Ltd Optional graphic snearing of display
JPS57199036A (en) * 1981-06-03 1982-12-06 Fuji Xerox Co Ltd Picture partial erasing device
JPH1055166A (en) * 1996-08-09 1998-02-24 Mitsubishi Electric Corp Polygon painting-out accelerator

Also Published As

Publication number Publication date
JPS5510656A (en) 1980-01-25

Similar Documents

Publication Publication Date Title
US4626838A (en) Filled shaped generating apparatus
EP0012173A1 (en) Apparatus for picture processing with resolution conversion
US4528692A (en) Character segmenting apparatus for optical character recognition
JPS6131905B2 (en)
JPS59162588A (en) Display unit
JPS6155677B2 (en)
KR100206258B1 (en) Image processing apparatus
JPS5836907B2 (en) Superimposable color graphic display method
JP2610825B2 (en) Graphic processing unit
JP2903214B2 (en) Area designation device
JPH0822555A (en) Method and device for graphic plotting
JPS62192865A (en) Graphic display device
JP3120118B2 (en) Image display device
JPS61878A (en) Label attaching circuit
JPS5983454A (en) Form pattern generator
JPH0573693A (en) Outline paint out system
JPH04354069A (en) Picture processor
JPH0232670B2 (en)
JPS6346473B2 (en)
JPS5836350B2 (en) Pattern display method
JPH01205388A (en) Generation system for high quality character and graphic or the like
JPH0750512B2 (en) Image processing device
JPS62235690A (en) Painting method for graphic
JPS60232597A (en) Display unit
JPH0820867B2 (en) Filled figure generation method