JPS62127972A - Clipping system in line segment drawing - Google Patents

Clipping system in line segment drawing

Info

Publication number
JPS62127972A
JPS62127972A JP60268532A JP26853285A JPS62127972A JP S62127972 A JPS62127972 A JP S62127972A JP 60268532 A JP60268532 A JP 60268532A JP 26853285 A JP26853285 A JP 26853285A JP S62127972 A JPS62127972 A JP S62127972A
Authority
JP
Japan
Prior art keywords
line
line segment
point
coordinate
clipping
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.)
Granted
Application number
JP60268532A
Other languages
Japanese (ja)
Other versions
JPH0241790B2 (en
Inventor
Junichi Ichikawa
純一 市川
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP60268532A priority Critical patent/JPS62127972A/en
Publication of JPS62127972A publication Critical patent/JPS62127972A/en
Publication of JPH0241790B2 publication Critical patent/JPH0241790B2/ja
Granted legal-status Critical Current

Links

Landscapes

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

Abstract

PURPOSE:To make line segment patterns coincident with each other completely by setting a value to be given to a cross point integer coordinate while supposing that an error and an offset of a line style register especially as the initial condition to a digital differentiation analyzer (DDA) are used to draw a line segment from a start point coordinate to an end point coordinate. CONSTITUTION:A line segment from a start point PS to an end point PE is clipped by a line through an optional midpoint of the line segment in parallel with the X or Y coordinate, and a line segment from a cross point integer coordinate PC nearest the cross point between the clipping line and the line segment (from the PS to the PE) to the point PE is drawn. As the initial condition given to the DDA, each axis difference and main axis designation are calculated from the coordinates of the points PS, PE and as the error and the offset of the line style register, values to be given at the point PC are set when a line segment is drawn from the point PS to the point PE as assumption, and as the main axis length, the main axis length from the point PC to the point PE is set to start the DDA. Thus, the line segment drawn completely and the clipping line segment generate a dot string of the equivalent line style.

Description

【発明の詳細な説明】 〔概  要〕 本発明は図形処理を実行するワークステーションにおい
てディスプレイ画面上に複数のウィンドウを表示するマ
ルチウィンドウ化に必要となるウィンドウィングに係り
、ディスプレイファイルから必要な線分のみを取出すク
リッピング機能方式に関する。
[Detailed Description of the Invention] [Summary] The present invention relates to windowing required for displaying multiple windows on a display screen in a workstation that executes graphic processing. This relates to a clipping function method that extracts only the minutes.

特に、本発明はビットマツプメモリに対して実線、点線
或いは一点鎖線等のラインスタイルを持った線分を描画
する際のクリッピング方式に関する。従来、この種のク
リッピング方式においてはクリッピングによっ、て求め
られた座標から新たにラインパターンレジスタに従って
線分を描画していた為、クリッピングされた場合とされ
ない場合とでは結果が異なるという欠点を有していた。
In particular, the present invention relates to a clipping method for drawing a line segment having a line style such as a solid line, a dotted line, or a chain line in a bitmap memory. Conventionally, in this type of clipping method, a line segment was drawn according to a new line pattern register from the coordinates determined by clipping, so it had the disadvantage that the results were different depending on whether it was clipped or not. Was.

本発明は二次元の整数座標でアクセス可能なメモリ上に
線分を発生するディジタル微分解析器で任意の始点座標
から終点座標に至る線分を垂直又は水平な直線でクリッ
ピングした場合、そのクリッピングラインと前記線分と
の交点に最も近い交点整数座標より前記終点に至る線分
を描画する際に、前記ディジタル微分解析器に与える初
期条件を定めている。すなわち、各軸方向差分値、主軸
指定は前記始点と終点の座標値から計算された値を設定
し、誤差量及びラインスタイルレジスタのオフセットは
前記始点座標から終点座標まで線分を描画したと仮定し
たときに前記交点整数座標においてもつべき値を設定し
、主軸方向長さとしては前記交点整数座標から前記終点
座標に至る主軸方向長さを設定し、前記ディジタル微分
解析器を起動することにしている。このようにすればラ
インスタイルを持った線分の描画においてもクリッピン
グのある場合とない場合において描かれる部分の線分パ
ターンは完全に一致するという効果がある。
The present invention uses a digital differential analyzer that generates line segments on a memory that can be accessed with two-dimensional integer coordinates, and when a line segment from arbitrary start point coordinates to end point coordinates is clipped by a vertical or horizontal straight line, the clipping line Initial conditions are determined to be given to the digital differential analyzer when drawing a line segment leading to the end point from the intersection integer coordinates closest to the intersection of the line segment and the line segment. That is, each axis direction difference value and principal axis specification are set to values calculated from the coordinate values of the start point and end point, and the error amount and line style register offset are assumed to have drawn a line segment from the start point coordinates to the end point coordinates. When this happens, set the value that the intersection integer coordinate should have, set the length in the principal axis direction from the intersection integer coordinate to the end point coordinate, and start the digital differential analyzer. There is. In this way, even when drawing a line segment with a line style, the line segment patterns of the drawn portions with and without clipping will completely match.

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

本発明は図形処理を実行するワークステーションにおい
てディスプレイ画面上に複数のウィンドウを表示するマ
ルチウィンドウ化に必要となるウィンドウィングに係り
、特にディスプレイファイルから必要な線分のみを取出
すクリッピング方式に関する。
The present invention relates to windowing required for displaying multiple windows on a display screen in a workstation that performs graphic processing, and particularly to a clipping method for extracting only necessary line segments from a display file.

さらに特に、本発明はビットマツプメモリに対してライ
ンスタイルを持った線分を描画する場合の線分描画にお
けるクリッピング方式に関する。
More particularly, the present invention relates to a clipping method for drawing line segments in a bitmap memory with a line style.

〔従 来 技 術〕[Traditional technique]

集積化技術の発展に伴い、マンマシンインターフェース
の基本技術である図形処理を専用に行う専用プロセッサ
を有効に使ってワークステーションにおけるグラフィッ
ク処理を実現する技術の重要性が高まってきた。このワ
ークステーションは主にメモリの1ビツトを画面の1ド
ツトに対応させるビットマツプディスプレイ装置を用い
てディスプレイ画面に複数のウィンドウを表示するマル
チウィンドウ機能を有し、それぞれのウィンドウをオー
バーランプして表示したり画面を分割して表示できるよ
うにしている。このマルチウィンドウ方式において重要
となる技術が広い座標系で定義された図形から興味のあ
る部分を抽出し、ウィンドウの座標系に変換するウィン
ドウィングの機能である。このウィンドウィングを行う
ためには図形に対して平行移動や回転あるいは拡大や縮
小といった機能ばかりでなく部分図形の面や線が他の部
分図形の面により隠され、隠された状態から再現する機
能が必要となる。そしてこのウィンドウィングに対して
はディスプレイファイルから必要な線分データのみを取
出すクリッピング機能が重要となる。ディスプレイファ
イルでは各部分図形は集合として形成され、各図形がウ
ィンドウ化のために図形変換を受ける場合には、ディス
プレイファイル上の広い座標系にまずウィンドウが設定
された後、ディスプレイ画面に相当する表示画面の所望
の場所にマルチウィンドウとして表示できるようにビュ
ーイング変換が行なわれる。ビューイング変換を行う場
合、特定の部分図形の拡大、縮小、あるいは平行移動や
回転等の変換はいわゆる写像変換であり、行列の掛算動
作で行われるが、前記クリッピング機能においては線分
の切り出しを効率良く行う必要がある。特にこのクリッ
ピングはディスプレイファイル上のウィンドウをディス
プレイ上の実際に見える部分とそうでない部分に分け、
見える部分だけに線分を描画することになる。
With the development of integrated technology, the importance of technology that realizes graphic processing on workstations by effectively using dedicated processors dedicated to graphic processing, which is the basic technology of man-machine interfaces, has increased. This workstation mainly has a multi-window function that displays multiple windows on the display screen using a bitmap display device that associates one bit in memory with one dot on the screen, and each window is displayed in an overlamp manner. You can also split the screen and display it. An important technology in this multi-window method is the windowing function that extracts interesting parts from figures defined in a wide coordinate system and converts them to the window coordinate system. In order to perform this windowing, not only functions such as parallel translation, rotation, enlargement, and reduction are required for the figure, but also a function that allows the faces and lines of a partial figure to be hidden by the faces of other partial figures, and reproduces them from the hidden state. Is required. For this windowing, a clipping function that extracts only necessary line segment data from the display file is important. In a display file, each partial figure is formed as a set, and when each figure undergoes figure transformation to become a window, a window is first set in a wide coordinate system on the display file, and then a display corresponding to the display screen is set. Viewing conversion is performed so that it can be displayed in a desired location on the screen as a multi-window. When performing viewing transformation, transformations such as enlargement, reduction, translation, rotation, etc. of a specific partial figure are so-called mapping transformations, which are performed by matrix multiplication operations, but in the clipping function, line segments are cut out. It needs to be done efficiently. In particular, this clipping divides the window on the display file into the part that is actually visible on the display and the part that is not.
Line segments will be drawn only in the visible areas.

このようなりリッピング機能を有する線分描画は二次元
の整数座標でアクセス可能なメモリ上に線分を発生する
ディジタル微分解析器(DDA)を用いて行われる。さ
らに前記DDAを用いてビットマツプディスプレイ上に
線分の点列を発生する場合に線分、即ちラインの種類と
して点線、実線、一点鎖線或いは二点鎖線といったライ
ンのスタイルを指定できる場合がある。このようなライ
ンスタイルを持った線分を描画する際のクリッピング方
式として従来はクリッピングによって求められた座標か
ら新たにラインパターンレジスタに従って線分を描画し
ていた。そのため、ラインスタイルを持った線分の描画
においてクリッピングのある場合とない場合において描
かれる線分パターンが完全に一致しないという問題があ
った。
Line segment drawing having such a ripping function is performed using a digital differential analyzer (DDA) that generates line segments on a memory that can be accessed using two-dimensional integer coordinates. Further, when generating a dot sequence of line segments on a bitmap display using the DDA, it is sometimes possible to specify a line style such as a dotted line, a solid line, a one-dot chain line, or a two-dot chain line as the type of the line segment. Conventionally, as a clipping method when drawing a line segment having such a line style, a line segment is newly drawn according to a line pattern register from the coordinates obtained by clipping. Therefore, when drawing a line segment with a line style, there is a problem in that the line segment patterns drawn with and without clipping do not completely match.

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

本発明は、このような従来の欠点を除去し、ビットマツ
プメモリに対してラインスタイルを持った線分を描画す
る際のクリッピング方式として、任意の始点座標から終
点座標に至る線分が垂直又は水平な直線でクリッピング
された場合、ディジタル微分解析器DDAに与える初期
条件として、ラインスタイルレジスタに対するオフセッ
トの指定を適当に行うことによってクリッピングが行わ
れなかった時と完全に一致する線分を描くことが可能な
線分描画におけるクリッピング方式を提供する。
The present invention eliminates such conventional drawbacks and uses a clipping method when drawing a line segment with a line style in a bitmap memory. When clipping occurs on a horizontal straight line, the initial condition given to the digital differential analyzer DDA is to draw a line segment that perfectly matches what would have been done without clipping by appropriately specifying the offset to the line style register. Provides a clipping method for line segment drawing that allows

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

本発明は上記目的を達成するために、二次元の整数座標
でアクセス可能なメモリ上に線分を発生するディジタル
微分解析器において、任意の始点座標から終点座標に至
る線分を垂直又は水平なクリッピングラインによってク
リッピングし、前記線分とクリッピングラインの交点か
ら終点に至る線分を描画する場合の前記ディジタル微分
解析器に与える初期設定値として、各軸方向差分値、主
軸指定は前記始点座標と前記終点座標の座標値から計算
される値を設定し、誤差量およびラインレジスタのオフ
セットは前記始点座標から終点座標まで描画したと仮定
した時に方程式の根から求められる交点座標に最も近い
交点整数座標において持つべき値をと設定し、主軸方向
長さとしては前記交点整数座標から前記終点座標に至る
ものを設定することによって前記ディジタル微分解析器
を起動することを特徴とする。
In order to achieve the above object, the present invention uses a digital differential analyzer that generates line segments on a memory that can be accessed by two-dimensional integer coordinates to generate line segments from arbitrary start point coordinates to end point coordinates in a vertical or horizontal direction. As an initial setting value given to the digital differential analyzer when clipping is performed using a clipping line and a line segment is drawn from the intersection of the line segment and the clipping line to the end point, each axis direction difference value and principal axis designation are set to the coordinates of the start point and Set the value calculated from the coordinate value of the end point coordinate, and the error amount and line register offset are the intersection integer coordinates closest to the intersection coordinate found from the root of the equation when assuming that the error amount and line register offset are drawn from the start point coordinate to the end point coordinate. The digital differential analyzer is started by setting the value that should be at , and setting the length in the principal axis direction from the integer coordinates of the intersection point to the end point coordinates.

〔作   用〕[For production]

任意の始点PSからPHに至る線分のうち中間のX又は
Y座標に平行な直線でクリッピングし、クリッピングラ
インと前記線分との交点に最も近い交点整数座標PCよ
りPEに至る線分を描画し、その場合のDDAに与える
初期条件として、各軸方向差分値、主軸指定は、PS、
PEの座標値から計算し、誤差量とラインスタイルレジ
スタのオフセットはPSからPEまで描画したと仮定し
た時にPCにおいて持つべき値を設定し、主軸方向長さ
はpcからPEに至る主軸方向長さを設定してDDAの
起動を行うようにしている。
Clip a line segment from an arbitrary starting point PS to PH with a straight line parallel to the intermediate X or Y coordinate, and draw a line segment from the intersection integer coordinate PC closest to the intersection of the clipping line and the line segment to PE. In that case, as the initial conditions given to DDA, each axis direction difference value and principal axis specification are PS,
Calculated from the PE coordinate values, the error amount and line style register offset are set to the values that should be in the PC when drawing from PS to PE, and the length in the principal axis direction is the length in the principal axis direction from pc to PE. is set to start DDA.

〔実  施  例〕〔Example〕

次に本発明の線分描画におけるクリッピング方式を図面
を参照して説明する。
Next, a clipping method for line segment drawing according to the present invention will be explained with reference to the drawings.

第1図は本発明の実施例を示す図形処理用装置の構成ブ
ロック図である。
FIG. 1 is a block diagram of a graphic processing device showing an embodiment of the present invention.

主制御部100は図形処理を実行するために全体の制御
を実行する部分で中央演算装置を内部に含む。主制御部
100は主にディジタル微分解析器(DDA)200に
対するパラメータの設定及び起動を実行する。DDA2
00は特定の部分図形の拡大、縮小、平行移動、回転、
あるいはマルチウィンドウにおけるウィンドウィング等
を実行するための描画処理において、特に、線分の処理
を行う部分で、線分をドツト単位で処理するためのハー
ドウェアである。そして非常に大きな座標系で定義され
た対象図形の全体から必要な部分を抽出し表示するため
のウィンドウィング機能において、DDA200はビッ
トマツプメモリ301゜302.303に必要な線分デ
ータのみを書き出すクリッピング機能に対する線分の発
生あるいは切り出しを実行する。このDDA200は、
たとえば、第4図に示すプレゼンハム(Bresenh
am )のアルゴリズムに従って線分を描画する機能を
含んでいる。そして、DDA  200は主制御部10
0から座標X及びY、XとYのそれぞれの差分の絶対値
DXとDY、主軸方向DIR1主軸方向の長さLEN及
び誤差ff1E等のパラメータを入力し、線分を描画す
る。第4図にX方向が主軸の時の流れ図を示す。DDA
では、まずDYからDXをひいて2倍してDDとし、Y
方向の差分DYを2倍したものをDとする。次に、誤差
量Eの符号によりEの初期値を決める。即ちEが正であ
る場合にはEにDDを加えてEとし、正でない場合には
EにDを加えて新しいEとする。その後点列を発生する
ルーチンに入る。先ず座標X、Yに対して色指定レジス
タ410で示される色の点を座標X、 Yに打つ。誤差
量Eが正である場合には已にDDを加えてEを更新し、
Yを1だけディクリメントする。Eが正でない場合には
EにDを加えてEを更新する。すなわち、Eが正である
場合にのみYはディクリメントされる。その後Xは常に
インクリメントされる。これはXを主軸とした場合であ
って、Xは常に1だけインクリメントされる。そして長
さLENがディクリメントされ、以上のルーチンがLE
N=0になるまで繰り返されて線分が描かれ線分は点列
として打たれることになる。
The main control unit 100 is a part that performs overall control to perform graphic processing, and includes a central processing unit therein. The main control unit 100 mainly executes parameter setting and startup for the digital differential analyzer (DDA) 200. DDA2
00 is enlargement, reduction, translation, rotation of a specific partial figure,
Alternatively, it is hardware for processing line segments dot by dot, especially in the part that processes line segments in drawing processing for executing windowing in a multi-window. In the windowing function for extracting and displaying the necessary parts from the entire target figure defined in a very large coordinate system, the DDA 200 uses clipping to write only the necessary line segment data to the bitmap memory 301, 302, and 303. Generate or cut out line segments for features. This DDA200 is
For example, the Bresenh (Bresenh) shown in FIG.
am ) includes a function to draw line segments according to the algorithm. The DDA 200 is the main control unit 10
Parameters such as the coordinates X and Y from 0, the absolute values DX and DY of the differences between X and Y, the length LEN in the principal axis direction DIR1, and the error ff1E are input, and a line segment is drawn. FIG. 4 shows a flowchart when the main axis is in the X direction. D.D.A.
First, subtract DX from DY, double it to get DD, and then Y
Let D be the difference in direction DY multiplied by two. Next, the initial value of E is determined based on the sign of the error amount E. That is, if E is positive, DD is added to E to create E; if it is not positive, D is added to E to create a new E. After that, a routine that generates a point sequence is entered. First, a point of the color indicated by the color designation register 410 is set at the coordinates X, Y. If the error amount E is positive, add DD to it and update E,
Decrement Y by 1. If E is not positive, D is added to E and E is updated. That is, Y is decremented only if E is positive. After that, X is always incremented. This is the case where X is the main axis, and X is always incremented by 1. Then the length LEN is decremented and the above routine becomes LE
Line segments are drawn repeatedly until N=0, and the line segments are drawn as a series of dots.

