JPH0727357B2 - Straight line drawing method in graphic device - Google Patents

Straight line drawing method in graphic device

Info

Publication number
JPH0727357B2
JPH0727357B2 JP60128149A JP12814985A JPH0727357B2 JP H0727357 B2 JPH0727357 B2 JP H0727357B2 JP 60128149 A JP60128149 A JP 60128149A JP 12814985 A JP12814985 A JP 12814985A JP H0727357 B2 JPH0727357 B2 JP H0727357B2
Authority
JP
Japan
Prior art keywords
point
straight line
points
line
coordinate
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
JP60128149A
Other languages
Japanese (ja)
Other versions
JPS61286895A (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.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP60128149A priority Critical patent/JPH0727357B2/en
Publication of JPS61286895A publication Critical patent/JPS61286895A/en
Publication of JPH0727357B2 publication Critical patent/JPH0727357B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Image Generation (AREA)
  • Controls And Circuits For Display Device (AREA)

Description

【発明の詳細な説明】 〔発明の利用分野〕 本発明はグラフィック装置における直線描画方式に関
し、更に詳しくは、直線の両端が直線の方向に対し垂直
に終端し、かつ一様な線幅を有する直線を描画するため
の直線描画方式に関するものである。
Description: BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a straight line drawing method in a graphic device, and more specifically, both ends of the straight line end perpendicularly to the direction of the straight line and have a uniform line width. The present invention relates to a straight line drawing method for drawing a straight line.

〔発明の背景〕[Background of the Invention]

ピクセルを表示の最小単位とするグラフィック装置にお
いて、従来、線幅を持った直線を描画するための方式の
一つに、直線の描画位置を指定する2つの指定点に対
し、x軸またはy軸方向に平行に1ピクセルずつずらし
て指定線幅の本数だけ多重に線を引く方式があった。こ
の方式によって、線幅が3ピクセル相当、線種が破線で
ある直線を表示した例を第11図(a)に示す。第11図
(a)において、丸印は表示上のピクセルを表わし、特
に斜線を施したものは実際の描画点を表わす。尚、この
ことは以下に示す第11図(b),(c)においても同様
とする。
In a graphic device that uses pixels as the minimum unit of display, one of the conventional methods for drawing a straight line having a line width is the x-axis or the y-axis with respect to two specified points that specify the drawing position of the straight line. There has been a method of shifting lines by one pixel in parallel to the direction and drawing multiple lines by a specified number of lines. An example of displaying a straight line having a line width of 3 pixels and a line type of a broken line by this method is shown in FIG. 11 (a). In FIG. 11 (a), circles represent pixels on the display, and hatched parts represent actual drawing points. This also applies to FIGS. 11 (b) and 11 (c) shown below.

第11図(a)を見れば明らかな通り、この方式では、
(1)直線の両端が直線の方向に対し、垂直に終端しな
い、(2)ラインスタイル(線パターン)が直線の垂直
方向に揃わない、などの点で問題があった。
As is clear from Fig. 11 (a), in this method,
There are problems in that (1) both ends of a straight line do not end vertically to the direction of the straight line, and (2) line styles (line patterns) are not aligned in the vertical direction of the straight line.

そこで、この様な第11図(a)に示した方式を改良する
ものとして、特開昭59−136784号公報に記載されている
様な直線描画方式が提案された。この方式では、平行な
多重線を順次描画する際、直線の描画位置を指定する2
つの指定点56,57の座標値より直線の角度を求め、これ
に応じて、ラインスタイル実現のための線パターン配列
の開始位置をずらすようなハードウェアを構成すること
により、直線の方向に対し垂直な方向にラインスタイル
の切れ目を揃えるようにしている。この方式による表示
例を第11図(b)に示す。この方式では、第11図(b)
に示す様に、第11図(a)で述べた問題のうち、ライン
スタイルに関する問題については改善されているが、そ
れ以外の問題については改善がなされておらず、また、
実施するに当り、特殊なハードウェアを付加せねばなら
ないという点も問題であった。
Therefore, as an improvement of the method shown in FIG. 11 (a), a straight line drawing method as described in JP-A-59-136784 has been proposed. In this method, when drawing parallel multiple lines sequentially, the drawing position of the straight line is specified.
By determining the angle of the straight line from the coordinate values of the two designated points 56 and 57, and configuring the hardware to shift the start position of the line pattern array to realize the line style, the direction of the straight line can be changed. The line style cuts are aligned in the vertical direction. A display example by this method is shown in FIG. 11 (b). In this method, FIG. 11 (b)
As shown in Fig. 11, among the problems described in Fig. 11 (a), the problems related to the line style have been improved, but the other problems have not been improved.
There was also a problem in that special hardware had to be added to the implementation.

また、この他の別の方式として、直線の両端において直
線の方向に対し垂直な方向に点列をそれぞれ求め、それ
ら両端の点列間を点同士それぞれ直線で結ぶという方式
がある。この方式によって、線幅が3ピクセルに相当す
る直線を表示した例を第11図(c)に示す。第11図
(c)において、点列64は、点64−a,64−b,64−cから
成り、点列55は、点65−a,65−b,65−cから成ってお
り、共に直線の両端における点列を示している。これら
の両端の点列64,65は、予め与えられている2つの指定
点56,57の座標と線幅とから幾何学的計算によって、先
ず直線の四隅の点64−a,64−c,65−a,65−cの座標値を
それぞれ求め、次にそれらを用いて、点64−aと点64−
cとの間を結ぶ直線と、点65−aと点65−cとの間を結
ぶ直線とを各々構成する点列をそれぞれ求めることによ
り得る。
Further, as another method, there is a method in which point sequences are obtained at both ends of a straight line in a direction perpendicular to the direction of the straight line, and the point sequences at both ends are connected by straight lines. An example of displaying a straight line having a line width of 3 pixels by this method is shown in FIG. 11 (c). In FIG. 11 (c), the point sequence 64 consists of points 64-a, 64-b, 64-c, and the point sequence 55 consists of points 65-a, 65-b, 65-c, Both show a series of points at both ends of the straight line. The point sequences 64, 65 at the both ends of the points are first calculated by the geometric calculation from the coordinates and the line widths of the two designated points 56, 57 given in advance, and the points at the four corners of the straight line 64-a, 64-c, The coordinate values of 65-a and 65-c are obtained, respectively, and then they are used to calculate points 64-a and 64-
It is obtained by determining the respective point sequences that respectively form the straight line connecting the points c and c and the straight line connecting the points 65-a and 65-c.

第12図は、上記した直線の四隅を求める方法を更に詳細
に説明するための説明図であり、第12図において、2つ
の指定点55,56の座標値をそれぞれ(x0,y0),(x1,y
1)とし、直線の長さをl、直線の方向に対する垂直方
向の線幅をdとする。
FIG. 12 is an explanatory diagram for explaining in more detail the method of obtaining the above-mentioned four corners of the straight line. In FIG. 12, the coordinate values of the two designated points 55, 56 are (x 0 , y 0 ) respectively. , (X 1 , y
1 ), the length of the straight line is l, and the line width in the direction perpendicular to the direction of the straight line is d.

例えば、求める四隅の点のうち1つの点90の座標は、破
線で示した2つの3角形の相似関係より、 と求まる。四隅の他の点91,92,93についても、点90に関
する指定点55からの偏差と、指定点55,56の座標値から
求めることができる。
For example, the coordinates of one point 90 among the four corner points to be obtained are calculated from the similarity relationship of the two triangles shown by the broken line, Is asked. The other points 91, 92, 93 at the four corners can also be obtained from the deviation of the point 90 from the designated point 55 and the coordinate values of the designated points 55, 56.

この方式では、第11図(a),(b)にそれぞれ示した
方式に比べ、直線の両端やラインスタイルの切れ目が、
直線の方向に対し垂直な方向に揃うという点で改善され
ている。
In this method, compared to the method shown in FIGS. 11 (a) and 11 (b), the ends of the straight line and the line style breaks are
It is improved in that it aligns in the direction perpendicular to the direction of the straight line.

しかし、新たに、次のような2つの問題が生じている。
1つは、直線の内部に塗りつぶしの抜けが生じるという
問題である。つまり、この方式では、第11図(c)に示
す様に直線の方向に対し垂直な方向に求めた両端の点列
64,点列65の中で、xおよびy座標値が同時に変化する
箇所、すなわち点64−aと64−bの間、点65−bと点65
−cの間、が存在し、このため、両端の点列間を結ぶ直
線を形成する点列を描画したときに、破線の丸印で示し
たような描画されない点53を生ずるのである。
However, the following two new problems have arisen.
First, there is a problem that the omission of the fill occurs inside the straight line. In other words, in this method, as shown in FIG. 11 (c), the point sequences at both ends obtained in the direction perpendicular to the straight line direction are obtained.
64, a point sequence 65 where x and y coordinate values change simultaneously, that is, between points 64-a and 64-b, points 65-b and 65.
Therefore, when a point sequence forming a straight line connecting between the point sequences at both ends is drawn, an undrawn point 53 as indicated by a broken circle is generated.

又、もう一つの問題点は、指定された直線を描画するた
めに多くの処理時間がかかることである。この理由は、
直線の四隅の点を求めるのに複雑な計算が必要であるこ
とや、直線の両端の点列間に多重に平行線を描画する塗
りつぶし方式を用いているためである。
Another problem is that it takes a lot of processing time to draw a designated straight line. The reason for this is
This is because complicated calculations are required to find the points at the four corners of the straight line, and the filling method that draws multiple parallel lines between the point sequences at both ends of the straight line is used.

〔発明の目的〕[Object of the Invention]

本発明の目的は、上記した従来技術の問題点を解決し、
グラフィック装置において、指定された線幅を有し、か
つ直線の方向に対し垂直な方向に直線の両端および指定
されたラインスタイルの切れ目が揃い、しかも、直線の
内部に塗りつぶしの抜けが生じていない直線を、高速に
描画する直線描画方式を提供することにある。
The object of the present invention is to solve the above-mentioned problems of the prior art,
In the graphic device, the line width has the specified line width, the both ends of the line and the specified line style cuts are aligned in the direction perpendicular to the direction of the line, and there is no omission of the fill inside the line. It is to provide a straight line drawing method for drawing a straight line at high speed.

〔発明の概要〕[Outline of Invention]

上記した目的を達成するために、本発明では、所定の線
幅を有した直線を描画する際、処理装置は、主メモリに
格納されたプログラムに従い、指定された第1及び第2
の指定点を結ぶ直線の方向に対して垂直な方向に、該第
1の指定点を含み、指定された線幅に相当する長さの直
線を構成する点列の各点座標を求め、さらに、それらの
各点について、その中に含まれる第1の基準点に対する
相対的な位置座標を求めて前記主メモリに記憶した後、
第1の指定点に対する第1の基準点の位置関係と同等の
位置関係を前記第2の指定点に対して持つ第2の基準点
の座標を求め、前記第1及び第2の基準点間を結ぶ直線
を構成する点列の各点座標を求めると共に、その点座標
を一点求める毎に、併せて前記主メモリに記憶した相対
的な位置座標を参照しながらその点に対する該位置座標
の各々に基づく各相対位置に存在する点の点座標をそれ
ぞれ求め、また、それら点のうち隣接する2つの点のx
座標値及びy座標値が異なる場合は、その2つの点のう
ち、一方の点とx座標値を同じくし、他方の点とy座標
値を同じくする点も併せて求め、求めた各点座標の座標
位置と対応する表示メモリ内のメモリ位置に各々所定の
点情報を格納し、その後、ディスプレイ制御装置が格納
した前記点情報を読出してラスタディスプレイの画面上
に表示することにより、該ラスタディスプレイの画面上
に所定の線幅を有した直線を表示するようにした。ま
た、本発明では、直線の描画位置を指定する2つの指定
点の間を結ぶ線の両側に均等な幅を有する直線を描画す
る場合においては、前記処理装置が、前記2つの指定点
のうちの一方の点の座標位置から、直線の方向に対し垂
直方向に指定した線幅の半分の距離に相当する個数だけ
順次点列を求めて、到達した点を第1の基準点とし、該
基準点から折返し前記指定点の方向に、指定した線幅の
距離に相当する個数だけ、順次点列を求め、求めたその
点列を第1の点列とすることにより、第1の点列を得る
ようにしたものである。
In order to achieve the above-mentioned object, in the present invention, when drawing a straight line having a predetermined line width, the processing device follows the program stored in the main memory and specifies the first and second designated lines.
The coordinates of each point of the point sequence forming the straight line having the length corresponding to the designated line width including the first designated point in the direction perpendicular to the direction of the straight line connecting the designated points of , For each of these points, after obtaining relative position coordinates relative to the first reference point contained therein and storing them in the main memory,
Between the first and second reference points, the coordinates of the second reference point having a positional relationship equivalent to the positional relationship of the first reference point with respect to the first specified point with respect to the second specified point are obtained. Each position coordinate of the point sequence forming the straight line connecting the points is obtained, and each time the position coordinate is obtained, each of the position coordinates with respect to that point is referred with reference to the relative position coordinates also stored in the main memory. The point coordinates of the points existing at each relative position based on
When the coordinate value and the y coordinate value are different, one of the two points has the same x coordinate value and the other point also has the same y coordinate value, and the obtained point coordinates Predetermined point information is stored in each memory position in the display memory corresponding to the coordinate position of the raster display, and then the point information stored by the display controller is read and displayed on the screen of the raster display. A straight line having a predetermined line width is displayed on the screen. Further, according to the present invention, when a straight line having a uniform width is drawn on both sides of a line connecting two designated points for designating the drawing position of the straight line, the processing device selects one of the two designated points. From the coordinate position of one of the points, a sequence of points is sequentially obtained by the number corresponding to the half of the line width specified in the direction perpendicular to the direction of the straight line, and the reached point is set as the first reference point. Folding from a point In the direction of the designated point, the point sequence is sequentially obtained by the number corresponding to the distance of the designated line width, and the obtained point sequence is set as the first point sequence. It's something I got to get.

〔発明の実施例〕Example of Invention

以下に本発明の一実施例を図を用いて説明する。 An embodiment of the present invention will be described below with reference to the drawings.

第2図は本発明を実施するために用いるグラフィック装
置の構成を示すブロック図である。
FIG. 2 is a block diagram showing the configuration of a graphic device used for implementing the present invention.

第2図において、10は主メモリ(以下、MMと略す)、11
は外部ファイルの制御装置(以下、EFIと略す)、12は
外部ファイル(以下、EFと略す)、13は演算装置処理
(以下、CPUと略す)、14はキーボードの制御装置(以
下、KBIと略す)、15はキーボード(以下、KBと略
す)、16はプリンタの制御装置(以下PRIと略す)、17
はプリンタ(以下、PRと略す)、20はグラフィック処理
ユニット(以下、GPUと略す)、22はラスタディスプレ
イ(以下、Dと略す)、であり、これらは共通バス21に
て互いに接続されている。
In FIG. 2, 10 is a main memory (hereinafter abbreviated as MM), 11
Is an external file control device (hereinafter abbreviated as EFI), 12 is an external file (hereinafter abbreviated as EF), 13 is a processing unit (hereinafter abbreviated as CPU), 14 is a keyboard control device (hereinafter abbreviated as KBI) Abbreviated), 15 a keyboard (hereinafter abbreviated as KB), 16 a printer controller (hereinafter abbreviated as PRI), 17
Is a printer (hereinafter abbreviated as PR), 20 is a graphic processing unit (hereinafter abbreviated as GPU), 22 is a raster display (hereinafter abbreviated as D), and these are connected to each other by a common bus 21. .

