JP2634906B2 - Image processing method - Google Patents

Image processing method

Info

Publication number
JP2634906B2
JP2634906B2 JP1125296A JP12529689A JP2634906B2 JP 2634906 B2 JP2634906 B2 JP 2634906B2 JP 1125296 A JP1125296 A JP 1125296A JP 12529689 A JP12529689 A JP 12529689A JP 2634906 B2 JP2634906 B2 JP 2634906B2
Authority
JP
Japan
Prior art keywords
outline
pixel
vector
created
point
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP1125296A
Other languages
Japanese (ja)
Other versions
JPH02304483A (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.)
Consejo Superior de Investigaciones Cientificas CSIC
Original Assignee
Consejo Superior de Investigaciones Cientificas CSIC
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 Consejo Superior de Investigaciones Cientificas CSIC filed Critical Consejo Superior de Investigaciones Cientificas CSIC
Priority to JP1125296A priority Critical patent/JP2634906B2/en
Priority to US07/524,428 priority patent/US5073960A/en
Publication of JPH02304483A publication Critical patent/JPH02304483A/en
Application granted granted Critical
Publication of JP2634906B2 publication Critical patent/JP2634906B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の詳細な説明】 <産業上の利用分野> この発明は、図形の輪郭をアウトライベクトルで表
し、このアウトライベクトルからアウトラインを作成し
て、このアウトラインの内部を塗りつぶすようにした画
像処理方法に関し、DTP(デスク・トップ・パブリッシ
ング)やLBP(レーザ・プリンタ)、などにおけるアウ
トラインフォントのベクタラスタ変換を容易かつ高速に
行うようにした画像処理方法に関する。
Description: BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an image processing method in which a contour of a figure is represented by an outline vector, an outline is created from the outline vector, and the inside of the outline is filled. The present invention relates to an image processing method for easily and rapidly performing vector raster conversion of an outline font in DTP (desktop publishing), LBP (laser printer), and the like.

<従来の技術> 図形の任意領域を塗りつぶす方法としては従来からシ
ードフィルやスキャンフィルが知られており、シードフ
ィルは多くの画像処理プロセッサーに採用されている
が、スキャンフィルと比べて処理速度が遅いという欠点
がある。
<Prior Art> Seed fill and scan fill are conventionally known as a method for filling an arbitrary region of a figure. Seed fill is used in many image processing processors, but the processing speed is higher than that of scan fill. It has the disadvantage of being slow.

スキャンフィルは第3図に示すように、塗りつぶした
い図形の輪郭をアウトラインベクトルで示し、このアウ
トラインベクトルの向きを、その左側を塗りつぶすと図
形が塗りつぶされるように設定する。例えば、第4図
(a)に示す元データから第4図(b)に示すアウトラ
インベクトルを作成する。そして、このアウトラインベ
クトルから第5図(a)に示すようなアウトラインを作
成し、x方向へスキャニングして、水平走査線と、この
アウトラインとの奇数回目の交差で塗りつぶしを開始
し、偶数回目の交差で塗りつぶしを中止して、第5図
(b)に示すような図形を得るようになっている。
In the scan fill, as shown in FIG. 3, the outline of the figure to be filled is indicated by an outline vector, and the direction of the outline vector is set so that the figure is filled when the left side is painted. For example, an outline vector shown in FIG. 4B is created from the original data shown in FIG. Then, an outline as shown in FIG. 5A is created from this outline vector, scanning is performed in the x direction, and painting is started at an odd-numbered intersection between the horizontal scanning line and this outline, and an even-numbered intersection is performed. Filling is stopped at the intersection, and a graphic as shown in FIG. 5 (b) is obtained.

このようなスキャンフィルにより図形を塗りつぶすよ
うにした画像処理方法としては、従来、特公昭53−4101
7号公報に示すようなものがある。この画像処理方法は
アウトラインベクトルから周知のブレーゼンハムのアル
ゴリズムに従ってアウトラインを作成し、例えば第6図
(a)、第7図(a)および第8図(a)に示すような
アウトラインを得るようにしている。
As an image processing method for filling a figure with such a scan fill, a conventional method is disclosed in Japanese Patent Publication No. 53-4101.
There is one as shown in Japanese Patent Publication No. This image processing method creates an outline from the outline vector according to the well-known Bresenham algorithm, and obtains an outline as shown in, for example, FIGS. 6 (a), 7 (a) and 8 (a). I have.

そして、x方向へスキャニングして、水平走査線とこ
れらのアウトラインとの奇数回目の交差の際に塗りつぶ
しを開始し、交差した画素も含めて塗りつぶし、偶数回
目の交差の際に塗りつぶしを中止し、交差した画素まで
塗りつぶすようにしている。
Then, scanning is performed in the x direction, filling is started at the odd-numbered intersections between the horizontal scanning lines and these outlines, painting is performed including the intersecting pixels, and painting is stopped at the even-numbered intersections. It fills up to the intersecting pixels.

