JPH04137188A - Generating circuit for address in polygon - Google Patents

Generating circuit for address in polygon

Info

Publication number
JPH04137188A
JPH04137188A JP2259565A JP25956590A JPH04137188A JP H04137188 A JPH04137188 A JP H04137188A JP 2259565 A JP2259565 A JP 2259565A JP 25956590 A JP25956590 A JP 25956590A JP H04137188 A JPH04137188 A JP H04137188A
Authority
JP
Japan
Prior art keywords
coordinates
circuit
coordinate
horizontal
minimum
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2259565A
Other languages
Japanese (ja)
Inventor
Mutsuhiro Omori
睦弘 大森
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.)
Sony Corp
Original Assignee
Sony Corp
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 Sony Corp filed Critical Sony Corp
Priority to JP2259565A priority Critical patent/JPH04137188A/en
Publication of JPH04137188A publication Critical patent/JPH04137188A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

PURPOSE:To generate picture element addresses in the polygon by generating integral coordinates since there are maximum and minimum coordinates present among integral coordinates of intersections of a scanning line and its approximate integral coordinate group without fail when the scanning crosses the polygon. CONSTITUTION:A maximum and minimum discrimination circuit 16 finds the minimum value MIN and maximum value MAX among six horizontal coordinates from linear approximate coordinate generating circuits 13 - 15 and supplies those minimum value MIN and maximum value MAX to an interpolating circuit 17. When all the supplied horizontal coordinates become codes NULL showing no intersection, the maximum and minimum discrimination circuit 16 supplies the codes NULL to the interpolating circuit 17. The interpolating circuit 17 generates a series of horizontal coordinates (X coordinate) between the minimum value MIN and maximum value MAX. The series of horizontal coordinates can be regarded as horizontal addresses XA and Y coordinates of a horizontal line outputted by a horizontal scanning circuit 9 can be regarded as vertical addresses YA.

Description