第3図は、第2図で示したGPU20の構成を詳細に示した
ブロック図である。
FIG. 3 is a block diagram showing in detail the configuration of the GPU 20 shown in FIG.

第3図において、23はセグメントメモリ(以下、SMと略
す)、24はグラフィック処理装置(以下、GPと略す)、
25は表示メモリ(以下、FMと略す)、26はディスプレイ
制御装置(以下、DCと略す)、であり、これらは内部バ
ス27にて互いに接続されている。
In FIG. 3, 23 is a segment memory (hereinafter abbreviated as SM), 24 is a graphic processing device (hereinafter abbreviated as GP),
Reference numeral 25 is a display memory (hereinafter abbreviated as FM), 26 is a display control device (hereinafter abbreviated as DC), and these are connected to each other by an internal bus 27.

なお、SM23はMM10で代用することができ、また、GP24は
CPU13にその機能を持たせることもできる。
SM23 can be replaced by MM10, and GP24 is
The CPU 13 can have that function.

第2図に示すグラフィック装置において、D22へ図形を
描画するための動作について第3図を共に参照しながら
説明する。
The operation for drawing a graphic on D22 in the graphic device shown in FIG. 2 will be described with reference to FIG.

D22へ図形を描画するためのプログラム及び図形データ
(一般には図形描画命令列)はMM10に格納されており、
CPU13はプログラムをMM10より読出して実行する。D22へ
の図形の表示を行なうには、CPU13はまず、該図形デー
タをMM10からGPU20内のSM23に転送する命令を該プログ
ラムより読出し、実行する。次いで、CPU13は、GPU20内
のGP24に図形描画の実行要求を行なう命令を、MM10より
取出し実行する。
A program for drawing a graphic on D22 and graphic data (generally a graphic drawing command sequence) are stored in MM10.
The CPU 13 reads the program from the MM 10 and executes it. In order to display a graphic on D22, the CPU 13 first reads an instruction to transfer the graphic data from the MM10 to the SM23 in the GPU 20 from the program and executes it. Next, the CPU 13 fetches from the MM 10 an instruction to request the GP 24 in the GPU 20 to execute drawing, and executes the command.

