JPH05108833A - Elliptic scan converter - Google Patents

Elliptic scan converter

Info

Publication number
JPH05108833A
JPH05108833A JP3293705A JP29370591A JPH05108833A JP H05108833 A JPH05108833 A JP H05108833A JP 3293705 A JP3293705 A JP 3293705A JP 29370591 A JP29370591 A JP 29370591A JP H05108833 A JPH05108833 A JP H05108833A
Authority
JP
Japan
Prior art keywords
ellipse
digits
scan conversion
calculation
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
JP3293705A
Other languages
Japanese (ja)
Inventor
Hiroshi Ishii
石井  博
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Home Electronics Ltd
NEC Corp
Original Assignee
NEC Home Electronics Ltd
Nippon Electric Co 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 NEC Home Electronics Ltd, Nippon Electric Co Ltd filed Critical NEC Home Electronics Ltd
Priority to JP3293705A priority Critical patent/JPH05108833A/en
Publication of JPH05108833A publication Critical patent/JPH05108833A/en
Pending legal-status Critical Current

Links

Landscapes

  • Complex Calculations (AREA)
  • Digital Computer Display Output (AREA)
  • Image Generation (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

PURPOSE:To plot an ellipse at a high speed by preliminarily predicting the number of maximum arithmetic digits based on the parameter of the ellipse to be plotted, and reducing the lower-order bits of an inside variable only in the prescribed number of digits according to the predicted number of digits in order to execute a scan conversion. CONSTITUTION:A parameter setting part 10 sets and inputs the parameter of the ellipse to be plotted, and initializes it. An arithmetic precision predicting part 12 receives the initial value and set value of the parameter, and searches the number of maximum arithmetic digits to be generated at the time of the scan conversion of the ellipse. A reduction number of digit calculating part 14 decides the number of digits of the lower order bits to be reduced from the inside variable used by the scan conversion of the ellipse to be plotted, based on the number of maximum arithmetic digits. An elliptic circumferential coordinate calculating part 16 reduces the lower-order bits of the inside variable only in the decided number of digits in order to execute the scan conversion, and decides the luster coordinate of the ellipse to be plotted. Then, an outputting part 18 transmits the searched elliptic luster coordinate to a display device, printing device, or storage device.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、コンピュータ・グラフ
ィックスに関し、特にラスタ・スキャン・ディスプレイ
に楕円を描画するためのスキャン変換装置に関する。
FIELD OF THE INVENTION This invention relates to computer graphics, and more particularly to a scan conversion device for drawing ellipses on a raster scan display.

【0002】[0002]

【従来の技術】CRT等のラスタ・スキャン・ディスプ
レイでは、画面上にマトリクス状に配置された画素を離
散的に発光させて画像を描く。したがって、たとえば、
ある1点から他の点へ厳密な直線を描くことは不可能な
ので、その直線に最も近い画素を選択して疑似的な直線
を描くようにしている。このように、描画すべき直線ま
たは曲線に対して最短距離の画素を決定する手順(ラス
タ化)を繰り返すことによって、発光させるべき一連の
画素の格子点位置(ラスタ座標)が決定される。このよ
うに、描画すべき画像に対してラスタ・スキャン・ディ
スプレイ上のラスタ座標を決定する手順は、スキャン変
換と称されている。
2. Description of the Related Art In a raster scan display such as a CRT, pixels arranged in a matrix on a screen are made to emit light discretely to draw an image. So, for example,
Since it is impossible to draw a strict straight line from one point to another point, a pixel closest to the straight line is selected to draw a pseudo straight line. In this way, the grid point positions (raster coordinates) of a series of pixels to emit light are determined by repeating the procedure (rasterization) of determining the pixel with the shortest distance with respect to the straight line or curve to be drawn. The procedure for determining the raster coordinates on the raster scan display for the image to be drawn in this way is called scan conversion.

【0003】従来、ラスタ・スキャン・ディスプレイで
楕円を描画するためのスキャン変換としては、ブレゼン
ハム(Bresenham)の円描画アルゴリズムをそのまま楕円
に応用したものが考えられている。以下に、この楕円描
画アルゴリズムについて説明する。
Conventionally, as scan conversion for drawing an ellipse on a raster scan display, it has been considered to apply the Bresenham circle drawing algorithm to the ellipse as it is. The ellipse drawing algorithm will be described below.

【0004】いま、図5に示すように、原点を中心と
し、X軸方向の径がRx、Y軸方向の径がRy の楕円を
描画するものとする。楕円は4方向対象性であるから、
第1象限内の4分楕円だけスキャン変換すれば、その4
分楕円を反転・折返すことで他の3象限の各4分楕円を
描画することができる。この楕円の方程式は、次式のよ
うに表される。 (x/Rx )2 +(y/Ry )2 =1 (1.01) この式は次式のように変形できる。 Ry 2 ・x2 +Rx 2 ・y2 =Rx 2 ・Ry 2 (1.02) Rx 2 =a、Ry 2 =bとおくと、次式のようになる。 bx 2 +ay 2 =ab (1.03)
Now, as shown in FIG. 5, it is assumed that an ellipse centered on the origin and having a diameter of Rx in the X-axis direction and a diameter of Ry in the Y-axis direction is drawn. Since the ellipse is symmetric in four directions,
If only the quadrant in the first quadrant is scan converted,
By inverting and folding the minute ellipse, it is possible to draw each quadrant of the other three quadrants. This elliptic equation is expressed as the following equation. (X / Rx) 2 + (y / Ry) 2 = 1 (1.01) This equation can be transformed into the following equation. When Ry 2 · x 2 + Rx 2 · y 2 = Rx 2 · Ry 2 (1.02) Rx 2 = a and Ry 2 = b, the following equation is obtained. bx 2 + ay 2 = ab (1.03)

【0005】このとき図6において、真の楕円L0 もし
くはL1 と右方向の近接格子点Phとの距離の自乗Eh
、右斜め下方向の近接格子点Pd との距離の自乗Ed
、真下方向の近接格子点Pv との距離の自乗Ev はそ
れぞれ次のようになる。 Ph : Eh =|b(xi +1)2 +a(yi )2 −ab| (1.04) Pd : Ed =|b(xi +1)2 +a(yi −1)2 −ab| (1.05) Pv : Ev =|b(xi )2 +a(yi −1)2 −ab| (1.06) ここで、 Δi =b(xi +1)2 +a(yi −1)2 −ab (1.07) と定義し、このΔi の符号を基に、次のように場合分け
して、Ph ,Pd ,Pvのうち真の楕円に最も近い格子
点を決定する。
At this time, in FIG. 6, the square of the distance Eh between the true ellipse L0 or L1 and the adjacent grid point Ph in the right direction Eh.
, The squared distance Ed from the adjacent grid point Pd in the lower right direction
, And the squared Ev of the distance from the adjacent lattice point Pv in the direct downward direction is as follows. Ph: Eh = | b (xi + 1) 2 + a (yi) 2- ab | (1.04) Pd: Ed = | b (xi + 1) 2 + a (yi-1) 2- ab | (1.05) Pv: Ev = | B (xi) 2 + a (yi -1) 2 -ab | (1.06) where Δi = b (xi +1) 2 + a (yi -1) 2 -ab (1.07) is defined, and the sign of this Δi Based on the above, the lattice points closest to the true ellipse among Ph, Pd, and Pv are determined by classifying as follows.

【0006】 Δi <0の場合 これは、図6において真の楕円が曲線L0 のようにPd
の外側を通る場合である。したがって、選択されるべき
格子点はPd もしくはPhのいずれかである。Pd もし
くはPh のいずれかを決定するために、Ph と真の楕円
L0 間の距離の自乗Eh と、Pd と真の楕円L0 間の距
離の自乗Ed との差δi を調べる。 δi =Eh −Ed =|b(xi +1)2 +a(yi )2 −ab|−|b(xi +1)2 + a(yi −1)2 −ab| =2{b(xi +1)2 +a(yi −1)2 −ab}−a(−2yi +1) =2Δi +2ayi −a (1.08) そうすると、δi <0の場合は、Eh <Ed だから、P
h を選択し、xi+1 =xi +1、yi+1 =yi として、
次の誤差項Δi+1 を求める。すなわち、 Δi+1 =b(xi+1 +1)2 +a(yi+1 −1)2 −ab =b(xi+12 +2xi+1 +1)+a(yi+1 −1)2 −ab =b(xi +1)2 +a(yi −1)2 −ab+b(2xi +1) =Δi +b(2xi+1 +1) (1.09) δi ≧0の場合は、Eh ≧Ed だから、Pd を選択し、
xi+1 =xi+1、yi+1 =yi −1として次の誤差項
Δi+1 を求める。すなわち、 Δi+1 =b(xi+1 +1)2 +a(yi+1 −1)2 −ab =Δi +b(2xi+1 +1)−a(2yi+1 −1) (1.10)
When Δi <0, this means that the true ellipse is Pd as shown by the curve L0 in FIG.
This is the case when passing outside of. Therefore, the grid point to be selected is either Pd or Ph. To determine either Pd or Ph, the difference .delta.i between the square of the distance Eh between Ph and the true ellipse L0 and the square of the distance between Pd and the true ellipse L0 Ed is examined. .delta.i = Eh-Ed = | b (xi + 1) 2 + a (yi) 2- ab |-| b (xi + 1) 2 + a (yi-1) 2 -ab | = 2 {b (xi + 1) 2 + a (Yi -1) 2 -ab} -a (-2yi +1) = 2Δi + 2ayi -a (1.08) Then, when δi <0, Eh <Ed, so P
Select h, and set xi + 1 = xi +1 and yi + 1 = yi,
Find the next error term Δi + 1. That, Δi + 1 = b (xi + 1 +1) 2 + a (yi + 1 -1) 2 -ab = b (xi + 1 2 + 2xi + 1 +1) + a (yi + 1 -1) 2 -ab = b (Xi + 1) 2 + a (yi-1) 2- ab + b (2xi + 1) = [Delta] i + b (2xi + 1 + 1) (1.09) [delta] i≥0, Eh≥Ed, so Pd is selected,
The next error term .DELTA.i + 1 is obtained with xi + 1 = xi + 1 and yi + 1 = yi-1. That is, Δi + 1 = b (xi + 1 + 1) 2 + a (yi + 1-1) 2 -ab = Δi + b (2xi + 1 + 1) -a (2yi + 1-1) (1.10)

【0007】 Δi >0の場合 これは、図6において、真の楕円が曲線L1 のようにP
d の内側を通る場合である。したがって、選択されるべ
き格子点は、Pd もしくはPv のいずれかである。この
いずれかを決定するために、Pv と真の楕円L1 間の距
離の自乗Ev とPd と真の楕円L1 間の距離の自乗Ed
との差δi を調べる。 δi =Ev −Ed =|b(xi )2 +a(yi −1)2 −ab|−|b(xi +1)2 + a(yi −1)2 −ab| =2{b(xi +1)2 +a(yi −1)2 −ab}−b(2xi +1) =2Δi −2bxi +b (1.11) そうすると、δi <0の場合は、Ev <Ed だから、P
v を選択し、xi+1 =xi 、yi+1=yi −1として、
次の誤差項Δi+1 を求める。すなわち、 Δi+1 =b(xi+1 +1)2 +a(yi+1 −1)2 −ab =Δi −a(2yi+1 −1) (1.12) δi ≧0の場合は、Ev ≧Ed だから、Pd を選択し、
xi+1 =xi +1、yi+1 =yi −1として、次の誤差
項Δi+1 を求める。すなわち、 Δi+1 =b(xi+1 +1)2 +a(yi+1 −1)2 −ab =Δi +b(2xi+1 +1)−a(2yi+1 −1) (1.13)
In the case of Δi> 0 This means that the true ellipse is P as shown by the curve L1 in FIG.
This is the case of passing inside d. Therefore, the grid point to be selected is either Pd or Pv. To determine either of these, the square of the distance Ev between Pv and the true ellipse L1 and the square of the distance Ed between Pd and the true ellipse L1 Ed.
Check the difference δi with. .delta.i = Ev-Ed = | b (xi) 2 + a (yi-1) 2- ab |-| b (xi + 1) 2 + a (yi-1) 2 -ab | = 2 {b (xi + 1) 2 + A (yi -1) 2 -ab} -b (2xi +1) = 2Δi -2bxi + b (1.11) Then, when δi <0, Ev <Ed, so P
Select v, and set xi + 1 = xi, yi + 1 = yi -1,
Find the next error term Δi + 1. That is, if Δi + 1 = b (xi + 1 + 1) 2 + a (yi + 1-1) 2 -ab = Δi-a (2yi + 1-1) (1.12) δi ≧ 0, then Ev ≧ Ed. , Pd,
The next error term .DELTA.i + 1 is obtained with xi + 1 = xi + 1 and yi + 1 = yi-1. That is, Δi + 1 = b (xi + 1 + 1) 2 + a (yi + 1-1) 2 -ab = Δi + b (2xi + 1 + 1) -a (2yi + 1-1) (1.13)

【0008】 Δi =0の場合 これは、真の楕円がPd の真上を通る場合である。した
がって、Pd を選択する。また、Δi+1 は次式のように
なる。 Δi+1 =b(xi+1 +1)2 +a(yi+1 +1)2 −ab =Δi +b(2xi+1 +1)−a(2yi+1 −1) (1.14)
Case of Δi = 0 This is a case where the true ellipse passes directly above Pd. Therefore, Pd is selected. Further, Δi + 1 is given by the following equation. Δi + 1 = b (xi + 1 + 1) 2 + a (yi + 1 + 1) 2 -ab = Δi + b (2xi + 1 + 1) -a (2yi + 1-1) (1.14)

【0009】このように、プレゼンハムの円描画アルゴ
リズムと同様なディジタル微分解析法(DDA:テ゛ィシ゛タ
ル・テ゛ファレンシャル・アナライシ゛ンク゛)により楕円のスキャン変換が
行える。図7は、上記した楕円描画アルゴリズムによる
楕円スキャン変換の処理を示すフローチャートである。
As described above, the elliptical scan conversion can be performed by the digital differential analysis method (DDA: Digital Differential Analysis) similar to the Presentham's circle drawing algorithm. FIG. 7 is a flowchart showing the elliptic scan conversion processing by the above ellipse drawing algorithm.

【0010】[0010]

【発明が解決しようとする課題】上述したように、プレ
ゼンハムの円描画アルゴリズムをそのまま応用したスキ
ャン変換によって楕円を描画することができる。しか
し、このような楕円描画アルゴリズムによると、内部の
演算で入力パラメータの4次の項を含む計算を行うため
(式 (1.03) )、期待する出力値の精度に比べて大規模
な演算装置を用いなければならなかった。また、パーソ
ナルコンピュータなどの小規模なシステムでは、ハード
ウェア上の演算精度は16ビット程度に制限されている
ことが多く、所要の演算精度がこれを超えるときはソフ
トウェアで処理しているが、しかし、その場合はスルー
プットが著しく低下するという問題が生じた。
As described above, it is possible to draw an ellipse by the scan conversion in which the Presentham's circle drawing algorithm is directly applied. However, according to such an ellipse drawing algorithm, the calculation including the quaternary term of the input parameter is performed by the internal calculation (Equation (1.03)), and therefore, a large-scale arithmetic device is required as compared with the expected output value accuracy. Had to use. In a small-scale system such as a personal computer, the calculation accuracy on hardware is often limited to about 16 bits, and when the required calculation accuracy exceeds this, it is processed by software. In that case, there was a problem that the throughput was significantly reduced.

【0011】本発明は、かかる問題点に鑑みてなされた
もので、小規模な回路により楕円を高速描画することが
でき、スループットの向上がはかれる楕円スキャン変換
装置を提供することを目的とする。
The present invention has been made in view of the above problems, and an object of the present invention is to provide an ellipse scan conversion device capable of drawing an ellipse at high speed with a small-scale circuit and improving throughput.

【0012】[0012]

【課題を解決するための手段】上記の目的を達成するた
め、本発明の楕円スキャン変換装置は、ラスタ・スキャ
ン・ディスプレイに楕円を描画するためにディジタル微
分解析法に基づいたスキャン変換により前記描画すべき
楕円の座標を決定する装置において、前記描画すべき楕
円について設定されたパラメータに基づいて前記スキャ
ン変換において生じ得る最大演算桁数を事前に予測する
演算精度予測手段と、前記演算精度予測手段によって予
測された最大演算桁数を基に前記スキャン変換で使用さ
れる内部変数から切り捨てられるべき下位ビットの桁数
を決定する切捨桁数演算手段と、前記切捨桁数演算手段
によって決定された桁数だけ内部変数の下位ビットを切
り捨てて前記スキャン変換を実行し、前記描画すべき楕
円のラスタ座標を決定する楕円円周座標演算手段とを具
備する構成とした。
In order to achieve the above object, the ellipse scan conversion apparatus of the present invention draws an ellipse on a raster scan display by scan conversion based on a digital differential analysis method. In an apparatus for determining the coordinates of an ellipse to be drawn, a calculation accuracy prediction unit that predicts in advance the maximum number of calculation digits that can occur in the scan conversion based on the parameters set for the ellipse to be drawn, and the calculation accuracy prediction unit. A truncation digit number calculation means for determining the number of digits of the lower bits to be truncated from the internal variable used in the scan conversion based on the maximum computation digit number predicted by Rounded down the lower bits of the internal variable by the number of digits Has a configuration comprising a elliptical circumferential coordinate calculating means for constant.

【0013】[0013]

【作用】描画すべき楕円について長径、短径、中心座標
等のパラメータが与えられるとそれらのパラメータおよ
びディジタル微分解析法のアルゴリズムから、スキャン
変換で生じ得る内部変数の最大値を求めることができ、
その最大値から最大演算桁数を求めることができる。こ
の最大演算桁数が生じるときは、桁あふれ量が最大にな
る。本発明では、桁あふれを起こなさないように、また
は最小限に抑えるように、内部変数を丸めて(切り捨て
て)スキャン変換の演算を行う。これにより、小型の演
算装置を用いても高速に楕円を描画することができる。
また、ソフトウェアで処理する場合は、演算桁数が抑制
されることで、スループットの向上がはかれる。
When parameters such as the major axis, the minor axis, and the center coordinate of the ellipse to be drawn are given, the maximum value of the internal variables that can occur in scan conversion can be obtained from those parameters and the algorithm of the digital differential analysis method.
The maximum number of calculation digits can be obtained from the maximum value. When this maximum number of calculated digits occurs, the overflow amount becomes maximum. In the present invention, the scan conversion operation is performed by rounding (truncating) the internal variable so as not to cause overflow or to minimize the overflow. As a result, an ellipse can be drawn at high speed even with a small arithmetic unit.
Further, in the case of processing by software, throughput can be improved by suppressing the number of calculation digits.

【0014】[0014]

【実施例】以下、図1〜図4を参照して本発明の実施例
を説明する。図1は、一実施例による楕円スキャン変換
装置の構成を示す。この楕円スキャン変換装置は、パラ
メータ設定部10、演算精度予測部12、切捨桁数計算
部14、楕円円周座標計算部16および出力部18から
なる。
Embodiments of the present invention will be described below with reference to FIGS. FIG. 1 shows the configuration of an elliptical scan conversion device according to an embodiment. This ellipse scan conversion device includes a parameter setting unit 10, a calculation accuracy prediction unit 12, a number of digits to be truncated calculation unit 14, an ellipse circumferential coordinate calculation unit 16 and an output unit 18.

【0015】パラメータ設定部10は、描画すべき楕円
のパラメータ(長径、短径、中心座標等)を設定入力
し、パラメータの初期化を行う。演算精度予測部12
は、パラメータ設定部10よりパラメータの設定値、初
期値を受け取り、後述する所定の演算式により、描画す
べき楕円のスキャン変換において生じ得る最大演算桁数
を求める。切捨桁数計算部14は、演算精度予測部12
で得られた最大演算桁数を基に、描画すべき楕円のスキ
ャン変換で使用する内部変数から切り捨てられるべき下
位ビットの桁数を決定する。楕円円周座標計算部16
は、切捨桁数計算部14によって決定された桁数だけ内
部変数の下位ビットを切り捨ててスキャン変換を実行
し、描画すべき楕円のラスタ座標を決定する。出力部1
8は、楕円円周座標計算部16で求められた楕円ラスタ
座標を表示装置、印画装置または記憶装置(図示せず)
に送出する。
The parameter setting unit 10 sets and inputs the parameters of the ellipse to be drawn (major axis, minor axis, center coordinates, etc.) and initializes the parameters. Calculation accuracy prediction unit 12
Receives the set value and initial value of the parameter from the parameter setting unit 10 and obtains the maximum number of calculation digits that can occur in scan conversion of the ellipse to be drawn by a predetermined calculation formula described later. The truncation digit number calculation unit 14 includes the calculation accuracy prediction unit 12
Determine the number of lower-order bits to be truncated from the internal variable used in scan conversion of the ellipse to be drawn, based on the maximum number of calculated digits obtained in. Ellipse circumference coordinate calculation unit 16
Cuts the lower bits of the internal variable by the number of digits determined by the truncated digit number calculation unit 14 and executes scan conversion to determine the raster coordinates of the ellipse to be drawn. Output part 1
A display device, a printing device, or a storage device (not shown) displays the elliptic raster coordinates obtained by the elliptic circle coordinate calculation unit 16.
To send to.

【0016】次に、図2のフローチャートにつき本実施
例の楕円スキャン変換装置の作用を説明する。この例で
も、図5に示すように原点を中心とし、X軸方向の径が
RxY軸方向の径がRy の楕円を第1象限内で時計回り
に4分楕円だけスキャン変換するものとする。他の3象
限の各4分楕円は、第1象限の4分楕円を反転・折返す
ことで描画することができる。
Next, the operation of the elliptical scan conversion apparatus of this embodiment will be described with reference to the flow chart of FIG. Also in this example, as shown in FIG. 5, an ellipse centered on the origin and having a diameter of Rx in the X-axis direction and a diameter of Ry in the Y-axis direction is scan-converted in the first quadrant in the clockwise direction by an ellipse of 4 minutes. Each quadrant of the other three quadrants can be drawn by inverting and folding the quadrant of the first quadrant.

【0017】スキャン変換が開始されると、先ず、パラ
メータ設定部10で初期化が行われる(20)。この初
期化では、開始座標(x=0,y=Ry )が決定される
とともに、この開始座標に対応するΔi (式(1.07)) の
初期値(Rx ×Rx ×(1−2×Ry)+Ry ×Ry )が
求められる。
When the scan conversion is started, the parameter setting unit 10 first initializes (20). In this initialization, the start coordinates (x = 0, y = Ry) are determined, and the initial value (Rx * Rx * (1-2 * Ry) of Δi (equation (1.07)) corresponding to the start coordinates is determined. + Ry × Ry) is required.

【0018】次に、演算精度予測部12において、この
スキャン変換において生じうるΔiの最大値ΔMAX が求
められる(22)。式(1.07)のΔi が最大値になるの
は、式(1.04)のEh が最大になるときか、または式(1.0
6)のEv が最大になるときかのいずれかである。図3に
示すように、Eh はX軸付近で最大となり、Ev はY軸
付近で最大となる。どちらの最大値が大きいかは、楕円
の縦横比、つまりRx とRy の比で決まる。したがっ
て、たとえば、図5に示すように、横長の楕円を描画す
るときは、Eh が最大になるX軸との交点の座標(Rx,
0)でΔi の最大値ΔMAX が得られる。このスキャン変
換において、最も値の大きい内部変数は4次の項を含む
Δi であるから、Δi の最大値ΔMAX は内部変数の最大
値でもある。そして、ΔMAX の演算桁数が[log(Δ
MAX )+1]として求められる。ここで、[x]はガウ
スの記号であり、実数xに対し[x]はxを超えない最
大の整数を表す。したがって、[x]=nならば、n≦
x<n+1の関係が成立する。
Next, the operation accuracy predicting unit 12, a maximum value delta MAX of Δi which may occur in this scan conversion are determined (22). The maximum value of Δi in equation (1.07) occurs when Eh in equation (1.04) becomes maximum, or
It is either when Ev of 6) becomes the maximum. As shown in FIG. 3, Eh is maximum near the X axis and Ev is maximum near the Y axis. Which maximum value is larger is determined by the aspect ratio of the ellipse, that is, the ratio of Rx and Ry. Therefore, for example, as shown in FIG. 5, when drawing a horizontally long ellipse, the coordinates (Rx, Rx,
0) maximum delta MAX of Δi is obtained by. In this scan conversion, most since the value is larger internal variable of a Δi including fourth-order terms, the maximum value delta MAX of Δi is also the maximum value of the internal variable. Then, the number of calculation digits of Δ MAX is [log (Δ
MAX ) +1]. Here, [x] is a Gaussian symbol, and for a real number x, [x] represents the maximum integer not exceeding x. Therefore, if [x] = n, n ≦
The relationship of x <n + 1 is established.

