JPS63221493A - Straight line drawing system for bit map - Google Patents

Straight line drawing system for bit map

Info

Publication number
JPS63221493A
JPS63221493A JP5603787A JP5603787A JPS63221493A JP S63221493 A JPS63221493 A JP S63221493A JP 5603787 A JP5603787 A JP 5603787A JP 5603787 A JP5603787 A JP 5603787A JP S63221493 A JPS63221493 A JP S63221493A
Authority
JP
Japan
Prior art keywords
straight line
length
line
dots
drawn
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP5603787A
Other languages
Japanese (ja)
Inventor
Takao Miura
孝雄 三浦
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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP5603787A priority Critical patent/JPS63221493A/en
Publication of JPS63221493A publication Critical patent/JPS63221493A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Generation (AREA)

Abstract

PURPOSE:To easily draw a straight line by providing plural tables to display the number of dots drawn once in an X direction when plural straight lines of a special length respectively have the inclination within 45 deg. with an A axis. CONSTITUTION:A table 100 to display the number of the continuous drawing dots in the X direction when the straight line of a line length (a) has the inclination of 0-45 deg., the same table 10, to the straight line of a line length (a+b), a table 102 to the straight line of a line length (a+2b) and a table 10n to a line length (a+nb) are equipped beforehand. A processor 1 designates an inclination theta with a length (l) and the X direction to a selecting means 20. The means 20 selects the table 10n of the line length closest to the length (l) and obtains the number of dots corresponding to an angle theta out of it. Next, only the number of the dots is drawn from a starting point in the X direction. Thus, the straight line can be easily drawn.

Description

【発明の詳細な説明】 〔概要〕 ビットマツプメモリに直線を描画する場合、直線長aと
直線長すを規定し、其の長さがa、a+b、a+2b、
a+nbの直線が夫々X軸と0〜45″の傾きを持った
場合のX方向に1回に描画するドツト数を表示した複数
個のテーブルを設け、描画する直線長に最も近い長さに
対応するテーブルを選択し、選択されたテーブルの中が
ら指定の角度に対応するドツト数を求めて直線を描画す
る。
[Detailed Description of the Invention] [Summary] When drawing a straight line in a bitmap memory, a straight line length a and a straight line length are defined, and the lengths are a, a+b, a+2b,
Multiple tables are provided that display the number of dots to be drawn at one time in the X direction when each straight line of a+nb has an inclination of 0 to 45'' with the X axis, and corresponds to the length closest to the straight line length to be drawn. Select the table to be drawn, find the number of dots corresponding to the specified angle in the selected table, and draw a straight line.

〔産業上の利用分野〕[Industrial application field]

本発明はビットマツプ方式のメモリを有する表示又は印
字出力システムに於ける直線描画方式の改良に関するも
のである。
The present invention relates to an improvement of the linear drawing method in a display or print output system having a bitmap type memory.

〔従来の技術〕[Conventional technology]

CRT等のグラフインク表示装置には画素位置に対応し
た格納位置を有するビットマツプ方式のメモリが使用さ
れる。
A graph ink display device such as a CRT uses a bitmap type memory having storage locations corresponding to pixel locations.

従来ビットマツプ方式のメモリに直線を描画して表示出
力として直線を表示する場合、描画する直線の傾き、及
び其の長さによって描画するド・ノド位置が決定される
Conventionally, when a straight line is drawn in a bitmap memory and displayed as a display output, the position of the line to be drawn is determined by the slope and length of the line to be drawn.

第4図は従来の直線描画方式の説明図である。FIG. 4 is an explanatory diagram of a conventional straight line drawing method.

図中、O印はオンとするビットマツプメモリであり、各
桁目はメモリの格納位置に対応する。
In the figure, the O mark indicates the bitmap memory to be turned on, and each digit corresponds to a storage position in the memory.