実行要求を受けたGPU20内のGP24はSM23から該当する図
形データを取出してピクセルデータに変換し、D22上の
ピクセルに対応したFM25上の領域に格納する。DC26は一
定周期でFM25を巡回的に読出しながら、読出した属性に
従って対応するピクセルを表示する。このことにより、
D22は常にFM25に格納されたデータを反映した表示が成
される。
Upon receipt of the execution request, the GP24 in the GPU20 extracts the corresponding figure data from the SM23, converts it into pixel data, and stores it in the area on the FM25 corresponding to the pixel on the D22. The DC 26 cyclically reads out the FM 25 at regular intervals, and displays the corresponding pixels according to the read out attributes. By this,
The display of D22 always reflects the data stored in FM25.

第4図は本発明の直線描画方式による画面出力例を示す
模式図である。
FIG. 4 is a schematic diagram showing an example of screen output by the straight line drawing method of the present invention.

第4図において、丸印は表示上のピクセルを表わし、特
に斜線を施したものは実際の描画点を表わす。また、点
55および56は直線の両端の指定点であり、本図は点55お
よび56を結ぶ直線を中心に両側に均等な幅を持つ直線33
(破線)を描いた例である。
In FIG. 4, circles represent pixels on the display, and those with diagonal lines represent actual drawing points. Also, the point
55 and 56 are designated points on both ends of the straight line, and this figure shows a straight line 33 with equal width on both sides centering on the straight line connecting points 55 and 56.
This is an example of drawing (broken line).

第4図に示す様に、本実施例によって描画される直線は
その両端が直線の方向に対し垂直に終端し、ラインスタ
イルも直線の方向に対し垂直な方向にパターンの切れ目
が揃うよう描画される。
As shown in FIG. 4, the straight line drawn according to the present embodiment has both ends terminating perpendicularly to the direction of the straight line, and the line style is also drawn so that the pattern cuts are aligned in the direction perpendicular to the direction of the straight line. It

では、第2図に示したグラフィック装置において、第4
図に示した様な直線を描画するための動作について説明
する。
Then, in the graphic device shown in FIG.
An operation for drawing a straight line as shown in the figure will be described.

尚、以下の説明では、ラスタ・ディスプレイの走査方向
をx軸、x軸と垂直方向をy軸とし、描画する直線の傾
斜角をx軸正方向を0°として反時計廻りに45°までの
範囲に限定して説明する。他の角度についても、x軸と
y軸の交換、第8図で後述するデジタル微分解析法(以
下、DDAと呼称する)におけるx軸方向またはy軸方向
の増分の符号の変更によって、以下と同様に取扱うこと
ができる。
In the following description, the scanning direction of the raster display is the x-axis, the direction perpendicular to the x-axis is the y-axis, and the inclination angle of the straight line to be drawn is 0 ° in the positive direction of the x-axis and up to 45 ° in the counterclockwise direction. The description will be limited to the range. Regarding other angles, by changing the x-axis and y-axis and changing the sign of the increment in the x-axis direction or the y-axis direction in the digital differential analysis method (hereinafter referred to as DDA) described later in FIG. It can be handled similarly.

第5図は、指定された線幅dと直線の傾斜角θとに対す
る補正線幅d′の関係を示すための説明図である。
FIG. 5 is an explanatory diagram showing the relationship of the corrected line width d ′ with respect to the designated line width d and the inclination angle θ of the straight line.

第2図及び第3図において前述した如く、CPU13がGPU20
内のGP24に対し、図形描画の実行要求として直線描画の
実行要求を出したとすると、その実行要求を受けたGP24
は、第4図に示した様な幅を持った直線を描画するため
に、次の様な処理を順に行う。
As described above with reference to FIGS. 2 and 3, the CPU 13 is the GPU 20.
If a straight line drawing execution request is issued to the GP24 inside as a drawing drawing execution request, the GP24 that has received the execution request
Performs the following processes in order to draw a straight line having a width as shown in FIG.

指定線幅dに対して、直線の傾きによって変化する
直線描画のための補正線幅d′(第5図参照)を求め
る。
For the designated line width d, a corrected line width d '(see FIG. 5) for drawing a straight line that changes depending on the inclination of the straight line is obtained.

直線の一端において、指定点55を中心として、直線
の方向に対し垂直な方向に、線幅d分の点列(y軸方向
の増分が補正線幅d′と等しくなる点列)を求め、その
点列中の一点を基準点としてその基準点に対する他の各
点の相対的な位置座標をSM23に記憶する。
At one end of the straight line, a point sequence having a line width d (a point sequence in which the increment in the y-axis direction is equal to the corrected line width d ′) is obtained in a direction perpendicular to the direction of the straight line with the designated point 55 as the center, Using one point in the point sequence as a reference point, the relative position coordinates of each of the other points with respect to the reference point are stored in SM23.

SM23に記憶された相対的な位置座標を参照しなが
ら、直線の一端から他端に向かって、順次、直線の方向
に対し垂直方向に連らなる点列の点座標を、直線の内部
に隙間ができないようにして求め、求めた点座標に対応
するFM25のメモリ位置に点情報(ピクセルデータ)を格
納する。
While referring to the relative position coordinates stored in the SM23, from one end of the straight line to the other end, the point coordinates of a series of points that are continuous in the direction perpendicular to the straight line The point information (pixel data) is stored in the memory position of the FM25 corresponding to the obtained point coordinates.

FM25に点情報を格納する際、その点情報は、ライン
スタイルを実現する為に、SM23に格納された線のパター
ン列を巡回的に参照することによって得る。
When the point information is stored in the FM 25, the point information is obtained by cyclically referencing the line pattern sequence stored in the SM 23 to realize the line style.

以上がGP24の処理動作の概略であるが、これらについて
以下ひとつづつ順をおって詳細に説明する。
The above is the outline of the processing operation of GP24, and these will be described in detail one by one below.

先ず、の処理動作について説明する前に、幅を有した
直線を描画するために必要なテーブルについて説明して
おく。
First, before describing the processing operation, the table necessary for drawing a straight line having a width will be described.

第6図は、本発明において直線描画のために必要なテー
ブルを示す模式図である。第6図に示す各テーブルは通
常SM23上に存在している。
FIG. 6 is a schematic diagram showing a table required for straight line drawing in the present invention. Each table shown in FIG. 6 usually exists on the SM 23.

第6図(a)に示すテーブルは、直線の属性テーブルで
ある。
The table shown in FIG. 6A is a straight line attribute table.

