JPH0769968B2 - Straight line drawing method in the clip area - Google Patents

Straight line drawing method in the clip area

Info

Publication number
JPH0769968B2
JPH0769968B2 JP62275326A JP27532687A JPH0769968B2 JP H0769968 B2 JPH0769968 B2 JP H0769968B2 JP 62275326 A JP62275326 A JP 62275326A JP 27532687 A JP27532687 A JP 27532687A JP H0769968 B2 JPH0769968 B2 JP H0769968B2
Authority
JP
Japan
Prior art keywords
straight line
clip area
pixel
coordinates
coordinate
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP62275326A
Other languages
Japanese (ja)
Other versions
JPH01116889A (en
Inventor
敏彦 小倉
範浩 小柳
利一 安江
重夫 辻岡
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP62275326A priority Critical patent/JPH0769968B2/en
Publication of JPH01116889A publication Critical patent/JPH01116889A/en
Publication of JPH0769968B2 publication Critical patent/JPH0769968B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

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

Description

【発明の詳細な説明】 [産業上の利用分野] 本発明は、クリップ領域内に描画する図形の直線部分に
適用して好適な直線描画方式に関する。
The present invention relates to a straight line drawing method suitable for being applied to a straight line portion of a figure drawn in a clip area.

[従来の技術] 従来のクリップ領域内の直線描画方式として、コーエン
・サザーランドのクリップ領域描画アルゴリズム(Cohe
n−Sutherland Clipping Algorithm)が挙げられる。こ
のアルゴリズムは、特公昭54−33495号公報に記載され
たように、クリップ領域の描画開始点と終了点を2分割
法という方法で求め、その間を直線で結ぶ描画処理方式
である。
[Conventional Technology] As a conventional straight line drawing method in the clip area, Cohen Sutherland's clip area drawing algorithm (Cohe
n-Sutherland Clipping Algorithm). As described in Japanese Patent Publication No. 54-33495, this algorithm is a drawing processing method in which a drawing start point and an end point of a clip area are obtained by a method called a two-division method, and the two are connected by a straight line.

このアルゴリズムでは、まず、直線の始点と終点より直
線の中心点を求め、この中心点がクリップ領域の内か外
かを判定する。
In this algorithm, first, the center point of the straight line is obtained from the start point and the end point of the straight line, and it is determined whether this center point is inside or outside the clip area.

1)、描画開始点を求める場合は、中心点が内ならば、
始点−中心点間の直線を次の2分割の対象直線とする。
外ならば、中心点を境にクリップ領域と交差する側の直
線を2分割の対象直線とする。
1) When obtaining the drawing start point, if the center point is inside,
The straight line between the start point and the center point is the target line of the next two divisions.
If it is outside, the straight line on the side intersecting the clip area with the center point as the boundary is set as the target straight line divided into two.

2)、描画終了点を求める場合は、中心点が領域の内な
らば、中心点−終了点間の直線を次の2分割の対象直線
とする。外ならば、中心点を境にクリップ領域と交差す
る側の直線を2分割の対象直線とする。
2) When obtaining the drawing end point, if the center point is within the area, the straight line between the center point and the end point is set as the target straight line of the next two divisions. If it is outside, the straight line on the side intersecting the clip area with the center point as the boundary is set as the target straight line divided into two.

次に、対象直線について、さらにその直線の中心点を求
め上記1)または2)の処理を繰り返して行い、最終的
に直線の2分割が不可能になった点を描画開始点または
終了点とする。そして、その2点間を結ぶことによって
クリップ領域内の直線描画を実現する。
Next, with respect to the target straight line, the center point of the straight line is further obtained, and the process of 1) or 2) is repeated, and the point at which the straight line cannot be divided into two is finally set as the drawing start point or end point. To do. Then, by connecting the two points, straight line drawing in the clip area is realized.

