JP2768370B2 - Drawing method - Google Patents

Drawing method

Info

Publication number
JP2768370B2
JP2768370B2 JP4011188A JP1118892A JP2768370B2 JP 2768370 B2 JP2768370 B2 JP 2768370B2 JP 4011188 A JP4011188 A JP 4011188A JP 1118892 A JP1118892 A JP 1118892A JP 2768370 B2 JP2768370 B2 JP 2768370B2
Authority
JP
Japan
Prior art keywords
scan line
tiling pattern
graphic
coordinates
processing
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
JP4011188A
Other languages
Japanese (ja)
Other versions
JPH05205070A (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.)
NEC Corp
Original Assignee
NEC 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 NEC Corp filed Critical NEC Corp
Priority to JP4011188A priority Critical patent/JP2768370B2/en
Publication of JPH05205070A publication Critical patent/JPH05205070A/en
Application granted granted Critical
Publication of JP2768370B2 publication Critical patent/JP2768370B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】本発明は、コンピュータ・ディス
プレイやプリンタ等の画像表示装置に画像を描画する図
形描画方法に関し、特に、面図形を描画する図形描画方
法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a graphic drawing method for drawing an image on an image display device such as a computer display or a printer, and more particularly to a graphic drawing method for drawing a plane figure.

【0002】[0002]

【従来の技術】図形には線図形と面図形の2種類があ
る。線図形は、直線や円のように画素の並びによって表
現される図形である。これに対して、面図形は、塗りつ
ぶした三角形や円のように「内部」を有する図形であ
る。面図形描画において、図形内部はタイリングパター
ンによって塗りつぶされる。
2. Description of the Related Art There are two types of figures: line figures and plane figures. A line figure is a figure represented by an arrangement of pixels, such as a straight line or a circle. On the other hand, a plane figure is a figure having an “inside”, such as a filled triangle or a circle. In drawing a plane figure, the inside of the figure is filled with a tiling pattern.

【0003】従来、最も汎用的なタイリングパターン
は、m×n画素のサイズの図形として定義され、図形描
画時には、塗りつぶし対象領域にタイリングパターンが
上下左右に連続するような形で敷き詰められる。このと
き、図形内のある画素とタイリングパターンとの対応
は、下記の数式1によって与えられる。
Conventionally, the most general-purpose tiling pattern is defined as a figure having a size of m × n pixels, and when drawing a figure, the tiling pattern is laid in an area to be painted in such a manner as to continue vertically, horizontally, and horizontally. At this time, the correspondence between a certain pixel in the figure and the tiling pattern is given by Equation 1 below.

【0004】[0004]

【数1】 (Equation 1)

【0005】次に、面図形描画を行う場合の基本的処理
について、図3および図5を用いて説明する。
[0005] Next, basic processing for drawing a plane figure will be described with reference to FIGS. 3 and 5.

【0006】図3は、面図形描画を行うのに必要な座標
およびタイリングパターンと、タイリングパターンのス
キャンラインにおける移動方向を示した図である。図3
において(A)は、描画図面の形状、タイリングパター
ンの設定情報、処理開始スキャンラインおよび処理終了
スキャンライン、描画処理対象スキャンラインにおける
描画処理開始座標および描画処理終了座標を示した図面
である。また図3において(B)は、描画処理開始座標
から描画処理終了座標までのタイリングパターン座標の
移動を示す図である。
FIG. 3 is a diagram showing coordinates and tiling patterns necessary for drawing a plane figure, and moving directions of the tiling patterns on a scan line. FIG.
7A is a drawing showing the drawing drawing shape, tiling pattern setting information, the processing start scan line and the processing end scan line, and the drawing processing start coordinates and the drawing processing end coordinates on the drawing processing target scan line. FIG. 3B is a diagram showing the movement of the tiling pattern coordinates from the drawing process start coordinates to the drawing process end coordinates.

【0007】図5は、従来の面図形描画方法の処理の流
れを示すフローチャートである。
FIG. 5 is a flowchart showing the flow of processing of the conventional plane figure drawing method.

【0008】ここでは、x座標は左から右へ値が増加す
るものと定義し、y座標軸は上から下へ値が増加するも
のと定義し、タイリングパターンの読みだしやマッピン
グの処理は座標値の方向へ進行するものとする。
Here, the x coordinate is defined as a value increasing from left to right, and the y coordinate axis is defined as a value increasing from top to bottom. It shall proceed in the direction of the value.

【0009】処理開始スキャンラインは、(y=Ya)
とし、処理終了スキャンラインは、(y=Yb)とす
る。
The processing start scan line is (y = Ya)
And the processing end scan line is (y = Yb).

【0010】処理対象スキャンラインは、(y=Yc)
とし、処理対象スキャンラインにおける描画開始座標を
(x=Xc1)とし、処理対象スキャンラインにおける
描画終了座標を(x=Xc2)とする。
The scan line to be processed is (y = Yc)
It is assumed that the drawing start coordinate on the processing target scan line is (x = Xc1) and the drawing end coordinate on the processing target scan line is (x = Xc2).

【0011】まず、タイリングパターンの設定情報、画
面図形の形状などに関する描画に必要な命令の入力を受
け付ける(ステップ201)。
First, an input of a command necessary for drawing of setting information of a tiling pattern and a shape of a screen graphic is received (step 201).

【0012】ステップ201で得られた図形の形状か
ら、処理対象となる図形空間を構成する水平ラインであ
るスキャンラインの範囲を定め、処理開始スキャンライ
ンおよび処理終了スキャンラインを設定する(ステップ
202)。
From the shape of the figure obtained in step 201, the range of scan lines which are horizontal lines constituting the figure space to be processed is determined, and the processing start scan line and the processing end scan line are set (step 202). .