第6図(a)において、エリア40,41はそれぞれ指定点5
5のx座標、y座標を格納しており、エリア42,43はそれ
ぞれ指定点56のx座標、y座標を格納している。又、エ
リア44は第5図に示す指定線幅dを、エリア45は直線描
画に用いる補正線幅d′をそれぞれ格納している。エリ
ア46はラインスタイル実現のための線パターンを格納し
ている。線パターンはビット列として表され、φ…描画
しない、1…描画する、の2状態を持ったビットを、ラ
インスタイルの一周期のピクセル個数分だけ用意してい
る。
In FIG. 6 (a), areas 40 and 41 are designated points 5 respectively.
The x coordinate and the y coordinate of 5 are stored, and the areas 42 and 43 store the x coordinate and the y coordinate of the designated point 56, respectively. The area 44 stores the designated line width d shown in FIG. 5, and the area 45 stores the correction line width d'used for straight line drawing. Area 46 stores a line pattern for realizing a line style. The line pattern is represented as a bit string, and bits having two states of φ ... not drawn and 1 ... drawn are prepared for the number of pixels in one cycle of the line style.

第6図(b)に示すテーブルは直線描画のためのワーク
・テーブルである。
The table shown in FIG. 6 (b) is a work table for drawing a straight line.

第6図(b)において、エリア47,48はそれぞれ後述の
如くして求められる第7図に示す基準点57のx座標、y
座標を格納するものであり、エリア49,50も同様にそれ
ぞれ、第7図に示す基準点58のx座標、y座標を格納す
るものである。又、オフセット配列51は、後述の如くGP
24は指定点を中心とする、描画すべき直線の方向に対し
垂直な、補正線幅分の長さをy軸方向に対して有する直
線を形成する点列の座標値を、基準点からのx座標,y座
標の偏差として求めた後、求めたy座標の偏差の小さい
点から順に、その点のx座標の偏差値を格納して行くも
のである。オフセット配列51の大きさは指定線幅dの指
定可能な最大値で決まる。
In FIG. 6 (b), areas 47 and 48 are respectively obtained as described later, and the x coordinate and y of the reference point 57 shown in FIG. 7 are obtained.
The coordinates are stored, and the areas 49 and 50 also store the x coordinate and the y coordinate of the reference point 58 shown in FIG. 7, respectively. Also, the offset array 51 is a GP as described later.
24 is the coordinate value of the point sequence forming a straight line centered on the specified point and perpendicular to the direction of the straight line to be drawn and having a length for the correction line width in the y-axis direction, from the reference point. After the deviations of the x-coordinate and the y-coordinate are obtained, the deviation value of the x-coordinate of the point is stored in order from the point having the smallest deviation of the y-coordinates obtained. The size of the offset array 51 is determined by the maximum specifiable value of the designated line width d.

第6図(c)に示すテーブルは線幅補正テーブルであ
り、直線の傾きと指定線幅dとから補正線d′を求める
ためのものである。第5図からわかる通り、dとd′の
関係は d′=dcosθ ……式(2) であり、直線の傾き を式(2)に代入すると、 と表わされる。実際必要なd′の値は整数値であるの
で、 の値に最も近い整数値をd′とする。そこで、式(3)
を用いて、指定可能な線幅dのそれぞれについて、補正
線幅d′の各整数値を取り得るための直線の傾きの各最
大値をそれぞれ求め、それらを格納したものが第6図
(c)に示す線幅補正テーブルである。
The table shown in FIG. 6 (c) is a line width correction table, which is used to obtain the correction line d'from the inclination of the straight line and the designated line width d. As can be seen from FIG. 5, the relationship between d and d ′ is d ′ = dcosθ (Equation (2)), and the slope of the straight line Substituting into equation (2), Is represented. Since the actually required value of d'is an integer value, Let d ′ be the integer value closest to the value of. Therefore, equation (3)
For each of the line widths d that can be specified, the respective maximum values of the slopes of the straight lines for obtaining the respective integer values of the corrected line width d ′ are respectively obtained, and these are stored in FIG. 6 (c). ) Is a line width correction table shown in FIG.

第6図(c)において、上端に並んだ各数字は線幅dの
値をそれぞれ示し、左端に並んだ文字は補正線幅d′の
値(dには、上記した線幅dの値が代入される。)をそ
れぞれ示し、又、各ブロック内の小数点の付いた数字は
直線の傾きの値を示している。
In FIG. 6 (c), the numbers arranged at the upper end indicate the value of the line width d, and the characters arranged at the left end indicate the value of the corrected line width d '(d is the value of the line width d described above. Substituted numbers) and the numbers with a decimal point in each block indicate the value of the slope of the straight line.

即ち、この線幅補正テーブルでは、或る指定線幅dに相
当する列において先頭ブロックからi行目のブロック内
の内容は、補正線幅d′をd−i+1とする直線の傾き
の最大値を格納している。なお、直線の角度が0°から
45°の範囲で、補正線幅d′が最大となるのは、式
(2)より角度45°すなわち傾き1のときである。よっ
て、各線幅dに対応する傾きのテーブルの最後の値は1,
000となる。
That is, in this line width correction table, the contents in the block of the i-th row from the first block in the column corresponding to a certain specified line width d is the maximum value of the inclination of the straight line with the correction line width d ′ being d−i + 1. Is stored. The angle of the straight line is from 0 °
In the range of 45 °, the correction line width d ′ becomes maximum when the angle is 45 °, that is, the inclination is 1 according to the equation (2). Therefore, the last value in the table of slopes corresponding to each line width d is 1,
It will be 000.

以上が、直線描画のために必要なテーブルである。The above is the table required for straight line drawing.

では、これらのテーブルを用いて行なわれるGP24の処理
動作について説明する。
Now, the processing operation of GP24 performed using these tables will be described.

前述したの処理動作では、先ず、GP24は、SM23内の属
性テーブル(第6図(a)参照)に格納されている2つ
の指定点55,56の座標値から直線の傾きを導びき出す。
次に、この直線の傾きの値と、属性テーブルに格納され
た指定線幅dの値とからSM23内の線幅補正テーブル(第
6図(c)参照)を用いて、補正線幅d′の値を次の様
にして求める。即ち、求めた直線の傾きの値が、指定線
幅dに相当する列の先頭からi−1行目の値より大き
く、i行目の値より小さいなら、補正線幅d′は、d′
=d−i+1の式に従って計算することにより、求める
ことができる。例えば、今、求めた直線の傾きの値が
“0.800"で、指定線幅dが“9"であったとすると、第6
図(c)において指定線幅“9"に相当する列は右端の1
列であり、その列の中で、直線の傾きの値“0.800"は、
先頭から2行目の値“0.633"より大きく、3行目の値
“0.958"より小さいので、iは“3"と求まり、従って、
式:d′=d−i+1にそれぞれ代入して計算すると、補
正線幅d′は“7"と求まる。
In the processing operation described above, first, the GP 24 derives the slope of a straight line from the coordinate values of the two designated points 55 and 56 stored in the attribute table (see FIG. 6A) in the SM 23.
Next, based on the value of the inclination of this straight line and the value of the designated line width d stored in the attribute table, the correction line width d ′ is used by using the line width correction table in SM23 (see FIG. 6 (c)). The value of is calculated as follows. That is, if the calculated slope value of the straight line is larger than the value of the i-1th row from the beginning of the column corresponding to the designated line width d and smaller than the value of the i-th row, the corrected line width d ′ is d ′.
= D-i + 1 can be calculated. For example, if the value of the slope of the straight line thus obtained is "0.800" and the designated line width d is "9", the sixth line
In the figure (c), the column corresponding to the designated line width "9" is 1 at the right end.
It is a column, and in that column, the value of the slope of the straight line “0.800” is
Since it is larger than the value "0.633" on the second line from the beginning and smaller than the value "0.958" on the third line, i is obtained as "3", and therefore,
Substituting into the formula: d ′ = d−i + 1 respectively, the correction line width d ′ is obtained as “7”.

次に第7図を用いて、前述したの処理動作について説
明する。
Next, the above-mentioned processing operation will be described with reference to FIG.

第7図は、直線の端の点列を求める動作を説明するため
の説明図である。
FIG. 7 is an explanatory diagram for explaining the operation of obtaining the point sequence at the end of the straight line.