このアルゴリズムについては、J・D・フォリー、A・
ヴァン・ダム共著「ファンダメンタルズ・オブ・インタ
ラクティブ・コンピュータ・グラフィックス(Fundamen
tals of Interactive Computer Graphics)」第4章、
第146頁から第151頁においても論じられている。
For this algorithm, see JD Foley, A.
Co-authored by Van Damme, "Fundamentals of Interactive Computer Graphics"
tals of Interactive Computer Graphics) ”, Chapter 4,
It is also discussed on pages 146-151.

[発明が解決しようとする問題点] 上記従来の方式でクリップ領域内に直線を描画する場
合、得られた描画開始点を始点に置き換え、また、終了
点を終点に置き換え、その間に発生する直線を描画する
ので、実際の始点から発生する直線とは誤差のために一
致しない。したがって、クリップ領域を拡大した場合に
は、新たに拡大された領域の直線を付加しなければなら
ないが、従来の方式で描画した場合は、連続したきれい
な直線にならないという問題があった。
[Problems to be Solved by the Invention] When a straight line is drawn in the clip area by the above conventional method, the obtained drawing start point is replaced with the start point, and the end point is replaced with the end point, and a straight line generated between them is generated. Is drawn, it does not match the straight line generated from the actual start point due to an error. Therefore, when the clip region is enlarged, the straight line of the newly enlarged region must be added, but when the drawing is performed by the conventional method, there is a problem that the line is not continuous and clean.

本発明の目的は、クリップ領域外の無駄な計算処理を行
わず、描画開始点座標の算出おび座標補正処理を行うこ
とによって、クリップ領域内の直線描画速度を向上し、
連続性のあるきれいな直線を描画する方式を提供するこ
とにある。
An object of the present invention is to improve the linear drawing speed in the clip area by performing the calculation of the drawing start point coordinates and the coordinate correction processing without performing unnecessary calculation processing outside the clip area.
It is to provide a method for drawing a continuous straight line.

[問題点を解決するための手段] 上記目的を達成するために、本発明は、 ラスタディスプレイの直線描画処理において、直線の始
終点および矩形クリップ領域に応じてクリップ処理が発
生するとき、 上記直線と上記クリップ領域との交点の1ピクセル外側
にある直前のピクセルの座標を算出し、 該直前のピクセル座標から直線描画アルゴリズムの誤差
値計算を行い、 該誤差値および上記直前のピクセルの座標から上記クリ
ップ領域内の直線の座標点を算出するようにしたもので
ある。
[Means for Solving the Problems] In order to achieve the above object, the present invention provides a straight line drawing process of a raster display, when the clip process occurs according to the start and end points of a straight line and a rectangular clip region, The coordinates of the immediately preceding pixel, which is outside the intersection of the above and the clip region by one pixel, are calculated, the error value of the straight line drawing algorithm is calculated from the immediately preceding pixel coordinates, and the error value and the coordinates of the immediately preceding pixel are calculated as described above. The coordinate points of a straight line in the clip area are calculated.

本発明の一実施態様としては、上記直線描画アルゴリズ
ムとしてブレゼンハム法を用い、与えられた直線がクリ
ップ領域の上側から進入する場合を考えると、直線の始
点座標を(X0,Y0)として、上記直前ピクセルの座標(X
0+cx1,drawy−1)を、 (dx,dyはそれぞれ始終点間のX軸,Y軸距離) に基いて計算し、上記誤差値eを、 e=2・dy−dx−(drawy−Y0−1)・2・dx +cx1・2・2y で計算することができる。
As an embodiment of the present invention, using the Bresenham method as the straight line drawing algorithm, considering the case where a given straight line enters from the upper side of the clip area, the starting point coordinates of the straight line are (X 0 , Y 0 ), The coordinates (X
0 + cx1, drawy-1), (Dx and dy are the X-axis and Y-axis distances between the start and end points, respectively), and the error value e is e = 2 · dy−dx− (drawy−Y 0 −1) · 2 · dx + cx1・ It can be calculated in 2 ・ 2y.