【発明の詳細な説明】 [産業上の利用分野コ 本発明は、2次元画像処理技術に関し、さらに詳しくは
例えばグラフィックスデイスプレィ装置において、表示
装置の座標系上で与えられた3点以上の点を頂点とする
多角形の内部を並列処理的な処理を用いて所定の色で塗
りつぶすように表示する場合に適用して卓効ある多角形
内部のアドレス発生回路に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to two-dimensional image processing technology, and more specifically, for example, in a graphics display device, the present invention relates to a two-dimensional image processing technology, and more specifically, for example, in a graphics display device, three or more points given on the coordinate system of the display device are The present invention relates to an address generation circuit inside a polygon that is extremely effective when applied to display the inside of a polygon whose vertices are filled with a predetermined color using parallel processing.

[発明の概要] 本発明は、例えばグラフィックスデイスプレィ装置にお
いて、表示装置の座標系上で与えられた3点以上の点を
頂点とする多角形の内部を並列処理的な処理を用いて所
定の色で塗りつぶすように表示する場合に適用して卓効
ある多角形内部のアドレス発生回路に関し、多角形の各
頂点の座標を保持する保持回路と、それら各頂点を結ぶ
各辺に夫々近似される近似整数座標群を生成する近似回
路と、所定の走査線とその近似整数座標群とめ交点の整
数座標の内の最小座標及び最大座標を求める最小最大回
路と、その最小座標と最大座標との間の整数座標を発生
する補間回路とを有し、その走査線でその多角形の全面
を走査したときにその補間回路より順次出力される整数
座標を夫々その多角形の内部の画素のアドレスとみなす
ことにより、その多角形の形状及び置き方によらずに共
通の回路構成で且つ単純な処理でその多角形の内部の画
素のアドレスを生成できるようにしたものである。
[Summary of the Invention] The present invention provides, for example, in a graphics display device, a predetermined process that uses parallel processing to process the inside of a polygon whose vertices are three or more points given on the coordinate system of the display device. Regarding the address generation circuit inside a polygon, which is extremely effective when applied to a display that is filled with color, there is a holding circuit that holds the coordinates of each vertex of the polygon, and a holding circuit that is approximated to each side connecting each of these vertices. An approximation circuit that generates a group of approximate integer coordinates, a minimum-maximum circuit that calculates the minimum and maximum coordinates of the integer coordinates of a predetermined scanning line and the intersection of the group of approximate integer coordinates, and the distance between the minimum and maximum coordinates. and an interpolation circuit that generates integer coordinates of the polygon, and when the entire surface of the polygon is scanned with the scanning line, the integer coordinates sequentially output from the interpolation circuit are regarded as the addresses of the pixels inside the polygon. This makes it possible to generate addresses for pixels inside a polygon with a common circuit configuration and simple processing regardless of the shape and placement of the polygon.

[従来の技術] グラフィックスデイスプレィ装置においては、表示装置
の表示画面上の水平方向及び垂直方向に夫々整数の座標
が設定され、一対の整数座標で夫々1個の画素が指定で
きるようになされている。
[Prior Art] In a graphics display device, integer coordinates are set in the horizontal and vertical directions on the display screen of the display device, and one pixel can be specified with each pair of integer coordinates. There is.

また、一般にその表示画面に対応して1フレ一ム分の全
画素の画像データを記憶しているフレームバッファ(F
B)メモリが設けられ、このフレームバッファメモリよ
り周期的に画像データを読み出してその表示装置に供給
することにより、その画像データに対応する画像の表示
が行われ、このフレームバッファメモリの内容を書き換
えることにより表示画像を変更することができる。また
、そのフレームバッファメモリの内部での各画素の画像
データの位置は複数ビットのアドレスで指定されるが、
このアドレスは夫々上記の表示装置の表示画面上の一対
の整数座標に対応している。
In general, a frame buffer (F
B) A memory is provided, and by periodically reading image data from this frame buffer memory and supplying it to the display device, an image corresponding to the image data is displayed, and the contents of this frame buffer memory are rewritten. This allows the displayed image to be changed. Also, the position of the image data for each pixel within the frame buffer memory is specified by a multi-bit address.
Each of these addresses corresponds to a pair of integer coordinates on the display screen of the display device.

そのようなグラフィックスデイスプレィ装置の表示画面
において、例えば与えられた整数座標で指定される3点
を頂点とする三角形の内部を所定の色で塗りつぶすには
、この所定の色で塗りつぶす画素のフレームバッファメ
モリ内でのアドレスにその色の画像データを書き込む必
要がある。
On the display screen of such a graphics display device, for example, in order to fill the inside of a triangle whose vertices are three points specified by given integer coordinates with a predetermined color, the frame buffer of the pixels to be filled with this predetermined color is It is necessary to write the image data of that color to the address in memory.

従来その所定の色で塗りつぶす画素のその表示装置上で
の整数座標ひいてはそのフレームバッファメモリ内での
アドレスを求めるときには、コンピュータのソフトウェ
ア上で例えば水平な走査ラインを表示装置の2次元の整
数座標の上から下に向かって移動させながら、その三角
形の2つの辺に着目して走査ライン上におけるそれら2
つの辺の水平座標を求める。この場合、その走査ライン
と各辺との交点は複数ドツトの画素になることがあるた
め、左側の辺と右側の辺とで夫々どの画素をその交点の
画素とみなすかを予め決めておくことになる。そして、
その交点の画素とみなされた2個の画素の間の画素の整
数座標がその走査ラインがその位置に存在するときの求
めるべき整数座標となる。
Conventionally, when determining the integer coordinates of a pixel to be filled with a predetermined color on the display device, and hence its address in the frame buffer memory, computer software is used to calculate, for example, a horizontal scanning line to the two-dimensional integer coordinates of the display device. While moving from top to bottom, focus on the two sides of the triangle and calculate those two sides on the scan line.
Find the horizontal coordinates of two sides. In this case, since the intersection between the scanning line and each side may be a plurality of pixels, it is necessary to decide in advance which pixel on the left side and the right side will be considered as the pixel at the intersection. become. and,
The integer coordinates of the pixel between the two pixels regarded as the pixels at the intersection are the integer coordinates to be determined when the scanning line exists at that position.

その水平な走査ラインを成る程度まで移動すると、左辺
又は右辺のどちらかが頂点に達するので、この頂点に達
した辺を除外すると共に残りの一辺を追加してその水平
な走査ラインの走査をその三角形の最も下の端点まで続
行する。
If you move the horizontal scan line to a certain extent, either the left side or the right side will reach the apex, so by excluding the side that reached this apex and adding the remaining side, you can change the scan of the horizontal scan line to that point. Continue to the lowest endpoint of the triangle.

[発明が解決しようとする課題] しかしながら、そのような処理を行うときにはその三角
形の形状及び置き方により場合分けして処理方法を少し
ずつ変更しなければならず、処理が複雑化すると共に処
理回路が共通に使用できない不都合がある。具体的に、
その三角形の形状及び置き方による場合分けには例えば
次の(ア)〜(オ)のようなものがある。
[Problems to be Solved by the Invention] However, when performing such processing, the processing method must be changed little by little depending on the shape and placement of the triangle, which complicates the processing and increases the processing circuitry. has the disadvantage that it cannot be used commonly. specifically,
For example, there are the following cases (a) to (e) depending on the shape and placement of the triangle.

(ア)左辺と右辺との頂点が上にあり、その右辺の他方
の頂点がその左辺の他方の頂点よりも上に位置しており
、右側に第3の辺が追加される。
(a) The vertices of the left side and the right side are above, the other vertex of the right side is located above the other vertex of the left side, and a third side is added to the right side.

(イ)上に頂点があり、左側に第3の辺が追加される。(b) There is a vertex at the top, and a third edge is added to the left.

(つ)上が三角形の底辺となっている。(1) The top is the base of the triangle.

(1)三角形が全て一点に縮退している。(1) All triangles are reduced to one point.

(オ)三角形の3個の頂点が同一直線上に乗っている。(e) The three vertices of a triangle lie on the same straight line.

これらの場合分けの処理に対処するため、従来は→イク
ロコードに、より処理手順を制御したりする必要が生じ
、その分処理が複雑化して処理速度も遅くなる不都合が
ある。
In order to deal with these cases-based processing, it is necessary to control the processing procedure more than in the conventional →microcode, which has the disadvantage of making the processing more complicated and slowing down the processing speed.

これに関して特開昭62−221781 号公報には、
表示画面上の水平方向に一辺が平行な矩形の全面を塗り
つぶす方法が開示されているが、この方法は一辺が水平
方向に平行であり且つ矩形であるという特別な場合にし
か適用できない不都合がある。
Regarding this, Japanese Patent Application Laid-Open No. 62-221781 states:
A method of filling the entire surface of a rectangle with one side parallel to the horizontal direction on the display screen has been disclosed, but this method has the disadvantage that it can only be applied in the special case where one side is parallel to the horizontal direction and the shape is a rectangle. .

本発明は斯かる点に鑑み、多角形の形状及び置き方に関
係なく共通の単純な処理でその多角形の内部の画素のア
ドレスを生成できるようにすることを目的とする。
In view of this, it is an object of the present invention to make it possible to generate addresses for pixels inside a polygon by common and simple processing, regardless of the shape and placement of the polygon.

[課題を解決するための手段] 本発明による多角形内部のアドレス発生回路は、例えば
第1図及び第4図に示す如く、多角形の各頂点の座標を
保持する保持回路(5,6,7)  と、それら各頂点
を結ぶ各辺に夫々近似される近似整数座標群を生成する
近似回路(13,14,15)と、所定の走査線(25
)とその近似整数座標群との交点の整数座標(a2. 
al、 cl−c5)の内の最小座標a2及び最大座標
C5を求める最小最大回路(16)と、その最小座標と
最大座標との間の整数座標を発生する補間回路(17)
とを有し、その走査線でその多角形の全面を走査したと
きにその補間回路(17)より順次出力される整数座標
を夫々その多角形の内部の画素のアドレスとみなすよう
にしたものである。
[Means for Solving the Problems] The address generation circuit inside a polygon according to the present invention includes a holding circuit (5, 6, 6, 7), an approximation circuit (13, 14, 15) that generates a group of approximate integer coordinates approximated to each side connecting each of these vertices, and a predetermined scanning line (25).
) and its approximate integer coordinate group (a2.
a minimum-maximum circuit (16) that calculates the minimum coordinate a2 and maximum coordinate C5 of (al, cl-c5), and an interpolation circuit (17) that generates integer coordinates between the minimum and maximum coordinates.
When the entire surface of the polygon is scanned with the scanning line, the integer coordinates sequentially output from the interpolation circuit (17) are regarded as the addresses of the pixels inside the polygon. be.

[作用〕 斯かる本発明によれば、対象とする多角形がどのような
多角形であってもその走査線(25)でその多角形の各
辺の近似整数座標群を走査すると、その走査線(25)
とその近似整数座標群との交点の個数はその走査線がそ
の多角形の外側に位萱するときには0であり、その走査
線がその多角形の内部を横切っているときには1個以上
である。従って、その走査線がその多角形を横切ってい
るときには必ずその走査線(25)とその近似整数座標
群との交点の整数座標の内の最小座標及び最大座標(こ
れが最小座標と一致する場合も含む)が存在するので、
それら最小座標と最大座標との間の整数座標を発生する
ことにより、その多角形の内部の画素のアドレスを発生
することができる。
[Operation] According to the present invention, no matter what kind of polygon the target polygon is, if the scanning line (25) is used to scan the approximate integer coordinate group of each side of the polygon, the scanning line (25)
The number of intersections between and its approximate integer coordinate group is 0 when the scan line is located outside the polygon, and is 1 or more when the scan line crosses inside the polygon. Therefore, when the scanning line crosses the polygon, the minimum and maximum coordinates of the integer coordinates of the intersection of the scanning line (25) and its approximate integer coordinate group (even if these coincide with the minimum coordinates) ) exists, so
By generating integer coordinates between the minimum and maximum coordinates, addresses of pixels inside the polygon can be generated.

[実施例] 以下、本発明の一実施例につき図面を参照して説明しよ
う。本例は三角形の内部の画素のアドレスを発生する回
路を有するグラフィックスデイスプレィ装置に本発明を
適用したものである。
[Embodiment] Hereinafter, an embodiment of the present invention will be described with reference to the drawings. In this example, the present invention is applied to a graphics display device having a circuit for generating addresses of pixels inside a triangle.

第1図は本例のグラフィックスデイスプレィ装置を示し
、この第1図において、(1)は全体の動作を制御する
中央処理ユニット(以下rCP UJという) 、(2
)はシステムバス、(3)は各種画像データを記憶する
メモ!J、(4)は入出力回路であり、そのCPU(1
)はそのメモリ(3)から読み出した三角形の3個の頂
点A、B及びCの夫々の2次元の整数座標をシステムバ
ス(2)を介してその入出力回路(4)に順次供給する
。本例では第2図に示すように、表示装置の左上に原点
Oを設定し、水平方向の左から右に値が次第に増加する
整数のX座標を設定し、垂直方向の上から下に値が次第
に増加する整数のY座標を設定する。
FIG. 1 shows the graphics display device of this example. In FIG. 1, (1) is a central processing unit (hereinafter referred to as rCP UJ) that controls the overall operation,
) is the system bus, and (3) is a memo that stores various image data! J, (4) is an input/output circuit, and its CPU (1
) sequentially supplies the two-dimensional integer coordinates of the three vertices A, B, and C of the triangle read from its memory (3) to its input/output circuit (4) via the system bus (2). In this example, as shown in Figure 2, the origin O is set at the top left of the display device, the X coordinate is set as an integer whose value gradually increases from left to right in the horizontal direction, and the value is set from top to bottom in the vertical direction. Set the Y coordinate of an integer that gradually increases.

