JPH04684A - Graphic painting-out method - Google Patents

Graphic painting-out method

Info

Publication number
JPH04684A
JPH04684A JP2102249A JP10224990A JPH04684A JP H04684 A JPH04684 A JP H04684A JP 2102249 A JP2102249 A JP 2102249A JP 10224990 A JP10224990 A JP 10224990A JP H04684 A JPH04684 A JP H04684A
Authority
JP
Japan
Prior art keywords
pixel
information
contour
image memory
painting
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.)
Pending
Application number
JP2102249A
Other languages
Japanese (ja)
Inventor
Kazunari Fukaya
和成 深谷
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.)
Yamaha Corp
Original Assignee
Yamaha Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yamaha Corp filed Critical Yamaha Corp
Priority to JP2102249A priority Critical patent/JPH04684A/en
Publication of JPH04684A publication Critical patent/JPH04684A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Generation (AREA)
  • Controls And Circuits For Display Device (AREA)
  • Dot-Matrix Printers And Others (AREA)

Abstract

PURPOSE:To attain various different painting-out by writing the directional information of a pixel in a picture memory corresponding to the incremental direction of the axis of ordinates of the pixel and the incremental direction of the axis of ordinates of the pixel one before it. CONSTITUTION:A CPU 1 clears the whole of a picture memory 5 prior to painting-out. Then, the increments DELTAXa1 and DELTAYa1 (i=1 to n) of respective pixels are determined successively by reading respective outline vectors to represent the contour of a character for which painting-out processing is executed, for instance coordinates (Xa1,Ya1) to the coordinates (Xan,Yan), from a character font memory 4 and interpolating between the respective coordinates with straight line generation. Then, contour lines OLa1, OLa2-OLan are found according to the increment DELTAXa1 and DELTAYa1. Then, contour information and directional information are found on pixels in the whole contour lines. When the stored information is scanned in a horizontal direction and the painting-out is executed, the various different painting-out can be executed by changing judging conditions for the painting-out.

Description

【発明の詳細な説明】 「産業上の利用分野」 この発明は、特に、高品位の文字や図形の表示、プリン
トアウトなどを行うシステムに用いて好適な図形塗り潰
し方法に関する。
DETAILED DESCRIPTION OF THE INVENTION "Field of Industrial Application" The present invention particularly relates to a figure filling method suitable for use in a system that displays and prints out high-quality characters and figures.

「従来の技術」 一般に、高品位の文字を取り扱うシステムにおいて、該
文字は、その字体を表す輪郭線から形成されている。こ
の輪郭線は複数の線分によって近似されており、実際に
は、これら複数の線分の始点座標をデータとするアウト
ラインベクタのみが記憶されている。そして、印刷や表
示の際には上記アウトラインベクタに基づいて、該文字
の輪郭線を生成し、該輪郭線により囲まれた閉領域内を
塗り潰すことで文字を形成する。この閉領域内を塗り潰
す処理は、例えば、次のように行われていた。
"Prior Art" Generally, in systems that handle high-quality characters, the characters are formed from outlines representing their fonts. This contour line is approximated by a plurality of line segments, and in reality, only outline vectors whose data are the starting point coordinates of these line segments are stored. When printing or displaying, a character is formed by generating an outline of the character based on the outline vector and filling in a closed area surrounded by the outline. For example, the process of filling out the inside of this closed area is performed as follows.

■まず、アウトラインベクタに基づいて輪郭線を生成し
、この輪郭線に相当するピクセル(画素)単位のドツト
情報に変換する。この場合、輪郭線を形成する1ビツト
のピクセルをrlJにする。
(1) First, a contour line is generated based on the outline vector, and is converted into dot information in units of pixels (pixels) corresponding to this contour line. In this case, the 1-bit pixel forming the outline is set to rlJ.

■次に、文字を水平方向あるいは垂直方向に走査する。■Next, scan the characters horizontally or vertically.

そして、この走査の際に上記ドツト情報がrlJのピク
セルの数をカウントし、カウント値が奇数の範囲にある
ピクセルを「1」にする。この結果、輪郭線と輪郭線と
に挟まれたピクセルが塗り潰されたことになる。
Then, during this scanning, the number of pixels whose dot information is rlJ is counted, and pixels whose count value is in an odd number range are set to "1". As a result, the pixels between the contour lines are filled in.

「発明が解決しようとする課題」 ところで、近年、文字などを取り扱う情報処理装置にお
いては、例えば文字では、ゴチック体、明朝体など多種
類の字体選択や自在な文字サイズの選択なとか要望され
ている。例えば、文字サイズに関しては、従来より、1
種類の輪郭情報を拡大したり、あるいは縮小したりして
、所望する文字サイズの輪郭情報に変換する。この拡大
、縮小の処理を行う際に輪郭線か第8図に示すように線
分A−Bと線分C−Dか重複したりする場合か生しる。
``Problems to be Solved by the Invention'' Incidentally, in recent years, in information processing devices that handle characters, for example, there has been a demand for the selection of many types of fonts such as Gothic and Mincho fonts, and the ability to freely select font sizes. ing. For example, regarding font size, conventionally 1
The type of outline information is enlarged or reduced to convert it into outline information of a desired character size. When performing this enlargement/reduction process, there may be cases where the line segment A-B and the line segment CD overlap as shown in FIG. 8.