まず、GP24は、指定点55から直線の方向に対し垂直な方
向に連なり、y軸方向の増分が〔d′/2〕(記号〔〕は
整数化することを意味する)、すなわち補正線幅d′の
半分を整数化した長さとなる点列をDDA処理により求め
る。第7図において、破線矢印で示す丸印は、このDDA
処理で求めた通過ピクセルである。次に、GP24は、この
様にして到達した点を基準点57とし、基準点57より指定
点55に向ってy軸方向の増分が補正線幅d′分の長さと
なる点列をDDA処理により、第7図において実線矢印で
示すように順次求めて行き、指定点55を中心に持つ点列
を得る。第7図において、正方形で囲んだピクセルは求
まった端の点列である。
First, the GP24 is continuous from the designated point 55 in a direction perpendicular to the straight line, and the increment in the y-axis direction is [d '/ 2] (the symbol [] means integerization), that is, the correction line width. A point sequence having a length obtained by converting half of d'to an integer is obtained by DDA processing. In Fig. 7, the circle indicated by the dashed arrow is the DDA
It is the passing pixel obtained by the processing. Next, the GP 24 sets the point thus reached as the reference point 57, and performs the DDA processing on the point sequence whose increment in the y-axis direction from the reference point 57 toward the designated point 55 is the length of the correction line width d ′. Thus, as shown by the solid arrow in FIG. 7, the points are sequentially obtained to obtain a point sequence having the designated point 55 as the center. In FIG. 7, the pixels surrounded by a square are the obtained point sequences.

次に、GP24は、求めた点列を、基準点57から偏差として
SM23に記憶する。具体的には、直線が0°〜45°の傾き
なら、求めた点列のy座標はすべての点で1ずつ異るの
で、GP24は、基準点57からのy座標値の偏差の絶対値
を、SM23内のワーク・テーブル(第6図(b)参照)に
おけるオフセット配列51のインデックス(index)とし
て、基準点57からのx座標値の偏差を、オフセット配列
51のインデックスが示す箇所に格納する。第7図に示す
直線の例では、オフセット配列51には先頭から順に、
φ,1,1,2,2,3,3,4,4と言った具合に格納される。
Next, GP24 uses the obtained point sequence as a deviation from the reference point 57.
Store in SM23. Specifically, if the straight line has an inclination of 0 ° to 45 °, the y coordinate of the obtained point sequence differs by 1 at every point, so the GP24 uses the absolute value of the deviation of the y coordinate value from the reference point 57. Is the index of the offset array 51 in the work table in the SM 23 (see FIG. 6 (b)), and the deviation of the x coordinate value from the reference point 57 is the offset array.
Store it at the location indicated by index 51. In the example of the straight line shown in FIG. 7, the offset array 51 has
It is stored in the order of φ, 1,1,2,2,3,3,4,4.

次に、の処理動作について説明するわけであるが、そ
の前に、本実施例で用いられるDDA処理について説明し
ておく。
Next, the processing operation will be described, but before that, the DDA processing used in this embodiment will be described.

第8図(a)〜(c)は、通常の直線描画に用いる単方
向DDA方式を説明するための説明図である。第8図にお
いて、丸印はピクセルを表わし、破線63は理想の直線を
表わす。単方向DDAは、第8図(a),(b)に示す様
に、理想の直線からピクセルの中心までの変位をΔyと
すると、ある点から次の点を求めるとき、Δyが負なら
ばx座標とともにy座標を1増加させた点60を次の点と
し、Δyが正ならばx座標だけ1増加した点61を次の点
とする方式である。この方式により描画した直線は第8
図(c)のようになる。
FIGS. 8A to 8C are explanatory views for explaining the unidirectional DDA method used for normal line drawing. In FIG. 8, circles represent pixels, and broken line 63 represents an ideal straight line. As shown in FIGS. 8 (a) and 8 (b), the unidirectional DDA is such that if the displacement from the ideal straight line to the center of the pixel is Δy, and when the next point is obtained from one point, if Δy is negative. In this method, the point 60 where the y coordinate is incremented by 1 along with the x coordinate is the next point, and the point 61 where the x coordinate is incremented by 1 is the next point if Δy is positive. The straight line drawn by this method is the 8th
It becomes like FIG.

第8図(d)〜(f)は、前述のDDAを、幅を持った直
線内部にできる規則的な抜けをすべて塗りつぶすことが
できるように変更を加えた、変形DDAを説明するための
説明図である。変形DDAは、ある点から次の点を求める
ときに、第8図(d)に示す様に、Δyが負ならばx座
標,y座標ともに1増加した点60を次点として描画し、そ
れと同時に、y座標だけ1増加した点62も併せて描画す
るという点で単方向DDAとは異なっている。この方式に
より描画した直線は第8図(f)のようになる。
FIGS. 8 (d) to 8 (f) are explanatory views for explaining the modified DDA in which the above-mentioned DDA is modified so that all regular voids formed inside a straight line having a width can be filled. It is a figure. When the next point is obtained from a certain point, the modified DDA draws the point 60, which is increased by 1 both in the x coordinate and the y coordinate, as the next point when Δy is negative, as shown in FIG. 8 (d). At the same time, it differs from the unidirectional DDA in that it also draws a point 62 that is incremented by 1 for the y coordinate. The straight line drawn by this method is as shown in FIG.

以上が、DDA処理についての説明である。The above is the description of the DDA process.

次に、第9図を用いて、前述したの処理動作について
説明する。
Next, the above-mentioned processing operation will be described with reference to FIG.

第9図は、直線の内部の点列を求める動作を説明するた
めの説明図である。
FIG. 9 is an explanatory diagram for explaining an operation for obtaining a point sequence inside a straight line.

GP24は、基準点57からもう一方の基準点58(基準点58の
求め方は後述する。)へ単方向DDA処理を行ない、基準
点57と58の間を結ぶ直線上の途中の点(xn,yn)70を順
次求める。このとき、GP24は、第9図に示す様に点
(xn,yn)を一点求める毎に、オフセット配列51内の有
効なd′個の要素について、先頭から後尾に至るまで順
次、各要素のインデックス値をynから引き、該インデッ
クスに格納されたオフセット値をxnに加えることによ
り、点(xn,yn)70に対する点列の各座標値71を求め、
それら座標値70,71に対応するFM25内のメモリ位置に点
情報を格納する。又、この際、変形DDA方式を用いて第
8図(d)に示したピクセル62のような点についても併
せて点情報を書き込むことにより、直線内部のすき間を
なくす。
The GP24 performs unidirectional DDA processing from the reference point 57 to the other reference point 58 (how to obtain the reference point 58 will be described later), and the midpoint (x n , y n ) 70 are sequentially obtained. At this time, as shown in FIG. 9, the GP24 sequentially calculates the effective d ′ elements in the offset array 51 from the beginning to the end each time it finds one point (x n , y n ). Each coordinate value 71 of the point sequence with respect to the point (x n , y n ) 70 is obtained by subtracting the element index value from y n and adding the offset value stored in the index to x n ,
The point information is stored in the memory location in the FM 25 corresponding to those coordinate values 70 and 71. Further, at this time, by using the modified DDA method, point information is also written for points such as the pixel 62 shown in FIG. 8 (d) to eliminate the gap inside the straight line.

次に、第10図を用いて、前述したの処理動作について
説明する。
Next, the above-mentioned processing operation will be described with reference to FIG.

第10図はラインスタイルを実現するための処理動作を説
明するための説明図である。
FIG. 10 is an explanatory diagram for explaining a processing operation for realizing the line style.

尚、予めSM23内の属性テーブル(第6図(a)参照)に
は、第10図に示す様な線パータン列46が格納されている
ものとし、この配列のインデックスを示すポインタも用
意されているものとする。
The attribute table in the SM 23 (see FIG. 6 (a)) is assumed to store a line pattern sequence 46 as shown in FIG. 10, and a pointer indicating the index of this array is also prepared. Be present.

そこで、GP24は、第9図にて述べた様に、基準点57から
58へ単方向DDA方式により、点(xn,yn)70を求めてゆ
くとき、第10図に示す配列46のポインタの内容を1ずつ
増加させながら、そのポインタの示す配列の内容を取出
し、その内容に従い、座標値(xn,yn)70の点、および
座標値(xn,yn)70からオフセット値を参照して求めた
座標値71を持つ点列、を描画するかどうかを決め、それ
に対応する様、点情報をFM25内に書き込む。即ち、その
内容がφであれば、前述した様に、描画しないというこ
となので、その意味に対応した点情報がFM25内に格納さ
れ、又、1であれば、描画するという意味に対応した点
情報が格納される。なお、配列46のポインタは配列の最
後を差し示したあとは、巡回的に配列の先頭を差し示す
ようにする。
Therefore, the GP24 starts from the reference point 57 as described in FIG.
When the point (x n , y n ) 70 is obtained by the unidirectional DDA method to 58, the contents of the array indicated by the pointer are taken out while incrementing the contents of the pointer of the array 46 shown in FIG. , Whether to draw the point with the coordinate value (x n , y n ) 70 and the point sequence with the coordinate value 71 obtained by referring to the offset value from the coordinate value (x n , y n ) 70 according to its contents Decide whether or not to write point information in FM25 to correspond to it. That is, if the content is φ, it means that the drawing is not performed as described above, and the point information corresponding to the meaning is stored in the FM25. If the content is 1, the point corresponding to the meaning of drawing is stored. Information is stored. After the pointer of the array 46 indicates the end of the array, the pointer of the array 46 cyclically indicates the beginning of the array.

以上が、GP24による処理動作の説明である。次に、この
様な処理動作について、第1図に示すフローチャートを
用い、その処理手順に沿って更に説明する。
The above is the description of the processing operation by the GP24. Next, such a processing operation will be further described in accordance with the processing procedure using the flowchart shown in FIG.

上記した様な処理動作を実現する為のプログラムは、通
常SM23上に格納されており、GP24がそのプログラムを解
釈し、実行することにより、所定の線幅を有した直線は
描画される。
A program for realizing the above-described processing operation is usually stored on the SM 23, and the GP 24 interprets and executes the program to draw a straight line having a predetermined line width.

第1図(a)はGP24の処理手順を示すフローチャートで
ある。
FIG. 1A is a flowchart showing the processing procedure of GP24.

GP24による処理手順の概略は、第1図(a)に示す如く
になっている。即ち、まず、線幅dが2以上の場合には
サブルーチンconpensate−winth130を呼び、補正線幅
d′を求める(ブロック103)。次にサブルーチンfind
−edge140を呼び、オフセット配列51を求める(ブロッ
ク104)。そして、最後にサブルーチンdraw−line150を
呼び、実際に直線を描画する(ブロック105)のであ
る。
The outline of the processing procedure by GP24 is as shown in FIG. That is, first, when the line width d is 2 or more, the subroutine compensate-winth130 is called to obtain the corrected line width d '(block 103). Then the subroutine find
Call edge140 to determine the offset array 51 (block 104). Finally, the subroutine draw-line150 is called to actually draw a straight line (block 105).

第1図(b)はサブルーチンconpensate−width130の詳
細な処理手順を示すフローチャートである。第1図
(b)に示す様に、まず、GP24は、SM23内の属性テーブ
ルに格納された2つの指定点のx座標,y座標の差の比よ
り、直線の傾きを求め(ブロック131)、次いで、SM23
内の線幅補正テーブル(第6図(c)参照)に対し、指
定された線幅dに関する線幅補正テーブルの先頭アドレ
スを求め、これをインデックスのφとする(ブロック13
2)。そしてGP24は、インデックスを1ずつ進めなが
ら、該当するテーブルの内容を順次読出して、求めた直
線の傾きと比較してゆき(ブロック134)、その直線の
傾きより大きくなった時点で、該当テーブルのインデッ
クス値をdから引くことにより補正線幅d′を求める
(ブロック136)。
FIG. 1B is a flowchart showing a detailed processing procedure of the subroutine compensate-width 130. As shown in FIG. 1 (b), the GP24 first obtains the slope of a straight line from the ratio of the difference between the x coordinate and the y coordinate of two designated points stored in the attribute table in the SM23 (block 131). , Then SM23
For the line width correction table (see FIG. 6 (c)), the start address of the line width correction table for the specified line width d is obtained, and this is set as φ of the index (block 13).
2). Then, the GP24 sequentially reads the contents of the corresponding table while advancing the index one by one, and compares the contents with the obtained slope of the straight line (block 134). The corrected line width d'is obtained by subtracting the index value from d (block 136).