本発明の他の実施態様としては、上記直線描画アルゴリ
ズムとしてブレゼンハム法を用い、与えられた直線がク
リップ領域の左側から進入する場合を考えると、直線の
始点座標を(X0,Y0)として、上記直線ピクセルの座標
(Y0+cy1,drawx−1)を、 (dx,dyはそれぞれ始終点間のX軸,Y軸距離) に基いて計算し、上記誤差値eを、 e=2・dy−dx+(drawx−X0−1)・2・dy −cy1・2・dx で計算するものが考えられる。
As another embodiment of the present invention, using the Bresenham method as the straight line drawing algorithm, and considering a case where a given straight line enters from the left side of the clip area, the starting point coordinates of the straight line are (X 0 , Y 0 ). , The coordinates (Y 0 + cy1, drawx-1) of the above straight line pixel, (Dx and dy are the X-axis and Y-axis distances between the start and end points, respectively), and the error value e is e = 2 · dy−dx + (drawx−X 0 −1) · 2 · dy −cy1・ It is conceivable to calculate by 2 ・ dx.

その他、与えられた直線がクリップ領域の右側あるいは
下側から進入する場合についても、本発明は適用可能で
ある。
In addition, the present invention can be applied to the case where the given straight line enters from the right side or the lower side of the clip area.

[作用] 従来の方式における描画開始点座標の計算式で得られる
値は整数値ではない。また、何らかの方法で整数化して
も当然誤差が生じ、始点から発生した直線とは一致しな
い場合が考えられる。
[Operation] The value obtained by the calculation formula of the drawing start point coordinate in the conventional method is not an integer value. In addition, there is a case in which an error naturally occurs even if it is converted into an integer by some method, and the line does not match the straight line generated from the start point.

そこで、計算式によって、実際の描画開始点の直前のピ
クセルの座標を求め、例えばブレゼンハムの直線発生ア
ルゴリズムの座標更新で用いる誤差値をその座標につい
て算出する。そして、この直前の座標から上記アルゴリ
ズムを起動し、描画開始点が求められた時点から、描画
処理を開始し、終了点まで描画処理を行う。ブレゼンハ
ムの直線発生アルゴリズムの詳細については、前記文献
「ファンダメンタルズ・オブ・インタラクティブ・コン
ピュータ・グラフィックス」の第11章を参照されたい。
Therefore, the coordinate of the pixel immediately before the actual drawing start point is obtained by a calculation formula, and the error value used in the coordinate update of the Bresenham straight line generation algorithm is calculated for that coordinate, for example. Then, the above algorithm is activated from the coordinates immediately before this, the drawing process is started from the time when the drawing start point is obtained, and the drawing process is performed up to the end point. For details of Bresenham's straight line generation algorithm, see Chapter 11 of the above-mentioned document "Fundamentals of Interactive Computer Graphics".

具体的には、本発明は、ブレゼンハムの直線発生のアル
ゴリズムを用いて、クリップ領域と直線との好転の直前
のピクセルの座標値を求めるための計算式と、その座標
値における座標更新方向を定めるための変数(誤差値)
を算出する手法を創案したものである。ブレゼンハムの
直線発生のアルゴリズムにおける座標更新は誤差値
(e)の値によって更新の方向を定める手法である。誤
差値(e)の初期値をe=2・dy−dxとすると、 e≦0ならば直線座標をx方向に1ピクセル更新し、e
値をe=e+2・dyに更新する。
Specifically, the present invention uses a Bresenham straight line generation algorithm to determine a calculation formula for obtaining the coordinate value of a pixel immediately before the improvement between the clip region and the straight line, and the coordinate update direction at the coordinate value. Variable for (error value)
Is a method for calculating. The coordinate update in the Bresenham straight line generation algorithm is a method of determining the update direction by the value of the error value (e). Assuming that the initial value of the error value (e) is e = 2 · dy−dx, if e ≦ 0, the linear coordinate is updated by 1 pixel in the x direction, and e
Update the value to e = e + 2 · dy.