(5)〜(7)は夫々入力部が入出力回路(4)の出力
部に接続されたレジスターを示し、Aレジスター(5)
には頂点への整数座標(Xl、Yl)を保持させ、Bレ
ジスター(6)には頂点Bの整数座標(X2. Y2)
を保持させ、Cレジスター(7)には頂点Cの整数座標
(X3. Y3)を保持させる。これらレジスター(5
)〜(7)に保持されているY座標Yl、 Y2及びY
3を夫々Y方向最小値判別回路(8)に供給し、この判
別回路(8)はそれらY座標の内の最小値の座標を水平
方向走査回路(9)に供給する。この水平方向走査回路
(9)はその最小値のY座標を始点として下側に水平走
査ライン(25) (第4図参照)の走査を行う。
(5) to (7) each indicate a register whose input section is connected to the output section of the input/output circuit (4), and A register (5).
holds the integer coordinates (Xl, Yl) to the vertex, and the B register (6) holds the integer coordinates (X2. Y2) of vertex B.
is held, and the integer coordinates (X3. Y3) of vertex C are held in the C register (7). These registers (5
) to (7) Y coordinates Yl, Y2 and Y
3 are respectively supplied to a Y direction minimum value discriminating circuit (8), and this discriminating circuit (8) supplies the coordinate of the minimum value among these Y coordinates to a horizontal direction scanning circuit (9). This horizontal scanning circuit (9) scans a horizontal scanning line (25) (see FIG. 4) downward from the Y coordinate of the minimum value as a starting point.