【0013】処理開始スキャンラインを処理対象スキャ
ンラインに設定する(ステップ203)。ここでは、処
理開始スキャンラインは(y=Ya)なので、この(y
=Ya)が処理対象スキャンラインとなる。
The processing start scan line is set as the scan line to be processed (step 203). Here, since the processing start scan line is (y = Ya), this (y)
= Ya) is the scan line to be processed.

【0014】処理対象スキャンラインが設定されると、
処理開始スキャンラインから処理終了スキャンラインま
での間のスキャンラインでは、順次以下の処理を行う。
When a scan line to be processed is set,
The following processing is sequentially performed on scan lines between the processing start scan line and the processing end scan line.

【0015】処理対象スキャンライン(y=Yc)にお
ける描画処理開始座標(x=Xc1)および描画処理終
了座標(x=Xc2)を算出する(ステップ204)。
The drawing processing start coordinates (x = Xc1) and the drawing processing end coordinates (x = Xc2) on the processing target scan line (y = Yc) are calculated (step 204).

【0016】描画処理開始座標(Xc1,Yc)に対応
するタイリングパターンの座標(Pc1)を上記の数式
1によって求める(ステップ205)。
The coordinates (Pc1) of the tiling pattern corresponding to the drawing processing start coordinates (Xc1, Yc) are obtained by the above formula 1 (step 205).

【0017】描画処理開始座標から描画処理終了座標ま
での間に、上述のステップ205で求めたタイリングパ
ターン座標をマップ開始点としてタイリングパターンを
マッピングする。すなわち、描画マスクを生成する(ス
テップ206)。このマッピングは、タイリングパター
ンの右端と左端が連続しているとみなして行われるの
で、PR がマッピングされた画素の右隣の画素には、P
L がマッピングされる。
The tiling pattern is mapped between the drawing processing start coordinate and the drawing processing end coordinate using the tiling pattern coordinate obtained in step 205 as the map start point. That is, a drawing mask is generated (step 206). Since this mapping is performed assuming that the right end and the left end of the tiling pattern are continuous, the pixel on the right side of the pixel on which PR is mapped has P
L is mapped.

【0018】面図形の描画を実行する(ステップ20
7)。
Draw a plane figure (step 20)
7).