各点列を示すX座標、Y座標は第1図の構成ブロック図
に示すようにRGBの各ビットマツプメモリ301.3
02.303に与えられる。そして、色指定レジスタ4
10の内容に従って特定な色のドツトを示す論理がメモ
リに書込まれると、各メモリの1ビツトを画面の1ドツ
トに対応させるビットマツプディスプレイ表示装置、即
ちCRT制御部500を介してCRT600に線分の点
列が表示されることになる。すなわち基本描画単位であ
る線分がビットマツプメモリ上に形成されるとラスク型
ディスプレイ装置500及び600によって線分のベク
トルが離散画素列として生成されることになる。この場
合、格子上の各交点における整数的な点列として離散的
な線分が描画されることになる。又、マルチウィンドウ
方式におけるクリッピングにおいては、主制御部100
内に保持されるディスプレイファイルの内容の内、必要
な線分データのみが取り出されて、ビットマツプディス
プレイ600に表示されるがこのクリッピング処理は主
制御部100によって実行される。すなわちマルチウィ
ンドウ方式のウィンドウィングは、ウィンドウとビュー
ポートの対応づけを行うために図形の平行移動や拡大縮
小等が行われるが、そのウィンドウが一般に複数個設け
られている場合には、それに対するビューボートに優先
順位をつけて重ねて表示したり、優先順がダイナミック
に変更できるようにしている。そのウィンドウの変換に
伴ってウィンドウの境界線において線分のクリッピング
が行われることになる。例えば、あるウィンドウに線分
を描画していた場合にそのウィンドウの優先順位が下が
って他のウィンドウで半分隠されてしまった場合、ウィ
ンドウの境界線において線分のクリッピングがおこるこ
とになる。従って、ウィンドウ内部の線分のみを表示す
るために特別なりリッピング処理を行う必要がある。
The X and Y coordinates indicating each point sequence are stored in each RGB bitmap memory 301.3 as shown in the block diagram of FIG.
Given on 02.303. And color specification register 4
10, a line is sent to the CRT 600 via the CRT control unit 500, which is a bitmap display device that makes each bit in the memory correspond to one dot on the screen. A series of dots will be displayed. That is, when a line segment, which is a basic drawing unit, is formed on the bitmap memory, the vector of the line segment is generated as a discrete pixel string by the Rask-type display devices 500 and 600. In this case, discrete line segments are drawn as an integer sequence of points at each intersection on the grid. In addition, in clipping in the multi-window method, the main control unit 100
Of the contents of the display file held within the display file, only necessary line segment data is extracted and displayed on the bitmap display 600, and this clipping process is executed by the main control unit 100. In other words, in a multi-window system, the figure is moved in parallel, scaled, etc. in order to establish a correspondence between the window and the viewport, but if there are generally multiple windows, the view for that window is Boats can be prioritized and displayed overlapping, and the priority order can be changed dynamically. As the window is converted, line segment clipping will be performed at the border of the window. For example, if a line segment is drawn in a certain window, and that window's priority is lowered and half of the line is hidden by another window, clipping of the line segment will occur at the border of the window. Therefore, special ripping processing must be performed to display only the line segments inside the window.