e>0ならば直線座標をxおよびy方向に1ピクセル更
新し、e値をe=e+2・dy−2・2xに更新し、この処
理を終点まで繰り返すという手法である。
If e> 0, the linear coordinates are updated by one pixel in the x and y directions, the e value is updated to e = e + 2 · dy−2 · 2x, and this process is repeated until the end point.

そこで、まず、発生した直線上の任意の座標点(Xm,Y
n)のe値はつぎのように計算できる。
Therefore, first, any coordinate point (Xm, Y
The e value of n) can be calculated as follows.

e=2・dy−dx+(Xm・2・dy)−(Ym・2・dx) …
(1) 次に、クリップ領域との交点座標を(Xm,Yn)とし、Yn
が与えられているとき、(1)式は次のように変形する
ことができる。
e = 2 · dy−dx + (Xm · 2 · dy) − (Ym · 2 · dx) ...
(1) Next, set the intersection coordinates with the clip area to (Xm, Yn), and set Yn
When is given, the equation (1) can be transformed as follows.

e=0とすると、 この(2)式で得られた座標値は、e=0と仮定して算
出したものであり、実際のクリップ領域との交点、つま
り描画開始点である場合は少ない。しかし、算出した座
標値は必ず、ブレゼンハムのアルゴリズムで発生した直
線上に存在する。
If e = 0, The coordinate value obtained by the equation (2) is calculated on the assumption that e = 0, and is rarely the intersection with the actual clip area, that is, the drawing start point. However, the calculated coordinate values always exist on the straight line generated by the Bresenham algorithm.

そこで、与えられたクリップ座標の(Yn−1)における
x座標を(2)式によって算出することによりクリップ
座標の1ピクセルの外側のピクセルの座標値とe値とが
求められる。そして、その座標値から実際に直線を発生
させ、y方向の座標がYnに代わった点を描画開始点とす
ることにより、クリップ領域の交点を求めることが実現
できる。
Therefore, the coordinate value and the e value of the pixel outside one pixel of the clip coordinates are obtained by calculating the x coordinate at (Yn-1) of the given clip coordinates by the equation (2). Then, a straight line is actually generated from the coordinate values, and the point where the y-direction coordinate is replaced by Yn is set as the drawing start point, whereby the intersection of the clip areas can be obtained.

このようにして求めた交点はブレゼンハムのアルゴリズ
ムで発生した直線上に存在するので、クリップ領域を拡
大して直線を付加した場合にも連続したきれいな直線が
得られる。
Since the intersections thus obtained exist on the straight line generated by the Bresenham algorithm, a continuous and clean straight line can be obtained even when the clip region is enlarged and a straight line is added.

[実施例] 以下、本発明の一実施例を添付図面に基き、詳細に説明
する。
[Embodiment] An embodiment of the present invention will be described below in detail with reference to the accompanying drawings.

第5図は、本発明を適用するシステムの構成図である。FIG. 5 is a configuration diagram of a system to which the present invention is applied.

501はプリンタ、502はプリンタ・キーボード制御部、50
3はワークメモリ、504はビットマッププロセッサ(BMP3
2)、505はマイクロプログラム用RAM、506はビデオピク
セル制御部、507はビデオRAM、508はCRTディスプレイで
ある。
501 is a printer, 502 is a printer / keyboard controller, 50
3 is a work memory, 504 is a bitmap processor (BMP3
2), 505 is a microprogram RAM, 506 is a video pixel controller, 507 is a video RAM, and 508 is a CRT display.

本発明の方式は、線図形描画処理プログラムとして、ビ
ットマッププロセッサ504内のマイクロプログラムに含
まれる。
The method of the present invention is included in the microprogram in the bitmap processor 504 as a line figure drawing processing program.