ところで、上記画像処理方法では、アウトラインを作
成する場合、第6図(a)における頂部や第7図におけ
る中央部のようにアウトラインベクトルが同一画素上に
重なった場合には、その画素の位置がアウトラインとな
る。このため、水平走査線がこのアウトラインと交差す
ると、その画素を含めてその右側の画素をすべて塗りつ
ぶすことになり、第6図(b)や第7図(b)に示すよ
うな塗りつぶしの誤りが生じる。また、第8図の(a)
のようにスキャン方向と平行なアウトラインが作成され
た場合、そのアウトラインが、走査線が交差する最初の
画素から数えて奇数回目の画素で終っている場合には、
その奇数回目の画素の右側の画素も塗りつぶされるため
第8図(b)に示すような塗りつぶしの誤りが生じる。
By the way, in the above image processing method, when an outline is created, when the outline vectors overlap on the same pixel as in the top in FIG. 6 (a) or the center in FIG. 7, the position of the pixel is Be an outline. For this reason, when the horizontal scanning line intersects this outline, all the pixels on the right side including that pixel are filled, and the filling error as shown in FIG. 6 (b) and FIG. 7 (b) occurs. Occurs. FIG. 8 (a)
If an outline parallel to the scan direction is created as shown in the above, if the outline ends with an odd-numbered pixel counting from the first pixel where the scanning line intersects,
The pixel on the right side of the odd-numbered pixel is also filled, so that a filling error as shown in FIG. 8B occurs.

このような誤りを発生しないようにするため、従来
は、例えば、第5図(a)に示すように、頂部のアウト
ラインからx軸方向に1ドットずれた画素の位置をもア
ウトラインとするような処理をしていた。また、スキャ
ン方向と平行なアウトラインにあっては長さが偶数ドッ
トとなるようにするか始点と終点だけをプロットする処
理をしていた。しかしながら、このようにした場合に
は、この処理を行うホストの処理速度が遅くなりホスト
の負荷も大きくなる。また、ベクトルフォントに上記処
理を施して得られたアウトラインをマスクROMなどのメ
モリに入れておき、そのアウトラインを縮小したり回転
した場合、例えば、第9図(a)に示すアウトラインを
第9図(b)に示すように縮小した場合に、上述したよ
うな塗りつぶしの誤りが発生することがある。また、例
えば第10図(a)に示すアウトラインに上記処理を施す
と第10図のようなアウトラインとなるが、これを塗りつ
ぶすと第10図(c)のようになり、第10図(a)で示す
図形から形状の異なる図形ができてしまう。
In order to prevent such an error from occurring, conventionally, for example, as shown in FIG. 5A, the position of a pixel shifted by one dot in the x-axis direction from the top outline is also taken as the outline. Was processing. Further, in the outline parallel to the scanning direction, the length is set to an even number of dots, or only the starting point and the ending point are plotted. However, in such a case, the processing speed of the host performing this processing becomes slow and the load on the host increases. When the outline obtained by performing the above processing on the vector font is stored in a memory such as a mask ROM, and the outline is reduced or rotated, for example, the outline shown in FIG. When the image is reduced as shown in (b), the above-described painting error may occur. Also, for example, when the above-described processing is performed on the outline shown in FIG. 10 (a), an outline as shown in FIG. 10 is obtained. When the outline is painted out, the outline becomes as shown in FIG. 10 (c). A graphic having a different shape is generated from the graphic indicated by.

このように塗りつぶしを行なった場合に誤りが生じた
り、形状が異なったりするアウトラインとしては第11図
に示すものが典型的な例としてあげられる。第11図
(a),(b)に示すアウトラインは第6図(a)や第
8図(a)に示したアウトラインと同種のアウトライン
であり、第11図(c)は同一画素を2つの境界が共有す
る場合、第11図(d)は第11図(c)との極限として2
つの境界が全く一致する場合を示している。そして、丸
印で囲ったアウトラインが誤りの原因となるアウトライ
ンを示している。
A typical example of an outline in which an error occurs or the shape is different when the painting is performed is shown in FIG. The outlines shown in FIGS. 11 (a) and (b) are the same kind of outlines as those shown in FIGS. 6 (a) and 8 (a), and FIG. 11 (c) shows the same pixel as two outlines. If the boundary is shared, FIG. 11 (d) is the limit of FIG. 11 (c) by 2
This shows a case where the two boundaries exactly match. An outline surrounded by a circle indicates an outline causing an error.

このように、上記従来の画像処理方法では、アウトラ
イン作成時に第11図に示すようなアウトラインを作成す
るため、このアウトラインに、図形塗りつぶしの際に誤
りを発生しないようにするための処理を施す必要が生
じ、処理速度が遅くなるという問題があった。また、上
記処理を施すために、塗りつぶしたあとの図形の形状が
元の図形の形状と大きく異なってしまい、ドットフォン
トよりも変倍、回転が容易でフォントが美しいベクトル
フォントの特徴を十分生かすことができないという問題
があった。
As described above, in the above-described conventional image processing method, since an outline as shown in FIG. 11 is created when the outline is created, it is necessary to perform a process on the outline so as not to cause an error when filling the figure. And the processing speed is reduced. In addition, to perform the above processing, the shape of the figure after filling is greatly different from the shape of the original figure, and it is necessary to make full use of the characteristics of vector fonts that are easier to scale and rotate than dot fonts and have beautiful fonts. There was a problem that can not be.

