JPH0241790B2 - - Google Patents

Info

Publication number
JPH0241790B2
JPH0241790B2 JP60268532A JP26853285A JPH0241790B2 JP H0241790 B2 JPH0241790 B2 JP H0241790B2 JP 60268532 A JP60268532 A JP 60268532A JP 26853285 A JP26853285 A JP 26853285A JP H0241790 B2 JPH0241790 B2 JP H0241790B2
Authority
JP
Japan
Prior art keywords
line
line segment
clipping
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 - Lifetime
Application number
JP60268532A
Other languages
Japanese (ja)
Other versions
JPS62127972A (en
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 filed Critical
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

Description

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

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

本発明は二次元の整数座標でアクセス可能なメ
モリ上に線分を発生するデイジタル微分解析器で
任意の始点座標から終点座標に至る線分を垂直又
は水平な直線でクリツピングした場合、そのクリ
ツピングラインと前記線分との交点に最も近い交
点整数座標より前記終点に至る線分を描画する際
に、前記デイジタル微分解析器に与える初期条件
を定めている。すなわち、各軸方向差分値、主軸
指定は前記始点と終点の座標値から計算された値
を設定し、誤差量及びラインスタイルレジスタの
オフセツトは前記始点座標から終点座標まで線分
を描画したと仮定したときに前記交点整数座標に
おいてもつべき値を設定し、主軸方向長さとして
は前記交点整数座標から前記終点座標に至る主軸
方向長さを設定し、前記デイジタル微分解析器を
起動することにしている。このようにすればライ
ンスタイルを持つた線分の描画においてもクリツ
ピングのある場合とない場合において描かれる部
分の線分パターンは完全に一致するという効果が
ある。
The present invention is a digital differential analyzer that generates line segments on a memory that can be accessed using two-dimensional integer coordinates. Initial conditions are determined to be given to the digital differential analyzer when drawing a line segment that reaches the end point from the intersection integer coordinates closest to the intersection of the line 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 offset of the line style register 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. This has the effect that even when drawing a line segment with a line style, the line segment patterns of the drawn portions with and without clipping completely match.

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

本発明は図形処理を実行するワークステーシヨ
ンにおいてデイスプレイ画面上に複数のウインド
ウを表示するマルチウインドウ化に必要となるウ
インドウイングに係り、特にデイスプレイフアイ
ルから必要な線分のみを取出すクリツピング方式
に関する。
The present invention relates to windowing necessary 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 a line segment in a bitmap memory with a line style.

〔従来技術〕[Prior art]

集積化技術の発展に伴い、マンマシンインター
フエースの基本技術である図形処理を専用に行う
専用プロセツサを有効に使つてワークステーシヨ
ンにおけるグラフイツク処理を実現する技術の重
要性が高まつてきた。このワークステーシヨンは
主にメモリの1ビツトを画面の1ドツトに対応さ
せるビツトマツプデイスプレイ装置を用いてデイ
スプレイ画面に複数のウインドウを表示するマル
チウインドウ機能を有し、それぞれのウインドウ
をオーバーラツプして表示したり画面を分割して
表示できるようにしている。このマルチウインド
ウ方式において重要となる技術が広い座標系で定
義された図形から興味のある部分を抽出し、ウイ
ンドウの座標系に変換するウインドウイングの機
能である。このウインドウイングを行うためには
図形に対して平行移動や回転あるいは拡大や縮小
といつた機能ばかりでなく部分図形の面や線が他
の部分図形の面により隠され、隠された状態から
再現する機能が必要となる。そしてこのウインド
ウイングに対してはデイスプレイフアイルから必
要な線分データのみを取出すクリツピング機能が
重要となる。デイスプレイフアイルでは各部分図
形は集合として形成され、各図形がウインドウ化
のために図形変換を受ける場合には、デイスプレ
イフアイル上の広い座標系にまずウインドウが設
定された後、デイスプレイ画面に相当する表示画
面の所望の場所にマルチウインドウとして表示で
きるようにビユーイング変換が行なわれる。ビユ
ーイング変換を行う場合、特定の部分図形の拡
大、縮小、あるいは平行移動や回転等の変換はい
わゆる写像変換であり、行列の掛算動作で行われ
るが、前記クリツピング機能においては線分の切
り出しを効率良く行う必要がある。特にこのクリ
ツピングはデイスプレイフアイル上のウインドウ
をデイスプレイ上の実際に見える部分とそうでな
い部分に分け、見える部分だけに線分を描画する
ことになる。
With the development of integrated technology, the importance of technology that realizes graphic processing at workstations by effectively using a dedicated processor 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 makes each bit of memory correspond to one dot on the screen, and each window is displayed in an overlapping manner. It also allows you to split the screen and display it. An important technology in this multi-window method is a windowing function that extracts interesting parts from figures defined in a wide coordinate system and converts them to the window's coordinate system. In order to perform this windowing, in addition to functions such as parallel translation, rotation, enlargement, and reduction of the figure, the faces and lines of the partial figure are hidden by the faces of other partial figures, and the hidden state is reproduced. A function to do this is required. For this windowing, a clipping function that extracts only necessary line segment data from the display file is important. In the 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 created. Viewing conversion is performed so that it can be displayed in a desired location on the screen as a multi-window. When performing a viewing transformation, transformations such as enlarging or reducing a specific partial figure, or translating or rotating it are so-called mapping transformations, which are performed by matrix multiplication operations, but the clipping function can efficiently cut out line segments. You need to do it well. In particular, this clipping divides the window on the display file into the visible part and the non-visible part of the display, and draws line segments only in the visible part.

このようなクリツピング機能を有する線分描画
は二次元の整数座標でアクセス可能なメモリ上に
線分を発生するデイジタル微分解析器(DDA)
を用いて行われる。さらに前記DDAを用いてビ
ツトマツプデイスプレイ上に線分の点列を発生す
る場合に線分、即ちラインの種類として点線、実
線、一点鎖線或いは二点鎖線といつたラインのス
タイルを指定できる場合がある。このようなライ
ンスタイルを持つた線分を描画する際のクリツピ
ング方式として従来はクリツピングによつて求め
られた座標から新たにラインパターンレジスタに
従つて線分を描画していた。そのため、ラインス
タイルを持つた線分の描画においてクリツピング
のある場合とない場合において描かれる線分パタ
ーンが完全に一致しないという問題があつた。
Line segment drawing with this kind of clipping function uses a digital differential analyzer (DDA) that generates line segments in memory that can be accessed using two-dimensional integer coordinates.
This is done using Furthermore, when generating a dot sequence of line segments on a bitmap display using the DDA, there are cases where you can specify the style of the line, such as a dotted line, solid line, one-dot chain line, or two-dot chain line. be. Conventionally, as a clipping method for 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 these conventional drawbacks and provides a clipping method for drawing line segments with a line style in a bitmap memory.
When a line segment from arbitrary start point coordinates to end point coordinates is clipped with a vertical or horizontal straight line, as an initial condition given to the digital differential analyzer DDA,
To provide a clipping method for drawing a line segment that can draw a line segment that completely matches the state when no clipping is performed by appropriately specifying an offset to a line style register.

〔問題点を解決するための手段〕[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 using two-dimensional integer coordinates. As the initial setting values 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, the difference value in each axis direction and the principal axis specification are as follows. Set the value calculated from the coordinate values of the starting point coordinates and the ending point coordinates, and the error amount and the offset of the line register are the ones that are the closest to the intersection coordinates found from the roots of the equation when it is assumed that the drawing is from the starting point coordinates to the ending point coordinates. The digital differential analyzer is started by setting a value to be held at the near intersection integer coordinates, and setting the length in the principal axis direction from the intersection integer coordinates to the end point coordinate. .

〔作用〕[Effect]

任意の始点PSからPEに至る線分のうち中間の
X又はY座標に平行な直線でクリツピングし、ク
リツピングラインと前記線分との交点に最も近い
交点整数座標PCよりPEに至る線分を描画し、そ
の場合のDDAに与える初期条件として、各軸方
向差分値、主軸指定は、PS、PEの座標値から計
算し、誤差量とラインスタイルレジスタのオフセ
ツトはPSからPEまで描画したと仮定した時に
PCにおいて持つべき値を設定し、主軸方向長さ
はPCからPEに至る主軸方向長さを設定して
DDAの起動を行うようにしている。
Clip a line segment from an arbitrary starting point PS to PE with a straight line parallel to the intermediate X or Y coordinate, and select a line segment from the intersection integer coordinate PC closest to the intersection of the clipping line and the line segment to PE. As an initial condition for drawing and giving to DDA in that case, each axis direction difference value and principal axis specification are calculated from the coordinate values of PS and PE, and the error amount and line style register offset are assumed to be drawn from PS to PE. When I did
Set the value that the PC should have, and set the length in the main axis direction from the PC to the PE.
I am trying 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 apparatus showing an embodiment of the present invention.

主制御部100は図形処理を実行するために全
体の制御を実行する部分で中央演算装置を内部に
含む。主制御部100は主にデイジタル微分解析
器(DDA)200に対するパラメータの設定及
び起動を実行する。DDA200は特定の部分図
形の拡大、縮小、平行移動、回転、あるいはマル
チウインドウにおけるウインドウイング等を実行
するための描画処理において、特に、線分の処理
を行う部分で、線分をドツト単位で処理するため
のハードウエアである。そして非常に大きな座標
系で定義された対象図形の全体から必要な部分を
挿出し表示するためのウインドウイング機能にお
いて、DDA200はビツトマツプメモリ301,
302,303に必要な線分データのみを書き出
すクリツピング機能に対する線分の発生あるいは
切り出しを実行する。このDDA200は、たと
えば、第4図に示すブレゼンハム(Bresenham)
のアルゴリズムに従つて線分を描画する機能を含
んでいる。そして、DDA200は主制御部10
0から座標X及びY、XとYのそれぞれの差分の
絶対値DXとDY、主軸方向DIR、主軸方向の長
さLEN及び誤差量E等のパラメータを入力し、
線分を描画する。第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が正である場合にはEにDD
を加えてEを更新し、Yを1だけデイクリメント
する。Eが正でない場合にはEにDを加えてEを
更新する。すなわち、Eが正である場合にのみY
はデイクリメントされる。その後Xは常にインク
リメントされる。これはXを主軸とした場合であ
つて、Xは常に1だけインイクリメントされる。
そして長さLENがデイクリメントされ、以上の
ルーチンがLEN=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. DDA200 processes line segments in units of dots, especially in the drawing process to enlarge, reduce, translate, rotate, or perform windowing in multi-windows of specific partial figures. This is the hardware to do so. In the windowing function for inserting and displaying a necessary part from the entire target figure defined in a very large coordinate system, the DDA 200 uses the bit map memory
302 and 303 generate or cut out line segments for a clipping function that writes only necessary line segment data. This DDA200 is, for example, a Bresenham model shown in FIG.
It includes a function to draw line segments according to the algorithm. Then, the DDA 200 is the main control unit 10
Input parameters such as the coordinates X and Y from 0, the absolute values DX and DY of the differences between X and Y, the main axis direction DIR, the length LEN in the main axis direction, and the error amount E.
Draw a line segment. FIG. 4 shows a flowchart when the main axis is in the X direction. In DDA, first subtract DX from DY and double it to obtain DD, and double the difference DY in the Y direction to obtain D. Next, the initial value of E is determined based on the sign of the error amount E. That is, if E is positive, add DD to E to make E, and if not positive, E
Add D to create a new E. After that, a routine that generates a point sequence is entered. First, the color point indicated by the color specification register 410 is set to the coordinates X, Y.
Hit Y. If the error value E is positive, add DD to E.
is added to update E, and Y is decremented by 1. If E is not positive, D is added to E and E is updated. That is, Y only if E is positive
is decremented. After that, X is always incremented. This is the case where X is the main axis, and X is always incremented by 1.
The length LEN is then decremented, and the above routine is repeated until LEN=0, a line segment is drawn and the line segment is printed as a series of dots.

各点列を示すX座標、Y座標は第1図の構成ブ
ロツク図に示すようにRGBの各ビツトマツプメ
モリ301,302,303に与えられる。そし
て、色指定レジスタ410の内容に従つて特定な
色のドツトを示す論理がメモリに書込まれると、
各メモリの1ビツトを画面の1ドツトに対応させ
るビツトマツプデイスプレイ表示装置、即ち
CRT制御部500を介してCRT600に線分の
点列が表示されることになる。すなわち基本描画
単位である線分がビツトマツプメモリ上に形成さ
れるとラスタ型デイスプレイ装置500及び60
0によつて線分のベクトルが離散画素列として生
成されることになる。この場合、格子上の各交点
における整数的な点列として離散的な線分が描画
されることになる。又、マルチウインドウ方式に
おけるクリツピングにおいては、主制御部100
内に保持されるデイスプレイフアイルの内容の
内、必要な線分データのみが取り出されて、ビツ
トマツプデイスプレイ600に表示されるがこの
クリツピング処理は主制御部100によつて実行
される。すなわちマルチウインドウ方式のウイン
ドウイングは、ウインドウとビユーポートの対応
づけを行うために図形の平行移動や拡大縮小等が
行われるが、そのウインドウが一般に複数個設け
られている場合には、それに対するビユーポート
に優先順位をつけて重ねて表示したり、優先順が
ダイナミツクに変更できるようにしている。その
ウインドウの変換に伴つてウインドウの境界線に
おいて線分のクリツピングが行われることにな
る。例えば、あるウインドウに線分を描画してい
た場合にそのウインドウの優先順位が下がつて他
のウインドウで半分隠されてしまつた場合、ウイ
ンドウの境界線において線分のクリツピングがお
こることになる。従つて、ウインドウ内部の線分
のみを表示するために特別なクリツピング処理を
行う必要がある。
The X and Y coordinates indicating each point sequence are given to RGB bitmap memories 301, 302, and 303, as shown in the block diagram of FIG. Then, when logic indicating a dot of a specific color is written into memory according to the contents of the color specification register 410,
A bit map display device in which each bit in memory corresponds to one dot on the screen, i.e.
A line segment dot sequence is displayed on the CRT 600 via the CRT control unit 500. That is, when a line segment, which is a basic drawing unit, is formed on the bitmap memory, the raster type display devices 500 and 60
0 means that the line segment vector is generated as a discrete pixel string. 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 in 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 section 100. In other words, in multi-window type windowing, figures are moved in parallel, enlarged and reduced, etc. in order to associate windows and viewports, but if there are generally multiple windows, the corresponding viewports are It allows you to set priorities and display them one on top of the other, and to dynamically change the priority order. As the window is converted, line segments will be clipped at the window boundaries. For example, if you are drawing a line segment in a certain window, and that window's priority is lowered and it becomes half hidden by another window, clipping of the line segment will occur at the window border. Therefore, special clipping processing must be performed to display only the line segments inside the window.

このような図形処理用装置の構成において、本
発明では、二次元の整数座標でアクセス可能なメ
モリ上に線分を発生する前記DDA200の出力
に従つて、ラインの種類、即ち点線、実線、一点
鎖線、或いは二点鎖線等のラインスタイルをライ
ンスタイルレジスタ420指定することができ
る。そして色指定レジスタ410によつて指定さ
れた色の点列を発生するための論理をビツトマツ
プメモリに与える場合に、ラインスタイルレジス
タ420の内容で適当にマスク回路430を介し
て点列をマスクすることによつてラインスタイル
に対応した線分を発生するようにしている。
In the configuration of such a graphic processing device, the present invention determines the type of line, ie, dotted line, solid line, single point, according to the output of the DDA 200, which generates line segments on a memory that can be accessed with two-dimensional integer coordinates. A line style such as a chain line or a two-dot chain line can be specified in the line style register 420. 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. By doing this, line segments corresponding to the line style are generated.

本発明によるクリツピングされた線分を発生す
る場合、交点を求める方式に従つている。第3図
に示すように、任意の始点座標PSから終点座標
PEに至る線分の途中で、例えばx=XCというY
座標に平行な直線でクリツピングした場合に、x
=XCとPS、PE間の線分との交点に最も近い整
数座標値PCを求め、PCからPEまでの線分をラ
インスタイルレジスタで指定されたラインで発生
するようにしている。このようにクリツピングラ
インと線分との交点を求めて交点と終点PEとの
線分を描くようにすれば始点PSからPCまでの点
列を発生せずにクリツピングされた線分を描くこ
とが出来るので高速になる。しかし、クリツピン
グによつて求められた交点PCから新たにライン
パターンレジスタ420の内容に従つて線分を描
画してしまうとクリツピングされた場合とされな
い場合とでは結果が異なるという問題がある。本
発明はラインスタイルレジスタ420のオフセツ
トが始点PSから終点PEまでの線分を描画したと
仮定した時に整数交点座標PCにおいて持つべき
値を設定することによりクリツピングのある場合
とそうでない場合において描かれる部分の線分パ
ターンを完全に一致させるようにしている。そこ
で、次にラインスタイルレジスタ420について
簡単に説明する。ラインスタイルレジスタ420
は、第2図aに示すように、Nビツトのレジスタ
で構成されており、Nビツトの各ビツトは描くべ
き線分の点の位置に1対1に対応している。そし
てその内容が論理的に1である場合にそれに対応
した線分の位置に色指定レジスタ410で指定さ
れた色の点が1ドツト打たれることになる。従つ
てラインスタイルレジスタ420のNビツトのパ
ターンは画面上に点列を打つていくポインタに同
期している。即ち、DDA200のX、Y座標の
点を出力する場合の同期信号に同期して次々にビ
ツト情報が読出され、その情報がマスク回路43
0を介して色指定レジスタ410の内容をビツト
マツプメモリ301,302,303に書込むか
どうかを決定する。例えば、第2図b,cは、線
分描画の様子を説明するための説明図で、ライン
スタイルジスタ420のビツトパターンに従つて
線分の点列が発生される様子を示している。ここ
で、重要なことは線分の描画はラインスタイルレ
ジスタのオフセツト値で指定された位置から線分
の点列が打たれるということである。即ち、第2
図bにおいてラインスタイルレジスタ420の内
容は先頭から111001110…となつており、オフセ
ツト位置は先頭から3ビツト目の2の位置であ
る。従つて描画される線分はオフセツト指定が行
われている3番目のビツトからのビツトパターン
に従つて線分が打たれることになる。第2図bに
おいてオフセツト指定の位置からのビツトパター
ンは1001110…となつているので、第2図cに示
すように、線分はP1の点がオフセツト指定の2
の位置に対応しているので打たれ、P2,P3は打
たれずP4,P5,P6が打たれて、P7が打たれない。
このようにしてラインスタイルレジスタ420の
オフセツト指定からのビツトパターンに対応した
ラインスタイルで線分が描かれることになる。即
ちラインスタイルレジスタ420の先頭からのオ
フセツト値で指定された位置から次々にビツト情
報が読み出され、ビツトの値が論理1である位置
には点が打たれ論理0の位置には打たれず、この
ようにしてラインスタイルを持つた線分が描画さ
れることになる。
When generating clipped line segments according to the present invention, a method of finding intersection points is followed. As shown in Figure 3, from the arbitrary starting point coordinate PS to the ending point coordinate
For example, in the middle of the line segment leading to PE,
When clipping with a straight line parallel to the coordinates, x
= Find the integer coordinate value PC closest to the intersection of the line segment between XC, PS, and PE, and make the line segment from PC to PE occur 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 becomes faster because it can be done. However, if a new line segment is drawn according to the contents of the line pattern register 420 from the intersection point PC determined by clipping, there is a problem that the result will be different depending on whether clipping is performed or not. The present invention allows drawing with and without clipping by setting the value that the offset in the line style register 420 should have at the integer intersection point coordinate PC when assuming that a line segment from the starting point PS to the ending point PE is drawn. The line segment patterns of the parts are made to match completely. Therefore, the line style register 420 will be briefly explained next. Line style register 420
As shown in FIG. 2a, it 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, one dot of the color specified by the color specification register 410 is placed at the position of the corresponding line segment. Therefore, the N-bit pattern in the line style register 420 is synchronized with the pointer that marks a series of dots on the screen. That is, bit information is read out 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 43.
It is determined whether the contents of the color designation register 410 are written to the bitmap memories 301, 302, and 303 via 0. For example, FIGS. 2b and 2c are explanatory diagrams for explaining how a line segment is drawn, and show how a line segment dot 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, a sequence of dots for the line segment is drawn from the position specified by the offset value of the line style register. That is, the second
In FIG. b, the contents of the line style register 420 are 111001110... from the beginning, and the offset position is the third bit 2 from the beginning. Therefore, the line segment to be drawn will be drawn according to the bit pattern starting from the third bit for which the offset is specified. In Figure 2b, the bit pattern from the offset specified position is 1001110..., so as shown in Figure 2c, the line segment is such that the point P1 is at the offset specified position.
, P 2 and P 3 are not hit, P 4 , P 5 , and P 6 are hit, and P 7 is not hit.
In this way, a line segment is drawn in a 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図aはクリツピングの説明
図であり、任意の始点座標PS=(XS、YS)から
終点座標PE=(XE、YE)に至る線分の途中、即
ち、x=XCのY軸に平行な直線でクリツピング
した場合、PS、PE間の線分とクリツピングライ
ンx=XCとの交点に最も近い整数座標PC=
(XC、YC)より前記終点座標PEに至る線分を描
画する場合を考察する。第5図bが流れ図であ
る。本実施例では、X軸が主軸である場合を述べ
るがX軸に平行な直線でクリツピングしたりY軸
が主軸である場合も同様である。動作が開始する
とまず線分PS・PE―――――→とx=XCのクリツピ
ング
ラインとの交点整数座標PCを求める。次にDDA
200に対する初期条件は次のように設定する。
すなわち各軸方向差分値、主軸指定はPS、PEの
座標値から計算された値を設定し、誤差量、オフ
セツトはPSからPEまで描画したと仮定したとき
にPCにおいて持つべき値を設定し、主軸方向長
さとしてはPCからPEに至るものを設定する。そ
してDDAの起動を行うようにしている。線分
PC・PE―――――→を描画する場合、始点座標はX
=XC、
Y=YCである。X方向の差分値DXはXE−XS
の絶対値、Y方向の差分値DYはYE−YSの絶対
値である。方向DIRは360度を8等分割した場合
に与えられる各方向を示す識別値であり、今の場
合PC・PE―――――→のベクトルの方向を示す。長

LENはXEからXCを引いた絶対値に1を加えた
値であり、これは点列の点の数にあたる。PS、
PE間の線分とクリツピングラインとの交点は実
際には実数値として求まる値であるがビツトマツ
プデイスプレイにおいては交点も整数座標系で与
えられるため、誤差を生じ、誤差量はPSからPE
まで描画したと仮定した時にPCにおいて持つべ
き値を設定する。このようにDDA200に対す
る初期パラメータを設定し、次に、色指定レジス
タ420に描画するべき線分の各座標における色
を表す論理を設定する。次に、ラインスタイルレ
ジスタ420にラインスタイルパターンとオフセ
ツトを設定する。この場合、オフセツト値aは
XCからXSを引いた絶対値をNで割つた余りとし
て与える。即ちa=|XC−XS|(modN)であ
る。このオフセツト値が明らかに、PSからPEま
で描画したと仮定した時に整数座標PCにおいて
持つべき値として設定されていることに重要性が
ある。以上のように定められた各パラメータを用
いてDDA200を起動すればクリツピングの有
無にかかわらずラインスタイルレジスタ420の
内容に従うラインスタイルで線分を正しく描くこ
とができる。このように、誤差量或いはラインス
タイルレジスタに対するオフセツトがPSからPE
まで描画したと仮定したときにPCにおいて持つ
べき値を用いていることによつて、例えば、マル
チウインドウ方式において、上のウインドウによ
つて一度PC、PE間の線分が消され、再び優先順
位が変わつてPC、PE間の線分が再現した場合に
も、正しいラインスタイルで再現されることにな
る。
Next, the flow of processing showing the operation of the present invention will be explained using FIG. Figure 5a is an explanatory diagram of clipping, and is located in the middle of a line segment from arbitrary starting point coordinates PS = (XS, YS) to end point coordinates PE = (XE, YE), that is, parallel to the Y axis of x = XC. When clipping is performed with a straight line, the integer coordinate PC = closest to the intersection of the line segment between PS and PE and the clipping line x = XC
Consider the case of drawing a line segment from (XC, YC) to the end point coordinate PE. FIG. 5b 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 find the integer coordinates PC of the intersection of the line segment PS·PE------→ and the clipping line of x=XC. Then DDA
The initial conditions for 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 it is drawn from PS to PE, The length in the main axis direction is set from PC to PE. Then, I try to start DDA. When drawing the line segment PC/PE――――――→, the starting point coordinates are X
=XC,
Y=YC. The difference value DX in the X direction is XE−XS
The absolute value of Y-direction difference value DY is the absolute value of YE-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 vector of PC/PE ------>. length
LEN is the absolute value of XE minus XC plus 1, which corresponds to the number of points in the point sequence. PS,
The intersection point between the line segment between PEs and the clipping line is actually a value determined as a real value, but in the bit map display, the intersection point is also given in an integer coordinate system, so an error occurs, and the amount of error is calculated from PS to PE.
Set the value that should be held on the PC when it is assumed that it has been drawn up to. In this way, the initial parameters for the DDA 200 are set, and then the logic representing the color at each coordinate of the line segment to be drawn is set in the color specification register 420. Next, the line style pattern and offset are set in the line style register 420. In this case, the offset value a is
Give the absolute value of XC minus XS as the remainder when divided by N. That is, a=|XC−XS|(modN). It is important that this offset value is clearly set as the value that the integer coordinate PC should have when it is assumed that drawing is done from PS to PE. By activating the DDA 200 using each parameter determined as described above, line segments can be drawn correctly in a line style according to the contents of the line style register 420, regardless of whether or not clipping is performed. In this way, the amount of error or the offset for the line style register can be changed from PS to PE.
For example, in a multi-window method, the line segment between the PC and PE is erased by the upper window, and the priority is changed again. Even if the line segment between PC and PE is reproduced due to a change in , it will be reproduced with 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 vertical or horizontal straight line in the middle of the line segment from arbitrary starting point coordinates to end point coordinates, and draws a line segment from the intersection point to the ending point. As an initial condition for DDA, in particular, by setting the error amount and the offset value for the line style register as 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, it is possible to set the value that should be held at the intersection integer 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 perfectly matched.

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

第1図は本発明のクリツピング方式に従う装置
の構成ブロツク図、第2図は本発明のラインスタ
イルレジスタによるラインスタイルを持つた線分
描画の説明図、第3図は本発明のクリツピングの
説明図、第4図はDDAの制御動作を示す流れ図、
第5図は本発明の線分描画におけるクリツピング
方式に従う主制御部の流れ図を示す。 100……主制御部、200……DDA、30
1,302,303……RGBビツトマツプメモ
リ、500……CRT制御部、600……CRT、
420……ラインスタイルレジスタ、430……
マスク回路、410……色指定レジスタ。
FIG. 1 is a block diagram of the configuration of an apparatus 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 an explanatory diagram of clipping of the present invention. , Figure 4 is a flowchart showing the control operation of DDA,
FIG. 5 shows a flowchart of the main control section according to the clipping method in drawing line segments according to the present invention. 100...Main control unit, 200...DDA, 30
1,302,303...RGB bit map memory, 500...CRT control unit, 600...CRT,
420... Line style register, 430...
Mask circuit, 410...color specification register.

Claims (1)

【特許請求の範囲】 1 二次元の整数座標でアクセス可能なメモリ上
に線分を発生するデイジタル微分解析器におい
て、 任意の始点座標から終点座標に至る線分を垂直
又は水平なクリツピングラインによつてクリツピ
ングし、前記線分とクリツピングラインの交点か
ら終点に至る線分を描画する場合の前記デイジタ
ル微分解析器に与える初期設定値として、 各軸方向差分値、主軸指定は前記始点座標と前
記終点座標の座標値から計算される値を設定し、 誤差量およびラインレジスタのオフセツトは前
記始点座標から終点座標まで描画したと仮定した
時に方程式の根から求められる交点座標に最も近
い交点整数座標において持つべき値を設定し、 主軸方向長さとしては前記交点整数座標から前
記終点座標に至るものを設定することによつて前
記デイジタル微分解析器を起動することを特徴と
する線分描画におけるクリツピング方式。
[Claims] 1. 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 can be converted into a vertical or horizontal clipping line. Therefore, as an initial setting value to be given to the digital differential analyzer when clipping and drawing a line segment from the intersection of the line segment and the clipping line to the end point, each axial difference value and principal axis designation are set to the coordinates of the starting point. Set the value calculated from the coordinate value of the end point coordinate, and set the error amount and line register offset to the intersection integer coordinate closest to the intersection coordinate found from the root of the equation when assuming that the line is drawn from the start point coordinate to the end point coordinate. clipping in line segment drawing, characterized in that the digital differential analyzer is started by setting a value that should be at the axis, and setting a length from the intersection integer coordinates to the end point coordinates as the length in the principal axis direction. method.
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 JPS62127972A (en) 1987-06-10
JPH0241790B2 true 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)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2704010B2 (en) * 1989-11-08 1998-01-26 株式会社日立製作所 Display system, bold line display method, and information processing device
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
JPS62127972A (en) 1987-06-10

Similar Documents

Publication Publication Date Title
US4653020A (en) Display of multiple data windows in a multi-tasking system
US4651146A (en) Display of multiple data windows in a multi-tasking system
JPH04246790A (en) Vector/conic section/area file primitive generator
US5341472A (en) Efficient area description for raster displays
US5128872A (en) Method and apparatus for determining line positions for display and manipulation by a computer system
WO2010089805A1 (en) Graphical user interface device and method for realizing graphical user interface
JPH0241790B2 (en)
US6344856B1 (en) Text optimization
US5777631A (en) Method and apparatus for displaying a video window in a computer graphics display
JPH07225849A (en) Graphics computer and line plotter
JPS62127971A (en) Clipping system in line segment drawing
JPS6339947B2 (en)
JPH0355870B2 (en)
JPS6177977A (en) Picture processor
JP2787487B2 (en) Circuit for determining the position of a line segment displayed and operated on a computer system
JPH04373084A (en) Character/graphic deformation processing device
JPH11161255A (en) Image display unit
JPS61130991A (en) Graphic processing method and apparatus
JPS63240682A (en) Clipping processing system for graphic display
JP2835056B2 (en) High quality character pattern generation method
JPS61240283A (en) Display controller
JPH10149358A (en) Character display device and recording medium
JP2000081872A (en) Character and graphic deformation processor and processing method
JPS62144197A (en) System of drawing segment on color display screen
JPS6265080A (en) Graph display system