第1図は、本発明に係るクリップ領域内における直線描
画方式を実現するための処理のフローチャートである。
FIG. 1 is a flowchart of a process for realizing the straight line drawing method in the clip area according to the present invention.

ステップ101では、クリップ領域外の直線描画の計算処
理を除くために、クリップ領域の描画開始点の直前のピ
クセルの座標を計算する。計算方法は、クリップ領域に
進入する位置によって異なる。まず初めに、第2図に示
すような場合を例として説明する。
In step 101, the coordinates of the pixel immediately before the drawing start point of the clip area are calculated in order to exclude the calculation processing of the straight line drawing outside the clip area. The calculation method differs depending on the position of entering the clip area. First, the case as shown in FIG. 2 will be described as an example.

第2図は、(X0,Y0)を始点とする直線がクリップ領域
の上部から進入し、右側へ抜け出るような場合である。
FIG. 2 shows a case where a straight line starting from (X 0 , Y 0 ) enters from the upper part of the clip area and exits to the right.

描画開始点を(Xm,Yn)、描画開始点の直前のピクセル
の座標を(Xm-1,Yn-1)とする。なお、始点(X0,Y0)か
ら上記直前のピクセルまでのX距離をcx1とする。(X
m-1,Yn-1)は次のように求める。
The drawing start point is (X m , Y n ), and the coordinates of the pixel immediately before the drawing start point are (X m-1 , Y n-1 ). The X distance from the starting point (X 0 , Y 0 ) to the immediately preceding pixel is cx1. (X
m-1 , Y n-1 ) is calculated as follows.

(dx,dyはそれぞれ始終点間のX軸,Y軸距離) (3)式の余りをAとする。 (Dx and dy are the X-axis and Y-axis distances between the start and end points, respectively) Let A be the remainder of equation (3).

cx1≧0の場合、 A=0ならばcx1=cx1 A>0ならばcx1=cx1+1 cx1<0の場合、cx1=0 よって、次式よりXm-1が求まる。In the case of cx1 ≧ 0, if A = 0, then cx1 = cx1 If A> 0, then cx1 = cx1 + 1 If cx1 <0, then cx1 = 0 Therefore, X m-1 can be obtained from the following equation.

Xm-1=X0+cx1 次に、ステップ102では、ステップ101で得られた座標
(Xm-1,Yn-1)の誤差値eを次式を用いて算出する。
X m-1 = X 0 + cx1 Next, in step 102, the error value e of the coordinates (X m-1 , Y n-1 ) obtained in step 101 is calculated using the following equation.

e=2・dy−dx−(drawy−Y0−1)・2・dx +cx1・2・dy 次に、ステップ103では、実際の描画開始点座標を求め
るために、誤差値eおよび描画点座標の更新を行うもの
で、詳しくは第4図を用いて説明する。
e = 2 · dy−dx− (drawy−Y 0 −1) · 2 · dx + cx1 · 2 · dy Next, in step 103, the error value e and the drawing point coordinate are calculated in order to obtain the actual drawing start point coordinate. Is updated, which will be described in detail with reference to FIG.

第4図のステップ401において、第1図のステップ102で
得られた誤差値の正負の判定を行う。負の場合は、ステ
ップ402においてx方向に座標を更新し、ステップ403で
誤差値eを更新する。ステップ401、403を、誤差値eが
0より大きくなるまで繰り返し行う。すなわち、座標が
y方向に更新されるまで第4図の処理を行う。そして、
y方向に更新されたときの座標が描画開始点座標とな
る。
In step 401 of FIG. 4, whether the error value obtained in step 102 of FIG. 1 is positive or negative is determined. If negative, the coordinates are updated in the x direction in step 402, and the error value e is updated in step 403. Steps 401 and 403 are repeated until the error value e becomes larger than 0. That is, the process of FIG. 4 is performed until the coordinates are updated in the y direction. And
The coordinates when updated in the y direction become the drawing start point coordinates.