そこで、本発明者は、図形の塗りつぶしの誤りや図形
の変形が生じることのない画像処理方法として、かつ
て、下記の3通りの画像処理方法を提案した。
Therefore, the present inventor has previously proposed the following three image processing methods as image processing methods that do not cause an error in painting a figure or deformation of the figure.

第1の画像処理方法は、アウトラインベクトルからア
ウトラインを作成する場合に、上記アウトラインベクト
ルのy軸方向の変化量が負か零か正かを判別し、上記ア
ウトラインベクトルのy軸方向の変化量が負であればブ
レーゼンハムのアルゴリズムに従ってアウトラインを作
成し、上記アウトラインベクトルのy軸方向の変化量が
零であればアウトラインを作成せず、上記アウトライン
ベクトルのy軸方向の変化量が正であればブレーゼンハ
ムのアルゴリズムで決定される位置からx軸方向に1ド
ットシフトした位置にアウトラインを作成し、上記作成
したアウトラインとの水平走査線との奇数回目の交差の
際に塗りつぶしを開始し、交差した画素も含めて塗りつ
ぶし、偶数回目の交差の際に塗りつぶしを中止して、偶
数回目に交差した画素の直前の画素までを塗りつぶし交
差した画素は消すようにしたものである。
The first image processing method determines whether the change amount of the outline vector in the y-axis direction is negative, zero, or positive when the outline is created from the outline vector, and determines the change amount of the outline vector in the y-axis direction. If negative, an outline is created according to Bresenham's algorithm. If the amount of change of the outline vector in the y-axis direction is zero, no outline is created. If the amount of change of the outline vector in the y-axis direction is positive, Bresenham is An outline is created at a position shifted by one dot in the x-axis direction from the position determined by the above algorithm, and when the odd outline intersects the created outline with a horizontal scanning line, painting is started. Fill and stop filling at the even-numbered intersection, and The crossed pixel fill up the pixel immediately before is obtained as erased.

また、第2の画像処理方法は、アウトラインベクトル
からアウトラインを作成する場合に、上記アウトライン
ベクトルのy軸方向の変化量が零か否かを判別し、上記
アウトラインベクトルのy軸方向の変化量が零であれば
アウトラインを作成せず、上記アウトラインベクトルの
y軸方向の変化量が零でなければブレーゼンハムのアル
ゴリズムに従ってアウトラインを作成し、上記作成した
アウトラインと、メモリのそのアウトラインの位置に対
応したアドレスに格納されたデータとの排他的論理和を
とって修正アウトラインとし、その修正アウトラインを
上記メモリの上記アドレスに格納し、上記メモリに格納
された修正アウトラインを読み出し、その修正アウトラ
インと水平走査線との奇数回目の交差の際に塗りつぶし
を開始し、交差した画素も含めて塗りつぶし、偶数回目
の交差の際にい塗りつぶしを中止して、交差した画素ま
で塗りつぶすようにしたものである。
Further, in the second image processing method, when an outline is created from an outline vector, it is determined whether or not the change amount of the outline vector in the y-axis direction is zero, and the change amount of the outline vector in the y-axis direction is determined. If it is zero, no outline is created.If the change amount of the outline vector in the y-axis direction is not zero, an outline is created according to the Bresenham algorithm, and the created outline and an address corresponding to the position of the outline in the memory. An exclusive OR with the data stored in the memory is taken as a corrected outline, the corrected outline is stored at the address of the memory, the corrected outline stored in the memory is read, and the corrected outline and the horizontal scanning line are read. Start filling on odd-numbered intersections of Containing even fill including, stop filling had during even-numbered crossing, in which as fill up pixels intersected.