(10)〜(12)は夫々Y方向配列回路を示し、Aレ
ジスター(5)に保持されている頂点Aの整数座標及び
Bレジスター(6)に保持されている頂点Bの整数座標
を第1のY方向配列回路(10)に供給し、その頂点A
の整数座標及びCレジスター(7)に保持されている頂
点Cの整数座標を第2のY方向配列回路(11)に供給
し、その頂点Bの整数座標及び頂点Cの整数座標を第3
のY方向配列回路(12)に供給する。(13)〜(1
5)は夫々Y方向配列回路(10)〜(12)の出力部
に接続された直線近似座標発生回路を示し、第1のY方
向配列回路(10)は本例の三角形の辺ABの頂点A及
びBの座標をY座標の小さい順序に配列して第1の直線
近似座標発生回路(13)に供給する。同様に第2のY
方向配列回路(11)は本例の三角形の辺CAの頂点C
及びAの座標をY座標の小さい順序に配列して第2の直
線近似座標発生回路(14)に供給し、第3のY方向配
列回路(12)は本例の三角形の辺BCの頂点B及びC
の座標をY座標の小さい順序に配列して第3め直線近似
座標発生回路(15)に供給する。
(10) to (12) respectively indicate Y-direction array circuits, and the integer coordinates of vertex A held in A register (5) and the integer coordinates of vertex B held in B register (6) are is supplied to the Y-direction array circuit (10), and its vertex A
The integer coordinates of the vertex B and the integer coordinates of the vertex C held in the C register (7) are supplied to the second Y-direction array circuit (11), and the integer coordinates of the vertex B and the integer coordinates of the vertex C are supplied to the third Y-direction array circuit (11).
is supplied to the Y-direction array circuit (12). (13)~(1
5) shows linear approximation coordinate generation circuits connected to the output parts of the Y-direction array circuits (10) to (12), respectively, and the first Y-direction array circuit (10) corresponds to the vertex of side AB of the triangle in this example. The coordinates of A and B are arranged in order of decreasing Y coordinate and are supplied to the first linear approximation coordinate generation circuit (13). Similarly, the second Y
The direction array circuit (11) is the vertex C of the side CA of the triangle in this example.
The coordinates of and A are arranged in ascending order of Y coordinates and supplied to the second linear approximation coordinate generation circuit (14), and the third Y-direction arrangement circuit (12) arranges the coordinates of A and A in ascending order of Y coordinates, and the third Y-direction arrangement circuit (12) arranges the coordinates of and C
The coordinates are arranged in ascending order of Y coordinates and supplied to the third linear approximate coordinate generation circuit (15).

これら直線近似座標発生回路(13)〜(15)は後述
のように夫々入力された2個の頂点間の辺に近似される
一連の整数座標を発生する。また、゛これら直線近似座
標発生回路(13)〜(15)には水平方向走査回路(
9)より水平走査ライン(25)の垂直座標(Y座標)
の値を供給し、これら直線近似座標発生回路(13)〜
(15)は夫々その水平走査ライン(25)と上記の辺
に近似された一連の整数座標との交点の水平座標(X座
標)の内の最小値及び最大値(最小値と一致することも
ある)を最小最大判別回路(16)に供給する。この場
合、その水平走査ライン(25)との交点が存在しない
ときには、交点が存在しないことを示す2個の符号NU
LLを供給する。即ち、この最小最大判別回路(16)
には2個の符号NULLを含めて6個の水平座標が供給
される。
These linear approximation coordinate generating circuits (13) to (15) each generate a series of integer coordinates that are approximated to the edge between two input vertices, as will be described later. Furthermore, these linear approximation coordinate generation circuits (13) to (15) include a horizontal scanning circuit (
9) Vertical coordinate (Y coordinate) of horizontal scanning line (25)
, and these linear approximation coordinate generation circuits (13) to
(15) are the minimum and maximum values (which may coincide with the minimum value) of the horizontal coordinates (X coordinates) of the intersection of the horizontal scanning line (25) and a series of integer coordinates approximated to the above sides, respectively. ) is supplied to the minimum/maximum discrimination circuit (16). In this case, when there is no intersection with the horizontal scanning line (25), two codes NU indicating that there is no intersection are displayed.
Supply LL. That is, this minimum/maximum discrimination circuit (16)
is supplied with six horizontal coordinates including two NULL codes.

最小最大判別回路(16)はその6個の水平座標の内か
ら最小値M、IN及び最大値MAXを求め、これら最小
値MIN及び最大値MAXを補間回路(17)に供給す
る。そして、供給される水平座標が全て符号NULLに
なったときには、最小最大判別回路(16)はその符号
NULLをその補間回路(17)に供給する。この補間
回路(17)はその最小値MINと最大値MAXとの間
の一連の水平座標(X座F)を発生する。これら一連の
水平座標は水平方向のアドレスXAと考えることができ
、水平方向走査回路(9)より出力される水平走査ライ
ン(25)ノYIIaは垂直方向のアドレスYAと考え
ることができる。また、この補間回路(17)は最小最
大判別回路(16)より符号NULLが供給されてきた
ときには、水平方向走査回路(9)に水平方向への走査
を停止させるた杓の制御信号を供給する。
The minimum/maximum discrimination circuit (16) determines the minimum value M, IN, and maximum value MAX from among the six horizontal coordinates, and supplies these minimum value MIN and maximum value MAX to the interpolation circuit (17). Then, when all of the supplied horizontal coordinates become the code NULL, the minimum/maximum discrimination circuit (16) supplies the code NULL to its interpolation circuit (17). This interpolator (17) generates a series of horizontal coordinates (X-coordinate F) between its minimum value MIN and maximum value MAX. These series of horizontal coordinates can be considered as a horizontal address XA, and the horizontal scanning line (25) YIIa output from the horizontal scanning circuit (9) can be considered as a vertical address YA. Furthermore, when the code NULL is supplied from the minimum/maximum discrimination circuit (16), this interpolation circuit (17) supplies a ladle control signal to the horizontal direction scanning circuit (9) to stop scanning in the horizontal direction. .

(18)ハメモリコントローラ、(19)はパレットレ
ジスタ、(20)はフレームバッファ (FB)メモリ
、(21)は表示装置を示し、そのメモリコントローラ
(18)には水平方向走査回路(9)及び補間回路(1
7)より夫々垂直方向のアドレスYA及び水平方向のア
ドレスχAを供給する。また、CPU(1)  は入出
力回路(4)を介してパレットレジスタ(19)に所定
のR,G、Bの色データCDを設定すると共に、補間回
路(17)はそのパレットレジスタ(19)に色データ
CDを出力するための制御信号を供給する。
(18) is a memory controller, (19) is a palette register, (20) is a frame buffer (FB) memory, and (21) is a display device, and the memory controller (18) includes a horizontal scanning circuit (9) and Interpolation circuit (1
7) respectively supply a vertical address YA and a horizontal address χA. Further, the CPU (1) sets predetermined R, G, and B color data CD in the palette register (19) via the input/output circuit (4), and the interpolation circuit (17) sets the color data CD in the palette register (19). A control signal for outputting color data CD is supplied to the controller.