描画ピクセル数=cx1+drawx−Xm ステップ105から109までは、ブレゼンハムのアルゴリズ
ムによる直線の描画処理である。まず、ステップ105で
は、ステップ103で得られた描画開始点座標に描画処理
を行う。そして、ステップ106では、ステップ102で算出
した誤差値を判断して誤差値:e>0ならば、ステップ10
7において、xおよびy座標を1更新し、誤差値eを次
のように更新する。
Number of drawing pixels = cx1 + drawx-X m Steps 105 to 109 are straight line drawing processing by Bresenham's algorithm. First, in step 105, drawing processing is performed on the drawing start point coordinates obtained in step 103. Then, in step 106, the error value calculated in step 102 is judged, and if the error value: e> 0, step 10
At 7, the x and y coordinates are updated by 1, and the error value e is updated as follows.

e=e+2・dy−2・dx 一方、誤差値e≦0ならば、ステップ108においてx座
標のみを1更新し、誤差値eを次のように更新する。
e = e + 2 · dy−2 · dx On the other hand, if the error value e ≦ 0, only the x coordinate is updated by 1 in step 108, and the error value e is updated as follows.

e=e+2・dy 次にステップ109では、描画ピクセル数の判定を行い、
0でなければ再びステップ105へ戻り、更新された誤差
値および描画点座標を用いて、描画処理を行う。そし
て、ステップ105〜109の処理を描画ピクセル数=0にな
るまで、繰り返すことによって、クリップ領域内の描画
処理を実現するものである。
e = e + 2 · dy Next, in step 109, the number of drawing pixels is determined,
If it is not 0, the process returns to step 105 again, and the drawing process is performed using the updated error value and drawing point coordinates. Then, the processing in steps 105 to 109 is repeated until the number of drawing pixels = 0, thereby realizing the drawing processing in the clip area.

以上、第2図を例にして説明したが、次に第3図のクリ
ップ領域の左側から進入する場合を例に、計算式だけを
挙げておく。尚、処理の流れは、前述と同様、第1図に
準ずるものである。
The description has been given above with reference to FIG. 2 as an example. Next, only the calculation formulas will be given, taking the case of entering from the left side of the clip region in FIG. 3 as an example. The processing flow is similar to that of FIG. 1 as described above.

ステップ101における計算式は次のようになる。The calculation formula in step 101 is as follows.

(4)式の余りをBとする。 Let B be the remainder of equation (4).

cy1≧0の場合、 B=0ならばcy1=cy1 B>0ならばcy1=cy1+1 cy1<0の場合、cy1=0 よって、次式よりYn-1が求まる。In case of cy1 ≧ 0, if B = 0, cy1 = cy1 If B> 0, cy1 = cy1 + 1 If cy1 <0, cy1 = 0 Therefore, Y n-1 can be obtained from the following equation.

Yn-1=Y0+cy1 次に、ステップ102における計算式は次のようになる。Y n-1 = Y 0 + cy1 Next, the calculation formula in step 102 is as follows.

e=2・dy−dx+(drawx−X0−1)・2・dy −cy1・2・dx [発明の効果] 以上、本発明によれば、クリップ領域内の描画処理につ
いては直線の座標値の計算処理を、クリップ領域内の座
標算出処理しか行わないので、従来の直線の始点から終
点までの全ての座標計算を行っていた描画処理に比べ
て、処理速度が向上する。かつ、直線とクリップ領域と
の交点の直前のピクセルから直線描画アルゴリズムの誤
差値計算を行ってクリップ領域内の直前の座標点を算出
するようにしたので、クリップ領域を拡大した場合に
も、拡大によって増加した部分についてのみ描画処理を
行なうことにより、連続性ある、きれいな直線を描画す
ることができる。
e = 2 · dy−dx + (drawx−X 0 −1) · 2 · dy −cy1 · 2 · dx [Advantages of the Invention] As described above, according to the present invention, the linear coordinate value is used for the drawing process in the clip area. Since only the coordinate calculation process within the clip area is performed for the calculation process of, the processing speed is improved compared to the conventional drawing process in which all coordinate calculations from the start point to the end point of the straight line are performed. Moreover, the error value of the straight line drawing algorithm is calculated from the pixel immediately before the intersection of the straight line and the clip area to calculate the previous coordinate point in the clip area. By performing drawing processing only on the portion increased by, it is possible to draw a continuous and clean straight line.

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