また、第3の画像処理方法は、図形の輪郭を時計の回
転方向に連なるアウトラインベクトルで表し、かつ上記
アウトラインベクトルの向きを、そのアウトラインベク
トルの左側を塗りつぶすと上記図形が塗りつぶされるよ
うに設定し、上記アウトラインベクトルからアウトライ
ンを作成する場合に、上記アウトラインベクトルのx軸
方向の変化量とy軸方向の変化量がそれぞれ負か零か正
かを判別し、上記アウトラインベクトルのy座標の変化
量が正の状態から零の状態になった場合に、その時のx
座標の変化量が正であれば、同じy座標の連続した点
は、y座標が変化する直前の点を除きプロットせず、y
座標が変化する直前の点については、y座標の変化量が
正になった場合にはプロットし、y座標の変化量が負に
なった場合にはプロットせず、上記アウトラインベクト
ルのy座標の変化量が正の状態から零の状態になった場
合に、その時のx座標の変化量が負であれば、同じy座
標の連続した点は、y座標が変化した直後の点をプロッ
トし、y座標が変化する直前の点については、y座標の
変化量が正になった場合にはプロットせず、y座標の変
化量が負になった場合にはプロットし、上記以外のy座
標の連続した点はプロットせず、上記アウトラインベク
トルのy座標の変化量が負の状態から零の状態になった
場合に、その時のx座標の変化量が負であれば、同じy
座標の連続した点は、y座標が変化する直前の点を除き
プロットせず、y座標が変化する直前の点については、
y座標の変化量が正になった場合にはプロットせず、y
座標の変化量が負になった場合にはプロットし、上記ア
ウトラインベクトルのy座標の変化量が負の状態から零
の状態になった場合に、その時のx座標の変化量が正で
あれば、同じy座標の連続した点は、y座標が変化した
直後の点をプロットし、y座標が変化する直前の点につ
いては、y座標の変化量が正になった場合にはプロット
し、y座標の変化量が負になった場合にはプロットせ
ず、上記以外のy座標の連続した点はプロットしないよ
うにしてアウトラインを作成し、x軸方向へスキャニン
グして、上記アウトラインと水平走査線との奇数回目の
交差で塗りつぶしを開始し、偶数回目の交差で塗りつぶ
しを中止するようにしたものである。
In the third image processing method, the outline of the figure is represented by an outline vector that is continuous in the clockwise direction, and the direction of the outline vector is set so that the figure is painted when the left side of the outline vector is painted. When an outline is created from the outline vector, it is determined whether the change amount in the x-axis direction and the change amount in the y-axis direction of the outline vector are negative, zero, or positive, respectively, and the change amount of the y coordinate of the outline vector is determined. Is changed from a positive state to a zero state, then x
If the amount of change in the coordinates is positive, continuous points at the same y-coordinate are not plotted except for the point immediately before the y-coordinate changes.
For the point immediately before the coordinate change, plotting is performed when the y-coordinate change is positive, and is not plotted when the y-coordinate change is negative. If the change amount changes from a positive state to a zero state and the change amount of the x coordinate at that time is negative, a continuous point of the same y coordinate plots a point immediately after the y coordinate changes, For the point immediately before the y coordinate changes, plotting is not performed when the y coordinate change amount is positive, and plotting is performed when the y coordinate change amount is negative. Consecutive points are not plotted. If the change in the y coordinate of the outline vector changes from a negative state to a zero state and the change in the x coordinate at that time is negative, the same y
Points with continuous coordinates are not plotted except for the point immediately before the y-coordinate changes.
If the change in the y coordinate is positive, do not plot
If the amount of change in the coordinates is negative, plot it.If the amount of change in the y coordinate of the outline vector changes from a negative state to zero, and if the amount of change in the x coordinate at that time is positive, , For consecutive points of the same y-coordinate, plot the point immediately after the y-coordinate changes, and plot the point immediately before the y-coordinate changes if the y-coordinate change becomes positive; If the coordinate change amount is negative, plotting is not performed, and other points on the y coordinate other than those described above are not plotted, and an outline is created. Scanning is performed in the x-axis direction. The filling is started at the odd-numbered intersection with, and is stopped at the even-numbered intersection.

<発明が解決しようとする課題> しかしながら、上記従来の画像処理方法では、アウト
ラインの最初の画素(始点)の処理が不完全になるとい
う問題がある。
<Problem to be Solved by the Invention> However, the above-described conventional image processing method has a problem that the processing of the first pixel (start point) of the outline becomes incomplete.

例えば、第12図のようなアウトラインベクトルを例に
とり、それぞれ点A,B,C,Dが始点の場合についてアウト
ラインを作成するとする。この場合、点A,点Dはプロッ
トする必要があるが、点B,点Cはプロットしてはいけな
い。このように、同じアウトラインでも、始点のとり方
によって、始点をプロットしなければならない場合と、
始点をプロットしてはならない場合がある。
For example, taking an outline vector as shown in FIG. 12 as an example, suppose that an outline is created when points A, B, C, and D are the starting points. In this case, points A and D need to be plotted, but points B and C must not be plotted. In this way, even if the same outline needs to be plotted depending on how to take the starting point,
You may not have to plot the starting point.

そこで、始点の位置をプロットしなければならない点
にもっていき、その点を必ずプロットするようにした方
法が考えられる。例えば、第12図において点Aを始点と
して選び、この始点Aを必ずプロットするようにする。
しかしながら、この方法によれば、上記のように点Aを
始点に選んだ場合は、この点Aはこのベクトルフォント
を傾斜したり回転したりした場合でも必ずプロットしな
ければならない点であるので問題はないが、次のような
場合は問題がある。
Therefore, a method is conceivable in which the position of the starting point is brought to a point to be plotted, and that point is always plotted. For example, in FIG. 12, point A is selected as a starting point, and this starting point A is always plotted.
However, according to this method, when the point A is selected as the starting point as described above, the point A is a point that must be plotted even when the vector font is inclined or rotated. However, there are problems in the following cases.