第1図(c)はサブルーチンfind−edge140の詳細な処
理手順を示すフローチャートである。
FIG. 1C is a flowchart showing the detailed processing procedure of the subroutine find-edge140.

本サブルーチンでは、GP24は、まず第7図で説明したよ
うに、指定点55より直線と垂直方向に、y軸方向の増分
がd′/2となる距離だけDDAによりドット展開を行ない
(ブロック142〜144)、到達した点を基準点57とする
(ブロック145)。次に、GP24は、基準点57から折返し
指定点55の方向に、y軸方向の増分がd′となる距離だ
けDDAによるドット展開を行ないブロック(147〜14
9)、このとき求まった点列のx座標に関して、基準点5
7のx座標からの偏位を、SM23内のワーク・テーブルに
おけるオフセット配列51に格納する(ブロック148)。
次に、GP24は、基準点57に関する指定点55からの偏位を
指定点56に加えることにより、もう一端の基準点58の座
標を求める(ブロック146)。
In this subroutine, the GP 24 first performs dot expansion by DDA by a distance such that the increment in the y-axis direction is d '/ 2 from the designated point 55 in the direction perpendicular to the straight line, as described with reference to FIG. 7 (block 142). ~ 144), and the reached point is used as the reference point 57 (block 145). Next, the GP 24 performs dot development by DDA in the direction from the reference point 57 to the return designated point 55 by a distance such that the increment in the y-axis direction is d ′ (blocks 147 to 14).
9), the reference point 5
The displacement of the 7 from the x coordinate is stored in the offset array 51 in the work table in the SM 23 (block 148).
Next, the GP 24 obtains the coordinates of the reference point 58 at the other end by adding the deviation of the reference point 57 from the designated point 55 to the designated point 56 (block 146).

第1図(d)はサブルーチンdraw−line150の詳細な処
理手順を示すフローチャートである。
FIG. 1D is a flow chart showing the detailed processing procedure of the subroutine draw-line 150.

尚、この第1図(d)に示すサブルーチンにおいて、
“点を描画する”とは、GP24がその点の座標値に対応す
るFM25内のメモリ位置に、描画を意味する点情報を書き
込むという意味である。
In the subroutine shown in FIG. 1 (d),
"Drawing a point" means that the GP24 writes point information, which means drawing, at a memory location in the FM25 corresponding to the coordinate value of that point.

第1図(d)に示す様に、GP24は、基準点57から基準点
58に向ってDDAを行ない点(xn,yn)70を順次求める
(ブロック152)。そして、GP24は、DDAを1ピクセル進
めるごとに、SM24内の属性テーブルに格納された線パタ
ーン列46を巡回的に見て(ブロック153〜155)、該当配
列要素がφなら何も描画せず、1ならば次に示すように
点の描画を行なう。
As shown in Fig. 1 (d), the GP24 has a reference point 57 to a reference point.
DDA is performed toward 58 to sequentially obtain points (x n , y n ) 70 (block 152). Then, the GP24 cyclically looks at the line pattern sequence 46 stored in the attribute table in the SM24 (blocks 153 to 155) every time the DDA is advanced by one pixel, and if the corresponding array element is φ, nothing is drawn. If 1, the dots are drawn as shown below.

まず、GP24は、第9図において、2重丸で表わされてい
る点(xn,yn)70を描画し、その後、SM24内のワーク・
テーブルに格納されたオフセット配列51の先頭から後尾
に至るまで、インデックス値をynから引き、インデック
スの示する配列51の内容をxnに加えることにより、点71
を順次求め、その点71を描画する(ブロック158〜16
2)。第9図では描画する点列を正方形で表わしてい
る。
First, the GP24 draws a point (x n , y n ) 70 represented by a double circle in FIG.
From the beginning to the end of the offset array 51 stored in the table, the index value is subtracted from y n, and the contents of the array 51 indicated by the index are added to x n
Are sequentially obtained, and the point 71 is drawn (blocks 158 to 16).
2). In FIG. 9, the dot sequence to be drawn is represented by a square.