【0019】処理対象スキャンラインが処理終了スキャ
ンラインであるかどうかを調べる(ステップ208)。
処理対象スキャンラインが処理終了スキャンラインであ
ればステップ208の=)面図形描画処理を終了させ
る。処理対象スキャンラインが処理終了スキャンライン
でなければ(ステップ208の≠)、処理対象スキャン
ラインの更新をし(ステップ209)、ステップ204
に戻る。すなわち、処理対象スキャンラインが(y=Y
b)になるまで、上述のステップ204から、ステップ
208までの処理を繰り返す。
It is checked whether or not the scan line to be processed is a scan line that has been processed (step 208).
If the scan line to be processed is the process end scan line, the step 208 =) plane figure drawing processing is ended. If the processing target scan line is not the processing end scan line (# in step 208), the processing target scan line is updated (step 209), and step 204 is performed.
Return to That is, the scan line to be processed is (y = Y
The processing from step 204 to step 208 described above is repeated until b).

【0020】以上の手順によって、m×nサイズのタイ
リングパターンを用いた面図形描画を行うことができ
る。
With the above procedure, a plane figure can be drawn using an m × n size tiling pattern.

【0021】しかし、上述の方法では、1スキャンライ
ンごとに2回剰余演算が必要となる。図形の高さをhと
すると、図形全体で2×h回の剰余演算が必要となる。
ところが、汎用CPUでの剰余計算の演算速度は極めて
遅く、100クロック近くを必要とする。DSP(Di
gital Signal Processor)のよ
うな演算処理を得意とするプロセッサでも、数十クロッ
クは必要である。この演算速度は、メモリのアクセス
(2〜3クロック)や加減乗算(1〜2クロック)と比
較して非常に遅い。
However, the above-described method requires two remainder operations for each scan line. Assuming that the height of the figure is h, 2 × h remainder operations are required for the entire figure.
However, the calculation speed of remainder calculation in a general-purpose CPU is extremely slow, and requires about 100 clocks. DSP (Di
Even a processor such as a digital signal processor, which is good at arithmetic processing, requires several tens of clocks. This operation speed is much slower than memory access (2 to 3 clocks) and addition / subtraction multiplication (1 to 2 clocks).

【0022】従来の図面描画においては、このような剰
余計算による処理速度の遅れをなくすために、以下のよ
うな方法を用いている。
In the conventional drawing of a drawing, the following method is used in order to eliminate a delay in processing speed due to such a remainder calculation.

【0023】 剰余計算で、除数が2のべき乗である
場合には、その演算が極めて簡単になり、高速に実行で
きる。そこで、除数となるべきタイリングパターンの幅
を2のべき乗に制限する。一般には、使用する図形描画
システムのバス幅にあわせて、16ビットあるいは32
ビットに制限する。
In the remainder calculation, when the divisor is a power of 2, the calculation is extremely simple and can be performed at high speed. Therefore, the width of a tiling pattern to be a divisor is limited to a power of two. Generally, 16 bits or 32 bits are used according to the bus width of the graphic drawing system to be used.
Restrict to bits.

【0024】 y座標の値は、スキャンラインの変更
にしたがって、1ずつ変化する。その場合、剰余計算が
下記の数式2で表わされるとき、
The value of the y coordinate changes one by one as the scan line changes. In that case, when the remainder calculation is represented by the following equation 2,

【0025】[0025]

【数2】 (Equation 2)

【0026】下記の数式3となる性質を利用すると、剰
余演算を比較演算と加算に置き換えることができる。
Using the property represented by the following equation 3, the remainder operation can be replaced with a comparison operation and an addition.

【0027】[0027]

【数3】 (Equation 3)

【0028】このような方法を用いることで、一つの図
形に対する剰余演算を処理開始スキャンラインに対する
y座標の剰余演算1回に削減することができる。
By using such a method, the remainder calculation for one figure can be reduced to one remainder calculation of the y coordinate for the processing start scan line.

【0029】すなわち、面図形の速度を大幅に向上する
ことができる。
That is, the speed of the plane figure can be greatly improved.

【0030】上記の方法は、スキャンラインを1ずつ
変化させながら処理を行う場合には、のタイリングパ
ターンの幅の制限にかかわりなく有効であるので、上述
の基本的処理手順においても適用することができる。そ
の場合、y方向に対しての剰余演算を処理開始スキャン
ラインに対する一回のみに削減することができるので、
高さhの図形で必要な剰余算の数は(h+1)回にな
る。
The above method is effective in the case where the processing is performed while changing the scan line one by one, regardless of the limitation of the width of the tiling pattern. Therefore, the above method is also applied to the above basic processing procedure. Can be. In that case, since the remainder calculation in the y direction can be reduced to only once for the processing start scan line,
The number of surplus computation required in the figure of the height h is made to (h + 1) times.

【0031】[0031]

【発明が解決しようとする課題】ところで、一般に、図
形描画システムでは、描画処理速度が重要となるので、
タイリングパターンの幅を制限しているシステムが多
い。
Generally, in a graphic drawing system, the drawing processing speed is important.
Many systems limit the width of the tiling pattern.

【0032】一方で、任意サイズのタイリングパターン
を用いて、高速に描画を行いたいという要求が高まって
きている。たとえば、既に描画されている画像データの
一部をタイリングパターンとして用いる場合に、そのタ
イリングパターンを制限なしで使いたいというような要
求である。
On the other hand, there is an increasing demand to draw at high speed using a tiling pattern of an arbitrary size. For example, when a part of image data already drawn is used as a tiling pattern, there is a request to use the tiling pattern without restriction.

【0033】また、解像度の異なるデバイスにおいて見
栄えが同じようになるように、タイリングパターンの大
きさを換えたい場合がある。例えば、プリンタの改造度
が縦横それぞれれ1.5倍になったときに、それまで3
2×32画素のタイリングパターンで出力を得ていたと
すれば、同様の結果を得るためには、48×48画素の
タイリングパターンを用いる必要がある。
In some cases, it is desired to change the size of the tiling pattern so that the appearance is the same in devices having different resolutions. For example, when the remodeling degree of the printer has increased 1.5 times in both the vertical and horizontal directions,
If an output is obtained with a tiling pattern of 2 × 32 pixels, a tiling pattern of 48 × 48 pixels must be used to obtain the same result.

【0034】しかし、従来の面図形描画方法では、2の
べき乗以外のタイリングパターンは使用できないか、ま
たは、2のべき乗以外のタイリングパターンを使用した
場合の描画処理速度は遅く、実用的ではない。
However, in the conventional plane figure drawing method, a tiling pattern other than a power of 2 cannot be used, or a drawing processing speed when a tiling pattern other than a power of 2 is used is slow, so that it is not practical. Absent.

【0035】このため、従来の方法で面図形をタイリン
グパターンを用いて描画する際には、後述するように、
タイリングパターンの自由度と描画処理速度との間でト
レードオフを行わなければならなかった。すなわち、任
意サイズのタイリングパターンを用いる場合には、各ス
キャンラインごとに剰余計算を行わなければならず、描
画処理速度が遅くなるという問題があった。また、高速
処理を必要とする場合には、タイリングパターンの幅を
2のべき乗に制限する、または、タイリングパターン
の幅を従来技術が採用される図形描画システムのバス幅
などに依存した既定値に制限しなければならないという
問題があった。
For this reason, when a plane figure is drawn using a tiling pattern by a conventional method, as described later,
A trade-off has to be made between the degree of freedom of the tiling pattern and the drawing processing speed. That is, when a tiling pattern of an arbitrary size is used, the remainder calculation must be performed for each scan line, and there is a problem that the drawing processing speed is reduced. Further, in the case that requires high-speed processing, either limits the width of the tiling pattern to a power of 2, or, depending of the width of the tiling pattern such as the bus width of the drawing system the prior art is employed There was a problem that it had to be limited to the default value.

【0036】従って、本発明の目的は、任意サイズのタ
イリングパターンを用いる場合の剰余計算を削減するこ
とによって、描画処理速度を高める図形描画方法を提供
することにある。
Accordingly, it is an object of the present invention to provide a graphic drawing method which increases a drawing processing speed by reducing a remainder calculation when a tiling pattern of an arbitrary size is used.

【0037】また、本発明の別な目的は、描画に対して
高速処理を必要とする場合には、タイリングパターンの
幅を2のべき乗に制限しない、また、タイリングパター
ンの幅を図形描画システムのバス幅などに依存した限定
値に制限しない、図形描画方法を提供することにある。
Another object of the present invention is to limit the width of the tiling pattern to a power of 2 when drawing requires high-speed processing, and to set the width of the tiling pattern to graphic drawing. An object of the present invention is to provide a graphic drawing method which is not limited to a limited value depending on a system bus width or the like.

【0038】[0038]

【課題を解決するための手段】上記目的を達成するため
に、本発明の図形描画方法は、図形の輪郭情報から該図
形内部を画像処理装置に入力された図形のタイリングパ
ターンによって塗りつぶした図形を発生する図形描画方
法であって、図形を包含する外接長方形を設定し、前記
外接長方形内部を走査し、前記図形内の塗りつぶすべき
描画座標を剰余演算によって求め、該塗りつぶすべき描
画座標をタイリングパターンによって描画する図形描画
方法において、外接長方形を求めるステップと、外接長
方形内部を走査するステップと、外接長方形内部の走査
の際に、外接長方形の内部であって塗りつぶすべき部分
に対してタイリングパターンを発生するステップと、外
接長方形の内部であって、かつ、前記塗りつぶすべき図
形の外部にあり、塗りつぶしの対象にならない画素の部
分をマスクする画素マスクを発生するステップと、画素
マスクによってマスクされている画素に対しては描画を
行わず、画素マスクによってマスクされていない画素に
対してはタイリングパターンを描画するステップと、を
し、前記外接長方形の内部を走査するときに、走査す
る方向であるx方向の範囲を、前記外接長方形の左端か
ら前記図形の右端の間とすることを特徴とする。
In order to achieve the above object, a graphic drawing method according to the present invention provides a graphic drawing method in which the inside of a graphic is filled with a tiling pattern of the graphic input to an image processing apparatus from contour information of the graphic. Setting a circumscribed rectangle containing the figure, scanning the inside of the circumscribed rectangle, obtaining drawing coordinates to be filled in the figure by a remainder operation, and tiling the drawn coordinates to be filled. A step of obtaining a circumscribed rectangle; a step of scanning the inside of the circumscribed rectangle; and a step of scanning the inside of the circumscribed rectangle. Generating, and inside the circumscribed rectangle and outside the figure to be filled, Generating a pixel mask that masks the portion of the pixel that is not the target of the crushing; and performing no drawing on the pixel masked by the pixel mask, and tying the pixel masked by the pixel mask. when it possesses the steps of drawing a ring pattern, and to scan the interior of the bounding rectangle, scanning to
The range in the x direction, which is the direction of the circumscribed rectangle,
And between the right ends of the figures .

【0039】上記剰余演算の回数を描画する図形に関係
なく、外接長方形の特定の一点に対応するタイリングパ
ターンの座標を求めるための回数のみ行うことによっ
て、剰余演算を削減し、描画速度を高めることが望まし
い。
The remainder calculation is reduced and the drawing speed is increased by performing only the number of times for obtaining the coordinates of the tiling pattern corresponding to a specific point of the circumscribed rectangle irrespective of the figure to be drawn. It is desirable.

【0040】[0040]

【0041】[0041]

【実施例】以下、本発明の実施例について図面を参照し
て説明する。
Embodiments of the present invention will be described below with reference to the drawings.

【0042】図1は、本発明の一実施例による図形描画
方法の処理の流れを示すフローチャートである。
FIG. 1 is a flowchart showing the flow of processing of a graphic drawing method according to one embodiment of the present invention.

【0043】本発明による図形描画方法は、タイリング
パターンの設定情報、画面図形の形状などに関する描画
に必要な命令の入力を受け付けるステップ101と、ス
テップ101で入力された図形に対する外接長方形(以
下、境界ボックス)を求めるステップ102と、境界ボ
ックスの左上隅の点に対応するタイリングパターンの座
標を求めるステップ103と、描画処理開始スキャンラ
インを境界ボックスの上辺に設定し、描画処理終了スキ
ャンラインを境界ボックス下辺に設定するステップ10
4と、最初に描画処理を行うスキャンラインを上述の描
画処理開始スキャンラインに設定するステップ105
と、描画処理対象スキャンラインの描画開始座標および
描画終了座標を求めるステップ106と、上述の描画処
理対象スキャンライン上にあって、塗りつぶしの対象に
ならない画素の部分をマスクする画素マスクを生成する
ステップ107と、描画処理対象スキャンライン上で上
述の画素マスクがかかっていない部分にタイリングパタ
ーンをマッピングするステップ108と、描画処理を行
った描画処理対象ラインをチェックし、描画処理対象ス
キャンラインが上述の描画処理終了スキャンラインであ
れば、描画処理を終了させ、描画処理対象スキャンライ
ンが上述の描画処理終了スキャンラインでなければ、後
述のステップ110に移るステップ109と、処理対象
スキャンラインを更新するステップ110と、タイリン
グパターンの座標を更新するステップ111とから構成
される。
The graphic drawing method according to the present invention includes a step 101 for receiving an input of a command necessary for drawing concerning setting information of a tiling pattern, a shape of a screen graphic, and the like; Step 102 for obtaining a bounding box), Step 103 for obtaining the coordinates of a tiling pattern corresponding to the point at the upper left corner of the bounding box, setting the drawing process start scan line to the upper side of the bounding box, and setting the drawing process end scan line Step 10 for setting the lower side of the bounding box
4 and a step 105 of setting a scan line to be initially subjected to the drawing process to the above-described drawing process start scan line
And a step 106 for obtaining the drawing start coordinates and the drawing end coordinates of the drawing processing target scan line, and a step of generating a pixel mask for masking a portion of the pixel which is on the above described drawing processing target scan line and is not to be filled. 107, a step 108 of mapping a tiling pattern on a portion of the scan line to be subjected to the drawing process, which is not covered with the pixel mask, and checking the line to be subjected to the drawing process, If the drawing processing end scan line is the drawing processing end scan line, the drawing processing is ended. If the drawing processing target scan line is not the above-described drawing processing end scan line, step 109 proceeds to step 110 described later, and the processing target scan line is updated. Step 110 and tiling pattern coordinates It consists updating step 111..

【0044】図2は、本発明の一実施例による図形描画
方法が適用される図形描画システムの構成を示すブロッ
ク図である。
FIG. 2 is a block diagram showing the configuration of a graphic drawing system to which the graphic drawing method according to one embodiment of the present invention is applied.

【0045】本発明が適用される図形描画システムは、
CPU10と、画面に表示する画像データの構成各画素
を保持するフレームメモリ11と、タイリングパターン
の座標を制御するタイリングパターン座標制御回路12
と、タイリングパターンを格納するタイリングパターン
格納メモリ13と、描画座標を保持する描画座標レジス
タ14と、画像処理装置に入力された図形の輪郭線を発
生させる輪郭線発生器15と、描画開始座標および描画
終了座標を保持する描画開始/終了座標レジスタ16
と、画素マスクを生成する描画マスク発生回路17と、
上述のタイリングパターン格納メモリ13と描画マスク
発生回路17とフレームメモリ11とから得られた情報
を制御する描画制御回路18と、から構成される。
A graphic drawing system to which the present invention is applied is as follows:
A CPU 10, a frame memory 11 for holding each pixel constituting image data to be displayed on the screen, and a tiling pattern coordinate control circuit 12 for controlling the coordinates of the tiling pattern
A tiling pattern storage memory 13 for storing a tiling pattern, a drawing coordinate register 14 for storing drawing coordinates, a contour generator 15 for generating a contour of a figure input to the image processing apparatus, Drawing start / end coordinate register 16 for storing coordinates and drawing end coordinates
A drawing mask generating circuit 17 for generating a pixel mask;
It comprises a tiling pattern storage memory 13, a drawing mask generation circuit 17, and a drawing control circuit 18 for controlling information obtained from the frame memory 11.

【0046】図3については、すでに従来の技術の項目
で説明したので、ここでは省略する。
FIG. 3 has already been described in the section of the prior art and will not be described here.

【0047】図4は、本発明の一実施例による図形描画
方法を適用した結果を示した図である。
FIG. 4 is a diagram showing the result of applying the graphic drawing method according to one embodiment of the present invention.

【0048】続いて、図2、図3および図4を用いて具
体的に説明する。
Next, a specific description will be given with reference to FIGS. 2, 3 and 4.

【0049】本説明では、座標またはベクトルによって
与えられる端点に基づいて定義される図形に対し、当該
図形の内部を描画する場合について、図3における
(A)に示す三角形の塗りつぶしを例に説明する。
In the present description, a case in which the inside of a figure defined on the basis of an end point given by coordinates or a vector is drawn will be described with reference to an example of filling a triangle shown in FIG. .

【0050】本実施例では、タイリングパターンの発生
を境界ボックスの内部全体に対して行うものとする。す
なわち、図3における(A)に示す領域[1]全体にタ
イリングパターンしてタイリングパターンの発生を行う
ものとする。
In this embodiment, it is assumed that the generation of a tiling pattern is performed for the entire inside of the bounding box. That is, a tiling pattern is generated by performing a tiling pattern on the entire region [1] shown in FIG.

【0051】タイリングパターンは図3(B)に示すm
×nのサイズとする。
The tiling pattern is shown in FIG.
× n size.

【0052】描画マスクで処理される座標の画素の値を
MSKとする。
The value of the pixel at the coordinates processed by the drawing mask is defined as MSK.

【0053】フレームメモリ11での描画座標の画素の
値をDSTとする。
The value of the pixel at the drawing coordinates in the frame memory 11 is DST.

【0054】タイリングパターン座標回路12によって
示されるタイリングパターン格納メモリの値をPTNと
する。
The value of the tiling pattern storage memory indicated by the tiling pattern coordinate circuit 12 is defined as PTN.

【0055】また、図形・タイリングパターン等に与え
られる座標については、従来の技術において使用した通
りとするので、ここでの説明は省略する。
The coordinates given to the figures, tiling patterns and the like are the same as those used in the prior art, and the description is omitted here.

【0056】まず、描画すべき図形およびそのタイリン
グパターン情報について入力する(ステップ101)。
ここでは、一つの三角形とその内部をタイリングパター
ンによって塗りつぶすので、それに必要な命令を入力す
る。
First, a figure to be drawn and its tiling pattern information are input (step 101).
Here, since one triangle and its interior are painted with a tiling pattern, a command necessary for it is input.

【0057】描画の前準備として次のことが行われる。The following is performed as preparation before drawing.

【0058】与えられた図形の境界ボックスを算出する
(ステップ102)。ここで得られる境界ボックスは、
点(Xa,Ya)と点(Xb,Yb)とを結ぶ線を対角
線とする長方形である。
The bounding box of the given figure is calculated (step 102). The bounding box obtained here is
It is a rectangle whose diagonal is a line connecting the point (Xa, Ya) and the point (Xb, Yb).

【0059】境界ボックスの左上隅の点(Xa,Ya)
に対応するタイリングパターン上の座標Paを求める
(ステップ103)。座標Paは数式1を用いると、下
記の数式4のようになる。
Point (Xa, Ya) at the upper left corner of the bounding box
Are obtained on the tiling pattern corresponding to (step 103). Using Equation 1, the coordinates Pa are as shown in Equation 4 below.

【0060】[0060]

【数4】 (Equation 4)

【0061】求めた座標Paを、タイリングパターン座
標制御回路12へ格納する。
The calculated coordinates Pa are stored in the tiling pattern coordinate control circuit 12.

【0062】描画処理開始スキャンラインを境界ボック
スの上辺(y=Ya)に設定し、また、描画処理終了ス
キャンラインを境界ボックスの下辺(y=Yb)に設定
する(ステップ104)。
The drawing process start scan line is set on the upper side (y = Ya) of the bounding box, and the drawing process end scan line is set on the lower side (y = Yb) of the bounding box (step 104).

【0063】最初の描画処理対象スキャンラインを描画
処理開始スキャンラインに設定する(ステップ10
5)。
The first scan line to be subjected to the drawing process is set as the scan line for starting the drawing process (step 10).
5).

