JPH0664443B2 - Vector drawing method - Google Patents

Vector drawing method

Info

Publication number
JPH0664443B2
JPH0664443B2 JP62039790A JP3979087A JPH0664443B2 JP H0664443 B2 JPH0664443 B2 JP H0664443B2 JP 62039790 A JP62039790 A JP 62039790A JP 3979087 A JP3979087 A JP 3979087A JP H0664443 B2 JPH0664443 B2 JP H0664443B2
Authority
JP
Japan
Prior art keywords
pixel
vector
bit
position determination
direction component
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
JP62039790A
Other languages
Japanese (ja)
Other versions
JPS63206796A (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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric 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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP62039790A priority Critical patent/JPH0664443B2/en
Publication of JPS63206796A publication Critical patent/JPS63206796A/en
Publication of JPH0664443B2 publication Critical patent/JPH0664443B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

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

Description

【発明の詳細な説明】 〔産業上の利用分野〕 この発明はコンピユータグラフイツク等におけるベクト
ル描画方式に関するものである。
The present invention relates to a vector drawing method in computer graphics or the like.

〔従来の技術〕[Conventional technology]

第6図は公知の従来のベクトル描画方式を示す説明図
で、ブレセンハム(Bresenham)の線分発生アルゴリズ
ムを具体的に表現したものである。図において、21は座
標x、22は座標x+1、23は座標x+2、24は座標y、
25は座標y+1、26は座標y+2、27は描画したい真の
線分を示し、28は座標が(x,y)である基準となるピク
セル、29はこのピクセル28と真の線分27との誤差、30は
座標(x+1,y)のピクセル、31は座標(x+1,y+1)
のピクセル、32は線分の傾き、ここでは真の線分27が座
標(x,y)から(x,y)までと仮定すると、そ
の値αはα=(y−y)/(x−x)となる。
更に33はピクセル30と真の線分27との新しい誤差、34は
ピクセル31と真の線分27との新しい誤差である。
FIG. 6 is an explanatory diagram showing a known conventional vector drawing method, and specifically expresses the Bresenham line segment generation algorithm. In the figure, 21 is coordinate x, 22 is coordinate x + 1, 23 is coordinate x + 2, 24 is coordinate y,
25 is the coordinate y + 1, 26 is the coordinate y + 2, 27 is the true line segment to be drawn, 28 is the reference pixel whose coordinate is (x, y), 29 is the pixel 28 and the true line segment 27 Error, 30 is pixel at coordinates (x + 1, y), 31 is coordinates (x + 1, y + 1)
, 32 is the inclination of the line segment, and here, assuming that the true line segment 27 is from coordinates (x 1 , y 1 ) to (x 2 , y 2 ), the value α is α = (y 2 −y 1) it will become / (x 2 -x 1).
Further, 33 is a new error between the pixel 30 and the true line segment 27, and 34 is a new error between the pixel 31 and the true line segment 27.

次に動作について説明する。ある基準となる座標(x,
y)のピクセル28と真の線分27の誤差29の値をeとす
ると、x座標が+1されることによつて、この誤差29は
線分の傾き32の値α=(y−y)/(x−x
分だけ増加する。従つて、新しい誤差により次のピクセ
ルを決定すれば良い。
Next, the operation will be described. Some reference coordinates (x,
Assuming that the value of the error 29 between the pixel 28 of y) and the true line segment 27 is e 0 , the x coordinate is incremented by 1, so that the error 29 has a value of the gradient 32 of the line segment α = (y 2 y 1) / (x 2 -x 1)
Increase by minutes. Therefore, the next pixel may be determined by the new error.

もし、次のピクセルとして、座標(x+1,y)のピクセ
ル30が選ばれたとすると、新しい誤差33の値eがその
ピクセルを選ぶ誤差となり、座標(x+1,y+1)のピ
クセル31が選ばれたとすると新しい誤差34の値(e
1)がそのピクセルを選ぶ時の誤差となる。従つて、第
5図の場合には誤差の小さな座標(x+1,y+1)のピ
クセル31が選ばれる。以下、この処理を連続に行なうこ
とによりベクトルが描画される。
If the pixel 30 with coordinates (x + 1, y) is selected as the next pixel, the new error value e 1 of the error 33 becomes the error for selecting that pixel, and the pixel 31 with coordinates (x + 1, y + 1) is selected. Then the new error 34 value (e 1
1) is the error when selecting that pixel. Therefore, in the case of FIG. 5, the pixel 31 at the coordinate (x + 1, y + 1) with a small error is selected. Hereinafter, a vector is drawn by continuously performing this process.

〔発明が解決しようとする問題点〕[Problems to be solved by the invention]

従来のベクトル描画方式は以上のように構成されている
ので、各ピクセル30,31を選択するたびに算術演算が必
要で、処理に時間がかかるという問題点があつた。
Since the conventional vector drawing method is configured as described above, there is a problem that an arithmetic operation is required every time each of the pixels 30 and 31 is selected, and the processing takes time.

この発明は、上記のような問題点を解消するためになさ
れたもので、ある範囲以内の短ベクトルが高速に描画で
きるベクトル描画方式を得ることを目的とする。
The present invention has been made to solve the above problems, and an object thereof is to obtain a vector drawing method capable of drawing a short vector within a certain range at high speed.

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

この発明に係るベクトル描画方式は、ビット“1"でx方
向,y方向成分の増加、ビト“0"でいずれか一方向成分の
みの増加を、あるいはビット“0"でx方向,y方向成分の
増加、ビット“1"でいずれか一方向成分のみの増加を示
す1ビット単位の相対変化ビットの複数により形成さ
れ、所定の範囲内にあるベクトルについてそれぞれ、各
ピクセルの相対位置を1ビット単位で記述したピクセル
相対位置決定情報をあらかじめピクセル位置決定テーブ
ル内に用意しておき、該当するピクセル相対位置決定情
報の相対変化ビツトに従つて当該ベクトルの各ピクセル
位置の決定を行つてゆくものである。
The vector drawing method according to the present invention uses the bit "1" to increase the x-direction and y-direction components, the bit "0" to increase only one of the directional components, or the bit "0" to increase the x-direction and y-direction components. , A relative change bit of 1 bit unit that indicates an increase in only one direction component by bit “1”, and the relative position of each pixel is defined by 1 bit unit for each vector within a predetermined range. The pixel relative position determination information described in 1. is prepared in advance in the pixel position determination table, and each pixel position of the vector is determined according to the relative change bit of the corresponding pixel relative position determination information. .

〔作 用〕[Work]

この発明におけるベクトル描画方式は、ベクトルの描画
に際して、それが所定の範囲内にあるベクトルであれ
ば、ピクセル位置決定テーブルの該当するピクセル相対
位置決定情報を参照し、その相対変化ビツトに従つてピ
クセル位置を個別に演算することなしにピクセルを配置
することによつて高速にベクトルを描画する。
In the vector drawing method according to the present invention, when drawing a vector, if the vector is within a predetermined range, the pixel relative position determination information of the corresponding pixel position determination table is referred to, and the pixel is changed according to the relative change bit. Vectors are drawn fast by arranging pixels without computing the positions individually.

〔実施例〕〔Example〕

以下、この発明の一実施例を図について説明する。第1
図において、1は座標x、2は座標x+1、3は座標x
+31、4は座標y、5は座標y+1、6は座標y+31、
7は描画したい真の線分、8は座標が(x,y)のベクト
ルの始点、9は座標が(x+n,y+m)のベクトルの終
点、10は決定されたピクセルを示している。
An embodiment of the present invention will be described below with reference to the drawings. First
In the figure, 1 is coordinate x, 2 is coordinate x + 1, 3 is coordinate x
+31, 4 is coordinate y, 5 is coordinate y + 1, 6 is coordinate y + 31,
7 is a true line segment to be drawn, 8 is the start point of the vector having coordinates (x, y), 9 is the end point of the vector having coordinates (x + n, y + m), and 10 is the determined pixel.

第2図はピクセル位置決定テーブルの一例を示す説明図
で、11はこのピクセル位置決定テーブル、12は始点の座
標が(x,y)であつて、終点の座標が(x+1,y),(x
+2,y)……(x+31),(x+1,y+1),(x+2,y
+1)……(x+31,y+1)……(x+n,y+m)……
(x+31,y+31)である各ベクトルのピクセル相対位置
決定情報である。このように、このピクセル位置決定テ
ーブル11にはベクトルの傾きαが0≦α≦45゜の範囲に
あり、かつ32ドツト以下のベクトルに関する全てのピク
セル相対位置決定情報12が、例えば前述の順序に従つて
整然と並べられている。また、第3図は前記ピクセル相
対位置決定情報12の詳細を示す説明図で、13は1ビツト
単位の相対変化ビツトであり、この相対変化ビツト13は
32ピツトで1つのピクセル相対位置決定情報12を形成し
ている。この相対変化ビツトは“1"でx方向、y方向と
もに前のピクセルより変化することを示し、“0"でx方
向にのみ変化してy方向には変化しないことを示してお
り、その0ビツト目が該当するベクトルの始点に対応し
ている。
FIG. 2 is an explanatory diagram showing an example of a pixel position determination table. 11 is this pixel position determination table, 12 is the starting point coordinates (x, y), and the ending point coordinates are (x + 1, y), ( x
+ 2, y) ... (x + 31), (x + 1, y + 1), (x + 2, y)
+1) …… (x + 31, y + 1) …… (x + n, y + m) ……
It is the pixel relative position determination information of each vector which is (x + 31, y + 31). As described above, in this pixel position determination table 11, all pixel relative position determination information 12 regarding vectors whose vector inclination α is in the range of 0 ≦ α ≦ 45 ° and 32 dots or less are stored in the above-mentioned order, for example. Therefore, they are arranged neatly. Further, FIG. 3 is an explanatory view showing the details of the pixel relative position determination information 12, 13 is a relative change bit in units of one bit, and this relative change bit 13 is
One pixel relative position determination information 12 is formed by 32 bits. This relative change bit is "1" indicating that both the x direction and the y direction change from the previous pixel, and "0" indicates that it changes only in the x direction and not in the y direction. The bit pattern corresponds to the starting point of the corresponding vector.

従つて、このピクセル位置決定テーブル11に格納される
ピクセル相対位置決定情報12のデータ量は終点の数に等
しく、 32+31+30+……+1−1 ={32×(32+1)/2}−1 =527 であり、テーブルサイズは、 527×(32/8)=2108(バイト) となる。
Therefore, the data amount of the pixel relative position determination information 12 stored in the pixel position determination table 11 is equal to the number of end points, and 32 + 31 + 30 + ... + 1-1 = {32 × (32 + 1) / 2} −1 = 527. Yes, the table size is 527 x (32/8) = 2108 (bytes).

次に動作について説明する。始点8の座標が(x,y)、
終点9の座標が(x+n,y+m)であるベクトル(ここ
で、n≧m,n≦31,m≦31)の描画を例に、第4図のフロ
ーチヤートに従つて説明する。まず、ステツプST1によ
つてベクトルの長さが求められる。ここでは、n≦31,m
≦31の条件よりこのベクトルは32ドツト以内の短ベクト
ルであることが判明する。従つて、次のステツプST2に
よる判定処理は否(FAULT)となり処理はステツプST3に
移る。ここで、ステツプST2による判定処理の結果が真
(TRUE)となつた場合、従来通りのBresenhamのアルゴ
リズムによつて直線を描画する。
Next, the operation will be described. The coordinates of the starting point 8 are (x, y),
An example of drawing a vector (here, n ≧ m, n ≦ 31, m ≦ 31) in which the coordinates of the end point 9 is (x + n, y + m) will be described according to the flow chart of FIG. First, the length of the vector is obtained in step ST1. Here, n ≦ 31, m
From the condition of ≤31, it is found that this vector is a short vector within 32 dots. Therefore, the determination process at the next step ST2 is negative (FAULT), and the process proceeds to step ST3. Here, if the result of the determination processing in step ST2 is true (TRUE), a straight line is drawn by the conventional Bresenham algorithm.

次にステツプST3では、このベクトルに対応するピクセ
ル相対位置決定情報12の場所(オフセツト)を求める処
理で、以下にその方式を示す。ピクセル位置決定テーブ
ル11に格納されるデータの総数は前述の如く527個であ
り、テーブルサイズは2108(バイト)である。次に、始
点(x,y)8,終点(x+n,y+m)9に対応するテーブル
のオフセツトを求めると、 となる。
Next, in step ST3, the method will be described below in the process of obtaining the location (offset) of the pixel relative position determination information 12 corresponding to this vector. The total number of data stored in the pixel position determination table 11 is 527 as described above, and the table size is 2108 (bytes). Next, when the offset of the table corresponding to the start point (x, y) 8 and the end point (x + n, y + m) 9 is obtained, Becomes

ここで、第5図は0゜〜360゜の一般的角度において、
ピクセル10を選択する場合の指針を45゜単位で示したも
のであり、ステツプST4では第5図に従つて当該ベクト
ルがどのエリアに該当するか判別し、0゜〜45゜の範囲
のみを規定している前記ピクセル位置決定テーブルのデ
ータを全角度に適用させるためピクセルの選択方式を決
定する。この例においてはベクトルの傾きαが0≦α≦
45゜であるため、座標(x,y)の基準ピクセル8に対し
て、次に選択されるピクセルの座標は(x+1,y)か
(x+1,y+1)のどちらかであることがわかる。
Here, FIG. 5 shows that at a general angle of 0 ° to 360 °,
The pointer for selecting the pixel 10 is shown in units of 45 °. At step ST4, the area to which the vector corresponds is determined according to FIG. 5, and only the range of 0 ° to 45 ° is specified. The pixel selection method is determined in order to apply the data of the pixel position determination table to all angles. In this example, the vector inclination α is 0 ≦ α ≦
Since it is 45 °, it can be seen that, with respect to the reference pixel 8 having the coordinates (x, y), the coordinates of the pixel selected next are either (x + 1, y) or (x + 1, y + 1).

次にステツプST5では、ステツプST3で得られたオフセツ
トより、ピクセル位置決定情報12を右へ1ビツトシフト
して、相対変化ビツト13に“1"が立てばピクセル(x+
1,y+1)を選択し、相対変化ビツト13が“0"であれ
ば、ピクセル(x+1,y)を選択する。以下、この操作
をn回繰り返し、各ピクセル10の座標をビツトマツプメ
モリー上にセツトする。グラフイツクデイスプレイに
は、このビツトマツプメモリー上にセツトされたデータ
に基づいてベクトルが描画される。
Next, in step ST5, the pixel position determination information 12 is shifted right one bit from the offset obtained in step ST3, and if "1" is set in the relative change bit 13, the pixel (x +
1, y + 1) is selected, and if the relative change bit 13 is "0", pixel (x + 1, y) is selected. Thereafter, this operation is repeated n times to set the coordinates of each pixel 10 on the bit map memory. In the graphic display, a vector is drawn on the basis of the data set on the bit map memory.

