JP2715496B2 - Image filling device - Google Patents

Image filling device

Info

Publication number
JP2715496B2
JP2715496B2 JP30736588A JP30736588A JP2715496B2 JP 2715496 B2 JP2715496 B2 JP 2715496B2 JP 30736588 A JP30736588 A JP 30736588A JP 30736588 A JP30736588 A JP 30736588A JP 2715496 B2 JP2715496 B2 JP 2715496B2
Authority
JP
Japan
Prior art keywords
coordinate
pixel
storage means
cell
closed area
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP30736588A
Other languages
Japanese (ja)
Other versions
JPH02153484A (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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial 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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP30736588A priority Critical patent/JP2715496B2/en
Publication of JPH02153484A publication Critical patent/JPH02153484A/en
Application granted granted Critical
Publication of JP2715496B2 publication Critical patent/JP2715496B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Image Generation (AREA)

Description

【発明の詳細な説明】 産業上の利用分野 本発明は、アウトラインフォントを生成する際、アウ
トラインフォントの輪郭内を塗りつぶす画像塗りつぶし
装置に関するものである。
Description: BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an image filling device for filling an outline of an outline font when an outline font is generated.

従来の技術 以下、第15図により、従来の画像塗りつぶし装置の原
理について説明する。従来の画像塗りつぶし装置では、
任意の閉領域は、第15図(A)の様に、あらかじめ画像
記憶装置に書き込まれる。そして、この閉領域内の1つ
の画素が、塗りつぶし開始点1501(通常、シードとい
う)として与えられる。そして、塗りつぶしは、このシ
ード1501を起点として開始する。このシード1501から、
1ライン横方向に塗りつぶす際、シード1501の上下にあ
る閉領域内の点を次の塗りつぶし開始点1502として記憶
する〔第15図(B)〕。そして、シード1501から1ライ
ン塗りつぶす。この際、第15図(B)の様な閉領域1503
が発生すると、塗りつぶし開始点1502はこの閉領域1503
とは、別の閉領域になってしまう。このため閉領域1503
は、塗りつぶせなくなってしまう。そこで、1ライン塗
る前に、第15図(A)の黒丸で示した点1504をスタック
に積んでおく必要がある。このようにして、1ライン毎
に塗りつぶして行くのが従来の方式である。〔参考文献
日経エレクトロニクス 1987.2.23 P159〜P160“拡
大、縮小、回転”塗りつぶしを高速処理する描画プロセ
ッサ〕 第14図は、従来の画像塗りつぶし装置のブロック構成
を示したものである。第14図において、1401は任意の閉
領域の輪郭の座標を発生する座標発生手段である。この
座標発生装置1401から出力された画素の座標は、1402の
画像記憶手段に入力される。1405は、画像記憶手段1402
に記憶された画像情報を表示する画像表示手段である。
1403は塗りつぶしを行う際、第15図(A)の黒丸で示し
た画素1504を記録するスタック、1404はこれらの制御を
行うプロセッサ、1406はこれらをつなぐバスである。
2. Description of the Related Art The principle of a conventional image filling apparatus will be described below with reference to FIG. In a conventional image filling device,
The arbitrary closed area is previously written in the image storage device as shown in FIG. Then, one pixel in this closed area is given as a painting start point 1501 (usually called a seed). Then, the painting is started with the seed 1501 as a starting point. From this seed 1501,
When painting one line in the horizontal direction, points in the closed area above and below the seed 1501 are stored as the next painting start point 1502 (FIG. 15B). Then, one line is painted from the seed 1501. At this time, a closed region 1503 as shown in FIG.
Occurs, the filling start point 1502 is set to this closed area 1503
Is another closed area. Therefore, the closed area 1503
Cannot be filled. Therefore, before painting one line, it is necessary to stack a point 1504 indicated by a black circle in FIG. 15A on the stack. In this manner, the conventional method paints out one line at a time. [Reference Literature Nikkei Electronics 1987.2.23 P159-P160 “Enlargement, Reduction, Rotation” Drawing Processor for High-Speed Fill Processing] FIG. 14 shows a block configuration of a conventional image filling apparatus. In FIG. 14, reference numeral 1401 denotes a coordinate generating means for generating the coordinates of the contour of an arbitrary closed area. The coordinates of the pixel output from the coordinate generation device 1401 are input to the image storage means 1402. 1405 is an image storage unit 1402
Image display means for displaying the image information stored in the.
Reference numeral 1403 denotes a stack for recording the pixels 1504 indicated by black circles in FIG. 15A when painting is performed, 1404 denotes a processor for controlling these, and 1406 denotes a bus connecting these.

発明が解決しようとする課題 しかしながら、第14図の画像塗りつぶし装置では、あ
らかじめ、閉領域を構成する輪郭情報を画像記憶手段14
02に書き込む必要がある。そして、その後この輪郭をた
どりながら、塗りつぶしを行っていく。このため、画像
記憶手段1402に対するアクセス回数が多くなり、輪郭を
発生させて、さらに塗りつぶしを行い、画像を表示する
のに多くの時間を必要としていた。
However, in the image filling device shown in FIG. 14, the outline information constituting the closed area is stored in advance in the image storage unit 14.
It is necessary to write to 02. Then, painting is performed while following this contour. For this reason, the number of accesses to the image storage unit 1402 has increased, and it has taken a lot of time to generate an outline, further paint, and display an image.

本発明は上記課題に鑑み、閉領域を構成する座標が与
えられる度に、この閉領域を塗りつぶすためのデータ構
造を作成していく。この結果、閉領域を構成する座標が
すべて与えられるのと同時に塗りつぶしの実行を可能に
する。このため、閉領域の塗りつぶしをより高速に実行
することを可能にするものである。
In view of the above problem, the present invention creates a data structure for filling a closed area every time coordinates forming a closed area are given. As a result, it is possible to execute the filling at the same time that all the coordinates constituting the closed area are given. Therefore, it is possible to execute the filling of the closed region at a higher speed.

課題を解決するための手段 上記課題を解決するためん、閉領域を構成する画素の
2次元座標を生成する座標発生手段と、前記座標発生手
段が発生した画素の第1の座標値を記憶する第1の座標
記憶手段と、前記第1の座標値毎に画素の第2の座標値
を昇順に記憶する第2の座標記憶手段と、前記第2の座
標記憶手段に記憶された第2の座標値に従い直線を描画
する直線描画手段と、前記直線描画手段が描画した直線
を記憶する画像記憶手段とを備え、前記第2の記憶手段
に第2の座標値を昇順に記憶する際、前の画素と次の画
素と現在の画素との第1の座標値が等しい場合に現在の
画素に対応する第2の座標値を記憶することなく現在の
画素と次の画素の第1の座標値が異なる場合のみ現在の
画素対し第2の座標値を記憶し、前記直線描画手段が、
第1の座標値毎に昇順に記憶された第2の座標値から昇
順に第2の座標値を2つづつ選択し、選択された2点を
結ぶ線分を描画するものである。
Means for Solving the Problems To solve the above problems, coordinate generating means for generating two-dimensional coordinates of pixels constituting a closed region, and first coordinate values of the pixels generated by the coordinate generating means are stored. A first coordinate storage unit, a second coordinate storage unit that stores a second coordinate value of a pixel in ascending order for each of the first coordinate values, and a second coordinate storage unit that stores the second coordinate value of the pixel in the second coordinate storage unit. A straight line drawing means for drawing a straight line according to the coordinate values; and an image storage means for storing the straight line drawn by the straight line drawing means. When the second coordinate values are stored in the second storage means in ascending order, When the first coordinate value of the current pixel is equal to the first coordinate value of the next pixel and the current pixel, the first coordinate value of the current pixel and the next pixel is stored without storing the second coordinate value corresponding to the current pixel. Is stored, the second coordinate value for the current pixel is stored only when The steps are
The second coordinate value is selected two by two in ascending order from the second coordinate value stored in ascending order for each first coordinate value, and a line segment connecting the selected two points is drawn.

作用 本発明は、上記構成により、任意の閉領域を高速に塗
りつぶすものである。第1の座標記憶手段には、閉領域
を構成する座標の一方(たとえばX,Y座標系でいえばY
座標)の各々の座標値に対する小領域(これをバケット
と呼ぶ)を持っている。第2の座標記憶手段には、他の
一方の座標(例えばX座標)を記憶する小領域(これを
セルと呼ぶ)が存在する。このセルは、閉領域を構成す
る画素1つに対して、1つ対応する。閉領域を構成する
画素の座標が順に与えられるにしたがって、この2つの
メモリ構造が構成される。すなわち、同じY座標をもつ
画素に対応するセルは、第2の座標記憶手段内でX座標
について昇順に並べられる。そして、この最初のセル
を、第1の座標記憶手段の対応するバケットが指し示
す。
The present invention fills an arbitrary closed area at high speed with the above configuration. The first coordinate storage means stores one of the coordinates constituting the closed area (for example, Y in the X, Y coordinate system).
(Coordinates) for each coordinate value (this is called a bucket). In the second coordinate storage means, there is a small area (this is called a cell) for storing another coordinate (for example, X coordinate). This cell corresponds to one pixel constituting the closed region. The two memory structures are configured as the coordinates of the pixels forming the closed area are sequentially given. That is, the cells corresponding to the pixels having the same Y coordinate are arranged in ascending order of the X coordinate in the second coordinate storage means. Then, the first cell is pointed to by the corresponding bucket in the first coordinate storage means.

このような構造は、閉領域を構成する画素の座標が与
えられるにつれてできあがっていく。従って、閉領域を
構成する画素の座標を発生し終えた時点で、このメモリ
構造はできあがっている。この閉領域を塗りつぶす際
は、第1の座標記憶手段のバケットを順にみていく。そ
して、このバケットに第2の座標記憶手段を指すデータ
が記憶されている場合は、第2の座標記憶手段を見る。
そして、第2の座標記憶手段に記憶されたセルを最初か
ら2つずつ組にして行き、このセルに対応する画素を結
ぶ直線を発生させる。このようにして、任意の閉領域を
塗りつぶすものである。
Such a structure is completed as the coordinates of the pixels constituting the closed area are given. Therefore, the memory structure is completed when the coordinates of the pixels constituting the closed area have been generated. When painting the closed area, the buckets of the first coordinate storage means are sequentially examined. Then, when data indicating the second coordinate storage means is stored in this bucket, the second coordinate storage means is looked at.
Then, the cells stored in the second coordinate storage means are grouped two by two from the beginning, and a straight line connecting the pixels corresponding to the cells is generated. In this way, an arbitrary closed area is painted out.

実 施 例 第1図は、本発明の一実施例における画素塗りつぶし
装置のブロック構成図である。第1図において、101は
任意の閉領域を構成する画素の座標を発生する座標発生
装置、102は第1の座標記憶手段であり、この中には、
任意の閉領域の全てのY座標に対応するパケットがあ
る。103は第2の座標記憶手段であり、任意の閉領域を
構成する画素にそれぞれ対応するセルが存在している。
106は直線描画手段であり、第2の座標記憶手段に記憶
されたセルを初めから2つずつ組にし、このセルに対応
する座標間の直線を描画する。107はこの直線を記憶す
る画像記憶手段、108はこれらを制御するプロセッサ、1
09はこれらのブロック間のデータを受け渡すバスであ
る。
FIG. 1 is a block diagram of a pixel filling device according to an embodiment of the present invention. In FIG. 1, reference numeral 101 denotes a coordinate generation device that generates coordinates of pixels constituting an arbitrary closed area, and 102 denotes first coordinate storage means.
There is a packet corresponding to all Y coordinates in an arbitrary closed area. Reference numeral 103 denotes a second coordinate storage unit in which cells corresponding to pixels constituting an arbitrary closed area exist.
Reference numeral 106 denotes a straight line drawing unit, which draws a line between coordinates corresponding to the cells by grouping two cells stored in the second coordinate storage unit from the beginning. 107 is an image storage means for storing these straight lines, 108 is a processor for controlling them, 1
09 is a bus for transferring data between these blocks.

以下、本発明に用いられるアウトラインフォントにつ
いて若干の説明した後、上記第1図のさらに詳細な各構
成と、その動作について説明する。
Hereinafter, after a brief description of the outline font used in the present invention, more detailed configurations of FIG. 1 and the operation thereof will be described.

第12図は、本発明に用いられるアウトラインフォント
を示したものである。アウトラインフォントは、このよ
うに、外側の閉曲線と、内側の閉曲線によって、構成さ
れている。この閉曲線は、直線、円弧、スプライン曲線
などで構成されている。そして、第12図の×印で示した
ような箇所でつながっている。通常外側の閉曲線は、時
計回り、内側の閉曲線は反時計回りである。また、これ
らの閉曲線は、互いに接することはあっても、交差する
ことはない。アウトラインフォントを描画する場合は、
外側の閉曲線と、内側の閉曲線を描画する。そして、こ
の内部を塗りつぶす。このように、アウトラインフォン
トの輪郭情報は、 ・ 一筆書きである ・ 閉領域を構成する線分が、直線、円弧、スプライン
関数といった、関数で記述されている ・ 閉曲線同士は、接することはあっても交差すること
はない。
FIG. 12 shows an outline font used in the present invention. The outline font is thus composed of an outer closed curve and an inner closed curve. This closed curve is composed of a straight line, an arc, a spline curve, and the like. Then, they are connected at the points indicated by the crosses in FIG. Usually, the outer closed curve is clockwise, and the inner closed curve is counterclockwise. Also, these closed curves may touch each other but do not intersect. If you want to draw an outline font,
Draw the outer closed curve and the inner closed curve. Then, paint this inside. In this way, the outline information of the outline font is as follows: ・ It is a single stroke ・ Lines constituting the closed area are described by functions such as straight lines, arcs, and spline functions ・ Closed curves may touch each other Nor do they intersect.

という特徴を持つ。It has the characteristic.

第13図は、本発明の原理を説明したものである。第13
図(A)は前述の閉領域を示している。この閉領域は、
Y座標の範囲がY0〜Y8、X座標がX0〜X9である。このよ
うな座標の範囲を取る場合、第1図に示した第1の座標
記憶手段102は、Y0〜Y8にそれぞれ対応したバケットと
呼ばれる小領域を持つ。このバケットには、第2の座標
記憶手段103へのポインタを記憶する。また、第2の座
標記憶手段103には、閉領域を構成する画素の個数分の
セルと呼ばれる小領域が存在する。
FIG. 13 illustrates the principle of the present invention. Thirteenth
FIG. 7A shows the above-described closed region. This closed area is
Range of Y coordinate is Y 0 to Y 8, X-coordinate is X 0 to X 9. When such range from the coordinates, the first coordinate storage unit 102 shown in FIG. 1 has a small area called buckets respectively corresponding to Y 0 to Y 8. In this bucket, a pointer to the second coordinate storage means 103 is stored. Further, in the second coordinate storage means 103, there are small areas called cells corresponding to the number of pixels constituting the closed area.

第13図(A)で示した閉領域を構成する画素の座標
が、この画像塗りつぶし装置に入力されると、次のよう
なデータ構造が、第1、第2の座標記憶手段102、103の
内部に構成される。第13図(A)の、画素1301、画素13
02、画素1303、画素1304を例に取って説明する。第13図
(A)の画素1301と画素1302のY座標は共にY3である。
そこで、第13図(B)では、第1の座標記憶手段102のY
3に対応するバケットから、第2の画像記憶手段103への
ポインタが延びている。このポインタは、画素1301に対
応するセル1308を指している。画素1302のX座標多は、
画素1301のX座標より大きいので、画素1302に対応する
セル1309は、画素1301に対応するセル1308よりも右に位
置する。画素1301に対応するセル1308と、画素1302に対
応するセル1309は、お互いを左右のポインタで指示しあ
っている。また、画素1303のY座標と画素1304のY座標
も共にY4で等しい。そこで、同様に、Y4に対応するバケ
ットから、画素1303、画素1304に対応するセルへのポイ
ンタが延びている。画素1304に対応するセル1311は、画
素1303に対応するセル1310の右に位置している。また、
画素1303は画素1301の下に、画素1302は、画素1304の上
に位置する。そこで、これらの画素に対応するセルは、
これらの画素を表示した際の位置関係を反映するよう
に、お互いを指し示している。このような構造が、第13
図(A)に示した全ての画素について形成される。
When the coordinates of the pixels constituting the closed area shown in FIG. 13 (A) are input to this image filling device, the following data structure is stored in the first and second coordinate storage units 102 and 103. Configured inside. The pixel 1301 and the pixel 13 in FIG.
02, pixel 1303, and pixel 1304 will be described as an example. Y coordinate of the pixel 1301 and pixel 1302 of FIG. 13 (A) are both Y 3.
Therefore, in FIG. 13 (B), Y
From the bucket corresponding to No. 3 , a pointer to the second image storage means 103 extends. This pointer points to the cell 1308 corresponding to the pixel 1301. The X coordinate of pixel 1302 is
The cell 1309 corresponding to the pixel 1302 is located to the right of the cell 1308 corresponding to the pixel 1301, because the cell 1309 is larger than the X coordinate of the pixel 1301. A cell 1308 corresponding to the pixel 1301 and a cell 1309 corresponding to the pixel 1302 point to each other with left and right pointers. Moreover, both also Y-coordinate of the Y-coordinate and the pixel 1304 of the pixel 1303 equal Y 4. Therefore, similarly, from the bucket corresponding to Y 4, a pointer to a cell corresponding to a pixel 1303, pixel 1304 extends. The cell 1311 corresponding to the pixel 1304 is located to the right of the cell 1310 corresponding to the pixel 1303. Also,
Pixel 1303 is located below pixel 1301, and pixel 1302 is located above pixel 1304. Therefore, the cells corresponding to these pixels are:
These pixels are pointed to each other so as to reflect the positional relationship when the pixels are displayed. Such a structure is the thirteenth
It is formed for all the pixels shown in FIG.

第13図(A)の閉領域を塗りつぶす場合は、第1の画
像記憶手段102のバケットを上から順にみていく。これ
らのバケットから、第2の画像記憶手段103のセルへの
ポインタが延びている場合は、このポインタをたどる。
そして、初めから2つずつ区切って行き、それらのセル
に対応する画素の直線を発生する。このようにして、閉
領域の塗りつぶしが行われる。このように、任意の閉領
域を構成する座標が発生されるに伴って、第1、第2の
座標記憶手段102,103の内部構造を作っておけば、閉領
域を構成する座標の発生が終了した時点で、即座にこの
閉領域の塗りつぶしを開始することが可能である。
In the case of filling the closed area in FIG. 13A, the buckets of the first image storage means 102 are viewed in order from the top. When a pointer to a cell of the second image storage means 103 extends from these buckets, the pointer is followed.
Then, two lines are divided from the beginning, and a straight line of pixels corresponding to those cells is generated. In this way, the filling of the closed area is performed. As described above, if the internal structure of the first and second coordinate storage units 102 and 103 is created along with the generation of the coordinates forming an arbitrary closed region, the generation of the coordinates forming the closed region is completed. At this point, it is possible to immediately start filling the closed area.

第2図は、第1図の第1の座標記憶手段102と、第2
の座標記憶手段103を示したものである。第1の座標記
憶手段102は、描画する閉領域のY座標に対応する個数
分のバケット201と呼ばれる小領域を持つ。第2の座標
記憶手段103は、セル203と呼ばれる区画に分割されてい
る。このセル203は、閉領域を構成する画素のX座標が
与えられるに伴って、一つずつ使用されていく。使用さ
れた領域は、使用済み領域205となる。使用されていな
い領域は、自由領域206である。この領域の境を自由領
域指示手段104が指し示している。
FIG. 2 shows the first coordinate storage means 102 of FIG.
2 shows the coordinate storage means 103 of FIG. The first coordinate storage means 102 has as many small areas called buckets 201 as the number corresponding to the Y coordinate of the closed area to be drawn. The second coordinate storage means 103 is divided into sections called cells 203. The cells 203 are used one by one as the X coordinates of the pixels constituting the closed area are given. The used area becomes the used area 205. The unused area is the free area 206. The boundary of this area is indicated by the free area designating means 104.

第3図は、第2の座標記憶手段103のセルの内部を示
したものである。5つの部分に分かれており、それぞ
れ、前向きポインタ301、下向きポインタ302、X座標30
3、上向きポインタ304、後向きポインタ305である。
FIG. 3 shows the inside of a cell of the second coordinate storage means 103. It is divided into five parts, a forward pointer 301, a downward pointer 302, and an X coordinate 30, respectively.
3. Upward pointer 304 and backward pointer 305.

第4図は、第2の座標記憶手段103と、第1の座標記
憶手段102の関連を示したものである。第1の座標記憶
手段102のバケット401からは、第2の座標記憶手段103
のセルへ402のポインタがのびている。第2の座標記憶
手段103の各セル間では、前後左右のポインタが相互に
張られている。
FIG. 4 shows the relationship between the second coordinate storage means 103 and the first coordinate storage means 102. From the bucket 401 of the first coordinate storage means 102, the second coordinate storage means 103
The pointer of 402 is extended to the cell of. In each cell of the second coordinate storage means 103, front, rear, left, and right pointers are set to each other.

第5図は、第1の座標記憶手段102の内部構成を示し
たものである。第5図(A)の様に、アウトラインフォ
ントのY座標の範囲がY0からYnまでであるとする。この
場合は、第1の座標記憶手段102には、Y0からYnまでの
座標に対応するバケット501が用意される。
FIG. 5 shows the internal configuration of the first coordinate storage means 102. As in FIG. 5 (A), the range of Y coordinates of the outline font is to be from Y 0 to Yn. In this case, the first coordinate storage unit 102, a bucket 501 corresponding to the coordinates from Y 0 to Yn are provided.

第6図、第7図、第8図は、一つの閉領域を構成する
画素の座標が、この画像塗りつぶし装置に入力された場
合の第1の座標記憶手段102と、第2の座標記憶手段103
の内部構造が生成される様子を示したものである。閉領
域は601に示してある。第6図(A)は、閉領域の最初
の1画素602の座標が入力されたところを示している。
最初に、第2の座標記憶手段103のセルが1つ確保さ
れ、この画素602のX座標が書き込まれる。次に、追加
位置記憶手段105を見る。この場合は、最初の画素なの
で、追加位置記憶手段105には、何も記憶されていな
い。そして、第1の座標記憶手段102内の、この画素602
のY座標に対応するバケットを見る。この対応するバケ
ットに、いま確保した第2の座標記憶手段103のセル160
4へのポインタを記入する。追加位置記憶手段105は、新
たに追加したセルを指しているポインタが格納されてい
る場所を指し示すようにする。この場合は、第1の座標
記憶手段102のこのセルを指すバケットを指すようにす
る。
FIGS. 6, 7, and 8 show a first coordinate storage unit 102 and a second coordinate storage unit when the coordinates of the pixels constituting one closed region are input to the image filling device. 103
Shows how the internal structure is generated. The closed area is shown at 601. FIG. 6A shows a state where the coordinates of the first pixel 602 in the closed area are input.
First, one cell of the second coordinate storage means 103 is secured, and the X coordinate of this pixel 602 is written. Next, the additional position storage unit 105 is viewed. In this case, since it is the first pixel, nothing is stored in the additional position storage unit 105. Then, this pixel 602 in the first coordinate storage
Look at the bucket corresponding to the Y coordinate of. In the corresponding bucket, the cell 160 of the second coordinate storage means 103 that has been secured is stored.
Fill in the pointer to 4. The additional position storage unit 105 points to the location where the pointer pointing to the newly added cell is stored. In this case, the bucket pointing to this cell in the first coordinate storage means 102 is pointed.

第6図(B)は、閉領域を構成する2つめの画素606
の座標が画像塗りつぶし装置に入力されたところを示し
ている。同様に、第2の記憶手段103のセルが1つ確保
される。このセル1607には、このセル1607に対応する画
素606のX座標が記入される。次に、追加位置記憶手段1
05をみる。現在、追加位置記憶手段105は、第1の座標
記憶手段102を指している。そして、このバケットに対
応するY座標のは、今回追加するセル1607に対応する画
素のY座標よりも小さい。そこで、追加位置記憶手段10
5の指すバケットの一つ上のバケットを見る。ここに
は、まだ何も記録されていないので、このバケットか
ら、新たに追したセル1607へのポインタが張られる。最
後に、第2の座標記憶手段103内の2つのセル同士でポ
インタが張られる。即ち、最初のセル1604の上向ポイン
タは、2番目のセル1607のアドレスを指し、2番目のセ
ル1607の下向きポインタは、最初のセル1604のアドレス
を指す。また、追加位置記憶手段105は、新しいセルを
指すバケットを指す。
FIG. 6B shows the second pixel 606 constituting the closed area.
Indicate that the coordinates of have been input to the image filling device. Similarly, one cell of the second storage means 103 is secured. In this cell 1607, the X coordinate of the pixel 606 corresponding to this cell 1607 is written. Next, additional position storage means 1
Look at 05. At present, the additional position storage means 105 points to the first coordinate storage means 102. Then, the Y coordinate corresponding to this bucket is smaller than the Y coordinate of the pixel corresponding to the cell 1607 to be added this time. Therefore, the additional position storage means 10
Look at the bucket one above the bucket pointed by 5. Since nothing has been recorded here, a pointer to the newly added cell 1607 is set from this bucket. Finally, a pointer is set between the two cells in the second coordinate storage means 103. That is, the upward pointer of the first cell 1604 points to the address of the second cell 1607, and the downward pointer of the second cell 1607 points to the address of the first cell 1604. Further, the additional position storage unit 105 indicates a bucket indicating a new cell.

第6図(C)は、更に2つの画素611の座標が与えら
れたところを示している。新たに2つのセル1612が、第
1の座標記憶手段102から割り当てられている。これら
のセルの間には、上下のポインタが張られている。ま
た、追加位置記憶手段は、最後に追加したセルを指すバ
ケットを指している。
FIG. 6C shows a state where the coordinates of two more pixels 611 are given. Two new cells 1612 have been allocated from the first coordinate storage means 102. Up and down pointers are provided between these cells. Further, the additional position storage means points to a bucket indicating the last added cell.

第7図は、与えられた画素が前の画素の横方向のもの
である場合を示している。この画素703のY座標は、追
加位置記憶手段105の指すバケットのY座標と同じであ
る。そこで、このバケットが指し示すセル701のX座標
と、新しいセル702のX座標を比較する。この例では、
新しいセル702のX座標の方が大きい。そこで、この新
しいセル702は、セル701の右側につながれる。そして、
セル701とセル702の間に左右のポインタが張られる。即
ち、セル701右向きポインタはセル702を指し、セル702
の左向きポインタはセル701を指す。追加位置記憶手段1
05は、セル701を指す。
FIG. 7 shows a case where a given pixel is in the horizontal direction of the previous pixel. The Y coordinate of the pixel 703 is the same as the bucket Y coordinate indicated by the additional position storage unit 105. Therefore, the X coordinate of the cell 701 indicated by the bucket and the X coordinate of the new cell 702 are compared. In this example,
The X coordinate of the new cell 702 is larger. Thus, this new cell 702 is connected to the right side of cell 701. And
Left and right pointers are set between the cells 701 and 702. That is, the right pointer of the cell 701 points to the cell 702, and the cell 702
Indicates the cell 701. Additional position storage means 1
05 indicates the cell 701.

第8図は、一つの閉領域801を構成する画素の座標が
すべて与えられたところを示している。このように、各
セルの上下左右を指すポインタは、それぞれの対応する
画素の位置関係に合わせて、上下左右に位置するセルを
指す。
FIG. 8 shows a state in which all the coordinates of the pixels constituting one closed area 801 are given. As described above, the pointers pointing up, down, left, and right of each cell indicate the cells located at the top, bottom, left, and right in accordance with the positional relationship of the corresponding pixels.

第9図は、1つの閉領域901を構成する画素の座標が
与えられた後、その内部に存在する他の閉領域902の画
素の座標が与えられた場合を示している。この場合も最
初に、第2の座標記憶手段103の1つのセル904を確保す
る。このセルに904は、いま与えられた画素903のX座標
が書き込まれる。次に、追加位置記憶手段105の指すセ
ルまたはバケットを見る。このセルまたはバケットのY
座標が、新しく発生したセル904のY座標と等しい場合
は、新しいセル904は追加位置記憶手段105の指すセルの
左右方向のどこかに追加すればよい。そこで、この左右
方向のセルのX座標を検査し、新しいセル904のX座標
が昇順の位置となる場所に新しいセルを追加する。この
場合は、第9図のようにポインタ905を一旦切り、新し
いポインタ906をつなぐ。
FIG. 9 shows a case where the coordinates of the pixels forming one closed area 901 are given, and then the coordinates of the pixels of another closed area 902 present inside the closed area 901 are given. Also in this case, first, one cell 904 of the second coordinate storage means 103 is secured. In this cell 904, the X coordinate of the pixel 903 just given is written. Next, the cell or bucket pointed to by the additional position storage means 105 is viewed. Y of this cell or bucket
When the coordinates are equal to the Y coordinate of the newly generated cell 904, the new cell 904 may be added somewhere in the left-right direction of the cell indicated by the additional position storage unit 105. Therefore, the X-coordinate of the cell in the left-right direction is inspected, and a new cell is added at a position where the X-coordinate of the new cell 904 is in ascending position. In this case, the pointer 905 is once cut off and a new pointer 906 is connected as shown in FIG.

また、追加位置記憶手段105の指すセルまたはバケッ
トのY座標と、新しい画素903のY座標が異なる場合
は、追加位置記憶手段105は見ない。この場合、第1の
座標記憶手段102の新しい画素903のY座標に対応するバ
ケットから、新しいセル904を追加する位置を求める。
If the Y coordinate of the cell or bucket indicated by the additional position storage means 105 is different from the Y coordinate of the new pixel 903, the additional position storage means 105 is not viewed. In this case, the position where the new cell 904 is added is obtained from the bucket corresponding to the Y coordinate of the new pixel 903 in the first coordinate storage means 102.

このようにして、一つの閉領域901の内部に存在する
他の閉領域903の画素の座標が次々と与えられるに従っ
て、それぞれの画素に対応するセルが、第2の画像記憶
手段103に作られていく。このようにして、第10図の様
な第1の座標記憶手段102、第2の座標記憶手段103の構
造が形成される。
In this way, as the coordinates of the pixels of another closed area 903 existing inside one closed area 901 are successively given, cells corresponding to the respective pixels are created in the second image storage means 103. To go. In this way, the structure of the first coordinate storage means 102 and the second coordinate storage means 103 as shown in FIG. 10 is formed.

このようにして第1、第2の座標記憶手段102,103の
構成が決定すれば、内部の塗りつぶしは容易である。即
ち、Y座標を小さい方から順に増加させていく。このY
座標に対応する第1の座標記憶手段102のバケットを見
る。バケットに第2の座標記憶手段103へのポインタが
記述されている場合は、それを見る。そして、1番目と
2番目、3番目と4番目というように、2つずつセルを
組にする。その後、これら2つのセルに対応する画素を
結ぶ直線を描画すれば、閉領域の塗りつぶしは完成す
る。
If the configuration of the first and second coordinate storage means 102 and 103 is determined in this way, the interior can be easily painted. That is, the Y coordinate is increased in ascending order. This Y
Look at the bucket in the first coordinate storage means 102 corresponding to the coordinates. If a pointer to the second coordinate storage means 103 is described in the bucket, it is checked. Then, two cells are grouped, such as the first and second cells, the third and fourth cells, and so on. Thereafter, by drawing a straight line connecting the pixels corresponding to these two cells, the filling of the closed area is completed.

以上のような、画像の塗りつぶしでは、次のような問
題が発生する。すなわち、この方式では、同じY座標を
持つX座標を先頭から2つずつ組にしてそのあいだを塗
りつぶす。この結果、第11図(A)の様に、1画素1102
だけ飛び出している図形の場合は、この画素に対応する
セルの隣に、別のセルが存在しないため、不具合が発生
する。また、第11図(B)、第11図(C)の様に、水平
方向に、奇数個の画素がある場合も問題となる。これに
対し、第1の問題、即ち図11(A)に関しては、例えば
同一X座標をもつセルを2つ記憶する方法や、セルが2
つない場合は直線を描画しない方法や、点描を直線描画
の一つとして処理することにより対応可能である。
The following problems occur in filling the image as described above. That is, in this method, two sets of X coordinates having the same Y coordinate are set from the beginning, and the area between them is painted. As a result, as shown in FIG.
In the case of a graphic that only protrudes, a problem occurs because another cell does not exist next to the cell corresponding to this pixel. Also, there is a problem when there are an odd number of pixels in the horizontal direction as shown in FIGS. 11 (B) and 11 (C). On the other hand, regarding the first problem, that is, FIG. 11A, for example, a method of storing two cells having the same X coordinate,
In the case of connection, it is possible to cope by a method of not drawing a straight line or by processing pointillism as one of the straight line drawing.

また、第2の問題、即ち図11(B)に対しては、前の
画素と次の画素と現在と画素との第1の座標値が等しい
場合に現在の画素に対応する第2の座標値を記憶するこ
となく現在の画素と次の画素の第1の座標値が異なる場
合のみ現在の画素対し第2の座標値を記憶することによ
り、斜線で示した画素に対応するセルは追加されず、本
方式により塗りつぶし処理が可能となる。
For the second problem, ie, FIG. 11B, when the first coordinate values of the previous pixel, the next pixel, the current pixel, and the current pixel are equal, the second coordinate corresponding to the current pixel is obtained. By storing the second coordinate value for the current pixel only when the first coordinate value of the current pixel is different from the first coordinate value of the next pixel without storing the value, a cell corresponding to the pixel indicated by oblique lines is added. Instead, this method enables the filling process.

このように、本装置では、輪郭を構成する画素の座標
生成が終わると同時に、塗りつぶしを開始することが可
能であり、その効果は大きい。
As described above, in the present apparatus, the filling can be started at the same time as the generation of the coordinates of the pixels constituting the contour, and the effect is large.

なお、本実施例では、新しいセルを追加するとき、追
加位置記憶手段105を最初にみた。このようにすること
により、新しいセルの追加位置を早く知ることが可能で
ある。
In this embodiment, when a new cell is added, the additional position storage unit 105 is first viewed. By doing so, it is possible to quickly know the position where a new cell is added.

しかし、新しいセルを追加する都度、第1の座標記憶
手段102を参照する。そして、新しいセルのY座標に対
応するバケットから、第2の座標記憶手段103をたぐ
る。そして、最後に、第2の座標記憶手段103内の新し
いセルを追加する位置を知る。このようにすれば、追加
位置記憶手段105は必要としない。このようにしても、
閉領域を構成する画素の座標を発生し終ったときすぐ
に、塗りつぶしを開始することが可能である。
However, each time a new cell is added, the first coordinate storage means 102 is referred to. Then, the second coordinate storage unit 103 is traversed from the bucket corresponding to the Y coordinate of the new cell. Finally, the position at which a new cell is added in the second coordinate storage means 103 is known. With this configuration, the additional position storage unit 105 is not required. Even if you do this,
As soon as the generation of the coordinates of the pixels constituting the closed area is completed, the filling can be started.

発明の効果 本発明は以上のように、閉領域を構成する座標が与え
られる度に、この閉領域を塗りつぶすためのデータ構造
を作成し、この結果、閉領域を構成する座標がすべて与
えられるのと同時に塗りつぶしの実行を実施するため、
閉領域の塗りつぶしをより高速に実行することができ
る。
Effect of the Invention As described above, the present invention creates a data structure for filling the closed area every time the coordinates constituting the closed area are given, and as a result, all the coordinates constituting the closed area are given. At the same time, to execute the fill,
The filling of the closed area can be executed faster.

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

第1図は本発明の一実施例における画像塗りつぶし装置
のブロック結線図、第2図〜第11図、及び第13図は同装
置の要部である第1、第2の座標記憶手段の記憶状態を
示す概念図、第12図は同装置で用いるアウトラインフォ
ントを示す図、第14図は従来の画像塗りつぶし装置のブ
ロック結線図、第15図は同画像塗りつぶし装置の動作を
示す概念図である。 101……座標発生手段、102……第1の座標記憶手段、10
3……第2の座標記憶手段、104……自由領域指示手段、
105……追加位置記憶手段、106……直線描画手段、107
……画像記憶手段、108……プロセッサ、109……バス。
FIG. 1 is a block diagram of an image filling device according to an embodiment of the present invention, and FIGS. 2 to 11 and FIG. 13 show storage of first and second coordinate storage means which are main parts of the device. FIG. 12 is a conceptual diagram showing a state, FIG. 12 is a diagram showing an outline font used in the device, FIG. 14 is a block diagram of a conventional image filling device, and FIG. 15 is a conceptual diagram showing an operation of the image filling device. . 101 coordinate generating means, 102 first coordinate storing means, 10
3 ... second coordinate storage means, 104 ... free area designating means,
105 additional storage means 106 linear drawing means 107
... Image storage means, 108, processor, 109, bus.

───────────────────────────────────────────────────── フロントページの続き (72)発明者 上杉 明夫 大阪府門真市大字門真1006番地 松下電 器産業株式会社内 (72)発明者 川上 桂 大阪府門真市大字門真1006番地 松下電 器産業株式会社内 (56)参考文献 特開 昭62−115580(JP,A) ──────────────────────────────────────────────────続 き Continuing on the front page (72) Inventor Akio Uesugi 1006 Kadoma Kadoma, Osaka Prefecture Inside Matsushita Electric Industrial Co., Ltd. (56) References JP-A-62-115580 (JP, A)

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】閉領域を構成する画素の2次元座標を生成
する座標発生手段と、 前記座標発生手段が発生した画素の第1の座標値を記憶
する第1の座標記憶手段と、 前記第1の座標値毎に画素の第2の座標値を昇順に記憶
する第2の座標記憶手段と、 前記第2の座標記憶手段に記憶された第2の座標値に従
い直線を描画する直線描画手段と、 前記直線描画手段が描画した直線を記憶する画像記憶手
段とを備え、 前記第2の記憶手段に第2の座標値を昇順に記憶する
際、前の画素と次の画素と現在の画素との第1の座標値
が等しい場合に現在の画素に対応する第2の座標値を記
憶することなく現在の画素と次の画素の第1の座標値が
異なる場合のみ現在の画素対し第2の座標値を記憶し、 前記直線描画手段が、第1の座標値毎に昇順に記憶され
た第2の座標値から昇順に第2の座標値を2つづつ選択
し、選択された2点を結ぶ線分を描画することを特徴と
する画像塗りつぶし装置。
1. A coordinate generating means for generating two-dimensional coordinates of a pixel forming a closed area; a first coordinate storing means for storing a first coordinate value of a pixel generated by the coordinate generating means; Second coordinate storage means for storing a second coordinate value of a pixel in ascending order for each one coordinate value, and straight line drawing means for drawing a straight line according to the second coordinate value stored in the second coordinate storage means And an image storage means for storing a straight line drawn by the straight line drawing means. When the second coordinate value is stored in the second storage means in ascending order, a previous pixel, a next pixel, and a current pixel are stored. When the first coordinate value of the current pixel is equal to the second pixel of the current pixel, the second coordinate value corresponding to the current pixel is not stored and only when the first coordinate value of the current pixel is different from that of the next pixel. Are stored in ascending order for each first coordinate value. And the second coordinate values from the second coordinate values in ascending order 2 by one selected image fills apparatus characterized by drawing a line connecting the two points that have been selected.
JP30736588A 1988-12-05 1988-12-05 Image filling device Expired - Lifetime JP2715496B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP30736588A JP2715496B2 (en) 1988-12-05 1988-12-05 Image filling device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP30736588A JP2715496B2 (en) 1988-12-05 1988-12-05 Image filling device

Publications (2)

Publication Number Publication Date
JPH02153484A JPH02153484A (en) 1990-06-13
JP2715496B2 true JP2715496B2 (en) 1998-02-18

Family

ID=17968201

Family Applications (1)

Application Number Title Priority Date Filing Date
JP30736588A Expired - Lifetime JP2715496B2 (en) 1988-12-05 1988-12-05 Image filling device

Country Status (1)

Country Link
JP (1) JP2715496B2 (en)

Also Published As

Publication number Publication date
JPH02153484A (en) 1990-06-13

Similar Documents

Publication Publication Date Title
JPS60239796A (en) Circuit and apparatus for altering data in display memory
WO1996031844A1 (en) Graphics system
JP3089792B2 (en) Hidden surface discrimination method for image data
US4748442A (en) Visual displaying
JP2715496B2 (en) Image filling device
JPH07111618B2 (en) Scroll screen display method and device
JPH07118024B2 (en) Pattern data generation method
US6476818B1 (en) Storage circuit control device and graphic computation device
JP2610825B2 (en) Graphic processing unit
JPH0544063B2 (en)
JPH0588838A (en) Multi window display device
JP2675169B2 (en) Graphic processing system
JPS6315288A (en) 3-d graphic display unit
JP3312560B2 (en) Texture mapping device
JPS5871409A (en) Method and device for displaying running position of vehicle
JPS6315617B2 (en)
JP2729437B2 (en) Ellipse drawing device
JPS63240682A (en) Clipping processing system for graphic display
JPS61159688A (en) 3-d cursor display circuit for crt display unit
JPH02127785A (en) Picture display device
JPH09134441A (en) Device for approximating curve with straight line
JP2940294B2 (en) Drafting equipment
JP3024178B2 (en) Polygon fill device for image processing device
EP0293698A2 (en) Graphic controller having function of painting designated area
JPH0644385A (en) Z buffer control circuit