その補間回路(17)は更にそのメモリコントローラ(
18)に最小値MINと最大値MAXとが符号NULL
でない期間には図示省略した信号ラインを介してデータ
の書き込み命令を供給し、メモリコントローラ(18)
は例えば水平ブランキング期間に垂直方向のアドレスY
A及び水平方向のアドレスXAで定まるフレームバッフ
ァメモIJ(20’)の記憶領域に色データCDを書き
込むと共に、そのフレームバッファメモ!J (20)
より周期的に読み出した画像データを表示装置(21)
に供給する。
The interpolation circuit (17) further includes the memory controller (
18) The minimum value MIN and maximum value MAX are sign NULL.
During the period when the memory controller (18)
For example, during the horizontal blanking period, the vertical address Y
The color data CD is written in the storage area of the frame buffer memo IJ (20') determined by the horizontal address XA and the frame buffer memo! J (20)
The image data read out more periodically is displayed on the display device (21).
supply to.

本例の直線近似座標発生回路(13)の動作につき第2
図及び第3図を参照して詳細に説明する。
Regarding the operation of the linear approximation coordinate generation circuit (13) of this example, the second
This will be explained in detail with reference to the figures and FIG.

第2図は近似対象とする三角形ABCの一例を示し、そ
の直線近似座標発生回路(13)では辺ABに近似され
る一連の整数座標が求められる。この場合、頂点A(X
i、 Yl)(7)Y座標YH2頂点B(X2. Y2
)のY座標Y2よりも小さく、次式が成立しているもの
とする。
FIG. 2 shows an example of a triangle ABC to be approximated, and the linear approximation coordinate generation circuit (13) calculates a series of integer coordinates to be approximated to the side AB. In this case, vertex A(X
i, Yl) (7) Y coordinate YH2 vertex B (X2. Y2
) is smaller than the Y coordinate Y2 of ), and the following equation holds true.

Xl−X2   >  Yl−Y2   −・・・(1
)この場合、その直線近似座標発生回路(13)は2個
の頂点A及びBの座標を取り込み(第3図のステップ(
101)) 、頂点Aの座標(XI、 Yl) ヲ1l
llIFの初期位置に設定する(ステップ(102) 
)。続いてステップ(103)  において、2点A及
びBの水平方向の間隔ΔX (=ΔXi = l Xl
−X21 )及び垂直方向の間隔△Y (=ΔYl =
 l Yl−Y21 )が求められ、ステップ(104
)  にてその間隔ΔXと冊隔ΔYとが比較される。
Xl-X2 > Yl-Y2 -...(1
) In this case, the linear approximation coordinate generation circuit (13) takes in the coordinates of the two vertices A and B (step (
101)), coordinates of vertex A (XI, Yl) wo1l
Set to the initial position of llIF (step (102)
). Subsequently, in step (103), the horizontal distance ΔX (=ΔXi = l Xl
-X21 ) and vertical distance ΔY (=ΔYl =
l Yl−Y21 ) is determined and step (104
), the interval ΔX and the book interval ΔY are compared.

本例では式(1)よりΔX〉ΔYが成立しているので、
水平方向(X方向)が長軸方向で垂直方向(Y方向)が
短軸方向になる。その直線近似座標発生回路(13)の
動作はステップ(105)  に移行して長軸方向であ
るX方向に座標x2に向かって1だけ初期位置からの移
動が行われる。この結果水平方向の座標がx2を超えた
ときには近似動作は終了するが(ステップ(106))
、水平方向の座標がx2を超えていないときには動作は
ステップ(107)  に移行して、本来の直線(即ち
辺AB)に近い垂直方向(Y方向)の整数座標が求めら
れる。その求められた直線近似の整数座標(X、Y)は
内部のメモリに記憶され(ステップ(10g))、その
後動作は再びステップ(105)  に移行して、長軸
方向への1だけの移動が行われる。
In this example, ΔX>ΔY holds true from equation (1), so
The horizontal direction (X direction) is the long axis direction, and the vertical direction (Y direction) is the short axis direction. The operation of the linear approximation coordinate generation circuit (13) proceeds to step (105), where movement from the initial position by 1 is performed in the X direction, which is the long axis direction, toward the coordinate x2. As a result, when the horizontal coordinate exceeds x2, the approximation operation ends (step (106))
, when the horizontal coordinates do not exceed x2, the operation moves to step (107), and integer coordinates in the vertical direction (Y direction) close to the original straight line (ie, side AB) are determined. The obtained integer coordinates (X, Y) of the linear approximation are stored in the internal memory (step (10g)), and the operation then shifts to step (105) again to move by 1 in the major axis direction. will be held.