すなわち、第13図の点Aのように頂点処理が必要でな
い点を始点にとっても、回転によっては頂点になる場合
がある。また、第13図の点Bのように頂点処理が必要で
ある点を始点にとっても、回転によって必要でなくな
る。このため、始点として選ぶ点が制約されるという問
題がある。また、機械的に任意に始点が設定できないと
いう問題がある。
That is, even if a point that does not require vertex processing such as point A in FIG. Also, even if a point requiring vertex processing such as point B in FIG. 13 is taken as a starting point, it is not necessary due to the rotation. For this reason, there is a problem that the point selected as the starting point is restricted. There is also a problem that the starting point cannot be set arbitrarily mechanically.

そこで、この発明の目的は、始点の選定を任意に行う
ことができ、しかも塗りつぶしの誤りを生じることのな
い画像処理方法を提供することにある。
SUMMARY OF THE INVENTION It is an object of the present invention to provide an image processing method that can arbitrarily select a starting point and that does not cause a painting error.

<課題を解決するための手段> 上記目的を達成するため、この発明は、図形の輪郭を
反時計方向に連なるアウトラインベクトルで表し、か
つ、上記アウトラインベクトルの向きを、そのアウトラ
インベクトルの左側を塗りつぶすと上記図形が塗りつぶ
しされるように設定し、上記アウトラインベクトルから
アウトラインを作成し、X軸方向へスキャニングして、
上記アウトラインと水平走査線との奇数回目の交差で塗
りつぶしを開始し、偶数回目の交差で交差した画素を消
し塗りつぶしを中止するようにした画像処理方法におい
て、上記アウトラインベクトルからアウトラインを作成
する場合に、作成するアウトラインの最初の画素をプロ
ットすることなく、次の画素から順次アウトラインを作
成していくと共に、上記最初の画素と次の画素との位置
関係を記憶しておき、最終的に上記最初の画素をプロッ
トしようとする時に、最初の画素とその前の画素との位
置関係と、上記記憶された位置関係とから、上記最初の
画素をプロットするかどうかを選択する一方、上記最初
の画素をプロットすることを選択した場合に、上記最初
の画素からX軸方向に1ドットシフトした位置の画素を
プロットするかどうかを選択するようにしたことを特徴
としている。
<Means for Solving the Problems> In order to achieve the above object, according to the present invention, a contour of a figure is represented by an outline vector connected in a counterclockwise direction, and the direction of the outline vector is painted on the left side of the outline vector. And the figure is set to be filled, an outline is created from the outline vector, and scanning is performed in the X-axis direction.
In the image processing method in which filling is started at an odd-numbered intersection between the outline and the horizontal scanning line, and pixels intersected at the even-numbered intersection are erased and filling is stopped, when an outline is created from the outline vector, Without plotting the first pixel of the outline to be created, the outline is sequentially created from the next pixel, and the positional relationship between the first pixel and the next pixel is stored. When trying to plot the pixel of the first pixel, while selecting whether to plot the first pixel from the positional relationship between the first pixel and the previous pixel and the stored positional relationship, Is selected, the pixel at the position shifted by one dot in the X-axis direction from the first pixel is plotted. It is characterized in that so as to choose.

<作用> 図形の輪郭を反時計方向に連なるアウトラインベクト
ルで表し、かつ、上記アウトラインベクトルの向きを、
そのアウトラインベクトルの左側を塗りつぶすと上記図
形が塗りつぶされるように設定する。そして、上記アウ
トラインベクトルからアウトラインを作成する場合に、
作成するアウトラインの最初の画素をプロットすること
なく、次の画素から順次アウトラインを作成していく。
この時、最初の画素と次の画素との位置関係をメモリに
記憶しておく。そして、最終的にプロットしようとする
画素が最初の画素にめぐってきた時に、上記メモリに記
憶された位置関係と、上記最初の画素とその前の画素と
の位置関係とから、上記最初の画素をプロットするかど
うかを選択する。この時、プロットすることが選択され
ると、上記最初の画素からX軸方向に1ドットシフトし
た位置の画素をプロットするかどうかを選択するように
してアウトラインを作成する。そして、X軸方向へスキ
ャニングして、上記アウトラインと水平走査線との奇数
回目の交差で塗りつぶしを開始し、偶数回目の交差で交
差した画素を消し塗りつぶしを中止する。こうすること
によって、簡単な始点の処理で塗りつぶしの誤りがなく
なるのである。
<Operation> The outline of a figure is represented by an outline vector that extends in a counterclockwise direction, and the direction of the outline vector is
When the left side of the outline vector is painted, the figure is set to be painted. Then, when creating an outline from the outline vector,
An outline is created sequentially from the next pixel without plotting the first pixel of the outline to be created.
At this time, the positional relationship between the first pixel and the next pixel is stored in the memory. Then, when the pixel to be plotted finally reaches the first pixel, the first pixel is obtained from the positional relationship stored in the memory and the positional relationship between the first pixel and the previous pixel. Choose whether to plot. At this time, if plotting is selected, an outline is created by selecting whether to plot a pixel at a position shifted by one dot in the X-axis direction from the first pixel. Then, scanning is performed in the X-axis direction, filling is started at the odd-numbered intersection of the outline and the horizontal scanning line, and pixels intersected at the even-numbered intersection are erased and the filling is stopped. By doing so, a simple starting point processing eliminates errors in filling.