なお、上記実施例ではピクセル相対位置決定情報を4バ
イト32ビツト構成とし、ベクトルの長さも32ビツトで制
限したものを示したが、メモリサイズに合わせて大きく
したり小さくしてもよく、上記実施例と同様の効果を奏
する。
In the above embodiment, the pixel relative position determining information has a 4-byte 32-bit structure and the vector length is limited to 32 bits. However, it may be increased or decreased according to the memory size. It has the same effect as the example.

〔発明の効果〕 以上のように、この発明によれば、所定の範囲内にある
ベクトルは、ピクセル位置決定テーブルに用意されたピ
クセル相対位置決定情報を参照して、その相対変化ビツ
トに従つてピクセルを配置して描画するように構成した
ので、ピクセルの位置決定にいちいち算術演算をする必
要がなく、複雑なベクトル図になるほど高速に描画でき
る効果がある。また、上記ピクセル相対位置決定情報
を、ビット“1"でx方向,y方向成分の増加、ビット“0"
でいずれか一方向成分のみの増加を、あるいはビット
“0"でx方向,y方向成分の増加、ビット“1"でいずれか
一方向成分のみの増加を示す1ビット単位の相対変化ビ
ットの複数により形成しているので、データ容量が少な
く、テーブルのメモリアクセスの回数も少なくなり、上
記の点と相候って描画の高速化をより達成することがで
きる。
[Effects of the Invention] As described above, according to the present invention, a vector within a predetermined range is referred to by the pixel relative position determination information prepared in the pixel position determination table, and according to its relative change bit. Since the pixels are arranged and drawn, it is not necessary to individually perform arithmetic operations for deciding the pixel positions, and it is possible to draw a complicated vector diagram at high speed. In the pixel relative position determination information, bit “1” increases the x-direction and y-direction components, and bit “0”
For increasing only one direction component, or for bit "0" for increasing x direction component, y direction component, and for bit "1" indicating increase in only one direction component Since it is formed by the above, the data capacity is small, the number of times of memory access of the table is small, and in combination with the above point, the drawing speed can be further increased.

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