なお、内部にできる塗りつぶされない点をなくすため、
GP24は、変形DDAに従い、一つ前の点(xn-1,yn-1)に
おける理想の直線からのy座標偏差であるΔyが負なら
ば、第8図(d)に示した様に次の点60と併せて点62の
ような点を描画し、(ブロック160)、Δyが正なら
ば、第8図(e)に示した様に次の点61のみを描画する
(ブロック161)。
In addition, in order to eliminate the points that are not filled inside,
According to the modified DDA, the GP24 has a negative y coordinate deviation Δy from the ideal straight line at the previous point (x n-1 , y n-1 ) as shown in FIG. Then, a point such as a point 62 is drawn together with the next point 60 (block 160), and if Δy is positive, only the next point 61 is drawn as shown in FIG. 8 (e) (block 161).

以上が、処理手順に沿ったGP24による処理動作の説明で
ある。
The above is the description of the processing operation by the GP 24 according to the processing procedure.

本実施例によれば、2つの指定点を結ぶ直線を中心とし
て両側に均等な幅を持ち、指定の線幅、指定のラインス
タイルを持つ直線を描画できる。また、本実施例では、
第11図(c)に示した従来方式の様に、直線の両端の点
列を求める際の複雑な計算が必要でなく、また、オフセ
ット配列51を求める時にDDAを行なう他は、任意の線幅
の直線において1回のDDAで描画できるため、第11図
(c)に示した方式のようなDDAを線幅分の回数、繰返
して描画する方法に比べ、高速に描画することができ
る。
According to the present embodiment, it is possible to draw a straight line having a uniform line width on both sides of a straight line connecting two specified points and having a specified line width and a specified line style. Further, in this embodiment,
Unlike the conventional method shown in FIG. 11 (c), no complicated calculation is required when obtaining the point sequences at both ends of a straight line, and DDA is performed when obtaining the offset array 51, and any other line is used. Since the DDA can be drawn on a straight line once, the DDA can be drawn at a higher speed than a method of repeatedly drawing the DDA the number of times corresponding to the line width as in the method shown in FIG. 11 (c).

なお、両側に均等でないような幅を持った直線を描画す
る場合においても、例えば、2つの指定点の片側だけに
線幅を持つ直線を描画する場合、直線の一端の点列を求
める際に、1方の指定点から単に直線の方向に対し垂直
な方向に連なる点列を求めるようにするだけで、それ以
上後の処理動作は全く変更する必要はない。
Even when a straight line having a width that is not equal on both sides is drawn, for example, when a straight line having a line width on only one side of two specified points is drawn, when a point sequence at one end of the straight line is obtained. It is only necessary to obtain a series of points from one designated point in the direction perpendicular to the direction of the straight line, and there is no need to change the subsequent processing operation.

〔発明の効果〕〔The invention's effect〕

本発明によれば、指定する2点間に線幅を持った直線を
描画する際に、次のような効果がある。
According to the present invention, the following effects are obtained when drawing a straight line having a line width between two designated points.

直線の両端やラインスタイルが直線の方向に対し、
垂直な方向に切れ、かつ直線内部に塗りつぶしの抜けが
生じないような直線が描画できる。
For both ends of the straight line and the direction of the line style,
It is possible to draw a straight line that is cut in the vertical direction and that does not cause the omission of the fill inside the straight line.

任意の幅の直線描画に対し、1度だけ両端を結ぶ直
線の点列を求めるだけなので、多重線による描画方式に
比べ高速に直線が描画できる。
Since a point sequence of straight lines connecting both ends only once is obtained for a straight line with an arbitrary width, a straight line can be drawn at a higher speed than a drawing method using multiple lines.

前記指定点間を結ぶ直線の両側に、均等な幅を持っ
た直線を描画できる。
A straight line having a uniform width can be drawn on both sides of the straight line connecting the designated points.

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

第1図(a)〜(d)は本発明におけるグラフィック処
理装置の処理手順を示すフローチャート、第2図は本発
明を実施するために用いるグラフィック装置の構成を示
すブロック図、第3図は第2図のグラフィック処理ユニ
ットの構成を示すブロック図、第4図は本発明の直線描
画方式による画面出力例を示す模式図、第5図は指定線
幅と補正線幅との関係を示すための説明図、第6図は本
発明において直線描画のために必要なテーブルを示す模
式図、第7図は本発明において直線の端の点列を求める
動作を説明するための説明図、第8図は本発明において
用いられるDAA処理を説明するための説明図、第9図は
本発明において直線の内部の点列を求める動作を説明す
るための説明図、第10図は本発明においてラインスタイ
ルを実現するための処理動作を説明する説明図、第11図
(a)乃至(c)はそれぞれ従来の直線描画方式を説明
するための説明図、第12図は従来の方式において直線の
四隅を求める方法を説明するための説明図、である。 符号説明 22…ラスタディスプレイ 23…セグメントメモリ 24…グラフィック処理装置 25…表示メモリ 26…ディスプレイ制御装置 46…線パターン列、51…オフセット配列 55,56…指定点、57,58…基準点
1 (a) to 1 (d) are flowcharts showing the processing procedure of the graphic processing device according to the present invention, FIG. 2 is a block diagram showing the configuration of the graphic device used for carrying out the present invention, and FIG. 2 is a block diagram showing the configuration of the graphic processing unit of FIG. 4, FIG. 4 is a schematic diagram showing an example of screen output by the straight line drawing method of the present invention, and FIG. 5 is a diagram showing the relationship between the designated line width and the correction line width. Explanatory diagram, FIG. 6 is a schematic diagram showing a table necessary for drawing a straight line in the present invention, FIG. 7 is an explanatory diagram for explaining an operation for obtaining a point sequence at the end of a straight line in the present invention, and FIG. Is an explanatory view for explaining the DAA processing used in the present invention, FIG. 9 is an explanatory view for explaining an operation for obtaining a point sequence inside a straight line in the present invention, and FIG. 10 is a line style in the present invention. To realize FIGS. 11A to 11C are explanatory diagrams for explaining the conventional straight line drawing method, and FIG. 12 is a method for obtaining the four corners of the straight line in the conventional method. FIG. Reference numeral 22 ... Raster display 23 ... Segment memory 24 ... Graphic processor 25 ... Display memory 26 ... Display controller 46 ... Line pattern row, 51 ... Offset array 55,56 ... Specified point, 57, 58 ... Reference point