<実施例> 以下、この発明を図示の実施例により詳細に説明す
る。
<Example> Hereinafter, the present invention will be described in detail with reference to an illustrated example.

本実施例の画像処理方法は、図形の輪郭を反時計方向
に連なるアウトラインベクトルで表し、かつ、上記アウ
トラインベクトルの向きを、そのアウトラインベクトル
の左側を塗りつぶすと上記図形が塗りつぶされるように
設定する。そして、上記アウトラインベクトルからアウ
トラインを作成する場合に、作成するアウトラインの最
初の画素をプロットせずに順次アウトラインを作成する
一方、上記最初の画素とその次の画素との位置関係をメ
モリにストアしておく。そして、プロットしようとする
画素が上記最初の画素にめぐってきた時に、上記メモリ
にストアした位置関係と、上記最初の画素とその前の画
素との位置関係から、上記最初の画素をプロットするか
どうかを選択する。また、上記最初の画素をプロットす
ることを選択した場合に、上記最初の画素からX軸方向
に1ドットシフトした位置の画素をプロットするかどう
かを選択する。そして、上記選択結果に基づいてアウト
ラインを作成し、X軸方向へスキャニングして、上記ア
ウトラインと水平走査線との奇数回目の交差で塗りつぶ
しを開始し、偶数回目の交差で塗りつぶしを中止する。
In the image processing method according to the present embodiment, the outline of a figure is represented by an outline vector connected in a counterclockwise direction, and the direction of the outline vector is set so that the figure is painted when the left side of the outline vector is painted. Then, when an outline is created from the outline vector, the outline is created sequentially without plotting the first pixel of the outline to be created, and the positional relationship between the first pixel and the next pixel is stored in a memory. Keep it. Then, when the pixel to be plotted reaches the first pixel, the first pixel is plotted based on the positional relationship stored in the memory and the positional relationship between the first pixel and the previous pixel. Choose whether or not. Further, when plotting the first pixel is selected, it is selected whether to plot a pixel at a position shifted by one dot in the X-axis direction from the first pixel. Then, an outline is created based on the selection result, scanning is performed in the X-axis direction, and painting is started at an odd-numbered intersection between the outline and the horizontal scanning line, and is stopped at an even-numbered intersection.

第1図および第2図はそれぞれ上記選択を行う場合の
判断基準の一例を示した図である。
1 and 2 are diagrams each showing an example of a criterion for making the above selection.

第1図はベクトルフォントが(c)に示すような台形
であり、点Aをアウトラインを作成するための始点に選
んだ場合である。まず、始点Aをプロットせずに、始点
Aとその次の点Bとの位置関係を表すAの方向ベクト
ル、すなわち、点Aからその次の点Bに向かうベクトル
を求める。そして、この方向ベクトルのX方向の向きが
正であれば“1"を、零であれば“0"を、負であれば“−
1"を第1図(a)に示すメモリのアドレスFDXに格納す
る。Y方向についても同様に“1"、“0"または“−1"を
アドレスFDXにい格納する。この場合、Aの方向ベクト
ルはX方向が正、Y方向が零であるので“1",“0"をそ
れぞれFDX,FDYに格納する。次に、順次アウトラインを
作成してゆき、一週回って終点である点Aをプロットす
る時に、この終点Aの一つ前の終点Aに向かうベクトル
の方向を上記と同様にしてアドレスADX,ADYに格納す
る。この場合は、X方向、Y方向共に正であるので、
“1",“1"をそれぞれADX,ADYに格納する。そうすると、
メモリに格納されたデータは、“1,0,1,1,"となり、終
点Aをプロットする。この場合のようにデータが“1,0,
1,1"の場合は始点をプロットする。
FIG. 1 shows a case where the vector font has a trapezoidal shape as shown in (c) and point A is selected as a starting point for creating an outline. First, without plotting the start point A, a direction vector of A indicating the positional relationship between the start point A and the next point B, that is, a vector from the point A to the next point B is obtained. If the direction of the direction vector in the X direction is positive, “1” is set, if zero, “0” is set, and if negative, “−” is set.
1 "is stored at the address FDX of the memory shown in Fig. 1 (a). Similarly, in the Y direction," 1 "," 0 "or" -1 "is stored at the address FDX. Since the direction vector is positive in the X direction and zero in the Y direction, "1" and "0" are stored in FDX and FDY, respectively. Is plotted, the direction of the vector toward the end point A immediately before the end point A is stored in the addresses ADX and ADY in the same manner as described above. In this case, since both the X and Y directions are positive,
“1” and “1” are stored in ADX and ADY, respectively. Then,
The data stored in the memory is “1,0,1,1,”, and the end point A is plotted. If the data is “1,0,
For 1,1 ", plot the starting point.