具体的には第2図に示すように、現在のX方向の整数座
標は垂直方向のライン(22^)に対応し、辺ABのY
方向の位置は水平方向のライン(23A)とライン(2
3B)  との間に存在する。この場合、その辺ABは
ライン(23B)よりもライン(23A>により近いの
で、近似されたY方向の整数座標はライン(23^)に
対応する座標となる。従って、垂直方向のライン(22
A) 上でその辺ABに近似される整数座標は画素P1
の整数座標である。また、辺ABが2本の水平方向のラ
インの中央に存在するときには例えば上のラインに対応
する整数座標が選択される。
Specifically, as shown in Figure 2, the current integer coordinate in the X direction corresponds to the vertical line (22^), and the Y of side AB
The position of the direction is horizontal line (23A) and line (2
3B) exists between. In this case, the side AB is closer to the line (23A> than the line (23B), so the approximated integer coordinates in the Y direction are the coordinates corresponding to the line (23^). Therefore, the vertical line (22
A) The integer coordinates approximated to the side AB above are pixel P1
are the integer coordinates of Further, when the side AB exists in the center of two horizontal lines, for example, integer coordinates corresponding to the upper line are selected.

同様に長軸方向へ更に1ずつ座標X2の方向に移動する
と、垂直方向のラインは(22B)、 (22C)、 
 ・・・・と変化する。そして、ライン(22B)上で
は辺ABは水平方向のライン(23B)に最も近いので
近似された整数座標としては画素P2の整数座標が選ば
れ、ライン(22C)上では辺ABは水平方向のライン
(23C)よりもライン(23B)により近いので近似
された整数座標としては画素P3の整数座標が選ばれ、
以下辺ABに近似された一連の整数座標が求められる。
Similarly, when moving further in the long axis direction in the direction of coordinate X2, the vertical lines are (22B), (22C),
It changes as... Then, on line (22B), side AB is closest to the horizontal line (23B), so the integer coordinates of pixel P2 are selected as the approximated integer coordinates, and on line (22C), side AB is closest to the horizontal line (23B). Since it is closer to line (23B) than line (23C), the integer coordinates of pixel P3 are selected as the approximated integer coordinates,
Below, a series of integer coordinates approximated to side AB are determined.

次に直線近似座標発生回路(14)では辺CAに近似さ
れた整数座標が求められるが、その辺CAは第2 図1
: 示t ヨうに頂点A(XI、 Yl)のY座IYI
は頂点C(X3. Y3)のY座標Y3よりも小さく、
次式が成立しているものとする。
Next, in the linear approximation coordinate generation circuit (14), integer coordinates approximated to the side CA are obtained, but the side CA is
: Y-locus IYI of vertex A(XI, Yl)
is smaller than the Y coordinate Y3 of vertex C (X3. Y3),
It is assumed that the following formula holds.

Xl−X3 l < l Yl−Y3 l  −−・−
(2)この場合、2点A及びCの水平方向の間隔ΔX(
=ΔX3= l Xl−X31 ) ト垂直方向ノ間隔
△Y(=ΔY3= l Yl−Y31 )との間には式
(2)よりΔXくΔYの関係が存在するため、この辺C
Aの長軸方向はY方向であり、短軸方向はX方向である
Xl−X3 l < l Yl−Y3 l −−・−
(2) In this case, the horizontal distance ΔX(
= ΔX3= l
The major axis direction of A is the Y direction, and the minor axis direction is the X direction.

そのため、直線近似座標発生回路(14)の動作は第3
図のステップ(104)からステップ(109)に移行
して長軸方向であるY方向に1だけ座標Y3の方向に移
動が行われる。この結果垂直方向の座標がY2を超えた
ときには近似動作は終了するが(ステップ(110))
、垂直方向の座標がY2を超えていないときには動作は
ステップ(111)  に移行して、本来の直線(即ち
辺CA)に近い水平方向(X方向)の整数座標が求めら
れる。その求められた直線近似の整数座標(X、Y)は
内部のメモリに記憶され(ステップ(112))、その
後動作は再びステップ(109)に移行して、長軸方向
への1だけの移動順次が行われる。
Therefore, the operation of the linear approximation coordinate generation circuit (14) is
Moving from step (104) to step (109) in the figure, movement is performed by 1 in the Y direction, which is the major axis direction, in the direction of coordinate Y3. As a result, when the vertical coordinate exceeds Y2, the approximation operation ends (step (110))
, when the vertical coordinate does not exceed Y2, the operation moves to step (111), and an integer coordinate in the horizontal direction (X direction) close to the original straight line (ie, side CA) is determined. The obtained integer coordinates (X, Y) of the linear approximation are stored in the internal memory (step (112)), and the operation then shifts to step (109) again to move by 1 in the major axis direction. Sequence takes place.

具体的には第2図に示すように、現在のY方向の整数座
標は水平方向のライン(23B)  に対応し、辺CA
のX方向の位置は垂直方向のライン(24A)よりもラ
イン(24B)  により近いので、近似されたX方向
の整数座標はライン(24B)  に対応する座標゛と
なる。従って、水平方向のライン(23B) 上でその
辺CAに近似される整数座標は画素P4の整数座標であ
る。同様に更に1だけ下側に移動した水平方向のライン
(23C)  においては、辺CAは垂直方向のライン
(24C)よりもライン(24B)により近いので、水
平方向のライン(23C)上でその辺CAに近似される
整数座標は画素P5の整数座標である。
Specifically, as shown in Figure 2, the current integer coordinate in the Y direction corresponds to the horizontal line (23B), and the side CA
Since the position in the X direction of is closer to the line (24B) than to the vertical line (24A), the approximated integer coordinate in the X direction is the coordinate corresponding to the line (24B). Therefore, the integer coordinates approximated to the side CA on the horizontal line (23B) are the integer coordinates of the pixel P4. Similarly, in the horizontal line (23C) that is further moved downward by 1, the side CA is closer to the line (24B) than the vertical line (24C), so The integer coordinates approximated to side CA are the integer coordinates of pixel P5.

また、直線近似座標発生回路(15)では辺BCに近似
される一連の整数座標が求められるが、第2図例の辺B
Cは辺ABと同様に長軸方向がX方向でるため、辺AB
と同様にして近似された整数座標が求められる。
Furthermore, in the linear approximation coordinate generation circuit (15), a series of integer coordinates approximated to the side BC are obtained, but the side B in the example in FIG.
C has the long axis direction in the X direction like side AB, so side AB
Approximate integer coordinates can be obtained in the same manner as .

直線近似座標発生回路(13)〜(15)のその後の動
作につき詳細に説明するに、説明の便宜上近似対象とす
る三角形の辺AC及び辺CAは第4図に示すように設定
して、それら辺AB及びCAに近似される整数座標の画
素は丸印で表示する。第4図例では水平方向走査回路(
9)はY座標がYlの頂点Aから下方向に水平走査ライ
ン(25)の走査を開始して、その水平走査ライン(2
5)のY座標を直線近似座標発生回路(13)〜り15
)に供給する。
To explain in detail the subsequent operations of the linear approximation coordinate generation circuits (13) to (15), for convenience of explanation, the sides AC and CA of the triangle to be approximated are set as shown in FIG. Pixels with integer coordinates approximated to sides AB and CA are indicated by circles. In the example in Figure 4, the horizontal scanning circuit (
9) starts scanning the horizontal scanning line (25) downward from the vertex A whose Y coordinate is Yl, and then scans the horizontal scanning line (25) downward.
5) Y coordinate is generated by linear approximation coordinate generation circuits (13) to 15
).

第4図においては、その水平走査ライン(25)は辺A
Bに近似された整数座標の画素の内の画素Q1及びC2
に交差しており、画素Q1及びC2のX座標を夫々a1
及びC2(al<C2)とすると、辺ACの近似整数座
標と水平走査ライン(25)との交点のX座標の最小値
はC2で最大値はalである。また、辺CAの近似整数
座標と水平走査ライン(25)との交点のX座標はcl
 〜c5 (CI <C2<C3<C4<C5)である