【0019】次に、切捨桁数計算部14において、演算
精度予測部12で得られた最大演算桁数[log(Δ
MAX )+1]を基に、描画すべき楕円のスキャン変換で
使用する内部変数から切り捨てられるべき下位ビットの
桁数kが決定される(24)。本スキャン変換装置の楕
円円周座標計算部16での演算は32ビット長の整数型
で行われるものとすると、桁あふれする最大ビット数k
は、 k=[log(ΔMAX )+1]−32 (2.01) として求められる。この桁あふれする最大ビット数k
が、内部変数から切り捨てられるべき下位ビットの桁数
kとなる。
Next, in the cutoff digit number calculation unit 14, the maximum calculation digit number [log (Δ
Based on (MAX ) +1], the number k of lower order bits to be truncated from the internal variable used in scan conversion of the ellipse to be drawn is determined (24). If the calculation in the elliptic circle coordinate calculation unit 16 of the present scan conversion apparatus is performed with an integer type of 32 bit length, the maximum number of overflow bits k
Is, k = is determined as [log (Δ MAX) +1] -32 (2.01). Maximum number of bits that overflows k
Is the number k of lower order bits to be truncated from the internal variable.

【0020】楕円円周座標計算部16には、パラメータ
設定部10より上記の初期値が与えられ、切捨桁数計算
部14より上記の切捨桁数kのデータが与えられる。楕
円円周座標計算部16では、ディジタル微分解析法(D
DA)によるスキャン変換を行うに先立ち、スキャン変
換で使用する漸化式の公差hdel,vdel,heps,veps
次の値として定義する(26)。 hdel =Rx ×Rx ×(1−2×Ry) (2.02) vdel =Ry ×Ry ×(2×Rx −1) (2.03) heps =Ry ×Ry ×(3−2×Rx) (2.04) veps =Rx ×Rx ×(2×Ry −3) (2.05) ここで、式(2.02)の公差hdel は式(1.09)の第2項(b
(2xi+1 +1))に相当し、式(2.03)の公差vdel は式
(1.12)の第2項(−a(2yi+1−1))に相当し、式(2.
04)の公差heps は式(1.11)の第2項および第3項(−
2bxi +b)に相当し、式(2.03)の公差veps は式
(1.08)の第2項および第3項(2ayi −a)に相当す
る。
The elliptic circle coordinate calculation section 16 is supplied with the above-mentioned initial value from the parameter setting section 10 and the cut-off digit number calculation section 14 with the above-mentioned data of the cut-off digit number k. In the elliptic circle coordinate calculation unit 16, the digital differential analysis method (D
Before performing the scan conversion by DA), the recurrence tolerances h del , v del , h eps , and v eps used in the scan conversion are defined as the following values (26). h del = R x × R x × (1-2 × R y ) (2.02) v del = R y × R y × (2 × R x −1) (2.03) h eps = R y × R y × ( 3-2 × R x ) (2.04) v eps = R x × R x × (2 × R y -3) (2.05) where the tolerance h del of the formula (2.02) is the second term of the formula (1.09). (B
(2x i + 1 +1)), and the tolerance v del in equation (2.03) is
Corresponding to the second term (-a (2yi + 1-1)) of (1.12), the equation (2.
Tolerance h eps of 04) is the second and third terms of equation (1.11) (-
2bxi + b), and the tolerance v eps of equation (2.03) is
This corresponds to the second and third terms (2ayi-a) of (1.08).

【0021】式(1.08),(1.09),(1.11), 式(1.12)はx
i,yi を変数とする項を含むため、xi,yi が1ずつ変
化する変化分が表現できなる。xi,yi を別に保持し、
計算に必要な度に下位ビットを丸めて(切り捨てて)使
うようにすればよいが、これを1ドット描画する毎に行
うのは大変である。そこで、本実施例では、スキャン変
換で使用する漸化式の変分を3次の項に合わせ公差に変
形した。
Equations (1.08), (1.09), (1.11), and Equation (1.12) are x
Since a term having i and yi as variables is included, it is possible to express a variation in which xi and yi change by one. Hold xi and yi separately,
The lower bits may be rounded (truncate) and used for each calculation, but it is difficult to do this each time one dot is drawn. Therefore, in the present embodiment, the variation of the recurrence formula used in the scan conversion is transformed into a tolerance in accordance with the third-order term.

【0022】楕円円周座標計算部16は、上記の算定し
た公差hdel,vdel,heps,veps について、それぞれ下
位ビットをk桁分丸める(26)。また、パラメータ設
定部10からの初期値Δi につても、その下位ビットを
k桁分丸める(28)。
The elliptic circle coordinate calculation unit 16 rounds the lower bits of the calculated tolerances h del , v del , h eps , v eps by k digits (26). Also, with respect to the initial value Δi from the parameter setting unit 10, the lower bits are rounded by k digits (28).

【0023】このように内部変数を丸めてから、楕円円
周座標計算部16は、ディジタル微分解析法(DDA)
によるスキャン変換を実行し、楕円のラスタ座標を決定
する(30〜54)。このスキャン変換の各ステップ3
0〜54は、図7のステップ106〜132にそれぞれ
対応する。本実施例のスキャン変換においては、Δiδi
,hdel,vdel,heps,veps 等の内部変数は、32ビ
ット以内に丸められているので、32ビットのプロセッ
サにより高速に楕円を描画することができる。また、ソ
フトウェア上の負担も少なく、オーバヘッドが軽微とな
り、スループットを向上させることができる。
After rounding the internal variables in this way, the elliptic circle coordinate calculation unit 16 uses the digital differential analysis method (DDA).
Scan conversion is performed to determine the elliptical raster coordinates (30 to 54). Each step 3 of this scan conversion
0 to 54 correspond to steps 106 to 132 of FIG. 7, respectively. In the scan conversion of this embodiment, Δiδi
, H del , v del , h eps , v eps, etc. are rounded to within 32 bits, so that an ellipse can be drawn at high speed by a 32-bit processor. Further, the burden on software is small, the overhead is small, and the throughput can be improved.

【0024】図4は、CRTで640×818ドットサ
イズの楕円を描画する場合、A4の用紙に2646×3
742ドットサイズの楕円を描画する場合、B4の用紙
に3238×4586ドットサイズの楕円を描画する場
合の各場合について、従来の方式による演算速度と本実
施例による演算速度を比較したものである。この実験結
果によれば、6.0〜8.2倍の高速化を達成すること
ができる。
FIG. 4 shows that when a 640 × 818 dot size ellipse is drawn on a CRT, it is 2646 × 3 on A4 size paper.
In each case of drawing an ellipse having a size of 742 dots and when drawing an ellipse having a size of 3238 × 4586 dots on a sheet of B4, the calculation speed according to the conventional method and the calculation speed according to the present embodiment are compared. According to this experimental result, it is possible to achieve a speedup of 6.0 to 8.2 times.

【0025】なお、本実施例では、式(2.01)より切捨桁
数kを求めたが、これに限るものではなく、必要に応じ
て、適当な値α(整数)の幅を持たせて、 k=[log(ΔMAX )+1]−32 (2.06) としてもよい。
In the present embodiment, the number of rounded digits k is obtained from the equation (2.01), but the number is not limited to this, and may have an appropriate value α (integer) width. , k = [log (Δ MAX ) +1] may be -32 (2.06).

【0026】[0026]

【発明の効果】以上説明したように、本発明によれば、
描画すべき楕円のパラメータに基づいて予め最大演算桁
数を予測し、その最大演算桁数に応じて内部変数の下位
ビットを所定の桁数だけ切り捨ててスキャン変換を実行
するようにしたので、小型の演算装置によっても高速に
楕円を描画することができ、ソフトウェアで処理する場
合にもスループットを向上させることができる。
As described above, according to the present invention,
The maximum number of calculation digits is predicted in advance based on the parameters of the ellipse to be drawn, and the lower bit of the internal variable is cut off by a predetermined number of digits according to the maximum number of calculation digits, and scan conversion is executed. The ellipse can also be drawn at high speed by the arithmetic unit of (1), and the throughput can be improved even when processing by software.

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

【図1】本発明の一実施例による楕円スキャン変換装置
の主要な構成を示すブロック図である。
FIG. 1 is a block diagram showing the main configuration of an elliptical scan conversion device according to an embodiment of the present invention.

【図2】実施例の楕円スキャン変換装置の処理を示すフ
ローチャートである。
FIG. 2 is a flowchart showing a process of an ellipse scan conversion device according to an embodiment.

【図3】実施例装置の演算精度予測手段の作用を説明す
るための図である。
FIG. 3 is a diagram for explaining an operation of a calculation accuracy prediction means of the embodiment apparatus.

【図4】実施例装置による描画高速化の効果を示す図で
ある。
FIG. 4 is a diagram showing an effect of speeding up drawing by the apparatus of the embodiment.

【図5】実施例および従来方式で描画される楕円の図形
を示す図である。
FIG. 5 is a diagram showing an elliptical figure drawn by the embodiment and the conventional method.

【図6】ブレゼンハムの円または楕円の描画アルゴリズ
ムを説明するための図である。
FIG. 6 is a diagram for explaining a Bresenham's drawing algorithm for a circle or an ellipse.

【図7】従来の楕円描画アルゴリズムによるスキャン変
換の処理を示すフローチャートである。
FIG. 7 is a flowchart showing a scan conversion process by a conventional ellipse drawing algorithm.

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

10 パラメータ設定部 12 演算精度予測部 14 切捨桁数計算部 16 楕円円周座標計算部 18 出力部 10 Parameter Setting Section 12 Calculation Accuracy Prediction Section 14 Truncated Digit Number Calculation Section 16 Elliptic Circular Coordinate Calculation Section 18 Output Section

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 ラスタ・スキャン・ディスプレイに楕円
を描画するためにディジタル微分解析法に基づいたスキ
ャン変換により前記描画すべき楕円のラスタ座標を決定
する装置において、 前記描画すべき楕円について設定されたパラメータに基
づいて前記スキャン変換において生じ得る最大演算桁数
を事前に予測する演算精度予測手段と、 前記演算精度予測手段によって予測された最大演算桁数
を基に前記スキャン変換で使用される内部変数から切り
捨てられるべき下位ビットの桁数を決定する切捨桁数演
算手段と、 前記切捨桁数演算手段によって決定された桁数だけ内部
変数の下位ビットを切り捨てて前記スキャン変換を実行
し、前記描画すべき楕円のラスタ座標を決定する楕円円
周座標演算手段と、を具備したことを特徴とする楕円ス
キャン変換装置。
1. An apparatus for determining raster coordinates of an ellipse to be drawn by scan conversion based on a digital differential analysis method for drawing an ellipse on a raster scan display, wherein the ellipse to be drawn is set. Calculation accuracy prediction means for predicting in advance the maximum number of calculation digits that can occur in the scan conversion based on parameters, and an internal variable used in the scan conversion based on the maximum number of calculation digits predicted by the calculation accuracy prediction means Truncation digit number calculating means for determining the number of lower-order bits to be truncated from, and performing the scan conversion by truncating the lower bits of the internal variable by the number of digits determined by the cutting-off digit number calculating means, And an elliptic circle coordinate calculating means for determining raster coordinates of an ellipse to be drawn. Conversion device.
JP3293705A 1991-10-14 1991-10-14 Elliptic scan converter Pending JPH05108833A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3293705A JPH05108833A (en) 1991-10-14 1991-10-14 Elliptic scan converter

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3293705A JPH05108833A (en) 1991-10-14 1991-10-14 Elliptic scan converter

Publications (1)

Publication Number Publication Date
JPH05108833A true JPH05108833A (en) 1993-04-30

Family

ID=17798172

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3293705A Pending JPH05108833A (en) 1991-10-14 1991-10-14 Elliptic scan converter

Country Status (1)

Country Link
JP (1) JPH05108833A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102646281A (en) * 2011-02-16 2012-08-22 富士通株式会社 Method and system for rasterizing elliptic arc

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102646281A (en) * 2011-02-16 2012-08-22 富士通株式会社 Method and system for rasterizing elliptic arc
CN102646281B (en) * 2011-02-16 2015-02-11 富士通株式会社 Method and system for rasterizing elliptic arc

Similar Documents

Publication Publication Date Title
EP3683726A1 (en) Aparatus and method for training classifying model
US6535221B1 (en) Image enhancement method and apparatus for internet printing
KR100200818B1 (en) Look-up table antialiasing method
EP2330560B1 (en) Method and device for processing vector graphics
EP0682320B1 (en) Stack filters for 1-to-N bit image processing in electronic printers
US8068122B2 (en) Method of image scaling
US4459676A (en) Picture image producing apparatus
JP2909273B2 (en) Outline font line width adjusting method and apparatus
JPH05108833A (en) Elliptic scan converter
US6711603B1 (en) Fractional, arithmetic unit, fractional arithmetic method, set-up engine for handling graphic images and computer-readable medium
JPH06309452A (en) Resolution converting processor
JPH06266747A (en) Dct/inverse dct arithmetic unit
CN102456219B (en) Rasterization method and apparatus thereof
EP0550245B1 (en) Generating and displaying freeform strokes in graphic displays
JPH1188693A (en) Pseudo-gradation processing unit
JP2738685B2 (en) Scan line density conversion method
JPH056440A (en) Method and device for scan conversion of ellipse
US6282323B1 (en) Image processing method and apparatus
KR100440944B1 (en) Binary image resolution reducing method and device simplifying resolution reduction algorithm
JPH10126609A (en) Image processor
JPH05205041A (en) Method and device for curve approximation
JPH07181944A (en) Outline font drawing device
JPH06274613A (en) Curve approximating device
JP3064097B2 (en) Image motion detection device
JP3035141B2 (en) Character creation device and character creation method