上述した従来の塗り潰し方法では、ピクセルが1ビツト
であるため、複数の輪郭線が交差したり、重複したりす
ると、2回輪郭線が通過しても、1回しか通過しなかっ
たように扱われ、第7図に示す点P、から点P、の間か
塗り潰されるという問題を生じる。
In the conventional filling method described above, each pixel is 1 bit, so if multiple contour lines intersect or overlap, even if the contour line passes twice, it is treated as if it had only passed once. This causes a problem in that the area between points P and P shown in FIG. 7 is filled out.

この発明は、上述した問題に鑑みてなされたもので、同
一方向、反対方向の複数の線分が交差あるいは重複して
も正確に塗り潰すことができ、また、輪郭線だけを容易
に抽出でき、種々の異なった塗り潰し効果を得ることが
できる図形塗り潰し方法を提供することを目的とする。
This invention was made in view of the above-mentioned problems, and it is possible to accurately fill in even when multiple line segments in the same direction and opposite directions intersect or overlap, and it is also possible to easily extract only the outline. , it is an object of the present invention to provide a figure filling method that can obtain various different filling effects.

「課題を解決するための手段」 上述した問題を解決するために、請求項1記載の発明で
は線分を表すベクトルデータをビクセルデータに変換し
て画像メモリに書き込み、該ピクセルデータによって囲
まれる前記画像メモリの内部を塗り潰す図形塗り潰し方
法において、前記ベクトルデータをピクセルデータに変
換して画像メモリに書き込む際に、前記ベクトルデータ
を展開して得られる輪郭情報をビクセル単位で前記画像
メモリに書き込むとともに、前記ピクセルの複数ビット
からなる方向情報を、該ピクセルの縦軸の増分方向と少
なくとも1つ前のピクセルの縦軸の増分方向とに応じて
、所定の補正値を加減算した後に前記画像メモリに書き
込み、また、既に前記輪郭情報が書き込まれているピク
セルに重畳して書き込みを行う場合は、既に書き込まれ
ている方向情報に前記所定の補正値を加減算した後に前
記画像メモリに書き込み、次に、前記画像メモリを走査
する際に、各ピクセルの前記方向情報を順次加算し、各
ビクセル毎に前記加算結果を所定の判断条件と比較し、
該判断条件を満足するピクセルを塗り潰すことを特徴と
する 請求項2記載の発明では、前記判断条件は複数用きされ
るとともに、塗り潰しに際して前記複数の判断条件のう
ちいずれか1つが前記所定の判断条件として選択される
ことを特徴とする。
"Means for Solving the Problem" In order to solve the above-mentioned problem, the invention according to claim 1 converts vector data representing a line segment into pixel data and writes it into an image memory. In a figure filling method for filling the inside of an image memory, when converting the vector data into pixel data and writing it to the image memory, contour information obtained by developing the vector data is written to the image memory in pixel units, and , the direction information consisting of a plurality of bits of the pixel is stored in the image memory after adding or subtracting a predetermined correction value according to the increment direction of the vertical axis of the pixel and the increment direction of the vertical axis of at least one previous pixel. When writing, or when writing superimposed on a pixel on which the contour information has already been written, the predetermined correction value is added or subtracted from the direction information that has already been written, and then written to the image memory, and then, When scanning the image memory, sequentially adding the direction information of each pixel and comparing the addition result with a predetermined judgment condition for each pixel,
In the invention according to claim 2, wherein the pixels satisfying the judgment condition are filled in, a plurality of the judgment conditions are used, and when filling, any one of the plurality of judgment conditions is set to the predetermined condition. It is characterized by being selected as a judgment condition.

−作用 」 ベクトルデータをピクセルデータに変換して画像メモリ
に書き込む際に、輪郭に該当するピクセルに輪郭情報を
書き込むとともに、上記ピクセルの方向を表す複数ビッ
トからなる方向情報を、該ピクセルの縦軸の増分方向と
少なくとも1つ前のピクセルの縦軸の増分方向とに応じ
て、所定の補正値を加減算した後に上記画像メモリに書
き込み、また、既に輪郭情報が書き込まれているピクセ
ルに重畳して書き込みを行う場合は、既に書き込まれて
いる方向情報に上記所定の補正値を加減算した後に上記
画像メモリに書き込み、次に、画像メモリを走査する際
に、各ピクセルの方向情報を順次加算し、各ピクセル毎
に加算結果を所定の判断条件と比較し、該判断条件を満
足するピクセルを塗り潰す。
- Effect' When converting vector data into pixel data and writing it into the image memory, contour information is written to the pixel corresponding to the contour, and direction information consisting of multiple bits representing the direction of the pixel is written to the vertical axis of the pixel. After adding and subtracting a predetermined correction value according to the increment direction of , and the increment direction of the vertical axis of at least one previous pixel, the image is written to the image memory, and the contour information is superimposed on the pixel on which contour information has already been written. When writing, the predetermined correction value is added or subtracted from the already written direction information, and then written to the image memory, and then, when scanning the image memory, the direction information of each pixel is sequentially added, The addition result for each pixel is compared with a predetermined judgment condition, and pixels that satisfy the judgment condition are painted out.

7実施例」 次に図面を参照してこの発明の実施例について説明する
7 Embodiments Next, embodiments of the present invention will be described with reference to the drawings.

第1図はこの発明の一実施例による塗り潰し方法を適用
したシステムの構成を示すブロック図である。この図に
おいて、lはCPU (中央処理装置)であり、ROM
2に記憶されたプログラムを実行し、その際に生じた各
種データなどをRAM3に記憶する。4は文字フォント
メモリであり、各文字(漢字、かな、アルファベット等
)の輪郭線がアウトラインベクタによって記憶されてい
る。
FIG. 1 is a block diagram showing the configuration of a system to which a filling method according to an embodiment of the present invention is applied. In this figure, l is the CPU (Central Processing Unit) and ROM
The program stored in 2 is executed, and various data generated at that time are stored in RAM 3. 4 is a character font memory in which the outline of each character (kanji, kana, alphabet, etc.) is stored as an outline vector.

具体的には、第2図に示すrPJの字であれば、図に示
す点の座標(X □、Y−+) 、 (X’−t、Y 
−t) −・・・・・(X 、、、Y 、、、)および
(Xb、、Yb、) 、 (Xb。
Specifically, for the character rPJ shown in Figure 2, the coordinates of the points shown in the figure are (X □, Y-+), (X'-t, Y
-t) -...(X,,,Y,,,) and (Xb,,Yb,), (Xb.

yl、t)、・・・・・(X bn、 Y b−)がア
ウトラインベクタとして記憶されている。5は画像メモ
リであり、上記アウトラインベクタを変換した後述する
ビクセルデータが記憶される。5は画像メモリであり、
CRT6の1画面分あるいはプリンタ7のプリントアウ
トの印字用紙1ページの全ビクセル数に対応している。
yl, t), ... (X bn, Y b-) are stored as outline vectors. Reference numeral 5 denotes an image memory, which stores pixel data, which will be described later, obtained by converting the outline vector. 5 is an image memory;
This corresponds to the total number of pixels of one screen of the CRT 6 or one page of printout paper of the printer 7.

すなわち、画像メモリ5に書き込まれに画像情報は、そ
のままCRT6に表示されるか、あるいはプリンタ7に
よりプリントアウトされる。
That is, the image information written in the image memory 5 is displayed as is on the CRT 6 or printed out by the printer 7.

上述した構成において、上g2cPU1は、文字の表示
あるいはプリントアウトの指示を受けると、所定の文字
データをRAM3に書込み、該文字データに対応する文
字フォントを順次文字フォントメモリ4から読出す。そ
して、アウトラインベクタを補間することによって滑ら
かな輪郭線とする。
In the above-described configuration, upon receiving an instruction to display or print out characters, the upper g2cPU 1 writes predetermined character data into the RAM 3 and sequentially reads character fonts corresponding to the character data from the character font memory 4. Then, by interpolating the outline vector, a smooth outline is obtained.

この輪郭線は文字を表示するための最小単位である前述
したピクセルデータに変換される。
This outline is converted into the aforementioned pixel data, which is the minimum unit for displaying characters.

次に、上述したピクセルデータの構造について、第3図
(a)、(b)に示すデータ構造の概念図を参照して説
明する。第3図(8L)において、lビクセルのデータ
は、4ビツトからなり、下位のビット0〜2の計3ビッ
トに方向情報が記憶され、ビット3の1ビツトに輪郭情
報が記憶される。上記方向情報とは、ビット2をサイン
ヒツトとし、1つ前のピクセルに対する該ピクセルのy
方向(縦方向)の増減を表す情報てあり、第3図(b)
に示すように−4〜+3の値をとる。なお、初期状態は
roooJとする。また、上記輪郭情報は、そのピクセ
ルか輪郭線(近似値)に該当する場合のみrlJの値を
とる。
Next, the structure of the above-mentioned pixel data will be explained with reference to the conceptual diagrams of the data structure shown in FIGS. 3(a) and 3(b). In FIG. 3 (8L), 1 pixel data consists of 4 bits, direction information is stored in a total of 3 bits (lower bits 0 to 2), and contour information is stored in 1 bit (bit 3). The above direction information is the y of this pixel with respect to the previous pixel, with bit 2 as the sign hit.
There is information indicating the increase/decrease in the direction (vertical direction), as shown in Figure 3(b)
It takes a value of -4 to +3 as shown in . Note that the initial state is roooJ. Further, the contour information takes the value rlJ only when the pixel corresponds to the contour line (approximate value).

次に、この実施例の塗り潰し手順について、第4図〜第
6図を参照して説明する。第4図は同実施例における方
向情報の更新処理に用いる更新規則図、第5図(2L)
〜(1)はさまざまな状況におけるアウトラインベクタ
の組合せおよびその組合せにより得られる方向情報を示
す概念図、第6図は同実施例における方向情報の更新処
理の特別な場合に用いる更新規則図である。
Next, the filling procedure of this embodiment will be explained with reference to FIGS. 4 to 6. FIG. 4 is an update rule diagram used for direction information update processing in the same embodiment, and FIG. 5 (2L)
~(1) is a conceptual diagram showing combinations of outline vectors in various situations and direction information obtained by the combinations, and FIG. 6 is an update rule diagram used in special cases of direction information update processing in the same embodiment. .

まず、CPUIは、塗り潰しに先立って画像メモリ5の
全てをクリアする。次に、塗り潰し処理を行う文字の輪
郭を表す各アウトラインベクタ、例えば第2図に示す座
標(X□、Y□)〜座標(Xan、Yan)を文字フォ
ントメモリ4から読出して、これらフォントデータに対
して、直線発生により各々の座標間を補間することによ
って、各ピクセルの増分ΔX□、Δy□(i = I 
−n )を順次確定する。そして、上記増分ΔX a 
l + Δyalに従って図示の輪郭線OL 、、、O
L 、、、−−−OL anを求め、該輪郭線に対応す
る画像メモリ5のピクセルに対して輪郭情報を表すヒツ
ト3をrlJにセットするとともに、同ピクセルの方向
情報を表すビット0〜2を更新する。
First, the CPUI clears everything in the image memory 5 prior to filling. Next, each outline vector representing the outline of the character to be filled out, for example, the coordinates (X□, Y□) to coordinates (Xan, Yan) shown in FIG. 2, is read from the character font memory 4 and converted into these font data. On the other hand, by interpolating between each coordinate by straight line generation, the increments ΔX□, Δy□ (i = I
-n) are determined sequentially. Then, the above increment ΔX a
The illustrated contour line OL , , O according to l + Δyal
L, ,, ---OL an is determined, and the bit 3 representing contour information is set in rlJ for the pixel of the image memory 5 corresponding to the contour line, and the bits 0 to 2 representing the direction information of the same pixel are set. Update.

次に、上述した方向情報の更新は次のように行う。まず
、更新するピクセルのIっ前のピクセルに対するy軸方
向の増分ΔyをΔynsw、上記1つ前のピクセルの更
に1つ府のピクセルに対するy軸方向の増分ΔyをΔy
0.6とする。次に、第4図に示す更新規則R1にII
Jす、例えば、Δ3’a+6が「負」で、かっΔy n
ewが「負Jならば、更新しようとするピクセルの方向
情報から「1」を減算する。これは、例えば、第5図(
d)、(h)の場合に相当する。また、他の例として、
Δyor4が「正Jで、かっΔy、、0wが「負」なら
ば、更新しようとするピクセルの方向情報はそのままに
する(例えば、第5図(e)を参照)。また、Δyol
dか「負」て、かつΔ3’n−,が「正」ならば、更新
しようとするピクセルの方向情報はそのままにしく第5
図(f)参照)、Δyoldか「正」で、かっΔY n
−が「正」ならば、更新するピクセルの方向情報にrl
Jを加算する(第5図(c)(g)参照)。
Next, the above-mentioned direction information is updated as follows. First, the increment Δy in the y-axis direction for the pixel immediately before the pixel to be updated is Δynsw, and the increment Δy in the y-axis direction for the pixel one position before the pixel to be updated is Δy.
It is set to 0.6. Next, in the update rule R1 shown in FIG.
For example, Δ3'a+6 is "negative" and Δy n
If ew is "negative J,""1" is subtracted from the direction information of the pixel to be updated. This can be seen, for example, in Figure 5 (
This corresponds to cases d) and (h). Also, as another example,
If Δyor4 is "positive J" and Δy, . Also, Δyol
If d is "negative" and Δ3'n-, is "positive", the direction information of the pixel to be updated should be left as is.
(see figure (f)), Δyold is “positive”, and ΔY n
- is "positive", rl is added to the direction information of the pixel to be updated.
Add J (see Figure 5(c) and (g)).

また1 Δ3/ ora力ゞ「0」で、力1つ、Δy 
nsw力く「正」または「負」の場合には、第6図に示
す更新規[1jR2に則って行う。 すなわち、Δy、
、ldが「0」の場合には、「0」でない最近のΔy(
Δy”)をΔyoraに置き換えた後、第4図に示す更
新規則R1に従って更新する。例えば、Δynewが正
で、かつ、最近のΔy゛が負の場合には、まず、該Δy
′をΔy0.6に置き換える。次に、更新規則R1に従
って、Δ’j oldが負で、かつ、Δ3’ n−が正
であるため、更新値を「0」とする(第5図(k)参照
)。また、Δ3’newが正で、かつ、最近のΔy°が
正の場合には、該Δy°をΔ3’ oldに置き換えて
、更新規則R1に従って、Δy0□6か正で、かつ、Δ
y7.1が正であるたぬ、更新値は:l」とする(第5
図(1)参照)。以下、同様にして、671.wか負で
、かつ、Δy゛が正の場合には、更新値は「0」としく
第5図(1)参照)、ΔY n−が負で、かつ、Δy゛
が負の場合には、更新値は「−1」となる(第5図(コ
)参照)。
Also, 1 Δ3/ora force is “0”, 1 force, Δy
If nsw is strongly "positive" or "negative", the update shown in FIG. 6 is carried out in accordance with [1jR2]. That is, Δy,
, ld is “0”, the recent Δy(
After replacing Δy'') with Δyora, the update is performed according to the update rule R1 shown in FIG.
′ is replaced with Δy0.6. Next, according to the update rule R1, since Δ'j old is negative and Δ3' n- is positive, the update value is set to "0" (see FIG. 5(k)). Also, if Δ3'new is positive and the recent Δy° is positive, replace the Δy° with Δ3'old, and according to the update rule R1, Δy0□6 is positive and Δy° is positive.
If y7.1 is positive, the updated value is: l (fifth
(See Figure (1)). Similarly, 671. If w is negative and Δy゛ is positive, the updated value is 0 (see Figure 5 (1)); if ΔY n- is negative and Δy゛ is negative, then , the updated value becomes "-1" (see FIG. 5(c)).

このようにして、全ての輪郭線におけるピクセルについ
て、輪郭情報および方向情報を求める。
In this way, contour information and direction information are obtained for pixels on all contour lines.

そして、塗り潰しの際には、画像の水平ライン毎に画像
メモリ5を走査し、ピクセルの方向情報を順次加算する
。そして、各ピクセル毎に、その輪郭情報およびそれま
での加算結果に基づいて、そのピクセルを塗り潰すか否
かを決定する。この塗り潰すピクセルを決定する際に用
いる判断条件は次の通りである。
When filling, the image memory 5 is scanned for each horizontal line of the image, and pixel direction information is sequentially added. Then, for each pixel, it is determined whether or not that pixel is to be filled in, based on its contour information and the summation results up to that point. The criteria used to determine the pixels to be filled are as follows.

■ゼロ ■非ゼロ ■偶数 ■奇数 これら■〜■の判断条件は、上述した加算結果に対する
ものであり、図形を塗り潰す際にいずれか1つが選択さ
れる。塗り潰し処理は、各ピクセルにおける輪郭情報が
「0」で、かつ、方向情報の加算結果が、選択された上
記判断条件を満足した場合のみ実行される。なお、輪郭
情報カリl」の場合には、該ピクセルは当然輪郭線とし
て残る。
■Zero ■Non-zero ■Even number ■Odd number These judgment conditions (1) to (2) are for the above-mentioned addition results, and one of them is selected when filling out the figure. The filling process is executed only when the contour information at each pixel is "0" and the addition result of the direction information satisfies the selected judgment condition. Note that, in the case of the contour information "Kari I", the pixel naturally remains as the contour line.

次に、図形として第7図(a)〜(e)に示す同心円状
に描かれた2つの円を例にとり、上述した判断条件を用
いる塗り潰し処理について説明する。
Next, a description will be given of the filling process using the above-mentioned judgment conditions, taking as an example two concentrically drawn circles shown in FIGS. 7(a) to 7(e).

まず、第7図(2L)において、アウトラインベクタに
従って輪郭線が求められ、該輪郭線に相当するピクセル
の輪郭情報のビットがrlJにセットされる。また、該
ピクセルの方向情報の更新が第4図および第6図に示す
更新規則RI R2に従って行われる。なお、各輪郭線
の方向は、第7図(a)〜(e)に示す各日の円周上の
矢印によって表す。
First, in FIG. 7 (2L), a contour line is found according to the outline vector, and a bit of contour information of a pixel corresponding to the contour line is set in rlJ. Further, the direction information of the pixel is updated according to the update rule RI R2 shown in FIGS. 4 and 6. Note that the direction of each contour line is represented by an arrow on the circumference of each day shown in FIGS. 7(a) to (e).

次に、塗り潰すピクセルの条件として、例えば、前述し
た判断条件の■を選択する。
Next, as the condition for the pixel to be filled, for example, the above-mentioned judgment condition (■) is selected.

そして、画像メモリ5の上から下へ水平方向に順次走査
して、各水平方向毎にピクセルの方向情報を加算してい
く。
Then, the image memory 5 is sequentially scanned in the horizontal direction from top to bottom, and pixel direction information is added for each horizontal direction.

上述した走査において、まず、第7図(a)に示すスキ
ャンラインAのように、−度も輪郭線を横切らない領域
X、Xては、該スキャンラインA上における方向情報の
加算結果はいずれのピクセルに関してもゼロになる。し
たかって、上記加算結果は全て判断条件■を満足するた
め、このスキャンラインA上のピクセルに対しては塗り
潰しが行われる。
In the above-mentioned scanning, first, in the case of a region X, which does not cross the contour line even by -degrees, such as the scan line A shown in FIG. 7(a), the addition result of the direction information on the scan line A is It will also be zero for pixels in . Therefore, since all of the above addition results satisfy the judgment condition (2), pixels on this scan line A are filled out.

次に、同走査において、同図に示すスキャンラインBの
ように、逆方向の輪郭線を2度横切る領域Y、Yについ
て説明する。該スキャンラインB上における方向情報の
加算結果は輪郭線を横切る度に変化するため、塗り潰す
領域に差が出てくる。
Next, regions Y and Y that cross the contour line in the opposite direction twice in the same scan, like the scan line B shown in the figure, will be described. Since the addition result of the direction information on the scan line B changes each time the contour line is crossed, a difference appears in the area to be filled.

すなわち、点Paから点pbまでの範囲には輪郭線がな
いため、方向情報の加算結果は「0」となる。したがっ
て、該加算結果は判断条件■を満足するため、この領域
に対するピクセルに対しては塗り潰しか行われる。次に
、点Pbのピクセルの方向情報は「−1」であるため(
第5図(d)参照)、この点Pbにおける方向情報の加
算結果は「−1」となる。また、この点pb以降、点P
cまての間は輪郭線かないf二め、同区間のピクセルの
方向情報は「0」である。したかって、上記点Pbから
点Pcまての各ピクセルにおける方向情報の加算値は「
−1」となり、上記判断条件■を満足しないため、この
区間のピクセルに対しては塗り潰しが行われない。ただ
し、点PbおよびPCは輪郭情報が「l」であるため輪
郭線として表示される。次に、点Pcのピクセルの方向
情報は「+1」であるため(第5図(c)参照)、この
点Pcにおける方向情報の加算値は「0」となる。
That is, since there is no contour line in the range from point Pa to point pb, the addition result of the direction information is "0". Therefore, since the addition result satisfies the judgment condition (2), only filling is performed on the pixels in this area. Next, since the direction information of the pixel at point Pb is “-1” (
(See FIG. 5(d)), the addition result of the direction information at this point Pb is "-1". Also, after this point pb, point P
There is no outline between c and f, and the direction information of pixels in the same section is "0". Therefore, the sum of the direction information at each pixel from point Pb to point Pc is "
-1'', and the above-mentioned judgment condition (2) is not satisfied, so pixels in this section are not filled. However, since the contour information of points Pb and PC is "l", they are displayed as contour lines. Next, since the direction information of the pixel at point Pc is "+1" (see FIG. 5(c)), the added value of the direction information at this point Pc becomes "0".

また、この点Pc以降、点Pdまでの間は、上述した点
Paから点Pbと同様に輪郭線がないため、同区間のピ
クセルの方向情報は「0」である。したがって、上記点
Pcから点Pdまでにおける方向情報の加算値は「0」
となり、上記判断条件■を満足するため、この区間のピ
クセルに対しては塗り潰しか行われる。
Further, since there is no contour line from point Pc to point Pd as from point Pa to point Pb described above, the direction information of the pixels in the same section is "0". Therefore, the added value of the direction information from the point Pc to the point Pd is "0"
Therefore, in order to satisfy the above judgment condition (2), only filling is performed on the pixels in this section.

また、同走査において、スキャンラインCのように、同
方向の輪郭線および逆方向の輪郭線を各々2度横切る領
域Zについて説明する。まず、点Pe−点Pfおよび点
21〜点Pjまでの区間には輪郭線がないため、方向情
報の加算結果は「0」となる。したかって、該加算結果
は判断条件■を満足するため、点Pe−点Pfおよび点
Pi〜点Pjの区間のピクセルに対しては塗り潰しが行
われる。また、点Pf〜点pgの区間では、点Pfのピ
クセルの方向情報が「−1」であるため(第5図(d)
参照)、この点Pfにおける方向情報の加算結果は「−
1」となる。また、この点Pf以降、点Pgまでの区間
には輪郭線がないため、同区間のピクセルの方向情報は
「0」である。したかって、上記区間の各ピクセルにお
ける方向情報の加算値は「−1」となる。この結果、上
記点P f = P gの区間では、上記判断条件■を
満足しないため、この区間のピクセルに対しては塗り潰
しが行われない。また、点pg〜点Phの区間では、点
pgのピクセルの方向情報がr−IJであるため(第5
図(d)参照)、この点pgにおける方向情報の加算結
果は「−2」となる。また、この点Pg以降、点Phま
での間は輪郭線がないため、同区間のピクセルの方向情
報は「0」である。したがって、上記区間の各ピクセル
における方向情報の加算値は「−21となり、上記判断
条件■を満足しないため、上記区間のピクセルに対して
は塗り潰しが行われない。そして、点Ph−点Piの区
間では、点Phのピクセルの方向情報が「+1」である
ため(第5図(c)参照)、この点Ph以降、点Piま
での間の方向情報の加算値は「−1」となり、上記判断
条件■を満足しない。この結果、この区間のピクセルに
対しての塗り潰しは行われない。
Also, in the same scan, a region Z, like scan line C, which crosses the contour line in the same direction twice and the contour line in the opposite direction twice will be described. First, since there is no contour line in the section from point Pe to point Pf and from point 21 to point Pj, the addition result of the direction information is "0". Therefore, since the addition result satisfies the judgment condition (2), pixels in the sections from point Pe to point Pf and from point Pi to point Pj are filled out. In addition, in the section from point Pf to point pg, since the direction information of the pixel at point Pf is "-1" (Fig. 5(d)
), the addition result of the direction information at this point Pf is “-
1". Further, since there is no contour line in the section from point Pf to point Pg, the direction information of pixels in the section is "0". Therefore, the added value of the direction information for each pixel in the above section is "-1". As a result, in the section of the point P f = P g, the above judgment condition (2) is not satisfied, and therefore pixels in this section are not filled. In addition, in the section from point pg to point Ph, since the direction information of the pixel at point pg is r-IJ (the fifth
(see figure (d)), the addition result of the direction information at this point pg is "-2". Further, since there is no contour line from point Pg to point Ph, the direction information of pixels in the same section is "0". Therefore, the added value of the direction information for each pixel in the above section is "-21", which does not satisfy the above judgment condition (■), so the pixels in the above section are not filled in. In the section, since the direction information of the pixel at point Ph is "+1" (see Figure 5 (c)), the added value of the direction information from point Ph to point Pi is "-1", The above judgment condition (■) is not satisfied. As a result, pixels in this section are not filled.

以上、判断条件■を選択した場合には、第7図(b)に
示す斜線部分が塗り潰される。また、前述した判断条件
■を選択した場合には第7図(c)に示す斜線部分が、
判断条件■を選択した場合には第7図(d)に示す斜線
部分が、判断条件■を選択した場合には第7図(e)に
示す斜線部分が塗り潰される。
As described above, when the judgment condition (2) is selected, the shaded area shown in FIG. 7(b) is filled out. In addition, when the above-mentioned judgment condition (■) is selected, the shaded area shown in FIG. 7(c) is
When the judgment condition (■) is selected, the shaded area shown in FIG. 7(d) is filled in, and when the judgment condition (■) is selected, the shaded area shown in FIG. 7(e) is filled out.

次に、同一方向または反対方向の複数の線分が交差ある
いは重複した(重なり合った)場合の塗り潰し処理につ
いて、第8図を参照して説明する。
Next, the filling process when a plurality of line segments in the same direction or opposite directions intersect or overlap (overlap) will be described with reference to FIG.

この図において、実際には2本の線分A−Bと線分C−
Dが重なり合って、見掛は上1本の線分になっている場
合を想定する。上記線分A−Bと線分C−Dが同じ方向
の線分であるとすると、スキャンラインDとの交点にお
ける方向情報の加算結果は「+2(または−2)」にな
る。また、線分ABと線分C−Dが逆方向の方向情報を
有する線分であるとすると、スキャンラインDとの交点
における方向情報の加算結果は「0」になる。このよう
に、複数の線分が重複している場合でも、平行している
場合と同じ結果が得られ、従来のように情報が失われる
という不具合は生じない。したがって、本実施例では、
常に輪郭線の通過回数を正確に把握することができる。
In this diagram, there are actually two line segments A-B and C-
Assume that D overlaps and appears to be a single line segment. If the line segment A-B and the line segment CD are in the same direction, the addition result of the direction information at the intersection with the scan line D will be "+2 (or -2)". Further, if line segment AB and line segment CD are line segments having direction information in opposite directions, the addition result of the direction information at the intersection with scan line D will be "0". In this way, even when a plurality of line segments overlap, the same result as when they are parallel can be obtained, and the problem of information loss as in the conventional case does not occur. Therefore, in this example,
It is possible to always accurately grasp the number of times the contour line has passed.

なお、上述した実施例では、方向情報を表すビット数を
3ヒツトととしたか、これは一般に同方向に連続して3
回以上交差あるいは重複するような図形はほとんどない
ため、上記方向情報か−4〜+3の範囲を越えることは
ないからである。しかし、上述のような仮定の成り立た
ない図形か塗り潰し処理の対象となる場合は、方向情報
のビット数を増やしてもよい。
In the above-mentioned embodiment, the number of bits representing the direction information was set to 3, which generally means 3 consecutive bits in the same direction.
This is because there are almost no figures that intersect or overlap more than once, so the above direction information never exceeds the range of -4 to +3. However, if a figure for which the above assumption does not hold is to be filled out, the number of bits of direction information may be increased.

「発明の効果」 以上説明したように、この発明によれば以下の利点か得
られる。
"Effects of the Invention" As explained above, the present invention provides the following advantages.

■各ピクセル毎に少なくとも3ピツト以上の方向情報を
持つようにしたため、同一方向、反対方向の複数の線分
か交差あるいは重複してもその情報を失うことなく保持
できる。
(2) Since each pixel has directional information of at least 3 pits, the information can be retained without loss even if a plurality of line segments in the same or opposite directions intersect or overlap.

■また、輪郭情報と方向情報とを別々に記憶するため、
輪郭線だけを容易に抽出できる。
■Also, since contour information and direction information are stored separately,
Only the outline can be easily extracted.

■さらに、蓄積された情報を水平方向に走査して塗り潰
しを実行する際に、塗り潰しのための判断条件を変える
ことにより、種々の異なった塗り潰し効果を得ることが
できる。
(2) Furthermore, when filling in by scanning the accumulated information in the horizontal direction, various different filling effects can be obtained by changing the judgment conditions for filling out.

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

第1図はこの発明の一実施例による塗り潰し方法を適用
したノステムの構成を示すブロック図、第2図はこの発
明の塗り潰し方法か適用される一図形の輪郭線を説明す
る説明図、第3図(a)は本発明の一実施例のピクセル
当たりのデータ構造を示す概念図、第3図(b)は同ビ
クセルの方向情報を示す下位3ピツトの状態図、第4図
は同実施例における方向情報の更新処理に用いる更新規
則図、第5図(a)〜(1)はさまざまな状況における
アウトラインベクタの組合せおよびその組合せにより得
られる方向情報を示す概念図、第6図は同実施例におけ
る方向情報の更新処理の特別な場合に用いる更新規則図
、第7図(a)は本発明の一実施例における塗り潰し方
法の手順を説明するための説明図、第7図(b)、(c
)、(d)および(e)は同実施例における塗り潰しの
判断条件を各々、「ゼロ」、「非ゼロ」、「偶数」、「
奇数」とした場合の塗り潰し例を示す概念図、第8図は
同実施例において輪郭線が重なり合った場合の塗り潰し
処理を説明するための説明図である。 l ・・・ CPU、  2 ・・・・・ ROM。 3 ・・・ RAM、  4 ・文字フォントメモリ、5 画像メモリ、6 ・・・・・CRT、7・・・・プリンタ。 第4図
FIG. 1 is a block diagram showing the configuration of a nostem to which a filling method according to an embodiment of the present invention is applied, FIG. 2 is an explanatory diagram illustrating the outline of a figure to which the filling method of the present invention is applied, and Figure (a) is a conceptual diagram showing the data structure per pixel in one embodiment of the present invention, Figure 3 (b) is a state diagram of the lower three pits showing direction information of the same pixel, and Figure 4 is the same embodiment. 5(a) to (1) are conceptual diagrams showing combinations of outline vectors in various situations and directional information obtained by the combinations; FIG. An update rule diagram used in a special case of direction information update processing in the example, FIG. 7(a) is an explanatory diagram for explaining the procedure of the filling method in one embodiment of the present invention, FIG. 7(b), (c
), (d), and (e) are the filling judgment conditions in the same example, respectively, "zero", "non-zero", "even number", and "
FIG. 8 is an explanatory diagram for explaining the filling process when contour lines overlap in the same embodiment. l: CPU, 2: ROM. 3: RAM, 4: Character font memory, 5: Image memory, 6: CRT, 7: Printer. Figure 4

Claims (2)

【特許請求の範囲】[Claims] (1)線分を表すベクトルデータをピクセルデータに変
換して画像メモリに書き込み、該ピクセルデータによっ
て囲まれる前記画像メモリの内部を塗り潰す図形塗り潰
し方法において、 前記ベクトルデータをピクセルデータに変換して画像メ
モリに書き込む際に、前記ベクトルデータを展開して得
られる輪郭情報をピクセル単位で前記画像メモリに書き
込むとともに、前記ピクセルの方向情報を、該ピクセル
の縦軸の増分方向と少なくとも1つ前のピクセルの縦軸
の増分方向とに応じて、所定の補正値を加減算した後に
前記画像メモリに書き込み、また、既に前記輪郭情報が
書き込まれているピクセルに重畳して書き込みを行う場
合は、既に書き込まれている方向情報に前記所定の補正
値を加減算した後に前記画像メモリに書き込み、次に、
前記画像メモリを走査する際に、各ピクセルの前記方向
情報を順次加算し、各ピクセル毎に前記加算結果を所定
の判断条件と比較し、該判断条件を満足するピクセルを
塗り潰すことを特徴とする図形塗り潰し方法。
(1) In a figure filling method in which vector data representing a line segment is converted to pixel data and written into an image memory, and the interior of the image memory surrounded by the pixel data is filled, the vector data is converted to pixel data. When writing to the image memory, the contour information obtained by developing the vector data is written to the image memory in pixel units, and the direction information of the pixel is changed from the increment direction of the vertical axis of the pixel to at least one previous one. When writing to the image memory after adding or subtracting a predetermined correction value according to the increment direction of the vertical axis of the pixel, or when writing by superimposing the contour information on a pixel to which the contour information has already been written, the predetermined correction value is added to or subtracted from the directional information, and then written into the image memory;
When scanning the image memory, the direction information of each pixel is sequentially added, the addition result is compared with a predetermined judgment condition for each pixel, and pixels satisfying the judgment condition are filled out. How to fill the shape.
(2)前記判断条件は複数用意されるとともに、塗り潰
しに際して前記複数の判断条件のうちいずれか1つが前
記所定の判断条件として選択されることを特徴とする請
求項1記載の図形塗り潰し方法。
(2) A figure filling method according to claim 1, characterized in that a plurality of said judgment conditions are prepared, and at the time of filling, any one of said plurality of judgment conditions is selected as said predetermined judgment condition.
JP2102249A 1990-04-18 1990-04-18 Graphic painting-out method Pending JPH04684A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2102249A JPH04684A (en) 1990-04-18 1990-04-18 Graphic painting-out method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2102249A JPH04684A (en) 1990-04-18 1990-04-18 Graphic painting-out method

Publications (1)

Publication Number Publication Date
JPH04684A true JPH04684A (en) 1992-01-06

Family

ID=14322332

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2102249A Pending JPH04684A (en) 1990-04-18 1990-04-18 Graphic painting-out method

Country Status (1)

Country Link
JP (1) JPH04684A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0916787A (en) * 1995-06-27 1997-01-17 Nippon Denki Micom Technol Kk Start point/end point plotting method for frame line for graphic painting-out

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61212895A (en) * 1985-03-18 1986-09-20 大日本スクリ−ン製造株式会社 Processing for smearing area with in polygon
JPS63305478A (en) * 1987-06-06 1988-12-13 Fujitsu Ltd Pattern information restoring device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61212895A (en) * 1985-03-18 1986-09-20 大日本スクリ−ン製造株式会社 Processing for smearing area with in polygon
JPS63305478A (en) * 1987-06-06 1988-12-13 Fujitsu Ltd Pattern information restoring device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0916787A (en) * 1995-06-27 1997-01-17 Nippon Denki Micom Technol Kk Start point/end point plotting method for frame line for graphic painting-out

Similar Documents

Publication Publication Date Title
EP0471482B1 (en) Character processing method
JPS62123573A (en) Computer graphic apparatus and operation thereof
US6437793B1 (en) System for rapidly performing scan conversion with anti-aliasing upon outline fonts and other graphic elements
EP0592770B1 (en) Method for filling of interior pixels within a polygon
US6614432B1 (en) Image rendering technique
US20060077210A1 (en) Rasterizing stacked graphics objects from top to bottom
JP2005326756A (en) Character image generation device and its method, display controller, character image generating program and display control program
JPH0369995A (en) Method of displaying character on raster display
JPH08194459A (en) Outline character plotting device
EP0392499B1 (en) Apparatus for generating high-quality character pattern
US5553219A (en) Font outline and bit map generator synthesizing filling data with selected outline data or duplicate outline data
EP0062669A1 (en) Graphic and textual image generator for a raster scan display.
JPH04684A (en) Graphic painting-out method
US5355451A (en) Graphic processing unit
KR100361387B1 (en) Polygon drawing method and polygon drawing apparatus
WO2010134124A1 (en) Vector graphic drawing device
JPH05297861A (en) 1/n bit phase matching method for graphics
US5428719A (en) Method and apparatus for generating high-quality pattern in accordance with an edge defining a character pattern
JP2888270B2 (en) Graphic processing apparatus and method
EP0391401A2 (en) Method and apparatus for generating high-quality pattern
JP3493745B2 (en) Drawing device
JP2782752B2 (en) Character pattern output device
JPH03278189A (en) Graphic processor
JPH0519739A (en) Character pattern generation device
JPH0661960B2 (en) Dot interpolation control device