ため、それら交点のX座標の最小値は画素R1に対応す
るC1であり、X座標の最大値は画素R2に対応するC
5である。また、辺BCとその水平走査ライン(25)
とは交点を有しないので、その辺BCに関する交点のX
座標の最小値及び最大値は共に符号NULLである。
In FIG. 4, the horizontal scanning line (25) is on side A.
Pixels Q1 and C2 among pixels with integer coordinates approximated to B
, and the X coordinates of pixels Q1 and C2 are respectively a1
and C2 (al<C2), the minimum value of the X coordinate of the intersection of the approximate integer coordinates of side AC and the horizontal scanning line (25) is C2, and the maximum value is al. Also, the X coordinate of the intersection of the approximate integer coordinates of side CA and the horizontal scanning line (25) is cl
~c5 (CI<C2<C3<C4<C5), so the minimum value of the X coordinate of these intersections is C1 corresponding to pixel R1, and the maximum value of the X coordinate is C1 corresponding to pixel R2.
It is 5. Also, side BC and its horizontal scanning line (25)
Since there is no intersection with
Both the minimum value and the maximum value of the coordinates have the sign NULL.

従って、直線近似座標発生回路(13)はX座標C2及
びalを最小最大判別回路(16)に供給し、直線近似
座標発生回路(14)はX座標c1及びC5を最小最大
判別回路(16)に供給し、直線近似座標発生回路(1
5)はX座標としての2個の符号NULLを最小最大判
別回路(16)に供給する。
Therefore, the linear approximation coordinate generation circuit (13) supplies the X coordinates C2 and al to the minimum/maximum discrimination circuit (16), and the linear approximation coordinate generation circuit (14) supplies the X coordinates c1 and C5 to the minimum/maximum discrimination circuit (16). and the linear approximation coordinate generation circuit (1
5) supplies the two codes NULL as the X coordinate to the minimum/maximum discrimination circuit (16).

この最小最大判別回路(16)はそれら6個のX座標の
内の全体の最小値MIN及び最大値MAXを求めて(符
号NULLは無視する)補間回路(17)に供給するが
、第4図例では全体の最小値MINはC2であり、全体
の最大値MAXはC5である。これに応じて補間回路(
17)は第5図に示すようにその水平走査ライン(25
)上でX座標が最小値a2と最大値C5との間に存在す
る黒丸で示す一連の画素のX座標(X方向のアドレスX
A)をメモリコントローラ(18)に供給する。ただし
、第5図例のようにX座標がC2の画素及びX座標がC
5の画素を含釣るのではなく、例えばX座標が最大値C
5である画素を除いた部分をその三角形の内部の画素で
あるとみなすようにしてもよい。
This minimum/maximum discrimination circuit (16) determines the overall minimum value MIN and maximum value MAX among the six X coordinates (ignoring the NULL sign) and supplies it to the interpolation circuit (17), as shown in FIG. In the example, the overall minimum value MIN is C2, and the overall maximum value MAX is C5. Depending on this, the interpolation circuit (
17) has its horizontal scanning line (25) as shown in FIG.
) of a series of pixels indicated by black circles whose X coordinates exist between the minimum value a2 and the maximum value C5 (address in the X direction
A) is supplied to the memory controller (18). However, as shown in the example in Figure 5, the pixel whose X coordinate is C2 and the pixel whose X coordinate is C
For example, instead of including 5 pixels, the X coordinate is the maximum value C
The portion excluding the pixels with a value of 5 may be considered to be the pixels inside the triangle.

第4図において、水平走査ライン(25)を次第に下方
向に走査するのに応じて補間回路(17)からはその水
平走査ライン(25)上に存在し、且つその三角形の内
部に存在する画素のアドレスがメモリコントローラ(1
8)に供給される。その水平走査ライン(25)のY座
標が頂点BのY座標Y2より大きくなると、その水平走
査ライン(25)と三角形ABCの各辺との交点は存在
しなくなるので、その水平走査ライン(25)の走査が
終了し、その三角形の内部の全ての画素のアドレスが得
られる。
In FIG. 4, as the horizontal scanning line (25) is scanned gradually downward, the interpolation circuit (17) detects pixels existing on the horizontal scanning line (25) and inside the triangle. The address of the memory controller (1
8). When the Y coordinate of the horizontal scanning line (25) becomes larger than the Y coordinate Y2 of the vertex B, there are no intersections between the horizontal scanning line (25) and each side of the triangle ABC, so the horizontal scanning line (25) is completed, and the addresses of all pixels inside the triangle are obtained.

上記のように本例では水平走査ライン(25)をその三
角形ABCの全面に走査して、その水平走査ライン(2
5)とその三角形ABCの各辺の近似整数座標との交点
を並列処理的に求めるだけでその三角形ABCの内部の
画素のアドレスが得られるので之その三角形の形状又は
置き方に関係なく常に正確に三角形の内部の画素のアド
レスを得ることができる利益がある。
As mentioned above, in this example, the horizontal scanning line (25) is scanned over the entire surface of the triangle ABC, and the horizontal scanning line (25) is scanned over the entire surface of the triangle ABC.
5) and the approximate integer coordinates of each side of the triangle ABC in parallel, the address of the pixel inside the triangle ABC can be obtained, so it is always accurate regardless of the shape or placement of the triangle. has the advantage of being able to obtain the addresses of pixels inside the triangle.