また、第2図はベクトルフォントが(c)に示すよう
な三角形であり、頂点Aをアウトラインを作成するため
の始点に選んだ場合である。この場合は、メモリに格納
されるデータは“−1,1,−1,−1"となり、始点Aと、こ
の始点AをX軸方向にシフトした点の2点をプロットす
る。このように、データが“−1,1,−1,−1"の場合は頂
点処理を行う必要があるため、始点と、この始点をX軸
方向にシフトした点の2点をプロットする。
FIG. 2 shows a case where the vector font is a triangle as shown in (c) and the vertex A is selected as a starting point for creating an outline. In this case, the data stored in the memory is “−1, 1, −1, −1”, and two points of the starting point A and a point obtained by shifting the starting point A in the X-axis direction are plotted. As described above, when the data is “−1, 1, −1, −1”, it is necessary to perform the vertex processing. Therefore, the starting point and a point obtained by shifting the starting point in the X-axis direction are plotted.

以上の例に示すように、始点をプロットする必要があ
るかどうか、頂点処理を行う必要があるかどうかの判定
基準を、種々のケースについて、始点とその次の点との
位置関係および始点とその前の点との位置関係とに基づ
いて定めておき、アウトライン作成時に、その始点につ
いて上記位置関係を求め、上記判定基準に従って、始点
の処理を行うようにしている。
As shown in the above example, whether or not the starting point needs to be plotted and whether or not vertex processing needs to be performed are determined based on the positional relationship between the starting point and the next point and the starting point for various cases. The position is determined based on the positional relationship with the preceding point, and when the outline is created, the positional relationship is determined for the starting point, and the processing of the starting point is performed according to the determination criteria.

従って、誤りのない塗りつぶしを行うに際して、始点
についての制約をうけることなく、始点を任意に設定で
き、設定した始点について容易かつ高速に始点の処理を
行うことができる。
Therefore, when performing filling without error, the start point can be arbitrarily set without being restricted by the start point, and the set start point can be easily and quickly processed.

<発明の効果> 以上より明らかなように、この発明の画像処理方法
は、アウトラインベクトルからアウトラインを作成する
場合に、作成するアウトラインの最初の画素をプロット
することなく、次の画素から順次アウトラインを作成し
ていく。この時、最初の画素と次の画素との位置関係が
事前にメモリされており、上記最初の画素をプロットす
る時点において、該最初の画素とその前の画素との位置
関係と、事前にメモリされた位置関係とから、最初の画
素をプロットするか否かを選択し、プロットする場合に
は最初の画素からX軸方向に1ドットシフトした位置に
画素をプロットするものであるから、誤りのない塗りつ
ぶしを行うことができるアウトラインを作成でき、また
アウトラインの始点についての制約を受けることが全く
ないこから、その始点を任意に設定でき、かつ設定した
始点のプロットについては、事前に位置関係をメモリし
ておく等の非常に簡単な手法により上述した通り始点を
正確にかつ容易に高速処理できる。
<Effects of the Invention> As is apparent from the above, the image processing method of the present invention, when creating an outline from an outline vector, sequentially outlines from the next pixel without plotting the first pixel of the created outline. Create. At this time, the positional relationship between the first pixel and the next pixel is stored in advance, and at the time of plotting the first pixel, the positional relationship between the first pixel and the previous pixel is stored in advance in the memory. From the obtained positional relationship, it is selected whether or not to plot the first pixel. When plotting, the pixel is plotted at a position shifted by one dot in the X-axis direction from the first pixel. You can create an outline that can be filled without color, and there is no restriction on the start point of the outline, so you can set the start point arbitrarily, and for the plot of the set start point, The start point can be accurately and easily processed at high speed as described above by a very simple method such as storing the data in a memory.

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