このような図形処理用装置の構成において、本発明では
、二次元の整数座標でアクセス可能なメモリ上に線分を
発生する前記DDA200の出力に従って、ラインの種
類、即ち点線、実線、一点I¥線、或いは二点鎖線等の
ラインスタイルをラインスタイルレジスタ420指定す
ることができる。
In the configuration of such a graphic processing device, in the present invention, the type of line, ie, dotted line, solid line, single point I\ A line style such as a line or a two-dot chain line can be specified in the line style register 420.

そして色指定レジスタ410によって指定された色の点
列を発生するための論理をビットマツプメモリに与える
場合に、ラインスタイルレジスタ420の内容で適当に
マスク回路430を介して点列をマスクすることによっ
てラインスタイルに対応した線分を発生するようにして
いる。
When providing logic for generating a dot sequence of the color specified by the color specification register 410 to the bitmap memory, the dot sequence is appropriately masked via the mask circuit 430 using the contents of the line style register 420. I am trying to generate line segments that correspond to the line style.

本発明によるクリッピングされた線分を発生する場合、
交点を求める方式に従っている。第3図に示すように、
任意の始点座標PSから終点座標PEに至る線分の途中
で、例えばx=XCというY座標に平行な直線でクリッ
ピングした場合に、x=XCとPS、PE間の線分との
交点に最も近い整数座標値PCを求め、pcからPEま
での線分をラインスタイルレジスタで指定されたライン
で発生するようにしている。このようにクリッピングラ
インと線分との交点を求めて交点と終点PEとの線分を
描くようにすれば始点PSからPCまでの点列を発生せ
ずにクリッピングされた線分を描くことが出来るので高
速になる。しかし、クリッピングによって求められた交
点PCから新たにラインパターンレジスタ420の内容
に従って線分を描画してしまうとクリッピングされた場
合とされない場合とでは結果が異なるという問題がある
。本発明はラインスタイルレジスタ420のオフセント
が始点PSから終点P JEまでの線分を描画したと仮
定した時に整数交点座標PCにおいて持つべき値を設定
することによりクリッピングのある場合とそうでない場
合において描かれる部分の線分パターンを完全に一致さ
せるようにしている。そこで、次にラインスタイルレジ
スタ420について簡単に説明する。ラインスタイルレ
ジスタ420は、第2図(alに示すように、Nビット
のレジスタで構成されており、Nビットの各ビットは描
くべき線分の点の位置に1対1に対応している。そして
その内容が論理的に1である場合にそれに対応した線分
の位置に色指定レジスタ410で指定された色の点が1
ドツト打たれることになる。従ってラインスタイルレジ
スタ420のNビットのパターンは画面上に点列を打っ
ていくポインタに同期している。即ち、DDA200の
X、 Y座標の点を出力する場合の同期信号に同期して
次々にビット情報が続出され、その情報がマスク回路4
30を介して色指定レジスタ410の内容をビットマツ
プメモリ301,302゜303に書込むかどうかを決
定する。例えば、第2図(bl、 (C)は、線分描画
の様子を説明するための説明図で、ラインスタイルレジ
スタ420のビットパターンに従って線分の点列が発生
される様子を示している。ここで、重要なことは線分の
描画はラインスタイルレジスタのオフセント値で指定さ
れた位置から線分の点列が打たれるということである。
When generating clipped line segments according to the present invention,
It follows the method of finding the intersection. As shown in Figure 3,
For example, if you clip with a straight line parallel to the Y coordinate x = XC in the middle of a line segment from arbitrary starting point coordinates PS to end point coordinate PE, the most The closest integer coordinate value PC is found, and the line segment from pc to PE is generated on the line specified by the line style register. In this way, by finding the intersection between the clipping line and the line segment and drawing the line segment between the intersection and the end point PE, you can draw the clipped line segment without generating a sequence of points from the starting point PS to PC. It will be faster because it can be done. However, if a line segment is newly drawn according to the contents of the line pattern register 420 from the intersection point PC obtained by clipping, there is a problem that the result will be different depending on whether the intersection point PC is clipped or not. The present invention sets the value that the offset of the line style register 420 should have at the integer intersection point coordinate PC when assuming that a line segment from the start point PS to the end point PJE is drawn, with or without clipping. The line segment patterns of the parts that are displayed are made to match completely. Therefore, the line style register 420 will be briefly explained next. As shown in FIG. 2 (al), the line style register 420 is composed of an N-bit register, and each of the N bits corresponds one-to-one to the position of a point on a line segment to be drawn. If the content is logically 1, the point of the color specified by the color specification register 410 is set to 1 at the position of the line segment corresponding to it.
You will be hit with a dot. Therefore, the N-bit pattern of the line style register 420 is synchronized with the pointer that marks a series of dots on the screen. That is, bit information is output one after another in synchronization with the synchronization signal when outputting the X and Y coordinate points of the DDA 200, and the information is sent to the mask circuit 4.
It is determined whether the contents of the color designation register 410 are to be written to the bitmap memories 301, 302, and 303 via the bitmap memories 301, 302, and 303. For example, FIG. 2 (bl, (C)) is an explanatory diagram for explaining how a line segment is drawn, and shows how a line segment point sequence is generated according to the bit pattern of the line style register 420. What is important here is that when drawing a line segment, the dot sequence of the line segment is drawn from the position specified by the offset value of the line style register.

即ち、第2図O〕)においてラインスタイルレジスタ4
20の内容は先頭から111001110  ・・・・
となっており、オフセット位置は先頭から3ビツト目の
2の位置である。従って描画される線分はオフセット↑
旨定が行われている3番目のビットからのビットパター
ンに従って線分が打たれることになる。第2図(b)に
おいてオフセット指定の位置からのビットパターンは1
001110  ・・・となっているので、第2図(C
1に示すように、線分はP、の点がオフセット指定の2
の位置に対応しているので打たれ、P2.P、は打たれ
ずP4゜Ps、Pbが打たれて、P7が打たれない。こ
のようにしてラインスタイルレジスタ420のオフセッ
ト指定からのビットパターンに対応したラインスタイル
で線分が描かれることになる。即ちラインスタイルレジ
スタ420の先頭からのオフセット値で指定された位置
から次々にビット情報が読みだされ、ビットの値が論理
1である位置には点が打たれ論理0の位置には打たれず
、このようにしてラインスタイルを持った線分が描画さ
れることになる。
That is, in the line style register 4 in FIG.
The contents of 20 are 111001110 from the beginning...
The offset position is the 2nd position of the third bit from the beginning. Therefore, the line segment drawn is offset ↑
A line segment will be drawn according to the bit pattern starting from the third bit where the determination is made. In Figure 2(b), the bit pattern from the specified offset position is 1.
001110 ..., so Figure 2 (C
As shown in 1, the line segment is P, and the point 2 is the offset specified.
Since it corresponds to the position of P2. P, is not hit, P4゜Ps, Pb is hit, but P7 is not hit. In this way, a line segment is drawn in the line style corresponding to the bit pattern specified by the offset in the line style register 420. That is, bit information is read out one after another from the position specified by the offset value from the beginning of the line style register 420, and a dot is placed at the position where the bit value is logical 1, but not at the position where the bit value is logical 0. , In this way, a line segment with a line style will be drawn.

次に第5図を用いて本発明の動作を示す処理の流れを説
明する。第5図(alはクリッピングの説明図であり、
任意の始点座標PS= (XS、YS)から終点座標P
E= (XE、YE)に至る線分の途中、即ち、X=X
COY軸に平行な直線でクリッピングした場合、PS、
PE間の線分とクリッピングラインX=XCとの交点に
最も近い整数座標PC= (XC,YC)より前記終点
座標PEに至る線分を描画する場合を考察する。第5図
(b)が流れ図である。本実施例では、X軸が主軸であ
る場合を述べるがX軸に平行な直線でクリッピングした
りY軸が主軸である場合も同様である。動作が開始する
とまず線分PS −PEとx=XCのクリッピングライ
ンとの交点整数座標PCを求める。
Next, the flow of processing showing the operation of the present invention will be explained using FIG. Figure 5 (al is an explanatory diagram of clipping,
Arbitrary starting point coordinates PS = (XS, YS) to ending point coordinates P
E= In the middle of the line segment leading to (XE, YE), that is, X=X
When clipping in a straight line parallel to the COY axis, PS,
Consider the case where a line segment leading to the end point coordinate PE is drawn from the integer coordinates PC=(XC, YC) closest to the intersection of the line segment between PEs and the clipping line X=XC. FIG. 5(b) is a flowchart. In this embodiment, a case will be described in which the X-axis is the main axis, but the same applies to cases where clipping is performed on a straight line parallel to the X-axis or when the Y-axis is the main axis. When the operation starts, first, the integer coordinates PC of the intersection of the line segment PS - PE and the clipping line of x=XC are determined.

次にDDA200に対する初期条件は次のように設定す
る。すなわち各軸方向差分値、主軸指定はPS、PEの
座標値から計算された値を設定し、誤差量、オフセット
はPSからPEまで描画したと仮定したときにPCにお
いて持つべき値を設定し、主軸方向長さとしてはPCか
らPEに至るものを設定する。そしてDDAの起動を行
うようにしている。線分PC−PEを描画する場合、始
点座標はX=XC,Y=YCである。X方向の差分値D
XはXE−XSの絶対値、Y方向の差分値DYはYE−
YSの絶対値である。方向DIRは360度を8等分割
した場合に与えられる各方向を示す識別値であり、今の
場合PC−PEのベクトルの方向を示す。長さLENは
XEからXCを引いた絶対値に1を加えた値であり、こ
れは点列の点の数にあたる。PS、PE間の線分とクリ
アピングラインとの交点は実際には実数値として求まる
値であるがビットマツプディスプレイにおいては交点も
整数座標系で与えられるため、誤差を生じ、誤差量はP
SからPEまで描画したと仮定した時にPCにおいて持
つべき値を設定する。このようにDDA200に対する
初期パラメータを設定し、次に、色指定レジスタ420
に描画するべき線分の各座標における色を表す論理を設
定する。
Next, initial conditions for the DDA 200 are set as follows. In other words, for each axis direction difference value and principal axis specification, set the value calculated from the coordinate values of PS and PE, and for the error amount and offset, set the value that should be in the PC when it is assumed that drawing is done from PS to PE, The length in the main axis direction is set from PC to PE. Then, the DDA is activated. When drawing the line segment PC-PE, the starting point coordinates are X=XC, Y=YC. Difference value D in the X direction
X is the absolute value of XE-XS, and the difference value DY in the Y direction is YE-
It is the absolute value of YS. The direction DIR is an identification value indicating each direction given when 360 degrees is divided into 8 equal parts, and in this case indicates the direction of the PC-PE vector. The length LEN is the absolute value of XE minus XC plus 1, which corresponds to the number of points in the point sequence. The intersection point between the line segment between PS and PE and the clear pin line is actually a value determined as a real value, but in a bitmap display, the intersection point is also given in an integer coordinate system, so an error occurs, and the amount of error is P
Set the value that the PC should have when it is assumed that drawing is done from S to PE. In this way, the initial parameters for the DDA 200 are set, and then the color specification register 420
Set the logic that represents the color at each coordinate of the line segment to be drawn.

次に、ラインスタイルレジスタ420にラインスタイル
パターンとオフセットを設定する。この場合、オフセッ
ト値aはXCからXSを引いた絶対値をNで割った余り
として与える。即ちa=  lxc−XSI(modN
)である。このオフセット値が明らかに、PSからPE
まで描画したと仮定した時に整数座標PCにおいて持つ
べき値として設定されていることに重要性がある。以上
のように定められた各パラメータを用いてDDA200
を起動すればクリッピングの有無にかかわらずラインス
タイルレジスタ420の内容に従うラインスタイルで線
分を正しく描くことができる。
Next, the line style pattern and offset are set in the line style register 420. In this case, the offset value a is given as the remainder when the absolute value obtained by subtracting XS from XC is divided by N. That is, a=lxc-XSI(modN
). This offset value is clearly from PS to PE
It is important that it is set as the value that should be held in the integer coordinate PC when it is assumed that the drawing is done up to the point. Using each parameter determined as above, DDA200
By activating , line segments can be drawn correctly in a line style that follows the contents of the line style register 420 regardless of whether or not there is clipping.

このように、誤差量或いはラインスタイルレジスタに対
するオフセットがPSからPEまで描画したと仮定した
ときにPCにおいて持つべき値を用いていることによっ
て、例えば、マルチウィンドウ方式において、上のウィ
ンドウによって一度PC,PE間の線分が消され、再び
優先順位が変わってPC,PE間の線分が再現した場合
にも、正しいラインスタイルで再現されることになる。
In this way, by using the value that the error amount or the offset for the line style register should have in the PC when drawing from PS to PE, for example, in a multi-window method, once the PC is Even when the line segment between PE is erased and the priority is changed again and the line segment between PC and PE is reproduced, it will be reproduced in the correct line style.

〔発明の効果〕〔Effect of the invention〕

本発明はこのようにラインスタイルを持った線分の描画
において任意の始点座標から終点座標に至る線分の途中
で垂直又は水平な直線でクリッピングし、交点から終点
までいたる線分を描画する場合、DDAに対する初期条
件として、特に誤差量とラインスタイルレジスタに対す
るオフセット値を始点座標から終点座標まで描画したと
仮定したときに交点整数座標において持つべき値を設定
することにより、クリッピングの有無にかかわらず完全
描画の線分とクリッピングの線分とで等価なラインスタ
イルの点列が発生でき両者で完全に一致させることがで
きるという効果がある。
In this way, when drawing a line segment with a line style, the present invention clips a line segment from arbitrary starting point coordinates to end point coordinates with a vertical or horizontal straight line, and draws a line segment from the intersection point to the end point. , as an initial condition for DDA, in particular, by setting the error amount and the offset value for the line style register to the value that should be at the intersection integer coordinate when it is assumed that the drawing is done from the start point coordinate to the end point coordinate, regardless of the presence or absence of clipping. This has the effect that a point sequence with an equivalent line style can be generated between a completely drawn line segment and a clipped line segment, and the two can be made to perfectly match each other.

【図面の簡単な説明】 第1図は本発明のクリッピング方式に従う装置の構成ブ
ロック図、 第2図は本発明のラインスタイルレジスタによるライン
スタイルを持った線分描画の説明図、第3図は本発明の
クリッピングの説明図、第4図はDDAの制御動作を示
す流れ図、第5図は本発明の線分描画におけるクリッピ
ング方式に従う主制御部の流れ図を示す。 100・・・主制御部、 200・・・DDA。 301.302,303 ・・ ・RGBビットマツプメモリ、 500・・・CRT制御部、 600・ ・ ・CRT。 420・・・ラインスタイルl/デスタ、430・・・
マスク回路、 410・・・色指定レジスタ、 N℃ゴ・ソト Nビットのノマターシ’2 #に’+匂!sL&う(a
) 万フて・ゾ14晶定 ↓ (I)) (C) 槽り引篠混の叛明図 第2図 タリッピシク”ライン クソッピ、ン7゛込書乞明口 第3図
[Brief Description of the Drawings] Fig. 1 is a block diagram of a device according to the clipping method of the present invention, Fig. 2 is an explanatory diagram of drawing a line segment with a line style using the line style register of the present invention, and Fig. 3 is a block diagram of a device according to the clipping method of the present invention. FIG. 4 is a flowchart showing the control operation of the DDA, and FIG. 5 is a flowchart of the main control section according to the clipping method in line segment drawing of the present invention. 100... Main control unit, 200... DDA. 301, 302, 303...RGB bitmap memory, 500...CRT control unit, 600...CRT. 420...Line style l/Desta, 430...
Mask circuit, 410...Color specification register, N°C Go Soto N bit nomatashi '2 #ni' + smell! sL&u(a
) Manfute Zo 14 Crystal Determination ↓ (I)) (C) Rebellion map of Tankari Hikishino Mixed Figure 2 Talippisik' Line Soppi, N7゛Including calligraphy opening Figure 3

Claims (1)

【特許請求の範囲】 二次元の整数座標でアクセス可能なメモリ上に線分を発
生するディジタル微分解析器において、任意の始点座標
から終点座標に至る線分を垂直又は水平なクリッピング
ラインによってクリッピングし、前記線分とクリッピン
グラインの交点から終点に至る線分を描画する場合の前
記ディジタル微分解析器に与える初期設定値として、 各軸方向差分値、主軸指定は前記始点座標と前記終点座
標の座標値から計算される値を設定し、誤差量およびラ
インレジスタのオフセットは前記始点座標から終点座標
まで描画したと仮定した時に方程式の根から求められる
交点座標に最も近い交点整数座標において持つべき値を
設定し、主軸方向長さとしては前記交点整数座標から前
記終点座標に至るものを設定することによって前記ディ
ジタル微分解析器を起動することを特徴とする線分描画
におけるクリッピング方式。
[Claims] In a digital differential analyzer that generates line segments on a memory that can be accessed using two-dimensional integer coordinates, a line segment from arbitrary start point coordinates to end point coordinates is clipped by vertical or horizontal clipping lines. , as the initial setting values given to the digital differential analyzer when drawing a line segment from the intersection of the line segment and the clipping line to the end point, each axis direction difference value and principal axis designation are the coordinates of the start point coordinates and the end point coordinates. Set the value calculated from the value, and set the value that the error amount and line register offset should have at the intersection integer coordinate closest to the intersection coordinate found from the root of the equation when it is assumed that the line is drawn from the start point coordinate to the end point coordinate. a clipping method for line segment drawing, characterized in that the digital differential analyzer is activated by setting the length in the principal axis direction from the integer coordinates of the intersection point to the coordinates of the end point.
JP60268532A 1985-11-29 1985-11-29 Clipping system in line segment drawing Granted JPS62127972A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP60268532A JPS62127972A (en) 1985-11-29 1985-11-29 Clipping system in line segment drawing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP60268532A JPS62127972A (en) 1985-11-29 1985-11-29 Clipping system in line segment drawing

Publications (2)

Publication Number Publication Date
JPS62127972A true JPS62127972A (en) 1987-06-10
JPH0241790B2 JPH0241790B2 (en) 1990-09-19

Family

ID=17459821

Family Applications (1)

Application Number Title Priority Date Filing Date
JP60268532A Granted JPS62127972A (en) 1985-11-29 1985-11-29 Clipping system in line segment drawing

Country Status (1)

Country Link
JP (1) JPS62127972A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5204945A (en) * 1989-11-08 1993-04-20 Hitachi, Ltd. Method of displaying thick line and information unit and display system used therefor
CN109146998A (en) * 2018-08-15 2019-01-04 广州盖特软件有限公司 The offscale design line shearing method for drafting of computer based on WEB

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5204945A (en) * 1989-11-08 1993-04-20 Hitachi, Ltd. Method of displaying thick line and information unit and display system used therefor
CN109146998A (en) * 2018-08-15 2019-01-04 广州盖特软件有限公司 The offscale design line shearing method for drafting of computer based on WEB

Also Published As

Publication number Publication date
JPH0241790B2 (en) 1990-09-19

Similar Documents

Publication Publication Date Title
US4653020A (en) Display of multiple data windows in a multi-tasking system
JPH04257085A (en) Clip mask processor for block texture complex
JPH0251786A (en) Scan converting system
JPH04246790A (en) Vector/conic section/area file primitive generator
US4747042A (en) Display control system
KR20040047413A (en) Comparing method of 2d cad file using graphic type
US6275241B1 (en) High speed image drawing apparatus for displaying three dimensional images
JPH0545039B2 (en)
US5157764A (en) Apparatus and method for using a test window in a graphics subsystem which incorporates hardware to perform clipping of images
US5128872A (en) Method and apparatus for determining line positions for display and manipulation by a computer system
JPS62127972A (en) Clipping system in line segment drawing
US5297240A (en) Hardware implementation of clipping and intercoordinate comparison logic
US5777631A (en) Method and apparatus for displaying a video window in a computer graphics display
JPS6339947B2 (en)
JPS62127971A (en) Clipping system in line segment drawing
EP0521210B1 (en) Graphics clipping
JPS5947664A (en) Picture paint processing system
JPH0355870B2 (en)
JPS6177977A (en) Picture processor
JPS61130991A (en) Graphic processing method and apparatus
JP2787487B2 (en) Circuit for determining the position of a line segment displayed and operated on a computer system
JPS63240682A (en) Clipping processing system for graphic display
JPS61240283A (en) Display controller
JPS6169094A (en) Graphic processing method and apparatus
JPH03109683A (en) Vector display system