───────────────────────────────────────────────────── フロントページの続き (72)発明者 池田 尚哉 神奈川県横浜市戸塚区吉田町292番地 株 式会社日立製作所マイクロエレクトロニク ス機器開発研究所内 (72)発明者 横山 佳弘 神奈川県横浜市戸塚区吉田町292番地 株 式会社日立製作所マイクロエレクトロニク ス機器開発研究所内 (56)参考文献 特開 昭57−159389(JP,A) 特開 昭59−29293(JP,A) 特開 昭59−136784(JP,A) ─────────────────────────────────────────────────── ─── Continuation of the front page (72) Inventor Naoya Ikeda 292 Yoshida-cho, Totsuka-ku, Yokohama-shi, Kanagawa Hitachi, Ltd. Microelectronics Equipment Development Laboratory (72) Inventor Yoshihiro Yokoyama Totsuka-ku, Yokohama-shi, Kanagawa 292 Yoshida-cho, Hitachi, Ltd. Microelectronics Equipment Development Laboratory (56) Reference JP-A-57-159389 (JP, A) JP-A-59-29293 (JP, A) JP-A-59-136784 (JP, A)

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】入力装置と、処理装置と、主メモリと、ラ
スタディスプレイと、表示メモリと、ディスプレイ制御
装置とから成り、前記入力装置からの指示により前記処
理装置は前記主メモリ内に格納された所望の図形データ
を取出して処理し、前記ラスタディスプレイの画面上の
画素に対応した前記表示メモリ上の領域に格納した後、
前記ディスプレイ制御装置が前記表示メモリから格納し
たデータを読出して前記ラスタディスプレイの画面上に
映像として表示するグラフィック装置において、前記入
力装置により所定の線幅を有した直線を前記ラスタディ
スプレイ上に表示するよう指示された際、前記処理装置
は、前記主メモリに格納されたプログラムに従い、前記
直線を規定するパラメータを該主メモリから求め、該パ
ラメータから当該直線の一端において該直線の方向に対
し垂直な方向に連なり前記線幅と同等な長さを有する第
1の点列の各点座標を求めて、該第1の点列中の一点を
第1の基準点として該第1の基準点に対する他の各点の
相対的な位置座標を前記メモリに格納した後、前記直線
の他端において前記第1の基準点と対応する第2の基準
点と、該第1の基準点との間を結ぶ線上に連なる第2の
点列の各点座標を求めると共に、その点座標を一点求め
る毎に、併せて前記主メモリに格納した相対的な位置座
標を参照しながらその点に対する各位置座標の各々に基
づく各相対位置に存在する相対点の点座標をそれぞれ求
め、その相対点の点座標を求める際、隣接する2つの相
対点のx座標値及びy座標値のいずれもが異なる場合
は、その2つの相対点のうちの一方の相対点とx座標値
を同じくし、他方の相対点とy座標値を同じくする点ま
たはその2つの相対点のうちの一方の相対点とy座標値
を同じくし、他方の相対点とx座標値を同じくする点を
併せて求め、求めた各点座標の座標位置と対応する前記
表示メモリ内のメモリ位置に各々所定の点情報を格納
し、その後、前記ディスプレイ制御装置が格納した前記
点情報を読出して前記ラスタディスプレイの画面上に表
示することにより、該ラスタディスプレイの画面上に所
定の線幅を有した直線を描画するようにしたことを特徴
とするグラフィック装置における直線描画方式。
1. An input device, a processing device, a main memory, a raster display, a display memory, and a display control device. The processing device is stored in the main memory according to an instruction from the input device. After extracting and processing the desired graphic data, and storing in the area on the display memory corresponding to the pixels on the screen of the raster display,
In a graphic device in which the display control device reads out data stored from the display memory and displays it as an image on a screen of the raster display, a straight line having a predetermined line width is displayed on the raster display by the input device. When instructed to do so, the processing device obtains a parameter defining the straight line from the main memory in accordance with a program stored in the main memory, and from the parameter, the processing unit determines a parameter perpendicular to the direction of the straight line at one end of the straight line. Each point coordinate of the first point sequence that is continuous in the direction and has a length equal to the line width is obtained, and one point in the first point sequence is used as a first reference point, and the other with respect to the first reference point. After storing the relative position coordinates of each point in the memory in the memory, a second reference point corresponding to the first reference point at the other end of the straight line and the first base point are stored. The coordinates of each point of the second series of points connected to the line connecting the points are obtained, and each time the point coordinates are obtained, the point is referred to with reference to the relative position coordinates also stored in the main memory. When the point coordinates of the relative point existing at each relative position based on each of the position coordinates with respect to are obtained respectively and the point coordinates of the relative point are obtained, both the x coordinate value and the y coordinate value of two adjacent relative points are obtained. , The x coordinate value is the same as one of the two relative points and the y coordinate value is the same as the other relative point, or one of the two relative points. And the y coordinate value are the same, and the other relative point and the point having the same x coordinate value are also obtained, and predetermined point information is respectively stored in the memory position in the display memory corresponding to the obtained coordinate position of each point coordinate. Store and then display control device A straight line in a graphic device, wherein the stored point information is read out and displayed on the screen of the raster display to draw a straight line having a predetermined line width on the screen of the raster display. Drawing method.
【請求項2】特許請求の範囲第1項に記載の直線描画方
式において、前記直線を規定するパラメータは該直線の
描画位置を指定する2つの指定点の点座標と該直線の線
幅を指定する値とを含み、前記処理装置が該パラメータ
から前記第1の点列を求める際、該処理装置は、前記2
つの指定点のうち一方の点の座標位置から前記直線の方
向に対し垂直な方向に、指定した線幅の半分の距離に相
当する個数だけ順次点列を求めて、到達した点を前記第
1の基準点とし、該基準点から折返し前記指定点の方向
に、指定した線幅の距離に相当する個数だけ順次点列を
求め、求めた該点列を前記第1の点列としたことを特徴
とするグラフィック装置における直線描画方式。
2. The straight line drawing method according to claim 1, wherein the parameters defining the straight line specify the point coordinates of two specified points that specify the drawing position of the straight line and the line width of the straight line. When the processing device obtains the first point sequence from the parameter, the processing device includes
From the coordinate position of one of the two designated points, the point sequence is sequentially obtained in the direction perpendicular to the direction of the straight line by the number corresponding to the half of the designated line width, and the reached point is the first point. The reference point is defined as a reference point, and a sequence of points is sequentially obtained from the reference point in the direction of the designated point by a number corresponding to the distance of the designated line width, and the obtained sequence of points is set as the first sequence of points. A straight line drawing method in a characteristic graphic device.
JP60128149A 1985-06-14 1985-06-14 Straight line drawing method in graphic device Expired - Lifetime JPH0727357B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP60128149A JPH0727357B2 (en) 1985-06-14 1985-06-14 Straight line drawing method in graphic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP60128149A JPH0727357B2 (en) 1985-06-14 1985-06-14 Straight line drawing method in graphic device

Publications (2)

Publication Number Publication Date
JPS61286895A JPS61286895A (en) 1986-12-17
JPH0727357B2 true JPH0727357B2 (en) 1995-03-29

Family

ID=14977597

Family Applications (1)

Application Number Title Priority Date Filing Date
JP60128149A Expired - Lifetime JPH0727357B2 (en) 1985-06-14 1985-06-14 Straight line drawing method in graphic device

Country Status (1)

Country Link
JP (1) JPH0727357B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05233821A (en) * 1992-02-24 1993-09-10 Japan Radio Co Ltd Graphic display device
CN115909380A (en) * 2022-11-28 2023-04-04 联宝(合肥)电子科技有限公司 Method, device, storage medium and electronic device for extracting frame table content

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS57159389A (en) * 1981-03-28 1982-10-01 Fujitsu Ltd Thick line drawing system
JPS5929293A (en) * 1982-08-11 1984-02-16 日本電気株式会社 System and apparatus for generation of broad vector
JPS59136784A (en) * 1983-01-25 1984-08-06 日本電気株式会社 System and apparatus for generating vector with width

Also Published As

Publication number Publication date
JPS61286895A (en) 1986-12-17

Similar Documents

Publication Publication Date Title
US4529978A (en) Method and apparatus for generating graphic and textual images on a raster scan display
CN1014835B (en) Method and system for generating fonts
JP2612260B2 (en) Texture mapping equipment
US5461703A (en) Pixel image edge enhancement method and system
US5489920A (en) Method for determining the optimum angle for displaying a line on raster output devices
US4972330A (en) Clipping process and processor
US4967376A (en) Method for displaying characters and/or figures in a computer graphics and apparatus thereof
JPH04362793A (en) Drawing method in raster device
JPH0725068A (en) Character generation method and apparatus
JPH02270019A (en) Generation system for high quality character pattern
JP3034140B2 (en) Character generation method and device
JPS61249088A (en) Generation of circular arc or elliptical curve
JPH07129149A (en) Character drawing device
JP2835056B2 (en) High quality character pattern generation method
JP2630843B2 (en) Straight line drawing method and apparatus
JP3517982B2 (en) Drawing device
JPS61286895A (en) Linear drawing system for graphic apparatus
US5305431A (en) Method and system for rendering polygons on a raster display
JP3269686B2 (en) Image creation device
JPS62127971A (en) Clipping system in line segment drawing
JPH0752466B2 (en) Raster operation device and method
JP2771981B2 (en) High quality character pattern generation method
JP2634906B2 (en) Image processing method
JPH02308381A (en) Polygon filling method
JPH0241790B2 (en)