第1図および第2図はこの発明の一実施例の始点処理を
説明する図、第3図はアウトライベクトルを説明する
図、第4図および第5図はスキャンフィルによる図形の
塗りつぶしを説明する図、第6,7,8図は従来の画像処理
方法によって作成されたアウトラインと塗りつぶしの誤
りが生じた図形を示す図、第9図は上記従来例における
縮小されたアウトラインが塗りつぶしの誤りを生じるア
ウトラインとなる場合を示す図、第10図は上記従来例に
おける図形の変形を説明する図、第11図は上記従来例に
おける塗りつぶしの誤りが生じるアウトラインの典型例
を示す図、第12図および第13図は従来例における始点処
理を説明する図である。
FIGS. 1 and 2 are diagrams for explaining a starting point process according to an embodiment of the present invention, FIG. 3 is a diagram for explaining an outlier vector, and FIGS. 4 and 5 are diagrams for explaining filling of a figure by scan fill. FIGS. 6, 7, and 8 are diagrams showing outlines created by the conventional image processing method and figures with erroneous fills, and FIG. 9 is a view showing reduced outlines in the above-described conventional example causing erroneous fills. FIG. 10 is a diagram illustrating a case of an outline, FIG. 10 is a diagram illustrating deformation of a figure in the conventional example, FIG. 11 is a diagram illustrating a typical example of an outline in which a fill error occurs in the conventional example, FIG. 12 and FIG. FIG. 13 is a diagram for explaining the starting point processing in the conventional example.

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】図形の輪郭を反時計方向に連なるアウトラ
インベクトルで表し、かつ、上記アウトラインベクトル
の向きを、そのアウトラインベクトルの左側を塗りつぶ
すと上記図形が塗りつぶしされるように設定し、上記ア
ウトラインベクトルからアウトラインを作成し、X軸方
向へスキャニングして、上記アウトラインと水平走査線
との奇数回目の交差で塗りつぶしを開始し、偶数回目の
交差で交差した画素を消し塗りつぶしを中止するように
した画像処理方法において、 上記アウトラインベクトルからアウトラインを作成する
場合に、作成するアウトラインの最初の画素をプロット
することなく、次の画素から順次アウトラインを作成し
ていくと共に、上記最初の画素と次の画素との位置関係
を記憶しておき、最終的に上記最初の画素をプロットし
ようとする時に、最初の画素とその前の画素との位置関
係と、上記記憶された位置関係とから、上記最初の画素
をプロットするかどうかを選択する一方、上記最初の画
素をプロットすることを選択した場合に、上記最初の画
素からX軸方向に1ドットシフトした位置の画素をプロ
ットするかどうかを選択するようにしたことを特徴とす
る画像処理方法。
1. The outline of a figure is represented by an outline vector connected in a counterclockwise direction, and the direction of the outline vector is set such that the figure is painted when the left side of the outline vector is painted. , An outline is created, scanning is performed in the X-axis direction, filling is started at an odd-numbered intersection of the outline and the horizontal scanning line, and pixels intersected at the even-numbered intersection are erased and the filling is stopped. In the processing method, when creating an outline from the outline vector, an outline is created sequentially from the next pixel without plotting the first pixel of the outline to be created, and the first pixel and the next pixel are created. Is stored, and finally the first pixel is When plotting, the user selects whether or not to plot the first pixel from the positional relationship between the first pixel and the previous pixel and the stored positional relationship, while plotting the first pixel. And selecting whether or not to plot a pixel at a position shifted by one dot in the X-axis direction from the first pixel.
JP1125296A 1989-05-18 1989-05-18 Image processing method Expired - Fee Related JP2634906B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP1125296A JP2634906B2 (en) 1989-05-18 1989-05-18 Image processing method
US07/524,428 US5073960A (en) 1989-05-18 1990-05-17 Image processing method using improved Bresenham algorithm in creating an outline of a figure to be painted and apparatus adopting the method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1125296A JP2634906B2 (en) 1989-05-18 1989-05-18 Image processing method

Publications (2)

Publication Number Publication Date
JPH02304483A JPH02304483A (en) 1990-12-18
JP2634906B2 true JP2634906B2 (en) 1997-07-30

Family

ID=14906574

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1125296A Expired - Fee Related JP2634906B2 (en) 1989-05-18 1989-05-18 Image processing method

Country Status (1)

Country Link
JP (1) JP2634906B2 (en)

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63305478A (en) * 1987-06-06 1988-12-13 Fujitsu Ltd Pattern information restoring device

Also Published As

Publication number Publication date
JPH02304483A (en) 1990-12-18

Similar Documents

Publication Publication Date Title
EP0592770B1 (en) Method for filling of interior pixels within a polygon
JP2634851B2 (en) Image processing device
EP0356262B1 (en) Image processing apparatus
US5475809A (en) Method and apparatus for generating high-quality character pattern defined by edge lines
JP2634906B2 (en) Image processing method
JPH04362793A (en) Drawing method in raster device
JP2770582B2 (en) Figure filling device
JP2613653B2 (en) Image processing device
JP4325812B2 (en) Vector image drawing circuit and vector image drawing method
JP3139805B2 (en) Image processing method and apparatus
JPH0520466A (en) Method and device for processing picture
JP3129717B2 (en) Image processing apparatus and image processing method
JPH0280267A (en) Processing of system of vector characters
JP2782904B2 (en) Polygon fill method
JP3089906B2 (en) Drawing equipment
JP2782752B2 (en) Character pattern output device
JP3338484B2 (en) Outline font transformation device
US5305431A (en) Method and system for rendering polygons on a raster display
JP3536894B2 (en) Graphic processing unit
JPH087794B2 (en) Image processing method
JPH0520468A (en) Method and device for processing picture
JP3567728B2 (en) Image processing method and apparatus
JP2835056B2 (en) High quality character pattern generation method
JPH01205388A (en) Generation system for high quality character and graphic or the like
JPH0423179A (en) Method and device for plotting thick line

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080425

Year of fee payment: 11

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090425

Year of fee payment: 12

LAPS Cancellation because of no payment of annual fees