なお、上述の実施例は三角形の内部の画素のアドレスを
発生する回路を示しているが、例えば第1図において、
レジスター(5)〜(7)、Y方向配列回路(10)〜
(12)、直線近似座標発生回路(13)〜(15)を
夫々N個(N =3.4’、 5.・・・・)ずつ設け
ることにより、容易にN角形の内部の画素のアドレ、ス
を発生することができる。
Note that the above embodiment shows a circuit that generates the address of a pixel inside a triangle, but for example, in FIG.
Registers (5) to (7), Y-direction array circuit (10) to
(12) By providing N linear approximation coordinate generating circuits (13) to (15), respectively (N = 3.4', 5...), addresses of pixels inside an N-gon are easily determined. , can generate a problem.

また、水平走査ライン(25)を三角形の全面に走査す
るのではなく、例えば垂直方向に延びる走査ラインをそ
の三角形の全面で水平方向に走査するようにしてもよい
Further, instead of scanning the horizontal scanning line (25) over the entire surface of the triangle, for example, a vertically extending scanning line may be scanned horizontally over the entire surface of the triangle.

このように、本発明は上述実施例に限定されず本発明の
要旨を逸脱しない範囲で種々の構成を採り得ることは勿
論である。
As described above, it goes without saying that the present invention is not limited to the above-described embodiments, and can take various configurations without departing from the gist of the present invention.

[発明の効果] 本発明によれば、多角形の形状及び置き方によらずに共
通の回路構成で且つ単純な処理でその多角形の内部の画
素のアドレスを生成できる利益がある。
[Effects of the Invention] According to the present invention, there is an advantage that addresses of pixels inside a polygon can be generated by a common circuit configuration and simple processing regardless of the shape and placement of the polygon.

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

第1図は本発明の一実施例のブロック図、第2′図は三
角形の各辺に近似される整数座標を示す線図、第3図は
直線に近似される整数座標を発生するときの動作を示す
フローチャート図、第4図は水平走査ライン上の整数座
標の最小値及び最大値を示す線図、第5図は補間動作の
説明に供する線図である。 (5)〜(7)は夫々レジスター、(8)はY方向最小
値判別回路、(9)は水平方向走査回路、(1o)〜(
12)は夫々Y方向配列回路、(13)〜(15)は夫
々直線近似座標発生回路、(16)は最小最大判別回路
、(17)は補間回路、(20)はフレームバッファメ
モリである。 代 理 人 松 隈 秀 盛
Fig. 1 is a block diagram of an embodiment of the present invention, Fig. 2' is a diagram showing integer coordinates approximated to each side of a triangle, and Fig. 3 is a diagram showing integer coordinates approximated to a straight line. FIG. 4 is a flowchart showing the operation, FIG. 4 is a diagram showing the minimum and maximum values of integer coordinates on the horizontal scanning line, and FIG. 5 is a diagram for explaining the interpolation operation. (5) to (7) are registers, (8) is a Y direction minimum value discrimination circuit, (9) is a horizontal direction scanning circuit, (1o) to (
12) are Y-direction array circuits, (13) to (15) are linear approximation coordinate generation circuits, (16) is a minimum/maximum discrimination circuit, (17) is an interpolation circuit, and (20) is a frame buffer memory. Agent Hidemori Matsukuma

Claims (1)

【特許請求の範囲】  多角形の各頂点の座標を保持する保持回路と、上記各
頂点を結ぶ各辺に夫々近似される近似整数座標群を生成
する近似回路と、所定の走査線と上記近似整数座標群と
の交点の整数座標の内の最小座標及び最大座標を求める
最小最大回路と、上記最小座標と最大座標との間の整数
座標を発生する補間回路とを有し、 上記走査線で上記多角形の全面を走査したときに上記補
間回路より順次出力される整数座標を夫々上記多角形の
内部の画素のアドレスとみなすようにしたことを特徴と
する多角形内部のアドレス発生回路。
[Scope of Claims] A holding circuit that holds the coordinates of each vertex of a polygon, an approximation circuit that generates a group of approximate integer coordinates that are respectively approximated to each side connecting each of the vertices, and a predetermined scanning line and the approximation circuit. It has a minimum-maximum circuit that calculates the minimum and maximum coordinates of the integer coordinates of the intersection with the integer coordinate group, and an interpolation circuit that generates the integer coordinates between the minimum coordinate and the maximum coordinate, An address generation circuit inside a polygon, characterized in that integer coordinates successively output from the interpolation circuit when scanning the entire surface of the polygon are respectively regarded as addresses of pixels inside the polygon.
JP2259565A 1990-09-28 1990-09-28 Generating circuit for address in polygon Pending JPH04137188A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2259565A JPH04137188A (en) 1990-09-28 1990-09-28 Generating circuit for address in polygon

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2259565A JPH04137188A (en) 1990-09-28 1990-09-28 Generating circuit for address in polygon

Publications (1)

Publication Number Publication Date
JPH04137188A true JPH04137188A (en) 1992-05-12

Family

ID=17335893

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2259565A Pending JPH04137188A (en) 1990-09-28 1990-09-28 Generating circuit for address in polygon

Country Status (1)

Country Link
JP (1) JPH04137188A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0855225A (en) * 1994-08-10 1996-02-27 Nec Corp Three-dimensional drawing device
JPH0916786A (en) * 1995-06-27 1997-01-17 Nippon Denki Micom Technol Kk Paint-out processing method for winding rules

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0855225A (en) * 1994-08-10 1996-02-27 Nec Corp Three-dimensional drawing device
JPH0916786A (en) * 1995-06-27 1997-01-17 Nippon Denki Micom Technol Kk Paint-out processing method for winding rules

Similar Documents

Publication Publication Date Title
JPS62156961A (en) Method of generating segment
JPS6380375A (en) Texture mapping device
JPH11161819A (en) Image processor, its method and recording medium recording image processing program
JPH04137188A (en) Generating circuit for address in polygon
US6002391A (en) Display control device and a method for controlling display
EP0357076B1 (en) Inclined rectangular pattern generating system
US5903280A (en) Image display apparatus that reduces necessary memory capacity for operation
EP0293698B1 (en) Graphic controller having function of painting designated area
JP2773127B2 (en) Image editing method
JP4320604B2 (en) Image processing method and image processing apparatus
JP2687429B2 (en) Graphic controller
JP2634905B2 (en) How to paint shapes
JPS63111584A (en) Image processor
JP2532596B2 (en) Fluoroscopic image display device
JP2010009271A (en) Image processor
JPS6315288A (en) 3-d graphic display unit
JP3278853B2 (en) Graphic drawing device
JPH0318717B2 (en)
EP0500035A2 (en) Three-dimensional graphic display system
JPH0567215A (en) Picture processor
JPH1186026A (en) Image processor
JPH01244584A (en) Graphic display device
JPH08315178A (en) Image composition device
JPH04100180A (en) Vector generator
JPH02308381A (en) Polygon painting-out system