令弟4図(alに示す様にビットマツプメモリ上に、X
軸と45度の勾配を持つ直線を引く場合はX方向に起点
から1ドツト移動し、次にY方向に1ド・ント移動した
ビットマツプメモリをオンとし、此の操作を繰り返すこ
とにより求められる。
As shown in Figure 4 (al), on the bitmap memory,
To draw a straight line with a slope of 45 degrees to the axis, move one dot from the starting point in the X direction, then move one dot in the Y direction, turn on the bitmap memory, and repeat this operation. .

第4図(blに示す様にX方向に1回で4ドツト描画(
4ドツトをオンとし)し、次にY方向に1ドツト移動し
た後、X方向に1回で4ド・ント描画すると、より傾き
の少ない直線を描画出来る。
Figure 4 (Drawing 4 dots at once in the X direction as shown in bl)
If you turn on 4 dots), move 1 dot in the Y direction, and then draw 4 dots at once in the X direction, you can draw a straight line with less slope.

第4図(C)は描画する直線の長さをL(ド・ント数で
表示)とした時、直線の角度とX方向に1回に描画する
ドツト数の関係を表示する。
FIG. 4(C) shows the relationship between the angle of the straight line and the number of dots drawn at one time in the X direction, when the length of the straight line to be drawn is L (expressed in the number of dots).

即ち、X方向に1回でaドツト描画すると、X方向に平
行(角度0°)な長さLの直線が得られ、X方向に1回
で2ドツト描画すると、X方向と260の角度を持つ長
さしの直線が得られ、更にX方向に1回で1ドツト描画
すると、X方向と45°の角度を持つ長さしの直線が得
られる。
That is, if you draw a dot in the X direction once, you will get a straight line of length L that is parallel to the If you draw one dot at a time in the X direction, you will get a straight line with a length that makes an angle of 45 degrees with the X direction.

此の様に描画する直線の傾き、及び其の長さによって描
画するドツト位置が決定されるが、従来方式ではBre
sen hamの直線発生アルゴリズムを使用し、此の
アルゴリズムをソフトウェア、又は専用のハードウェア
を使用して実施する方法を採っていた。
In this way, the dot position to be drawn is determined by the slope of the drawn straight line and its length, but in the conventional method, Bre
Sen Ham's straight line generation algorithm was used, and this algorithm was implemented using software or dedicated hardware.

第5図はBresen hamの直線発生アルゴリズム
の説明図である。
FIG. 5 is an explanatory diagram of Bresen ham's straight line generation algorithm.

直線L′は描画したい線で、点XI、点x2は同じx=
aの軸上にあり、直線L°を挟み相互に隣接するビット
マツプ・メモリの中心である。
The straight line L' is the line you want to draw, and the points XI and x2 are the same x=
It is located on the axis of a and is the center of mutually adjacent bitmap memories with a straight line L° in between.

点X、と点X2を結ぶ線と直線L゛の交点をUとし、点
xlと点U間の距離と、点X2と点U間の距離を比較し
、近い方の点のビットマツプ・メモリをオンとする。
Let U be the intersection of the line connecting points X and X2 and straight line L, compare the distance between point xl and point U with the distance between point X2 and point U, and store the bitmap memory of the closer point. Turn on.

従って第5図の例では点X1を中心とするビットマツプ
・メモリをオンとする。
Therefore, in the example of FIG. 5, the bitmap memory centered at point X1 is turned on.

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

然しながら此のBresen hateの直線発生アル
ゴリズムを使用するソフトウェアによる方法では処理時
間がかかり、専用のハードウェアを使用すると高価格に
なると云う問題点があった。
However, this software method using Bresen Hate's straight line generation algorithm has problems in that it takes a long processing time and that the use of dedicated hardware is expensive.

〔問題点を解決するための手段〕[Means for solving problems]

上記問題点は第1図の原理図に示す様に表示出力する画
素の位置と対応する格納位置を有するビットマツプメモ
リに対し直線を表示出力すべくデータを書込む直線描画
方式に於いて、第1直線長aと第2直線長すを夫々規定
し、第1直線長aを持つ直線、第1直線長aと第2直線
長すの和の長さを持つ直線、第1直線長aと第2直線長
す複数倍の和の長さを持つ直線が、夫々X軸と45度以
内の傾きを持った場合、X方向に1回に描画するドツト
数を表示した複数個のテーブル100〜107、及び複
数個のテーブル10o〜107の中から描画する直線長
に最も近い長さに対応す、るテーブル100〜107を
選択する手段20を具備することにより解決される。
As shown in the principle diagram in Figure 1, the above problem occurs in the straight line drawing method in which data is written to display and output a straight line in a bitmap memory that has a storage position corresponding to the position of the pixel to be displayed and output. A straight line length a and a second straight line length are defined respectively, and a straight line having the first straight line length a, a straight line having the sum of the first straight line length a and the second straight line length, and a first straight line length a. A plurality of tables 100 to 100 displaying the number of dots to be drawn at one time in the X direction when a straight line having a length that is multiple times the sum of the lengths of the second straight line has an inclination within 45 degrees from the X axis. 107, and means 20 for selecting the table 100-107 corresponding to the length closest to the straight line length to be drawn from among the plurality of tables 10o-107.

〔作用〕[Effect]

本発明に依ると予め規定された直線長aを持つ直線、直
線長a+b、直線長a+nbの直線が、夫々X軸と45
度以内の傾きを持った場合、X方向に1回に描画するド
ツト数を表示した複数個のテーブル100〜101を設
けて置き、選択手段20により指定された線長に最も近
い長さに対応するテーブル100〜10I、を選択する
。次に選択されたテーブル100〜10..の中から指
定された角度に対応するドツト数を求める。
According to the present invention, a straight line having a predefined straight line length a, a straight line having a straight line length a+b, and a straight line having a straight line length a+nb are connected to the X axis by 45
If the line has an inclination within 100 degrees, a plurality of tables 100 to 101 displaying the number of dots to be drawn at one time in the X direction are provided, and the line corresponds to the line length that is closest to the line length specified by the selection means 20. Tables 100 to 10I are selected. Next selected tables 100-10. .. Find the number of dots corresponding to the specified angle.

〔実施例〕〔Example〕

第2図(a)は本発明に依るビットマツプの直線描画方
式の一実施例を示す図である。
FIG. 2(a) is a diagram showing an embodiment of a bitmap linear drawing method according to the present invention.

第2図(b)は本発明の直線描画テーブルを示す図であ
る。
FIG. 2(b) is a diagram showing a straight line drawing table of the present invention.

第3図は本発明のフローチャートである。FIG. 3 is a flow chart of the present invention.

図中、1はプロセッサ、2はビットマツプメモリ、10
1.10□、10nは夫々テーブル、2oは選択手段、
30はグラフィック表示器である。
In the figure, 1 is a processor, 2 is a bitmap memory, 10
1.10□ and 10n are each a table, 2o is a selection means,
30 is a graphic display.

本発明に於いては、X軸又はY軸と平行な直線として先
づ成る最短長の線長aと可変長の線長すを規定して1き
、第2図(b)に示す様に線長aを持つ直線がO〜45
6の傾きを持った場合のX方向又はY方向への連続描画
ドツト数を表示したテーブル100、線長a+bを持つ
直線がθ〜45°の傾きを持った場合のテーブル101
、線長a+2bを持つ直線がθ〜45°の傾きを持った
場合のテーブル102、線長a+nbを持つ直線がO〜
45″の傾きを持った場合のテーブル10nを予め作成
して置く。
In the present invention, the first shortest line length a and the variable length line length are defined as straight lines parallel to the X-axis or Y-axis, and as shown in FIG. 2(b), A straight line with line length a is O~45
A table 100 showing the number of consecutively drawn dots in the X direction or Y direction when the line has an inclination of 6, and a table 101 when a straight line with line length a+b has an inclination of θ to 45°.
, table 102 when a straight line with line length a+2b has an inclination of θ~45°, and a straight line with line length a+nb has an inclination of θ~45°.
A table 10n having an inclination of 45'' is prepared and placed in advance.

尚nは任意の整数で、線の傾きが45〜90°の場合は
X方向とY方向を入れ換えれば良い。
Note that n is any integer, and if the inclination of the line is 45 to 90 degrees, the X direction and Y direction may be interchanged.

選択手段20がプログラム動作手段として動作する場合
、ビットマツプメモリ2上に長さlでX方向との傾きが
θである直線を描画する時、プロセッサlは先づ選択手
段20に対し長さβと角度θを指定する。此れは例えば
キーボード或いはライトペン等で起点、座標、位置、及
び終点座標位置が入力されるならば自動的に長さ、及び
角度の演算を行った後、指定される。
When the selection means 20 operates as a program operation means, when drawing a straight line on the bitmap memory 2 with a length l and an inclination of θ with respect to the and the angle θ. For example, if the starting point, coordinates, position, and end point coordinate position are input using a keyboard or a light pen, the length and angle are automatically calculated and then specified.

選択手段20は先づ長さlに最も近い線長のテーブル1
0.1を選択し、次に選択されたテーブル10nの中か
ら角度θに対応するドツト数を求める。
The selection means 20 first selects a table 1 of line lengths closest to the length l.
0.1 is selected, and then the number of dots corresponding to the angle θ is determined from the selected table 10n.

プロセッサ1は此のドツト数を使用して第3図のフロー
チャートに従って直線を描画する。
Processor 1 uses this number of dots to draw a straight line according to the flowchart of FIG.

尚此の場合、ビットマツプメモリ2に何も描画されてい
ない時は論理“0”が格納される。
In this case, when nothing is drawn in the bitmap memory 2, logic "0" is stored.

■先づ描画しようとする線長lに最も近い線長のテーブ
ル10.を選択する。
■Table of line lengths closest to the line length l to be drawn first 10. Select.

■テーブル1〇−内に於いて、指定された角度θに対応
するドツト数を求める。
(2) Find the number of dots corresponding to the specified angle θ in table 10-.

■起点からX方向に此のドツト数だけ描画する。■Draw this number of dots in the X direction from the starting point.

即ち、特定の論理データ“1″を書き込む。That is, specific logical data "1" is written.

■全線長の描画を終了したか否かを調べ、若し終了して
いないならば■へ移り、若し終了しているならば終了と
する。
- Check whether drawing of the entire line length has been completed. If not, proceed to (2); if it has been completed, finish.

■Y方向のアドレス(ドツト数)を+1して■へ戻る。■Add 1 to the Y-direction address (number of dots) and return to ■.

此の様にして作成された直線は、例えばビットマツプメ
モリ2のアドレスを連続走査して読出し供給されること
によりグラフインク表示器30に表示される。
The straight line created in this manner is displayed on the graph ink display 30 by, for example, reading and supplying the addresses of the bitmap memory 2 by continuously scanning them.

〔発明の効果〕 以上詳細に説明した様に本発明によれば、テーブルの選
択により簡単に直線を描画出来ると云う大きい効果があ
る。
[Effects of the Invention] As described above in detail, the present invention has the great effect that a straight line can be easily drawn by selecting a table.

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

第1図は本発明の原理図である。 第2図(alは本発明に依るビットマツプの直線描画方
式の一実施例を示す図である。 第2図(blは本発明の直線描画テーブルを示す図であ
る。 第3図は本発明のフローチャートである。 第4図は従来の直線描画方式の説明図である。 第5図はBresen hamの直線発生アルゴリズム
の説明図である。 図中、1はプロセッサ、2はピントマツプメモリ、10
1 、IQ、 、1(1,は夫々テーブル、20は選択
手段1.30はグラフィック表示器である。
FIG. 1 is a diagram showing the principle of the present invention. FIG. 2 (al is a diagram showing an embodiment of a bitmap straight line drawing method according to the present invention. FIG. 2 (bl is a diagram showing a straight line drawing table of the present invention). FIG. This is a flowchart. Fig. 4 is an explanatory diagram of a conventional straight line drawing method. Fig. 5 is an explanatory diagram of Bresen ham's straight line generation algorithm. In the figure, 1 is a processor, 2 is a focus map memory, and 10
1, IQ, , 1 (1 and 1 are respectively tables, 20 is a selection means 1, and 30 is a graphic display.

Claims (1)

【特許請求の範囲】 表示出力する画素の位置と対応する格納位置を有するビ
ットマップメモリに対し直線を表示出力すべくデータを
書込む直線描画方式に於いて、第1直線長(a)と第2
直線長(b)を夫々規定し、該第1直線長(a)を持つ
直線、 該第1直線長(a)と該第2直線長(b)の和の長さを
持つ直線、 該第1直線長(a)と該第2直線長(b)の複数倍の和
の長さを持つ直線が、夫々X軸と45度以内の傾きを持
った場合、X方向に1回に描画するドット数を表示した
複数個のテーブル(10_0〜10_n)、及び複数個
の該テーブル(10_0〜10_n)の中から描画する
直線長に最も近い長さに対応するテーブル(10_0〜
10_n)を選択する手段(20)を具備することを特
徴とするビットマップの直線描画方式。
[Claims] In a straight line drawing method in which data is written to display and output a straight line in a bitmap memory having a storage position corresponding to the position of a pixel to be displayed and output, a first straight line length (a) and a first straight line length (a) 2
A straight line having a first straight line length (a), a straight line having a length equal to the sum of the first straight line length (a) and the second straight line length (b), each having a straight line length (b) defined; If a straight line with a length that is multiple times the length of one straight line (a) and the second straight line length (b) has an inclination within 45 degrees with respect to the X axis, it is drawn at once in the X direction. A plurality of tables (10_0 to 10_n) displaying the number of dots, and a table (10_0 to 10_n) corresponding to the length closest to the straight line length to be drawn from among the plurality of tables (10_0 to 10_n).
10_n).
JP5603787A 1987-03-11 1987-03-11 Straight line drawing system for bit map Pending JPS63221493A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5603787A JPS63221493A (en) 1987-03-11 1987-03-11 Straight line drawing system for bit map

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5603787A JPS63221493A (en) 1987-03-11 1987-03-11 Straight line drawing system for bit map

Publications (1)

Publication Number Publication Date
JPS63221493A true JPS63221493A (en) 1988-09-14

Family

ID=13015881

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5603787A Pending JPS63221493A (en) 1987-03-11 1987-03-11 Straight line drawing system for bit map

Country Status (1)

Country Link
JP (1) JPS63221493A (en)

Similar Documents

Publication Publication Date Title
EP0825559A2 (en) Method and apparatus for modifying a node-link diagram
KR20010012815A (en) A reference based parametric demensioning method and system
US6404419B1 (en) Image processing device
EP0199160B1 (en) Method for generating a circular or elliptic arc
JPS63221493A (en) Straight line drawing system for bit map
JPH056439A (en) Vector data/image data conversion system
JP2630843B2 (en) Straight line drawing method and apparatus
JPH09259295A (en) Cad system
JPH0752466B2 (en) Raster operation device and method
JP4195953B2 (en) Image processing device
JPH01241681A (en) Image processor
JP2000298729A (en) Two-dimensional image generation device
JPH0785125A (en) Graphic drawing device
JPH02250178A (en) Graphic generator
JP2605609B2 (en) Dot display processing device
JPS61223986A (en) Picture processing method
JP2729437B2 (en) Ellipse drawing device
JP3407310B2 (en) Ruled line output method and ruled line output device
JP3278853B2 (en) Graphic drawing device
JPS6240492A (en) Auxiliary line display system for display unit
JPH02153392A (en) Vector figure display method
JPH01130186A (en) Character processor
JPH061483B2 (en) Normalized figure input device
JPH0827842B2 (en) Polygonal vertex data tracking device in scanning display device
JPH0746388B2 (en) Color painting device