【0064】次に、描画処理開始スキャンラインと描画
処理終了スキャンラインとの間の各描画処理対象スキャ
ンラインに対して、順次以下の処理を施す。
Next, the following processing is sequentially performed on each scanning target scan line between the rendering processing start scan line and the rendering processing end scan line.

【0065】描画図形と描画処理対象スキャンラインと
の交点の座標を輪郭線発生器15を用いて求める。輪郭
線発生器15によって得られる描画図形と描画処理対象
スキャンラインとの交点のうち、左側の交点座標(Xc
1,Yc)は描画開始座標として設定され、右側の交点
座標(Xc2,Yc)は描画終了座標として設定される
(ステップ106)。これらの描画開始座標および描画
終了座標は、描画開始/終了座標レジスタ16に格納さ
れる。
The coordinates of the intersection between the drawing figure and the scan line to be subjected to the drawing process are obtained by using the contour generator 15. Among the intersections between the drawing figure obtained by the contour generator 15 and the scan line to be subjected to the drawing processing, the coordinates of the intersection at the left (Xc
(1, Yc) is set as drawing start coordinates, and the right intersection coordinates (Xc2, Yc) are set as drawing end coordinates (step 106). These drawing start coordinates and drawing end coordinates are stored in the drawing start / end coordinate register 16.

【0066】描画マスク発生回路17によって、描画マ
スクを生成する(ステップ107)。描画マスクは、境
界ボックスの左端から右端まで走査される描画座標レジ
スタ14の値(X)と、描画開始/終了座標レジスタ1
6に格納されている描画開始座標(Xc1)および描画
終了座標(Xc2)とを比較し、Xc1≦X≦Xc2と
なる部分に対してのみ描画が行われるように、かつ、そ
れ以外の部分には描画の影響が及ばないようなパターン
に生成される。
A drawing mask is generated by the drawing mask generation circuit 17 (step 107). The drawing mask includes the value (X) of the drawing coordinate register 14 scanned from the left end to the right end of the bounding box, and the drawing start / end coordinate register 1
6 is compared with the drawing start coordinates (Xc1) and the drawing end coordinates (Xc2), and the drawing is performed only on the portion where Xc1 ≦ X ≦ Xc2, and on the other portions. Is generated in a pattern that is not affected by drawing.

【0067】処理開始点(Xa,Xc)から処理終了点
(Xb,Yc)までの間に、Pcをマッピング開始点と
してタイリングパターンをマッピングする(ステップ1
08)。
A tiling pattern is mapped using Pc as a mapping start point between the processing start point (Xa, Xc) and the processing end point (Xb, Yc) (step 1).
08).