第1図は本発明の方式を実現するための処理手順を示し
たフローチャート、第2図、第3図はクリップ領域内の
直線描画の例を示した説明図、第4図は第1図のステッ
プ103を詳しく示したフローチャート、第5図は本発明
を適用するシステムの構成を示すブロック図である。
FIG. 1 is a flow chart showing a processing procedure for realizing the method of the present invention, FIGS. 2 and 3 are explanatory diagrams showing an example of straight line drawing in a clip area, and FIG. 4 is a diagram showing FIG. FIG. 5 is a block diagram showing the configuration of a system to which the present invention is applied, in which a flowchart showing step 103 in detail is shown.

フロントページの続き (72)発明者 小柳 範浩 神奈川県横浜市戸塚区吉田町292番地 株 式会社日立マイクロソフトウェアシステム ズ内 (72)発明者 安江 利一 神奈川県横浜市戸塚区吉田町292番地 株 式会社日立製作所マイクロエレクトロニク ス機器開発研究所内 (72)発明者 辻岡 重夫 神奈川県横浜市戸塚区吉田町292番地 株 式会社日立製作所マイクロエレクトロニク ス機器開発研究所内 (56)参考文献 特開 昭63−228274(JP,A) 特開 昭62−127971(JP,A)(72) Inventor Norihiro Koyanagi, 292 Yoshida-cho, Totsuka-ku, Yokohama, Kanagawa Prefecture Hitachi Micro Software Systems Ltd. (72) Toshikazu Yasue, 292 Yoshida-cho, Totsuka-ku, Yokohama, Kanagawa Incorporated company Hitachi, Ltd., Microelectronics Device Development Laboratory (72) Inventor Shigeo Tsujioka, 292, Yoshida-cho, Totsuka-ku, Yokohama City, Kanagawa Prefecture Incorporated, Hitachi, Ltd. Microelectronics Device Development Laboratory (56) References 63-228274 (JP, A) JP-A-62-127971 (JP, A)

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】設定された直線の始点より順次、描画した
ピクセルの座標の、設定された直線の始終点を理想的に
結んだ直線に対する誤差に応じて、次に描画するピクセ
ルの座標を定めていくことにより、設定された直線の始
終点を結ぶ直線を描画する描画アルゴリズムによって、
設定された直線の始終点を結ぶ直線の、設定された矩形
のクリップ領域内に含まれる部分を描画する方法であっ
て、 設定された直線の始終点間を結ぶ直線を前記描画アルゴ
リズムによって描画した場合に描画されるピクセルであ
って、前記クリップ領域の1ピクセル外側にあるピクセ
ルである直前ピクセルの座標を算出し、 算出した直前ピクセルの座標の、前記誤差を算出し、 算出した直前ピクセルの座標と、算出した直前ピクセル
の座標の誤差を、新たな始点と始点の前記誤差として、
前記描画アルゴリズムによって順次定まるピクセルの座
標のうちの、前記クリップ領域内の座標のピクセルを描
画することを特徴とするクリップ領域内における直線描
画方法。
1. A coordinate of a pixel to be drawn next is determined in accordance with an error of a coordinate of a drawn pixel from a set start point of a straight line to a line ideally connecting the start and end points of the set straight line. By drawing, the drawing algorithm that draws the straight line connecting the start and end points of the set straight line,
A method for drawing a part of a straight line connecting the start and end points of a set straight line included in a clip area of a set rectangle, wherein a straight line connecting the start and end points of the set straight line is drawn by the drawing algorithm. In this case, the coordinates of the immediately preceding pixel, which is the pixel that is to be drawn and is one pixel outside the clip area, is calculated, and the error of the calculated coordinates of the immediately preceding pixel is calculated. And, the error of the calculated coordinates of the immediately preceding pixel as a new start point and the error of the start point,
A straight line drawing method in a clip area, wherein a pixel having coordinates in the clip area among the pixel coordinates sequentially determined by the drawing algorithm is drawn.
【請求項2】特許請求の範囲第1項記載のクリップ領域
内における直線描画方法であって、 前記描画アルゴリズムは、ブレゼンハム(Bresenham)
の描画アルゴリズムであることを特徴とするクリップ領
域内における直線描画方法。
2. A straight line drawing method in a clip area according to claim 1, wherein the drawing algorithm is Bresenham.
A straight line drawing method in a clip area, which is a drawing algorithm of.
JP62275326A 1987-10-30 1987-10-30 Straight line drawing method in the clip area Expired - Fee Related JPH0769968B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP62275326A JPH0769968B2 (en) 1987-10-30 1987-10-30 Straight line drawing method in the clip area

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP62275326A JPH0769968B2 (en) 1987-10-30 1987-10-30 Straight line drawing method in the clip area