第1図はこの発明の一実施例によるベクトル描画方式を
示す説明図、第2図はそのピクセル位置決定テーブルの
構成を示す説明図、第3図はそのピクセル相対位置決定
情報の構成を示す説明図、第4図はその動作を示すフロ
ーチヤート、第5図はピクセルの選択指針を45゜単位で
示した説明図、第6図は従来のベクトル描画方式を示す
説明図である。 10はピクセル、11はピクセル位置決定テーブル、12はピ
クセル相対位置決定情報、13は相対変化ビツト。
FIG. 1 is an explanatory diagram showing a vector drawing system according to an embodiment of the present invention, FIG. 2 is an explanatory diagram showing the configuration of a pixel position determination table, and FIG. 3 is an explanation showing the configuration of pixel relative position determination information. FIGS. 4 and 5 are flow charts showing the operation, FIG. 5 is an explanatory view showing a pixel selection guide in 45 ° units, and FIG. 6 is an explanatory view showing a conventional vector drawing system. 10 is a pixel, 11 is a pixel position determination table, 12 is pixel relative position determination information, and 13 is a relative change bit.

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】ベクトルをグラフィックディスプレイ上に
描画するベクトル描画方式において、ピクセル位置決定
テーブル内にあらかじめ、ビット“1"でx方向,y方向成
分の増加、ビット“0"でいずれか一方向成分のみの増加
を、あるいはビット“0"でx方向,y方向成分の増加、ビ
ット“1"でいずれか一方向成分のみの増加を示す1ビッ
ト単位の相対変化ビットの複数により形成され、所定の
範囲内にあるベクトルのそれぞれについて当該ベクトル
の各ピクセルの相対位置を1ビット単位で記述したピク
セル相対位置決定情報を保管しておき、前記所定の範囲
内にあるベクトルの描画に際しては、前記ピクセル位置
決定テーブルから読みだした該当するピクセル相対位置
決定情報に従って前記各ピクセルの位置を決定し、当該
ベクトルを前記グラフィックディスプレイ上に描画する
ことを特徴とするベクトル描画方式。
1. In a vector drawing method for drawing a vector on a graphic display, in the pixel position determination table, a bit "1" is used to increase an x-direction component and a y-direction component, and a bit "0" is added to one direction component. Or a predetermined change is formed by a plurality of 1-bit relative change bits indicating an increase in the x-direction component and the y-direction component at bit "0" and an increase in only one direction component at bit "1". For each vector within the range, pixel relative position determination information describing the relative position of each pixel of the vector in 1-bit units is stored, and when drawing the vector within the predetermined range, the pixel position The position of each pixel is determined according to the corresponding pixel relative position determination information read from the determination table, and the vector is converted into the graph. Vector drawing method, characterized in that drawing on the click display.
JP62039790A 1987-02-23 1987-02-23 Vector drawing method Expired - Lifetime JPH0664443B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP62039790A JPH0664443B2 (en) 1987-02-23 1987-02-23 Vector drawing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP62039790A JPH0664443B2 (en) 1987-02-23 1987-02-23 Vector drawing method

Publications (2)

Publication Number Publication Date
JPS63206796A JPS63206796A (en) 1988-08-26
JPH0664443B2 true JPH0664443B2 (en) 1994-08-22

Family

ID=12562741

Family Applications (1)

Application Number Title Priority Date Filing Date
JP62039790A Expired - Lifetime JPH0664443B2 (en) 1987-02-23 1987-02-23 Vector drawing method

Country Status (1)

Country Link
JP (1) JPH0664443B2 (en)

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61158394A (en) * 1984-12-29 1986-07-18 富士通株式会社 Fast circle circular arc generation system

Also Published As

Publication number Publication date
JPS63206796A (en) 1988-08-26

Similar Documents

Publication Publication Date Title
US6232987B1 (en) Progressively renderable outline font and methods of generating, transmitting and rendering the same
JPH0251786A (en) Scan converting system
EP0714057B1 (en) Method and apparatus for displaying a cursor along a two dimensional representation of a computer generated three dimensional surface
US7616200B1 (en) System for reducing aliasing on a display device
JPH07503087A (en) Video graphics controller with improved pattern performance
JP4240543B2 (en) Display device
JPH0561980A (en) Line drawing device
US7038684B2 (en) Rendering process apparatus capable of improving processing speed of overall graphic system
US6930686B1 (en) Method and apparatus for drawing thick graphic primitives
JP2000148126A (en) Image display device and method
JPH0729022A (en) Straight line drawing device
JP4834642B2 (en) Graphic change device, graphic change method, computer program, and recording medium
JP2630843B2 (en) Straight line drawing method and apparatus
JP2507812B2 (en) Square root calculation method
JP3089740B2 (en) Line drawing device
EP0357076A2 (en) Inclined rectangular pattern generating system
JP2000298729A (en) 2D image generator
JP2780496B2 (en) Clipping method for drawing equipment
JPS6045287A (en) Clipping processor
JP2001183977A (en) Bird's-eye view creation device, navigation device, bird's-eye view creation method, and recording medium storing bird's-eye view creation program
JPH1031760A (en) Graphic processing unit
JPS63206796A (en) Vector lithography system
JPH02212984A (en) Generating device for elliptical pattern
JPH11250269A (en) How to avoid clipping decision error
JP2000322585A (en) Image processing method and apparatus