【0068】上述のDST、PTNおよびMSKを用い
ると、描画は下記の数式5の演算によって実行される。
When the above-mentioned DST, PTN, and MSK are used, drawing is performed by the calculation of the following equation (5).

【0069】[0069]

【数5】 (Equation 5)

【0070】描画結果は、図4に示すようになる。すな
わち、Aの部分は描画前のDSTの値を保ち、Bの部分
はPTNの値が書き込まれる。
The drawing result is as shown in FIG. That is, the portion A holds the value of DST before drawing, and the portion B writes the value of PTN.

【0071】描画実行後、描画処理対象スキャンライン
が描画処理終了スキャンラインであれば、描画処理を終
了するが、描画処理対象スキャンラインが描画処理終了
スキャンラインでない場合(ステップ109の≠)は以
下のことを行う。
After the execution of the drawing, if the scan line to be subjected to the drawing process is the scan line at which the drawing process has been completed, the drawing process is terminated. Do that.

【0072】描画処理対象スキャンラインの更新する
(ステップ110)、描画処理対象スキャンラインの更
新においては、現在の処理対象スキャンラインよりも1
画素下の部分に、処理対象スキャンラインを移動させる
ことになる。更新されたスキャンラインは、下記の数式
6のように表すことができる。
The scan line to be subjected to the drawing process is updated (step 110).
The scan line to be processed is moved to a portion below the pixel. The updated scan line can be expressed as Equation 6 below.

【0073】[0073]

【数6】 (Equation 6)

【0074】また、点(Xa,Yc+1)に対応するタ
イリングパターン上の座標Pc+1は、Pcの値に数式
3を適用することで求めることができる。(ステップ1
11)タイリングパターンの更新を終えた後、再び上述
のステップ106に戻る。
The coordinates Pc + 1 on the tiling pattern corresponding to the point (Xa, Yc + 1) can be obtained by applying Equation 3 to the value of Pc. (Step 1
11) After updating the tiling pattern, the process returns to step 106 again.

【0075】以上の処理を描画処理対象スキャンライン
と描画処理終了スキャンラインとが一致する、すなわ
ち、Yc=Ybとなるまで繰り返す。
The above processing is repeated until the scan line to be subjected to the drawing process and the scan line at the end of the drawing process match, that is, Yc = Yb.

【0076】これまで延べてきた描画処理は、視点を変
えると次のように考えることもできる。 タイリングパターンの発生は、境界ボックスの内部
ら全体に対して行う。 描画マスクを用いることで、実際に描画が行われる
画素を描画対象図形の内部に限定する。
The drawing processing that has been extended can be considered as follows when the viewpoint is changed. The generation of the tiling pattern is performed for the entire inside of the bounding box. By using the drawing mask, the pixel where the drawing is actually performed is limited to the inside of the drawing target graphic.

【0077】によって、x座標に関する剰余演算を省
略することができる。すなわち、境界ボックス左端のx
座標(Xa)は、描画処理開始スキャンラインから描画
処理終了スキャンラインの間で変化しない。したがっ
て、x座標に関する剰余計算は、最初に一度だけ、(X
a mod m)を計算するだけでよい。
As a result, the remainder operation on the x coordinate can be omitted. That is, x at the left end of the bounding box
The coordinates (Xa) do not change between the drawing processing start scan line and the drawing processing end scan line. Therefore, the remainder calculation on the x coordinate is performed only once (X
a mod m) only needs to be calculated.

【0078】次に、本発明の図形描画方法の別の実施例
について説明する。
Next, another embodiment of the graphic drawing method of the present invention will be described.

【0079】タイリングパターンの発生を境界ボックス
の内部全体に行うとすると、実際に描画が行われるの
は、図3(A)に示す領域[1]のみである。その他の
領域の[2]〜[4]については、タイリングパターン
の発生は行われるが、描画マスクによってマスクされる
ので描画は行われない。描画処理対象スキャンライン上
において、塗りつぶすべき図形の最右端までを走査すれ
ばよい。よって、[3]と[4]は、無駄な領域であ
る。
If the generation of the tiling pattern is performed on the entire inside of the bounding box, only the area [1] shown in FIG. 3A is actually drawn. For the other regions [2] to [4], a tiling pattern is generated, but is not drawn since it is masked by the drawing mask. It suffices to scan up to the rightmost end of the graphic to be painted on the drawing processing target scan line. Therefore, [3] and [4] are useless areas.

【0080】この無駄をなくすためには、上述のステッ
プ107および108すなわち、画素マスクの生成と描
画実行におけるx方向の走査範囲を、境界ボックスの左
端から、描画終了座標までと制限すればよい。そうする
と、図3(A)における領域[3]および[4]に対す
るタイリングパターンの発生と描画マスクの発生とを省
略できる。
In order to eliminate this waste, the above-described steps 107 and 108, that is, the scanning range in the x direction in generating the pixel mask and executing the drawing may be limited from the left end of the bounding box to the drawing end coordinates. Then, generation of a tiling pattern and generation of a drawing mask for the regions [3] and [4] in FIG. 3A can be omitted.

【0081】それ以外の処理については、上述の実施例
に従うので、ここでは省略する。
The other processes are the same as those in the above-described embodiment, and thus will not be described here.

【0082】[0082]

【発明の効果】以上説明したように、本発明の図形描画
方法は、剰余演算の回数を描画する図形に関係なく、画
像処理装置に入力された図形を包含する外接長方形の特
定の一点に対応するタイリングパターンの座標を求める
ための回数のみ行えばよいので、剰余演算が削減でき、
描画速度を高めることができる。
As described above, the graphic drawing method according to the present invention can be applied to a specific point of a circumscribed rectangle including a graphic input to the image processing apparatus, regardless of the graphic to be drawn for the number of remainder operations. Need only be performed the number of times to obtain the coordinates of the tiling pattern to be performed, so that the remainder calculation can be reduced,
The drawing speed can be increased.

【0083】また、本発明の図形描画方法は、タイリン
グパターンの幅を2のべき乗に制限しない、また、タイ
リングパターンの幅を図形描画システムのバス幅などに
依存した限定値に制限しないので、画像処理システムの
違いにかかわらず、描画処理速度とタイリングパターン
の自由度を保持することができる。
The graphic drawing method of the present invention does not limit the width of the tiling pattern to a power of two and does not limit the width of the tiling pattern to a limited value depending on the bus width of the graphic drawing system. Regardless of the difference between the image processing systems, the drawing processing speed and the degree of freedom of the tiling pattern can be maintained.

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

【図1】本発明の一実施例による図形描画方法の処理の
流れを示すフローチャートである。
FIG. 1 is a flowchart showing a processing flow of a graphic drawing method according to an embodiment of the present invention.

【図2】本発明の一実施例による図形描画方法が適用さ
れる図形描画システムの構成を示すブロック図である。
FIG. 2 is a block diagram showing a configuration of a graphic drawing system to which a graphic drawing method according to one embodiment of the present invention is applied;

【図3】面図形描画を行うのに必要な座標およびタイリ
ングパターンと、タイリングパターンのスキャンライン
における移動方向を示した図である。図3において
(A)は、描画図面の形状、タイリングパターンの設定
情報、処理開始スキャンラインおよび処理終了スキャン
ライン、描画処理対象スキャンラインにおける描画開始
座標および描画処理終了座標を示した図面である。また
図3において(B)は、描画処理開始座標から描画処理
終了座標までのタイリングパターン座標の移動を示す図
である。
FIG. 3 is a diagram showing coordinates and tiling patterns necessary for drawing a plane figure and moving directions of the tiling patterns on a scan line. FIG. 3A is a diagram showing the shape of the drawing, the setting information of the tiling pattern, the processing start scan line, the processing end scan line, and the drawing start coordinates and the drawing processing end coordinates of the drawing processing target scan line. . FIG. 3B is a diagram showing the movement of the tiling pattern coordinates from the drawing process start coordinates to the drawing process end coordinates.

【図4】本発明の一実施例による図形描画方法を適用し
た結果を示した図である。
FIG. 4 is a diagram showing a result of applying a graphic drawing method according to an embodiment of the present invention.

【図5】従来の面図形描画方法の処理の流れを示すフロ
ーチャートである。
FIG. 5 is a flowchart showing a processing flow of a conventional plane figure drawing method.

【符号の説明】[Explanation of symbols]

10 CPU 11 フレームメモリ 12 タイリングパターン座標制御回路 13 タイリングパターン格納メモリ 14 描画座標レジスタ 15 輪郭線発生器 16 描画開始/終了座標レジスタ 17 描画マスク発生回路 18 描画制御回路 Reference Signs List 10 CPU 11 Frame memory 12 Tiling pattern coordinate control circuit 13 Tiling pattern storage memory 14 Drawing coordinate register 15 Contour generator 16 Drawing start / end coordinate register 17 Drawing mask generating circuit 18 Drawing control circuit

Claims (2)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 画像処理装置に入力された図形の輪郭情
報から該図形内部のタイリングパターンによって塗りつ
ぶした図形を発生する図形描画方法であって、 前記図形を包含する外接長方形を設定し、前記外接長方
形内部を走査し、前記図形内の塗りつぶすべき描画座標
を剰余演算によって求め、該塗りつぶすべき描画座標を
タイリングパターンによって描画する図形描画方法にお
いて、 前記外接長方形を求めるステップと、 前記外接長方形内部を走査するステップと、 前記外接長方形内部の走査の際に、前記外接長方形の内
部であって前記塗りつぶすべき部分に対してタイリング
パターンを発生するステップと、 前記外接長方形の内部であって、かつ、前記塗りつぶす
べき図形の外部にあり、塗りつぶしの対象にならない画
素の部分をマスクする画素マスクを発生するステップ
と、 前記画素マスクによってマスクされている画素に対して
は描画を行わず、前記画素マスクによってマスクされて
いない画素に対しては前記タイリングパターンを描画す
るステップとを有し、 前記外接長方形の内部を走査するときに、走査する方向
であるx方向の範囲を、前記外接長方形の左端から前記
図形の右端の間と することを特徴とする図形描画方法。
1. A graphic drawing method for generating a graphic filled with a tiling pattern inside a graphic from contour information of the graphic input to an image processing apparatus, comprising: setting a circumscribed rectangle including the graphic; A figure drawing method for scanning the inside of a circumscribed rectangle, obtaining drawing coordinates to be filled in the figure by a remainder operation, and drawing the drawing coordinates to be filled with a tiling pattern, wherein the step of obtaining the circumscribed rectangle; Scanning the inside of the circumscribed rectangle, and generating a tiling pattern for the portion to be painted inside the circumscribed rectangle, and inside the circumscribed rectangle, and Pixels that are outside the figure to be filled and are not to be filled. Generating a pixel mask to be masked, and drawing the tiling pattern for pixels not masked by the pixel mask without drawing the pixels masked by the pixel mask. have a, when scanning the interior of the bounding rectangle, the direction of scanning
From the left end of the circumscribed rectangle to the x direction
A graphic drawing method characterized by being between right ends of the graphic.
【請求項2】 前記剰余演算の回数を描画する図形に関
係なく、前記外接長方形の特定の一点に対応する前記タ
イリングパターンの座標を求めるための回数のみ行うこ
とによって、剰余演算を削減し、描画速度を高めること
を特徴とする請求項1記載の図形描画方法。
2. The method according to claim 1, wherein the number of times of the remainder calculation is performed only by the number of times for obtaining the coordinates of the tiling pattern corresponding to a specific point of the circumscribed rectangle, regardless of a figure to be drawn. 2. The graphic drawing method according to claim 1, wherein the drawing speed is increased.
JP4011188A 1992-01-24 1992-01-24 Drawing method Expired - Lifetime JP2768370B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4011188A JP2768370B2 (en) 1992-01-24 1992-01-24 Drawing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4011188A JP2768370B2 (en) 1992-01-24 1992-01-24 Drawing method

Publications (2)

Publication Number Publication Date
JPH05205070A JPH05205070A (en) 1993-08-13
JP2768370B2 true JP2768370B2 (en) 1998-06-25

Family

ID=11771095

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4011188A Expired - Lifetime JP2768370B2 (en) 1992-01-24 1992-01-24 Drawing method

Country Status (1)

Country Link
JP (1) JP2768370B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006209654A (en) * 2005-01-31 2006-08-10 Matsushita Electric Ind Co Ltd Pattern-equipped polygon drawing device
JP5345973B2 (en) * 2010-05-20 2013-11-20 株式会社沖データ Image forming apparatus

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0328984A (en) * 1989-06-27 1991-02-07 Fujitsu Ltd Face paint drawing system using hatch pattern

Also Published As

Publication number Publication date
JPH05205070A (en) 1993-08-13

Similar Documents

Publication Publication Date Title
JP3107452B2 (en) Texture mapping method and apparatus
US4975976A (en) Image transformation method and device
EP0344686B1 (en) Clipping process and processor
JPH0660173A (en) Method and apparatus for reducing picture
JPS6327983A (en) Rotating graphic form generating device
JP2768370B2 (en) Drawing method
JPH01296389A (en) Method and device for processing graphic
US5299299A (en) Scan line full figure filling device for display units and printers
JPH07225849A (en) Graphics computer and line plotter
JP2899838B2 (en) Storage device
JPH09106453A (en) Picture deforming method
JP2000298729A (en) Two-dimensional image generation device
JP3272463B2 (en) Image forming apparatus and method of using the same
JPH08314428A (en) Display device with character masking function
JP2642374B2 (en) Figure clipping method
JP3211591B2 (en) Image processing device
JP2836617B2 (en) Rendering processor
JP3517982B2 (en) Drawing device
JP2787487B2 (en) Circuit for determining the position of a line segment displayed and operated on a computer system
JP2633517B2 (en) Display information processing device
JPH05225354A (en) Method and device for three-dimensional graphic display processing and graphic display method
JP2616443B2 (en) Graphic drawing device
JP2803235B2 (en) Digital image processing method
JPH02308381A (en) Polygon painting-out system
JP3159431B2 (en) Image processing system

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 19980311