JPH0148593B2 - - Google Patents
Info
- Publication number
- JPH0148593B2 JPH0148593B2 JP59105013A JP10501384A JPH0148593B2 JP H0148593 B2 JPH0148593 B2 JP H0148593B2 JP 59105013 A JP59105013 A JP 59105013A JP 10501384 A JP10501384 A JP 10501384A JP H0148593 B2 JPH0148593 B2 JP H0148593B2
- Authority
- JP
- Japan
- Prior art keywords
- residual
- holding means
- lattice point
- held
- value
- 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
Links
Landscapes
- Image Generation (AREA)
Description
産業上の利用分野
本発明は、格子状に分割された画像空間におけ
る格子点計算装置に関するものである。
従来例の構成とその問題点
近年、電子計算機による画像処理はたいへん重
要度を増しているが、特に超小型計算機の普及に
伴つて、事務処理、設計、その他画像の編集、加
工、曲線や直線の描画などの処理を電子計算機に
よつて実行することがたいへん重要なこととなつ
てきている。
たとえば従来、格子状に分割された画像空間内
に直線または曲線を描画するため、関数式から描
画点を計算する手法として、デジタル微分解析
(以下、DDAと略記する。)なる手法が知られて
いる。
第1図、第2図、及び第3図はこのDDAのア
ルゴリズムを説明するためのものである。以下、
DDAアルゴリズムにより、たとえば第(1)式なる
曲線を発生する場合について説明する。
f(x、y)=0 ……(1)
まず上記第(1)式を微分すると
df(x、y)=G(dn、dy、x、y)=0 ……(2)
を得る。そして第(2)式に新しい変数dtを導入する
ことにより
dx=g1(x、y、dt)
dy=g2(x、y、dt) ……(3)
と書き改ためることができる。この第(3)式より、
xn+1=xn+dx=xn+g1(xn、yn、dt)
yn+1=yn+dy=yn+g2(xn、yn、dt) ……(4)
となる。
xn、ynに関する漸化式を導出し、xn、ynと微
小な一定値dtとから次々と隣接する点の位置を求
めることができる。格子間隔をlとすると、座標
(xn、yn)に点を描けば、第(1)式の曲線を描くこ
とができる。(ただし、xn=〔xn/l〕yn=
〔yn/l〕で、〔x〕はxを越えない整数を表わ
すものとする。)
第1図は点P1から点P4に至るまでの真の位置
の座標に×印を、(xn、yn)を越えない整数
(xn、yn)の位置(以下、近似点と略記する。)
に丸印を施してある。
真の位置と近似点の間隔をRx、Ryとすると、
DDAアルゴリズムによりn番目の点の座標位置
からn+1番目の値を得るには、第2図に示すよ
うなフローチヤートに従い、処理を実行してい
く。なお第3図は第2図に示す処理22の部分を
さらに詳細に記述したものである。また第2図に
示す処理23については第3図に示すxの処理部
分の全体をyに置き換えたものである。
さて第1図のPoに対応する近似点からPo+1の近
似点へ移動するプロセスは次のようになる。すな
わちはじめに、xo、yoの増分△x、△yが求めら
れる(第2図の処理21)。この増分を残差Rxに
加算する(第3図の処理31)。この結果、Rxが
lより大きくなつた際には格子の縦線を右へ1本
越えたことを意味するから、Rxが再びlより小
さな値にもどされ、格子線の位置を表わす変数
Xoに1が加算される(第3図の処理34〜処理
35)。一方△xが負であり処理31の加算の結
果、Rxが−lより小さくなつた場合は、新しい
点は格子の縦線を1本左の方向へ越えた先にある
ことを意味するから、格子線の変数Xoを1だけ
減じ、Rxを正の値にもどす(第3図の処理37
〜処理39)。
以上のようなアルゴリズムを実現する従来の方
法を、第4図および第5図によつてさらに詳細に
説明する。
第4図は上記方法によつて格子間の位置の表現
方法を説明するものである。区間41,42,4
3はそれぞれ格子間の番号N−1,N,N+1
と、そこから残差RXで一義的に表示されている。
格子線番号Xと残差RX各々を、たとえば1語16
ビツトのデータ(16値表記)で表わす区間42に
おける格子線上の位置は〈N、0000〉となり、格
子線N+1の直前の点は〈N、FFFF〉となる。
このような点の位置の表記方法を用いる場合△x
の表現には大きさと方向を表わすため2語を必要
とする。すなわち第3図の流れの処理は第5図に
示すような計算により処理される。すなわち、残
差RXと△xの下位部分DXLとを加算し、その結果
を新しいRXとする。加算時に発生した桁上げ情
報CRYは格子線番号Xoと△xの上位部分DXUと
の加算時に同時に加算される。この結果が新しい
格子点の位置を示すことになる。
次に第6図を参照して、上記処理を実行する装
置の一例について説明する。
第6図の装置によれば、残差レジスタ1の内容
RXと下位増分レジスタ2の内容DXLとを加算器3
により加算し、この結果を再び残差レジスタ1に
格納する。一方加算時に発生した桁上げ情報保持
回路4が保持するCRYと格子線番号保持回路5
における格子線番号の内容Xoと上位増分レジス
タ6の内容DXUは加算器7により同時に加算さ
れ、この結果を再び格子線番号保持回路5に格納
する。
このようにして描画すべき点の格子線番号が計
算される。
しかしながら、上記構成され残差RXの表示方
法が0000〜FFFFというように常に正の数として
扱われているため、増分△xが第2図の処理21
の結果負となり、さらに第3図の処理31の結
果、残差RXが負になつたり、かつRXが−lより
小さい場合は、処理37,38により格子線番号
を1だけ減じて残差RXを正にもどす処理をしな
ければならない。つまり増分の符号によつてプロ
グラムのフローが異なるため、同一のアルゴリズ
ムで曲線などを描画できないうえ、制御プログラ
ムも複雑になるという欠点を有していた。
さらに残差レジスタ1の初期値が格子線番号
X1とX2のちようど中間点の4000と固定であるこ
とにより、たとえば円弧の描画時において同一の
中心、及び半径をもつ円弧であつても、X軸、Y
軸上から描画を始めた場合では、それらの円弧の
軌跡は必ずしも一致しないという欠点を有してい
た。
発明の目的
本発明は、以上のような従来の問題点を解消す
るためになされたもので、画像空間上に任意の曲
線を描画する際に、描画する点の位置を極めて容
易に計算することができる格子点計算装置を提供
するものである。
発明の構成
本発明は、増分を2の補数表現で保持している
増分保持手段と、前記増分保持手段が保持してい
る増分と自己の保持していた2の補数表現による
残差とを加算手段により加算するとともに、その
加算結果の残差を新たな残差として再び2の補数
表現で保持する残差保持手段と、前記残差保持手
段に対して初期値を設定する初期値設定手段と、
前記増分保持手段が保持している増分と前記残差
保持手段が保持し直す新たな残差との最上位ビツ
トの値に応じて格子点保持手段が保持している格
子点の値を変更するか否かを決定するとともに、
その格子点の値を変更する決定がなされると前記
残差保持手段の最上位ビツトの値も変更する格子
点位置変更手段とを設けることにより、上記目的
を達成するものである。
実施例の説明
以下、図面を参照しながら本発明の一実施例に
ついて説明する。
第7図は本発明の一実施例における格子線計算
装置の要部ブロツク構成を示すものである。
第7図において、70は後述する残差レジスタ
72に初期値を与える初期値設定手段で、キーボ
ード等から初期値を入力する。71は格子のx軸
方向の増分△xを2の補数により16ビツトで順次
保持している増分レジスタで、そのデータの最上
位ビツトは増分△xの正・負を表わしている。7
2は格子のx軸方向における残差RXを2の補数
により16ビツトで保持する残差レジスタで、加算
回路73により(増分△x)+(残差RX)を計算
した後その残余をRXとして再び保持しなおす。
74は残差レジスタ72の最上位ビツト(すなわ
ち、2の補数表現における符号ビツト)の符号が
“1”であるか“0”であるかを検出している符
号ビツト検出回路で、“1”の符号を検出すると
後述する信号選択回路79に信号選択制御信号を
送出するとともに、残差レジスタ72の最上位ビ
ツトの符号を“1”から“0”に変更させる。7
5は格子線の番号N、すなわちx軸方向の格子点
Xoを記憶している格子点ポインタで、加算回路
73が加算を行なう毎にx軸方向の格子点の記憶
更新を行なう。76は格子点ポインタ75が保持
している格子点Xoに1を加算する加算回路、7
7は格子点ポインタ75が保持している格子点か
ら1を減算する減算回路である。78は普通は加
算回路76の出力を通過させている信号選択回路
で、増分レジスタ71の最上位ビツトが負、すな
わち符号が“1”を表わしている時のみ減算回路
77の出力を通過させる。79は普通は格子点ポ
インタ75の出力を通過させて再び格子点ポイン
タ75にその出力を送出する信号選択回路で、符
号ビツト検出回路74が負を示す符号“1”を検
出したときのみ信号選択回路78からの信号を通
過させて格子点ポインタ75に新しい格子点を記
憶更新させる。
上記構成において、以下その動作を第8図のフ
ローチヤートとともに説明するが、それに先立つ
て本実施例における格子間の位置の表現方法につ
いて第9図を参照して説明しておく。
第9図において、区間91は格子線の番号Nを
基準としてN−1からN+1までの間を、格子点
ポインタ75が保持している格子線の番号Nと、
残差レジスタ72が保持している残差RXとで表
わしたものである。なお、この残差RXの初期値
は初期値設定手段70により値に任意に設定する
ことができる。残差RXの16ビツト情報における
最上位ビツトが正・負の符号を表わすビツトとし
て用いられ、残りのビツトが大きさを表わしてい
る。格子線の番号Nを基準としてN−1の方向は
負の領域となるので2の補数表示として〈(N)
8000〉〜〈(N)FFFF〉とし、N+1の方向は
正の領域となるので〈(N)、0000〉〜〈(N)、
7FFF〉とする。また区間72は上記と同様に格
子線の番号N+1を基準に表現したものである。
さて残余RXは常に正の数として扱われるため、
負の領域を設定したい場合は初期値設定手段70
により格子線番号を1だけ減じて残余RXを正に
もどすことにより、任意に初期値設定ができる。
その際の残余の範囲は0〜7FFFとなる。なお2
の補数とは一般的に知られているように、上位4
ビツトに限定して記載すれば下表のようになり、
最上位ビツトが“0”か“1”であるかにより
正・負を表わしている。
INDUSTRIAL APPLICATION FIELD The present invention relates to an apparatus for calculating grid points in an image space divided into a grid. Configuration of conventional examples and their problems In recent years, image processing using electronic computers has become very important, but especially with the spread of ultra-compact computers, processing of images, editing and processing of images, curves and straight lines has become increasingly important. It is becoming very important to use electronic computers to perform processes such as drawing images. For example, a method called digital differential analysis (hereinafter abbreviated as DDA) has been known as a method for calculating drawing points from functional expressions in order to draw straight lines or curves in an image space divided into a grid. There is. FIG. 1, FIG. 2, and FIG. 3 are for explaining this DDA algorithm. below,
A case will be explained in which, for example, a curve expressed by equation (1) is generated by the DDA algorithm. f(x, y)=0...(1) First, by differentiating the above equation (1), we obtain df(x, y)=G(dn, dy, x, y)=0...(2). By introducing a new variable dt into equation (2), it can be rewritten as dx=g 1 (x, y, dt) dy=g 2 (x, y, dt) ...(3). From this equation (3), xn + 1 = xn + dx = xn + g 1 (xn, yn, dt) yn + 1 = yn + dy = yn + g 2 (xn, yn, dt) ... (4). By deriving a recurrence formula regarding xn, yn, it is possible to find the positions of adjacent points one after another from xn, yn and a small constant value dt. If the grid spacing is l, then by drawing a point at the coordinates (xn, yn), the curve of equation (1) can be drawn. (However, xn=[xn/l]yn=
In [yn/l], [x] represents an integer not exceeding x. ) In Figure 1, the coordinates of the true position from point P 1 to point P 4 are marked with an x, and the position of an integer (xn, yn) not exceeding (xn, yn) (hereinafter abbreviated as approximate point) .)
is marked with a circle. If the distance between the true position and the approximate point is R x and R y , then
In order to obtain the (n+1)th value from the coordinate position of the nth point using the DDA algorithm, processing is performed according to the flowchart shown in FIG. Note that FIG. 3 describes in more detail the part of the process 22 shown in FIG. 2. Further, in the process 23 shown in FIG. 2, the entire processing portion of x shown in FIG. 3 is replaced with y. Now, the process of moving from the approximate point corresponding to P o in Figure 1 to the approximate point P o+1 is as follows. That is, first, the increments Δx and Δy of x o and y o are determined (process 21 in FIG. 2). This increment is added to the residual R x (process 31 in FIG. 3). As a result, when R x becomes larger than l, it means that one vertical line of the grid has been crossed to the right, so R x is returned to a value smaller than l, and the variable representing the position of the grid line is
1 is added to X o (processes 34 to 35 in FIG. 3). On the other hand, if △x is negative and R x becomes smaller than -l as a result of the addition in process 31, this means that the new point is beyond one vertical line of the grid to the left. , reduce the grid line variable X o by 1, and return R x to a positive value (Process 37 in Figure 3).
~Processing 39). A conventional method for implementing the above algorithm will be explained in more detail with reference to FIGS. 4 and 5. FIG. 4 explains how to express the position between grids using the above method. Section 41, 42, 4
3 are interlattice numbers N-1, N, N+1, respectively
And from there, it is uniquely expressed as the residual R X.
Each grid line number X and residual R
The position on the grid line in the section 42 represented by bit data (16-value notation) is <N, 0000>, and the point immediately before grid line N+1 is <N, FFFF>.
When using this method of notation for the position of a point, △x
The expression requires two words to represent magnitude and direction. That is, the processing of the flow shown in FIG. 3 is processed by calculations as shown in FIG. That is, the residual R X and the lower part D XL of Δx are added, and the result is set as a new R X. The carry information CRY generated during the addition is added at the same time as the grid line number X o and the upper part D XU of Δx. This result will indicate the position of the new grid point. Next, with reference to FIG. 6, an example of a device that executes the above processing will be described. According to the apparatus of FIG. 6, the contents of residual register 1
Adder 3 adds R X and the content D XL of lower increment register 2.
This result is stored in the residual register 1 again. On the other hand, CRY held by the carry information holding circuit 4 that occurred during addition and the grid line number holding circuit 5
The content X o of the grid line number in and the content D In this way, the grid line number of the point to be drawn is calculated. However, since the display method of the residual R
If the result is negative, and if the residual R X becomes negative as a result of process 31 in Figure 3, and if R Processing must be performed to return the difference R X to a positive value. In other words, since the flow of the program differs depending on the sign of the increment, curves etc. cannot be drawn using the same algorithm, and the control program also becomes complicated. Furthermore, the initial value of residual register 1 is the grid line number.
By fixing the midpoint of 4000 after X 1 and X 2 , for example, when drawing an arc, even if the arc has the same center and radius, the
When drawing starts from the axis, the trajectories of the arcs do not necessarily match. Purpose of the Invention The present invention has been made in order to solve the above-mentioned conventional problems, and it is an object of the present invention to extremely easily calculate the position of a point to be drawn when drawing an arbitrary curve on an image space. This provides a lattice point calculation device that can perform Structure of the Invention The present invention includes an increment holding means that holds an increment in two's complement representation, and an increment held by the increment holding means and a residual difference held by itself in two's complement representation. a residual value holding means for adding the result of the addition by a means and again holding the residual as a new residual in two's complement representation; and an initial value setting means for setting an initial value for the residual value holding means. ,
The value of the lattice point held by the lattice point holding means is changed according to the value of the most significant bit of the increment held by the incremental holding means and the new residual held by the residual holding means. In addition to determining whether or not
The above object is achieved by providing lattice point position changing means for changing the value of the most significant bit of the residual holding means when a decision is made to change the value of the lattice point. DESCRIPTION OF EMBODIMENTS An embodiment of the present invention will be described below with reference to the drawings. FIG. 7 shows the main block configuration of a grid line calculation device according to an embodiment of the present invention. In FIG. 7, reference numeral 70 denotes an initial value setting means for providing an initial value to a residual register 72, which will be described later, and the initial value is input from a keyboard or the like. Reference numeral 71 denotes an increment register which sequentially holds the increment .DELTA.x in the x-axis direction of the grid in 16 bits using two's complement, and the most significant bit of the data represents the positive or negative of the increment .DELTA.x. 7
2 is a residual register that holds the residual R X in the x -axis direction of the grid in 16 bits using two's complement; Hold it again as R X.
74 is a sign bit detection circuit that detects whether the sign of the most significant bit of the residual register 72 (that is, the sign bit in two's complement representation) is "1" or "0"; When the sign is detected, a signal selection control signal is sent to a signal selection circuit 79, which will be described later, and the sign of the most significant bit of the residual register 72 is changed from "1" to "0". 7
5 is the grid line number N, that is, the grid point in the x-axis direction
With the lattice point pointer that stores X o , the memory of the lattice points in the x-axis direction is updated every time the addition circuit 73 performs addition. 76 is an addition circuit that adds 1 to the grid point X o held by the grid point pointer 75;
7 is a subtraction circuit that subtracts 1 from the grid point held by the grid point pointer 75. A signal selection circuit 78 normally passes the output of the adder circuit 76, and passes the output of the subtracter circuit 77 only when the most significant bit of the increment register 71 is negative, that is, the sign represents "1". 79 is a signal selection circuit that normally passes the output of the lattice point pointer 75 and sends the output to the lattice point pointer 75 again, and selects the signal only when the sign bit detection circuit 74 detects a sign "1" indicating a negative value. A signal from the circuit 78 is passed through to cause the grid point pointer 75 to store and update the new grid point. The operation of the above configuration will be explained below with reference to the flowchart of FIG. 8, but first, the method of expressing the position between the grids in this embodiment will be explained with reference to FIG. 9. In FIG. 9, a section 91 is a section from N-1 to N+1 based on the grid line number N held by the grid point pointer 75, and
This is expressed by the residual R X held in the residual register 72. Note that the initial value of this residual R X can be arbitrarily set by the initial value setting means 70. The most significant bit in the 16-bit information of the residual R.sub.X is used as a bit representing the positive/negative sign, and the remaining bits represent the magnitude. Based on the grid line number N, the direction of N-1 is a negative area, so it can be expressed as a two's complement by 〈(N)
8000〉~〈(N)FFFF〉, and since the direction of N+1 is a positive area, 〈(N), 0000〉~〈(N),
7FFF>. Also, the section 72 is expressed based on the grid line number N+1, as described above.
Now, the residual R X is always treated as a positive number, so
If you want to set a negative area, use the initial value setting means 70.
By subtracting the grid line number by 1 and returning the residual R X to positive, the initial value can be set arbitrarily.
The remaining range in this case is 0 to 7FFF. Note 2
As is generally known, the complement of is the top 4
If you limit the information to bits, it will look like the table below.
Positive or negative is indicated depending on whether the most significant bit is "0" or "1".
【表】【table】
【表】【table】
【表】
さて以下に、第8図のフローチヤートとともに
第7図に示した格子点計算装置の動作について説
明する。なお第8図のフローチヤートは第3図に
示したフローチヤートに対応するものである。
(イ) まず加算回路73により残差レジスタ72に
保持されていた残差RXと、増分レジスタ71
が保持している増分△xとの加算が行なわれ、
その加算値を残差RXとして再び増分レジスタ
72に記憶させる。その際、桁上げ情報は無視
される。
(ロ) 次に符号ビツト検出回路74では増分レジス
タ72の最上位ビツトの符号を検査する。
そして符号ビツト検出回路74が“0”、すな
わち正の符号を検出した際には、信号選択回路7
9の制御を行なわない。そのため、信号選択回路
79はa側の信号、すなわち格子点ポインタ75
が保持していたx軸方向の格子点Xoの情報を通
過させ、再び格子点ポインタ75にその格子点
Xoの情報を記憶させる。
一方符号ビツト検出回路74が“1”、すなわ
ち負の符号を検出した際には、残差レジスタ72
の最上位ビツトの符号を“1”から“0”にする
とともに、信号選択回路79に信号選択制御信号
を送出して信号選択回路79の制御を行なう。そ
のため、信号選択回路79はb側の信号を通過さ
せて、格子点ポインタ75に新たな格子点Xoが
記憶されるよう制御される。
(ハ) さて、上記(ロ)の制御とともに、信号選択回路
78も増分レジスタ71の増分△xにおける最
上位ビツトの情報“0”、“1”に応じて制御が
なされている。
(ニ) すなわち増分△xの最上位ビツト情報が
“0”の場合には、信号選択回路78はa側の
信号を選択し、加算回路76により、格子点ポ
インタ75から送出された格子点Xoに1を加
算したものが送出される。
(ホ) 一方増分△xの最上位ビツト情報が“1”の
場合には、信号選択回路78はb側の信号を選
択し、減算回路77により、格子点ポインタ7
5から送出された格子点Xoから1を減算した
ものが送出される。
(ヘ) 上記(ニ)、あるいは(ホ)の制御により、格子点ポ
インタ75には加算回路76、あるいは減算回
路77から送出される情報が、信号選択回路7
8,79を介して格子点ポインタ75に記憶更
新される。
上記(イ)〜(ホ)の制御から明らかなように、増分レ
ジスタ71の最上位ビツトの値にかかわらず、
RX+△xの結果、残差レジスタ72の最上位ビ
ツトが“0”の場合はx軸方向の格子点に変更が
ないので、格子点ポインタ75は送出した格子点
Xoの情報を信号選択回路79を介して再び入力
し、記憶する。
一方RX+△xの結果、残差レジスタ72の最
上位ビツトが“1”となると、x軸方向の格子点
に変更が発生したこととなる。その際、増分レジ
スタ71の最上位ビツトが“0”の場合には正の
方向に格子点が1つ移動したこととなるため、加
算回路76は格子点ポインタ75から送出されて
くる格子点Xoに1を加算し、信号選択回路78,
79を介して格子点ポインタ75に新たな格子点
Xo+1を記憶させる。一方増分レジスタ71の
最上位ビツトが“1”の場合には負の方向に格子
点が1つ移動したこととなるため、減算回路77
は格子点ポインタ75から送出されてくる格子点
Xoから1を減算し、信号選択回路78,79を
介して格子点ポインタ75に新たな格子点(Xo
−1)を記憶させる。
上記動作により生じる格子点ポインタ75の記
憶更新状態を下表に示す。[Table] Now, the operation of the lattice point calculation device shown in FIG. 7 will be explained below along with the flowchart shown in FIG. Note that the flowchart in FIG. 8 corresponds to the flowchart shown in FIG. (a) First, the residual R
is added to the increment △x held by
The added value is stored again in the increment register 72 as the residual R.sub.X. At this time, carry information is ignored. (b) Next, the sign bit detection circuit 74 checks the sign of the most significant bit of the increment register 72. When the sign bit detection circuit 74 detects "0", that is, a positive sign, the signal selection circuit 7
9 control is not performed. Therefore, the signal selection circuit 79 selects the a-side signal, that is, the lattice point pointer 75
passes the information about the grid point X o in the x-axis direction held by
X o memorize information. On the other hand, when the sign bit detection circuit 74 detects "1", that is, a negative sign, the residual difference register 72
The signal selection circuit 79 is controlled by changing the sign of the most significant bit from "1" to "0" and sending a signal selection control signal to the signal selection circuit 79. Therefore, the signal selection circuit 79 is controlled so that the signal on the b side is passed through and the new grid point X o is stored in the grid point pointer 75. (c) In addition to the control described in (b) above, the signal selection circuit 78 is also controlled in accordance with the information "0" and "1" of the most significant bit in the increment Δx of the increment register 71. (d) That is, when the most significant bit information of the increment Δx is “0”, the signal selection circuit 78 selects the signal on the a side, and the addition circuit 76 selects the signal at the lattice point X sent from the lattice point pointer 75. o plus 1 is sent. (e) On the other hand, when the most significant bit information of the increment Δx is "1", the signal selection circuit 78 selects the signal on the b side, and the subtraction circuit 77 moves the lattice point pointer 7
The value obtained by subtracting 1 from the grid point X o sent from 5 is sent. (F) By the control in (D) or (E) above, the information sent from the addition circuit 76 or the subtraction circuit 77 is sent to the grid point pointer 75 by the signal selection circuit 77.
The data is stored and updated in the lattice point pointer 75 via 8 and 79. As is clear from the controls in (a) to (e) above, regardless of the value of the most significant bit of the increment register 71,
If the most significant bit of the residual register 72 is “0” as a result of R
Information on X o is input again via the signal selection circuit 79 and stored. On the other hand, when the most significant bit of the residual register 72 becomes "1" as a result of R X +Δx, this means that a change has occurred in the grid point in the x-axis direction. At this time, if the most significant bit of the increment register 71 is "0", it means that the grid point has moved by one in the positive direction, so the addition circuit 76 receives the grid point X sent from the grid point pointer 75. 1 is added to o , the signal selection circuit 78,
A new grid point is added to the grid point pointer 75 via 79.
Memorize X o +1. On the other hand, if the most significant bit of the increment register 71 is "1", this means that the grid point has moved by one in the negative direction, so the subtraction circuit 77
is the grid point sent from the grid point pointer 75
1 is subtracted from X o , and a new grid point (X o
-1) is memorized. The table below shows the storage update state of the lattice point pointer 75 caused by the above operation.
【表】
以上のように本実施例によれば、2の補数によ
り表現されている増分レジスタ71及び残差レジ
スタ72のそれぞれの最上位ビツトの値により信
号選択回路78,79を制御するよう構成するだ
けで、ある微小な一定値dtに生じる格子点の変化
を容易に計算することができる。
なお本実施例では信号選択手段79は格子点ポ
インタ75及び信号選択回路78の一方の情報
を、符号ビツト検出回路74から送出される信号
選択制御信号に応じて格子点ポインタ75に送出
して、記憶更新させているが、格子点ポインタ7
5の記憶変更が必要な時のみに信号選択手段78
から送出される出力を格子点ポインタ75に送出
して記憶更新させるよう構成してもよい。
また初期値設定手段70を設けることにより、
始点の格子線間隔以下の微妙な位置でも設定する
ことが可能なため、より正確に曲線全体の位置を
設定することができる。
発明の効果
本発明は以上のように、増分を2の補数表現で
保持している増分保持手段と、前記増分保持手段
が保持している増分と自己の保持していた2の補
数表現による残差とを加算手段により加算すると
ともに、その加算結果の残差を新たな残差として
再び2の補数表現で保持する残差保持手段と、前
記残差保持手段に対して初期値を設定する初期値
設定手段と、前記増分保持手段が保持している増
分と前記残差保持手段が保持し直す新たな残差と
の最上位ビツトの値に応じて、格子点保持手段が
保持している格子点の値を変更するか否かを決定
するとともに、その格子点の値を変更する決定が
なされると前記残差保持手段の最上位ビツトの値
も変更する格子点位置変更手段とを設けることに
より、画像空間上に任意の曲線を描画する際に、
描画する点の位置をきわめて容易に計算すること
ができ、さらには微妙な描画も正確に行なうこと
ができ、その効果は大きい。[Table] As described above, according to this embodiment, the signal selection circuits 78 and 79 are controlled by the values of the most significant bits of the increment register 71 and the residual register 72, which are expressed in two's complement numbers. By simply doing this, you can easily calculate the changes in the grid points that occur at a certain small constant value dt. In this embodiment, the signal selection means 79 sends information from either the lattice point pointer 75 or the signal selection circuit 78 to the lattice point pointer 75 in response to the signal selection control signal sent from the code bit detection circuit 74. Although the memory is being updated, the grid point pointer 7
The signal selection means 78 is used only when it is necessary to change the memory in step 5.
It may be configured such that the output sent from the lattice point pointer 75 is sent to the grid point pointer 75 to update the memory. Furthermore, by providing the initial value setting means 70,
Since it is possible to set even a delicate position that is less than the grid line interval of the starting point, the position of the entire curve can be set more accurately. Effects of the Invention As described above, the present invention provides an increment holding means that holds an increment in two's complement representation, and an increment held by the increment holding means and the remainder held by itself in two's complement representation. and a residual holding means for adding the difference by an adding means and holding the residual of the addition result as a new residual again in two's complement representation; and an initialization for setting an initial value for the residual holding means. a value setting means, and a grid held by the grid point holding means according to the value of the most significant bit of the increment held by the increment holding means and a new residual held by the residual holding means; and lattice point position changing means for determining whether or not to change the value of a point, and also changing the value of the most significant bit of the residual holding means when a decision is made to change the value of the lattice point. When drawing an arbitrary curve on the image space,
The position of the point to be drawn can be calculated extremely easily, and even delicate drawings can be performed accurately, which is highly effective.
第1図はデジタル微分解析を説明する概略図、
第2図、第3図は同解析のフローチヤート、第4
図は格子間の位置表現を示す図、第5図は第3図
の計算処理を説明する図、第6図は第5図に示す
計算処理を実行する従来の格子点計算装置の要部
ブロツク結線図、第7図は本発明の一実施例にお
ける格子点計算装置のブロツク結線図、第8図は
同格子点計算装置のフローチヤート、第9図は同
格子点計算装置における格子間の位置表現を示す
図である。
70……初期値設定手段、71……増分レジス
タ、72……残差レジスタ、73……加算回路、
74……符号ビツト検出回路、75……格子点ポ
インタ、76……加算回路、77……減算回路、
78,79……信号選択回路。
Figure 1 is a schematic diagram explaining digital differential analysis.
Figures 2 and 3 are flowcharts of the same analysis, and Figure 4
The figure shows a representation of the position between grids, Figure 5 is a diagram explaining the calculation process shown in Figure 3, and Figure 6 is a block diagram of the main parts of a conventional grid point calculation device that executes the calculation process shown in Figure 5. 7 is a block wiring diagram of the lattice point calculation device according to an embodiment of the present invention, FIG. 8 is a flowchart of the lattice point calculation device, and FIG. 9 is a diagram showing the positions between lattices in the lattice point calculation device. It is a figure showing an expression. 70... Initial value setting means, 71... Increment register, 72... Residual register, 73... Addition circuit,
74... Sign bit detection circuit, 75... Grid point pointer, 76... Addition circuit, 77... Subtraction circuit,
78, 79...Signal selection circuit.
Claims (1)
手段と、前記増分保持手段が保持している増分と
自己の保持していた2の補数表現による残差とを
加算手段により加算するとともに、その加算結果
の残差を新たな残差として再び2の補数表現で保
持する残差保持手段と、前記残差保持手段に対し
て初期値を与える初期値設定手段と、前記増分保
持手段が保持している増分と前記残差保持手段が
保持し直す新たな残差との最上位ビツトの値に応
じて格子点保持手段が保持している格子点の値を
変更するか否かを決定するとともに、その格子点
の値を変更する決定がなされると前記残差保持手
段の最上位ビツトの値も変更する格子点位置変更
手段とを具備する格子点計算装置。 2 格子点位置変更手段は、格子点保持手段が保
持している格子点に1を加算する加算手段と、前
記格子点保持手段が保持している格子点から1を
減算する減算手段と、増分保持手段が保持してい
る増分の最上位ビツトの値に応じて前記加算手
段、あるいは減算手段の一方の出力を選択する第
1の信号選択手段と、残差保持手段が保持してい
る残差の最上位ビツトの値に応じて、前記格子点
保持手段が保持している格子点を前記第1の信号
選択手段が選択した情報に変更するか否かを決定
する決定手段とを具備することを特徴とする特許
請求の範囲第1項記載の格子点計算装置。 3 決定手段は残差保持手段が保持している残差
の最上位ビツトの値に応じて、格子点保持手段が
保持している格子点を再び前記格子点保持手段に
再記憶させるか、第1の信号選択手段が選択した
情報を前記格子点保持手段に記憶更新させる第2
の信号選択手段であることを特徴とする特許請求
の範囲第2項記載の格子点計算装置。[Claims] 1. An increment holding means that holds an increment in two's complement representation, and adding the increment held by the increment holding means and the residual held by itself in two's complement representation. a residual difference holding means for adding the difference by means of a residual difference holding means and again holding the residual difference of the addition result as a new residual in two's complement representation; and an initial value setting means for giving an initial value to the residual difference holding means; The value of the lattice point held by the lattice point holding means is changed according to the value of the most significant bit of the increment held by the incremental holding means and the new residual held by the residual holding means. 2. A lattice point calculation device comprising lattice point position changing means for determining whether or not the lattice point value is changed, and also changing the value of the most significant bit of the residual holding means when a decision is made to change the value of the lattice point. 2. The lattice point position changing means includes an addition means for adding 1 to the lattice points held by the lattice point holding means, a subtraction means for subtracting 1 from the lattice points held by the lattice point holding means, and an incrementing means for adding 1 to the lattice points held by the lattice point holding means; a first signal selection means for selecting the output of either the addition means or the subtraction means according to the value of the most significant bit of the increment held by the holding means; and a residual held by the residual holding means. determining means for determining whether or not to change the lattice point held by the lattice point holding means to the information selected by the first signal selection means, according to the value of the most significant bit of the lattice point holding means. A lattice point calculation device according to claim 1, characterized in that: 3. The determining means may cause the grid point holding means to re-store the grid points held by the grid point holding means in accordance with the value of the most significant bit of the residual held by the residual holding means; a second one for storing and updating the information selected by the first signal selecting means in the grid point holding means;
3. The lattice point calculation device according to claim 2, wherein the lattice point calculation device is a signal selection means.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP59105013A JPS60247788A (en) | 1984-05-23 | 1984-05-23 | Calculating device of lattice point |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP59105013A JPS60247788A (en) | 1984-05-23 | 1984-05-23 | Calculating device of lattice point |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPS60247788A JPS60247788A (en) | 1985-12-07 |
| JPH0148593B2 true JPH0148593B2 (en) | 1989-10-19 |
Family
ID=14396182
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP59105013A Granted JPS60247788A (en) | 1984-05-23 | 1984-05-23 | Calculating device of lattice point |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPS60247788A (en) |
-
1984
- 1984-05-23 JP JP59105013A patent/JPS60247788A/en active Granted
Also Published As
| Publication number | Publication date |
|---|---|
| JPS60247788A (en) | 1985-12-07 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US5191641A (en) | Cursor shift speed control system | |
| JP3161536B2 (en) | How to move the displayed image | |
| US4675665A (en) | Realtime tracking of a movable cursor | |
| EP0416421B1 (en) | A clipping processor | |
| JPH061193B2 (en) | Vehicle navigator | |
| JPH0148593B2 (en) | ||
| JPH04291621A (en) | Movement display system | |
| JPH0444785B2 (en) | ||
| JP4811177B2 (en) | Graph display device and graph display processing program | |
| JPS59176821A (en) | Data correction method for data processing equipment | |
| JP2800145B2 (en) | Item selection controller | |
| JPH082747Y2 (en) | Document processing device | |
| JP2593620B2 (en) | Character processor | |
| JP3091472B2 (en) | Image processing method | |
| JPH0194483A (en) | Layout design supporting device | |
| JPS5894071A (en) | Coordinate detector | |
| JPH08335142A (en) | Mouse pointer movement control device | |
| JPH08110836A (en) | Data interpolation processing method | |
| JPS594048B2 (en) | Digital differential analyzer | |
| JPH0133851B2 (en) | ||
| JPH0425553B2 (en) | ||
| JPS59206884A (en) | Circle or ellipse fill method | |
| JPS6332590A (en) | Cursor movement system for display device | |
| JPH03141462A (en) | document processing device | |
| JPS61237116A (en) | Information processor |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| EXPY | Cancellation because of completion of term |