Publications (2)

Publication Number Publication Date
JPH01116889A JPH01116889A (en) 1989-05-09
JPH0769968B2 true JPH0769968B2 (en) 1995-07-31

Family

ID=17553897

Family Applications (1)

Application Number Title Priority Date Filing Date
JP62275326A Expired - Fee Related JPH0769968B2 (en) 1987-10-30 1987-10-30 Straight line drawing method in the clip area

Country Status (1)

Country Link
JP (1) JPH0769968B2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01166179A (en) * 1987-12-22 1989-06-30 Fujitsu Ltd Method for drawing clipped straight line
JP2581802B2 (en) * 1989-07-03 1997-02-12 株式会社日立製作所 Graphic display device and display method
JP2937587B2 (en) * 1991-10-30 1999-08-23 株式会社日立テレコムテクノロジー Intersection calculation method in line drawing processing
CN104112285B (en) * 2013-04-16 2017-05-31 北京金阳普泰石油技术股份有限公司 Towards oil field prospecting and the intelligent Drawing method and system for depositing phasor developed

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62127971A (en) * 1985-11-29 1987-06-10 Fujitsu Ltd Clipping system in line segment drawing

Also Published As

Publication number Publication date
JPH01116889A (en) 1989-05-09

Similar Documents

Publication Publication Date Title
US4849907A (en) Draw processing method and apparatus
US20040164985A1 (en) Triangle polygon plotting device and triangle polygon plotting method
JPH0769968B2 (en) Straight line drawing method in the clip area
JP2557591B2 (en) Guide map creation processing method
JP2684609B2 (en) Graphic display method in graphic data processing device
JPH0368086A (en) Linear interpolating circuit
JP2934011B2 (en) Image processing method and apparatus
JP2000298729A (en) Two-dimensional image generation device
JPH0535912B2 (en)
JP2714114B2 (en) Graphic processing method and graphic system
JPH05205070A (en) Graphic plotting method
JP2780496B2 (en) Clipping method for drawing equipment
JPH07334695A (en) Plotter and line width determining method
JPS6283790A (en) Image processor
JPH0736606A (en) Waveform data analysis system
JPH0962837A (en) Segment enlarging and plotting method and device therefor
JPH08221544A (en) Image deformation processor
JPH0566914A (en) Drawing system for broken line
JPH07105382A (en) Moving picture processing unit
JP2000242803A (en) Image processor
JPH06290273A (en) Figure display processor
JPH06162213A (en) Rectangular surface painting system
JPH03147190A (en) Straight line drawing method
JP2002073001A (en) Quadrangle plotting method and apparatus
JPH10116349A (en) Picture paint-out processing method

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees