JP2007286942A - Method for generating drawing data and data processor - Google Patents

Method for generating drawing data and data processor Download PDF

Info

Publication number
JP2007286942A
JP2007286942A JP2006114158A JP2006114158A JP2007286942A JP 2007286942 A JP2007286942 A JP 2007286942A JP 2006114158 A JP2006114158 A JP 2006114158A JP 2006114158 A JP2006114158 A JP 2006114158A JP 2007286942 A JP2007286942 A JP 2007286942A
Authority
JP
Japan
Prior art keywords
coordinate
point
coordinate point
graphic
data
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.)
Withdrawn
Application number
JP2006114158A
Other languages
Japanese (ja)
Inventor
Osamu Nakamura
理 中村
Kazuyoshi Koga
和義 古賀
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.)
Renesas Technology Corp
Original Assignee
Renesas Technology 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 Renesas Technology Corp filed Critical Renesas Technology Corp
Priority to JP2006114158A priority Critical patent/JP2007286942A/en
Publication of JP2007286942A publication Critical patent/JP2007286942A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

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

Abstract

<P>PROBLEM TO BE SOLVED: To provide a method for generating drawing data for drawing a desired figure with a thick line having a predetermined width without generating pixels to be drawn twice, and to provide a data processor. <P>SOLUTION: When drawing data of a circle A having a line thickness n is generated, a drawing coordinate generating program (13A) controls a computing process (S1) for the upper end yA and the lower end yB of the y-coordinates of pixels forming a first circle (21) and processes (S3, S5) for registering x-coordinates of the pixels that locate at the outermost position among the pixels forming the first circle and x-coordinates of the pixels that locate at the innermost position among the pixels forming a second circle (22) into a corresponding horizontal line drawing information buffer (11) for each y-coordinate from the upper end to the lower end. Using two registered x-coordinates as one pair, a pixel drawing program (14A) controls a process (S8) for generating drawing data from the coordinate point data from one coordinate point to the other included in the pair. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は、所望の図形を表示するためにフレームバッファに格納される描画データを生成する方法及びデータプロセッサに関し、例えば指定された線の太さ及び図形のパラメータに基づいて、図形の描画データを生成する描画データ生成方法及びデータプロセッサに適用して有効な技術に関する。   The present invention relates to a method and a data processor for generating drawing data stored in a frame buffer for displaying a desired figure, and for example, drawing data of a figure based on a specified line thickness and figure parameters. The present invention relates to a drawing data generation method to be generated and a technique effective when applied to a data processor.

2次元グラフィックスの描画技術としては、アルファ・ブレンディング、ラスタオペレーション等の混合処理がある。描画とは、所望の図形を構成する複数の画素の座標点、例えばx座標軸とy座標軸で特定される空間上での画素の中心座標を算出し、算出された座標点における画素の属性を示すデータ、例えば特定の色等を示すデータを演算し、画素の座標点に基づいてフレームバッファのアクセスアドレスを生成し、そこに色等のデータを書込む処理とされる。特許文献1には、ビットマップディスプレイ装置に供給する画像情報、例えばフレームバッファにパターン描画を行うときに、パターンの輪郭を線の集合として定義するようなデータ構造を持つアウトラインフォントデータに基づく描画効率を向上させることができる描画システム及び描画方法が開示されている。   Two-dimensional graphics drawing techniques include mixed processing such as alpha blending and raster operations. Drawing refers to the coordinate points of a plurality of pixels constituting a desired figure, for example, the center coordinates of the pixels on the space specified by the x coordinate axis and the y coordinate axis, and the attributes of the pixels at the calculated coordinate points. Data, for example, data indicating a specific color or the like is calculated, an access address of the frame buffer is generated based on the coordinate point of the pixel, and data such as color is written therein. Patent Document 1 discloses image information supplied to a bitmap display device, for example, drawing efficiency based on outline font data having a data structure that defines a pattern outline as a set of lines when drawing a pattern in a frame buffer. A drawing system and a drawing method that can improve the above are disclosed.

特許第2659557号公報Japanese Patent No. 2659557

本発明者は、指定された線の太さ及び図形のパラメータに基づいて、期待する描画結果を得るための図形の描画データを生成する手段について検討した。混合処理では、例えば下地の色を示すデータが格納されたフレームバッファが用意され、図形を構成する画素の座標点における色を示すデータと、この座標点から生成されるアクセスアドレスにおけるフレームバッファの下地の色を示すデータとを画素演算し、演算結果を描画データとして、フレームバッファに書き戻す処理を行う。これは、図形を構成する画素毎に行われる。要するに、全ての画素の描画データがフレームバッファに書き戻されることで、図形全体が描画されることになる。   The present inventor has examined a means for generating graphic drawing data for obtaining an expected drawing result based on the specified line thickness and graphic parameters. In the mixing process, for example, a frame buffer in which data indicating the background color is stored is prepared, the data indicating the color at the coordinate point of the pixel constituting the figure, and the frame buffer background at the access address generated from this coordinate point. The pixel calculation is performed on the data indicating the color of the image, and the calculation result is written back to the frame buffer as the drawing data. This is performed for each pixel constituting the figure. In short, the entire figure is drawn by writing the drawing data of all the pixels back to the frame buffer.

しかしながら、指定された太さの太線を描画するためには、太さの中心に位置する1つの画素の描画データだけでなく、画素が矩形であれば、この1つの画素の四辺に隣接する4つの画素の描画データも生成しなければならない。このため、混合処理によって画素の描画データを生成し、太線で円を描画する場合、2度演算される座標点が発生してしまう。つまり、円周上に順次太線を描画すると、上記隣接する4つの画素のうち少なくとも1つの画素が2度描画されてしまう。即ち、混合処理では、同一の座標点が算出された場合、前回の画素演算の演算結果であるデータ、即ちフレームバッファの本来の下地の色とは異なっているデータを参照して、同一の座標点における色を示すデータとの画素演算を行い、演算結果を描画データとしてフレームバッファに書き戻す。その結果、2度の画素演算により生成された描画データは、1度の画素演算により生成された描画データと色が異なってしまう。要するに、混合処理を行い、指定された太線で図形を描画するとき、期待した描画結果を得ることが困難であった。   However, in order to draw a thick line with a specified thickness, not only the drawing data of one pixel located at the center of the thickness, but if the pixel is a rectangle, 4 adjacent to the four sides of this one pixel. The drawing data for one pixel must also be generated. For this reason, when pixel drawing data is generated by the mixing process and a circle is drawn with a bold line, coordinate points that are calculated twice are generated. That is, when a thick line is sequentially drawn on the circumference, at least one of the four adjacent pixels is drawn twice. That is, in the mixing process, when the same coordinate point is calculated, the same coordinate point is referred to by referring to the data that is the result of the previous pixel calculation, that is, the data different from the original background color of the frame buffer. Pixel calculation is performed with data indicating the color at the point, and the calculation result is written back to the frame buffer as drawing data. As a result, the drawing data generated by the second pixel calculation is different in color from the drawing data generated by the first pixel calculation. In short, when a mixed process is performed and a figure is drawn with a designated thick line, it is difficult to obtain an expected drawing result.

本発明の目的は、2度描画される画素を発生させずに、指定された太線で所望の図形を描画するための描画データを生成することができる描画データ生成方法及びデータプロセッサを提供することにある。   An object of the present invention is to provide a drawing data generation method and a data processor capable of generating drawing data for drawing a desired figure with a designated thick line without generating pixels to be drawn twice. It is in.

本発明の前記並びにその他の目的と新規な特徴は本明細書の記述及び添付図面から明らかになるであろう。   The above and other objects and novel features of the present invention will be apparent from the description of this specification and the accompanying drawings.

本願において開示される発明のうち代表的なものの概要を簡単に説明すれば下記の通りである。   The following is a brief description of an outline of typical inventions disclosed in the present application.

〔1〕本発明に係る描画データ生成方法は、第1座標軸(x)と第2座標軸(y)で特定される空間上において指定された線の太さ(n)及び図形のパラメータに基づいて、前記図形の描画データを生成する。描画データ生成方法は、第1処理(S1)と、第2処理(S3,S5)と、第3処理(S7)と、第4処理(S8)とを含む。第1処理は、前記線の太さに応じた前記図形の外側の輪郭図形(21)と内側の輪郭図形(22)を含む領域の前記第1座標軸上における始点(yA)と終点(yB)を演算する。第2処理は、前記始点から前記終点に向かって、前記第1座標軸上の第1座標点(yi)毎に前記外側の輪郭図形と前記内側の輪郭図形の各々の前記第2座標軸上の第2座標点を演算する。第3処理は、前記第1座標点毎に演算された前記第2座標点のうち、前記外側の輪郭図形では最も外側の外側座標点(x1,x2)と、前記内側の輪郭図形では最も内側の内側座標点(x3,x4)とを選択し、前記外側座標点と前記内側座標点を大きい順又は小さい順に並べ替える。第4処理は、並べ替えられた順で、前記外側座標点と前記内側座標点を1組((x1,x3)、(x4,x2))とし、前記1組に含まれる前記外側座標点から前記内側座標点に至る座標点のデータに基づいて、描画データを生成する。   [1] The drawing data generation method according to the present invention is based on the line thickness (n) and graphic parameters specified in the space specified by the first coordinate axis (x) and the second coordinate axis (y). The drawing data of the figure is generated. The drawing data generation method includes a first process (S1), a second process (S3, S5), a third process (S7), and a fourth process (S8). The first process includes a start point (yA) and an end point (yB) on the first coordinate axis of an area including an outer contour graphic (21) and an inner contour graphic (22) according to the thickness of the line. Is calculated. In the second process, from the start point toward the end point, the outer contour graphic and the inner contour graphic on the second coordinate axis for each first coordinate point (yi) on the first coordinate axis. Two coordinate points are calculated. In the third process, among the second coordinate points calculated for each of the first coordinate points, the outermost outer coordinate point (x1, x2) in the outer contour graphic and the innermost in the inner contour graphic The inner coordinate point (x3, x4) is selected, and the outer coordinate point and the inner coordinate point are rearranged in the descending order. In the fourth process, the outer coordinate point and the inner coordinate point are set as one set ((x1, x3), (x4, x2)) in the rearranged order, and from the outer coordinate point included in the one set Drawing data is generated based on the data of the coordinate point reaching the inner coordinate point.

上記より、第1座標軸上における始点から終点に向かって、第1座標点毎に外側の輪郭図形の外側座標点と内側の輪郭図形の内側座標点を選択するから、図形の輪郭を構成する画素の座標点のデータを第1座標毎に得ることができる。ここで、座標点のデータとは、例えば図形を構成する画素の座標点と、座標点における画素の属性を示すデータ、即ち特定の色等を示すデータとを含む。図形は指定された線の太さで描画されるので、外側の輪郭図形と内側の輪郭図形の間にも画素が存在する。これらの輪郭図形の間に存在する画素の座標点は、第4処理における1組での外側座標点から内側座標点に至る座標点に含まれる。これにより、第4処理では、図形の輪郭及び内部を構成する画素の座標点のデータに基づいて、第1座標点毎に描画データを生成することになる。このため、アルファ・ブレンディング、ラスタオペレーション等の混合処理による画素演算の結果を、描画データとしてフレームバッファに書き戻す場合、共通の第1座標点を有する複数の画素の座標点のデータは、第4処理において、それぞれ1度しか画素演算されない。言い換えると、2度描画される画素は発生しない。そして、第4処理を行う毎に、第1座標点の値を例えば1つだけインクリメントすれば、始点から終点に至る第1座標点の全てに対して第4処理を行い、図形全体の描画データを生成できる。従って、2度描画される画素を発生させずに、指定された太線で所望の図形を描画することが可能な描画データを生成できる。   From the above, since the outer coordinate point of the outer contour graphic and the inner coordinate point of the inner contour graphic are selected for each first coordinate point from the start point to the end point on the first coordinate axis, the pixels constituting the contour of the graphic The coordinate point data can be obtained for each first coordinate. Here, the coordinate point data includes, for example, the coordinate points of the pixels constituting the graphic and the data indicating the attributes of the pixels at the coordinate points, that is, the data indicating the specific color. Since the graphic is drawn with the specified line thickness, there are also pixels between the outer contour graphic and the inner contour graphic. The coordinate points of the pixels existing between these contour figures are included in the coordinate points from the outer coordinate point to the inner coordinate point in one set in the fourth process. Accordingly, in the fourth process, drawing data is generated for each first coordinate point based on the contour of the figure and the coordinate point data of the pixels constituting the inside. For this reason, when the result of pixel calculation by mixing processing such as alpha blending and raster operation is written back to the frame buffer as drawing data, the coordinate point data of a plurality of pixels having a common first coordinate point is the fourth In the processing, each pixel calculation is performed only once. In other words, a pixel drawn twice is not generated. Then, every time the fourth process is performed, if the value of the first coordinate point is incremented by one, for example, the fourth process is performed on all the first coordinate points from the start point to the end point, and the drawing data of the entire figure Can be generated. Therefore, it is possible to generate drawing data that can draw a desired graphic with a designated thick line without generating a pixel to be drawn twice.

本発明の具体的な一つの形態として、前記図形に端点が存在するとき、前記外側の輪郭図形に含まれる第1端点(23a)と、前記内側の輪郭図形に含まれる第2端点(24a)とを結ぶ直線(C)の間の第3座標点(25)を演算する第5処理(S13)をさらに含む。前記第3処理において、前記第2座標点が有する第1座標点と共通の第1座標点(yd)を有する前記第3座標点があるとき、前記第3座標点と前記外側座標点又は前記内側座標点を大きい順又は小さい順に並べ替える。前記第4処理において、前記第3座標点から前記外側座標点又は前記内側座標点に至る座標点のデータに基づいて、描画データを生成する。上記より、端点が存在する図形では、第1端点と第2端点を結ぶ直線の間において、外側座標点と内側座標点からなる1組を得られない場合がある。この場合には、第3座標点を算出することにより、第3座標点と外側座標点又は内側座標点からなる1組を得ることができる。このようにすれば、上記直線の第1座標点についても、座標点のデータに基づいて、描画データを生成することができる。このため、端点の存在する図形を描画するための描画データを生成するとき、2度描画される画素が発生しない。また、端点が存在する図形としては、例えば円の一部である円弧や、双曲線、高次曲線等がある。   As one specific form of the present invention, when an end point exists in the graphic, the first end point (23a) included in the outer contour graphic and the second end point (24a) included in the inner contour graphic. 5th process (S13) which calculates the 3rd coordinate point (25) between the straight lines (C) which connect with (C) is further included. In the third process, when there is the third coordinate point having the first coordinate point (yd) common to the first coordinate point of the second coordinate point, the third coordinate point and the outer coordinate point or the The inner coordinate points are rearranged in descending order. In the fourth process, drawing data is generated based on data of coordinate points from the third coordinate point to the outer coordinate point or the inner coordinate point. From the above, in a figure with end points, there may be a case where one set of outer coordinate points and inner coordinate points cannot be obtained between straight lines connecting the first end point and the second end point. In this case, a set of the third coordinate point and the outer coordinate point or the inner coordinate point can be obtained by calculating the third coordinate point. In this way, drawing data can also be generated for the first coordinate point of the straight line based on the coordinate point data. For this reason, when drawing data for drawing a figure having an end point is generated, a pixel to be drawn twice is not generated. In addition, examples of the figure having end points include an arc that is a part of a circle, a hyperbola, and a higher-order curve.

本発明の具体的な一つの形態として、前記図形が円(A)であるとき、前記図形のパラメータは、中心点(O)と半径(r)である。前記外側の輪郭図形は、前記中心点を中心とし、前記半径よりも大きい第1の半径を有する第1の円(21)とされる。前記内側の輪郭図形は、前記中心点を中心とし、前記半径よりも小さく、前記第1の半径との差が前記太さとなる第2の半径を有する第2の円(22)とされる。上記より、第1座標軸上の始点は、例えば円の上端となり、終点は円の下端となる。円の上端及び下端付近の第1座標点では、第2の円の第2座標点が存在しない場合がある。この場合には、第1の円の一方の外側座標点から他方の外側座標点に至る座標点のデータに基づいて、第1座標点における描画データを生成することになる。また、円の上端及び下端付近以外の第1座標点では、2つの同心円上での外側座標点から内側座標点に至る座標点のデータに基づいて、第1座標点における描画データを生成することになる。これにより、2度描画される画素を発生させずに、指定された太線で円を描画するための描画データを生成できる。また、円とは、画素で描画されるので、数学上の真円とは異なる。しかし、例えば円を構成する画素のサイズが小さく、かつ画素の数が十分に多ければ、例えば液晶ビットマップディスプレイ上では円として認識可能とされる。   As a specific form of the present invention, when the graphic is a circle (A), the parameters of the graphic are a center point (O) and a radius (r). The outer contour graphic is a first circle (21) centered on the center point and having a first radius larger than the radius. The inner contour graphic is a second circle (22) having a second radius that is centered on the center point, smaller than the radius, and whose difference from the first radius is the thickness. From the above, the start point on the first coordinate axis is, for example, the upper end of a circle, and the end point is the lower end of the circle. At the first coordinate points near the upper end and the lower end of the circle, the second coordinate point of the second circle may not exist. In this case, drawing data at the first coordinate point is generated based on the data of the coordinate point from one outer coordinate point of the first circle to the other outer coordinate point. In addition, at the first coordinate point other than the vicinity of the upper end and the lower end of the circle, drawing data at the first coordinate point is generated based on the data of the coordinate point from the outer coordinate point to the inner coordinate point on the two concentric circles. become. Thereby, it is possible to generate drawing data for drawing a circle with a designated thick line without generating a pixel to be drawn twice. Also, since a circle is drawn with pixels, it is different from a mathematically true circle. However, for example, if the size of the pixels constituting the circle is small and the number of pixels is sufficiently large, it can be recognized as a circle on a liquid crystal bitmap display, for example.

本発明の具体的な一つの形態として、前記半径をr、前記太さをnとしたとき、nが奇数であれば、前記第1の半径は、r+n/2で示される値の整数部分であり、前記第2の半径は、r−n/2で示される値の整数部分である。nが偶数であれば、前記第1の半径は、r+n/2−1で示される値であり、前記第2の半径は、r−n/2で示される値である。上記より、画素の集合体である円を描画するためには、半径、太さ共に整数である必要がある。このため、第1の半径と第2の半径を、上記の式で得られる値とし、第1の円の外側座標点から第2の円の内側座標点に至る座標点のデータに基づいて、半径r、太さnの円を描画するための描画データを生成できる。   As one specific form of the present invention, when the radius is r and the thickness is n, if n is an odd number, the first radius is an integer part of a value represented by r + n / 2. And the second radius is an integer part of a value represented by rn / 2. If n is an even number, the first radius is a value indicated by r + n / 2-1 and the second radius is a value indicated by rn / 2. From the above, in order to draw a circle which is a collection of pixels, both the radius and the thickness need to be integers. For this reason, the first radius and the second radius are values obtained by the above formula, and based on the coordinate point data from the outer coordinate point of the first circle to the inner coordinate point of the second circle, Drawing data for drawing a circle having a radius r and a thickness n can be generated.

〔2〕本発明に係るデータプロセッサは、中央処理装置(2)と、前記中央処理装置が実行するプログラムを格納するプログラムメモリ(10)と、を有する。前記プログラムメモリは、第1座標軸と第2座標軸で特定される空間上において指定された線の太さ及び図形のパラメータに基づいて、前記図形の描画データを生成する描画データ生成プログラム(13A,14A)を有する。前記描画データ生成プログラムは、第1処理と、第2処理と、第3処理と、第4処理とを制御する。第1処理は、前記線の太さに応じた前記図形の外側の輪郭図形と内側の輪郭図形を含む領域の前記第1座標軸上における始点と終点を演算する。第2処理は、前記始点から前記終点に向かって、前記第1座標軸上の第1座標点毎に前記外側の輪郭図形と前記内側の輪郭図形の各々の前記第2座標軸上の第2座標点を演算する。第3処理は、前記第1座標点毎に演算された前記第2座標点のうち、前記外側の輪郭図形では最も外側の外側座標点と、前記内側の輪郭図形では最も内側の内側座標点とを選択し、前記外側座標点と前記内側座標点を大きい順又は小さい順に並べ替える。第4処理は、並べ替えられた順で、前記外側座標点と前記内側座標点を1組とし、前記1組に含まれる前記外側座標点から前記内側座標点に至る座標点のデータに基づいて、描画データを生成する。   [2] A data processor according to the present invention includes a central processing unit (2) and a program memory (10) for storing a program executed by the central processing unit. The program memory generates a drawing data generation program (13A, 14A) for generating drawing data of the graphic based on the line thickness and graphic parameters specified in the space specified by the first coordinate axis and the second coordinate axis. ). The drawing data generation program controls a first process, a second process, a third process, and a fourth process. The first process calculates a start point and an end point on the first coordinate axis of an area including an outer contour graphic and an inner contour graphic according to the thickness of the line. The second process includes a second coordinate point on the second coordinate axis of each of the outer contour graphic and the inner contour graphic for each first coordinate point on the first coordinate axis from the start point to the end point. Is calculated. The third process includes, among the second coordinate points calculated for each first coordinate point, the outermost outer coordinate point in the outer contour graphic, and the innermost inner coordinate point in the inner contour graphic. Then, the outer coordinate point and the inner coordinate point are rearranged in the descending order. The fourth process is based on the coordinate point data from the outer coordinate point to the inner coordinate point included in the first set, with the outer coordinate point and the inner coordinate point as one set in the rearranged order. Generate drawing data.

上記より、中央処理装置は、上記〔1〕の描画データ生成プログラムを実行することができる。その結果、指定された太線で所望の図形を描画するときに、2度描画する画素を発生させないから、液晶ビットマップディスプレイ等に期待した描画結果を表示できる。   As described above, the central processing unit can execute the drawing data generation program [1]. As a result, when a desired figure is drawn with the designated thick line, a pixel to be drawn twice is not generated, so that an expected drawing result can be displayed on a liquid crystal bitmap display or the like.

図2には、本発明の実施形態に係るデータプロセッサの一例が示される。データプロセッサ1は、中央処理装置(CPU)2と、液晶ディスプレイ用インタフェース回路3(LCDIF)と、データバス・アドレスバス等のバス制御を行うバスステートコントローラ(BSC)4とを有し、それぞれデータバス・アドレスバスからなる内部バス(IBUS)5を介して接続されている。データプロセッサ1は、液晶ディスプレイ用インタフェース回路3を介して、外部バス(EXBUS)6を経由して液晶ディスプレイ7に接続されている。また、データプロセッサ1は、バスステートコントローラ4を介して、外部メモリバス(EXMBUS)8を経由して外部メモリ9に接続されている。外部メモリ9は、例えばプログラム格納部10、水平ライン描画情報バッファ11及びフレームバッファ12を備えている。   FIG. 2 shows an example of a data processor according to the embodiment of the present invention. The data processor 1 includes a central processing unit (CPU) 2, a liquid crystal display interface circuit 3 (LCDIF), and a bus state controller (BSC) 4 that performs bus control such as a data bus / address bus. They are connected via an internal bus (IBUS) 5 comprising a bus / address bus. The data processor 1 is connected to a liquid crystal display 7 via an external bus (EXBUS) 6 via a liquid crystal display interface circuit 3. The data processor 1 is connected to the external memory 9 via the bus state controller 4 and the external memory bus (EXMBUS) 8. The external memory 9 includes, for example, a program storage unit 10, a horizontal line drawing information buffer 11, and a frame buffer 12.

プログラム格納部10には、CPU2が実行する各種プログラムが格納され、ここでは一例として、描画座標生成プログラム13Aと、画素描画プログラム14Aとが示される。水平ライン描画情報バッファ11は、詳細は後述するが、描画座標生成プログラム13A及び画素描画プログラム14Aを実行するときに用いられるバッファであって、図3に例示されるように、登録点数格納部15と、座標データ格納部16〜19とを有する。   Various programs to be executed by the CPU 2 are stored in the program storage unit 10. Here, as an example, a drawing coordinate generation program 13A and a pixel drawing program 14A are shown. Although the details will be described later, the horizontal line drawing information buffer 11 is a buffer used when the drawing coordinate generation program 13A and the pixel drawing program 14A are executed, and as illustrated in FIG. And coordinate data storage units 16 to 19.

CPU2は、不図示の入力装置により指定された線の太さや図形のパラメータに基づいて、描画座標生成プログラム13A及び画素描画プログラム14Aを実行することで、例えば下地の色を示すデータが格納されたフレームバッファ12を用いて混合処理を行い、この図形の描画データを生成する。描画データは、図形を構成する複数の画素の座標点における色等を示すデータと、この座標点から生成されるアクセスアドレスにおけるフレームバッファ12の下地の色を示すデータとを画素演算することで生成される。また、説明の便宜上、図形を構成する全ての画素の座標点における色を示すデータは、例えば赤色とする。これにより、画素の座標点における色を示すデータは、専用のフレームバッファではなく、適宜のレジスタに保持させることができる。画素の座標点は、例えばx座標軸とy座標軸で特定される空間上での画素の中心座標とされる。描画データを生成するための画素演算は、例えばラスタオペレーションによる論理演算やアルファ・ブレンディングによる混合比を用いた色演算等があり、画素毎に行われる。そして、生成された描画データは、フレームバッファ12のアクセスアドレスに書き戻される。CPU2は、フレームバッファ12に書き戻された描画データを、液晶ディスプレイ用インタフェース回路3、外部バス6を経由して、図示を省略する表示コントローラに出力する。液晶ディスプレイ7は、表示コントローラによる表示タイミングに基づいて図形を表示する。   The CPU 2 executes, for example, the drawing coordinate generation program 13A and the pixel drawing program 14A based on the line thickness and graphic parameters specified by the input device (not shown), thereby storing data indicating the background color, for example. A mixing process is performed using the frame buffer 12 to generate drawing data for this figure. The drawing data is generated by pixel calculation of data indicating the color at the coordinate points of a plurality of pixels constituting the figure and data indicating the background color of the frame buffer 12 at the access address generated from the coordinate points. Is done. For convenience of explanation, the data indicating the color at the coordinate points of all the pixels constituting the figure is, for example, red. Thereby, the data indicating the color at the coordinate point of the pixel can be held in an appropriate register instead of the dedicated frame buffer. The coordinate point of the pixel is, for example, the center coordinate of the pixel on the space specified by the x coordinate axis and the y coordinate axis. The pixel calculation for generating the drawing data includes, for example, a logical calculation by a raster operation and a color calculation using a mixing ratio by alpha blending, and is performed for each pixel. The generated drawing data is written back to the access address of the frame buffer 12. The CPU 2 outputs the drawing data written back to the frame buffer 12 to a display controller (not shown) via the liquid crystal display interface circuit 3 and the external bus 6. The liquid crystal display 7 displays a figure based on the display timing by the display controller.

図1には、本発明の実施形態1に係る描画データ生成方法を示すフローチャートが例示される。実施形態1に係る描画データ生成方法は、例えば描画座標生成プログラム13A及び画素描画プログラム14Aが制御する各処理を含む。ここでは、所望の図形の一例として、太さn、中心点O、半径rの円Aの描画データを生成する場合を示している。この円Aは、画素の集合体であるので、いわゆる真円ではない。しかし、画素のサイズが小さく、かつ、液晶ディスプレイ7の解像度が大きければ、円として認識可能とされる。また、画素の形状は正方形とする。描画座標生成プログラム13Aは、ステップS1〜S7、S9、S10を制御する。また、画素描画プログラム14Aは、ステップS8を制御する。   FIG. 1 illustrates a flowchart illustrating a drawing data generation method according to the first embodiment of the present invention. The drawing data generation method according to the first embodiment includes, for example, each process controlled by the drawing coordinate generation program 13A and the pixel drawing program 14A. Here, as an example of a desired figure, a case where drawing data of a circle A having a thickness n, a center point O, and a radius r is generated is shown. Since this circle A is an aggregate of pixels, it is not a so-called true circle. However, if the pixel size is small and the resolution of the liquid crystal display 7 is large, it can be recognized as a circle. The pixel shape is a square. The drawing coordinate generation program 13A controls steps S1 to S7, S9, and S10. Further, the pixel drawing program 14A controls Step S8.

まず、CPU2は、適宜の入力装置によって、図4に例示されるx座標軸とy座標軸で特定される空間上において指定された線の太さnと、図形のパラメータとして指定された、中心点O、半径rに基づいて、第1の円21を構成するy座標の上端yAと下端yBを算出する(S1)。第1の円21は、外側の輪郭図形であって、中心点Oを中心とし、半径rよりも大きい第1の半径を有する。第1の半径は、nが奇数であれば、「r+n/2」で示される値の整数部分であり、nが偶数であれば、「r+n/2−1」で示される値である。ここでは、円Aの半径rは、中心点Oから点Pまでの距離とされる。また、太さnは、点Pを含む画素と、この画素と共通のy座標を有する隣接する画素とからなる。つまり、円Aの太さnは、3つの画素からなるので、画素の一辺を「1」とすれば、「3」となる。この上端yAと下端yBの値は、中心点Oの座標を(xO,yO)とすれば、それぞれ第1の円21の半径だけyOから減算又は加算した値となる。要するに、円Aに含まれる画素のy座標をyiとすると、yA≦yi≦yBとされる。そして、yAを適宜のレジスタにyiの初期値として保持させ、同じく、yBをyiの上限値として保持させる。   First, the CPU 2 uses an appropriate input device to specify the line thickness n specified on the space specified by the x coordinate axis and the y coordinate axis illustrated in FIG. 4 and the center point O specified as a graphic parameter. Based on the radius r, the upper end yA and the lower end yB of the y coordinate constituting the first circle 21 are calculated (S1). The first circle 21 is an outer contour graphic, and has a first radius centered on the center point O and larger than the radius r. The first radius is an integer part of a value represented by “r + n / 2” if n is an odd number, and a value represented by “r + n / 2−1” if n is an even number. Here, the radius r of the circle A is the distance from the center point O to the point P. The thickness n is composed of a pixel including the point P and an adjacent pixel having a common y coordinate with the pixel. That is, since the thickness n of the circle A is composed of three pixels, if one side of the pixel is “1”, it is “3”. The values of the upper end yA and the lower end yB are values obtained by subtracting or adding from the yO by the radius of the first circle 21 when the coordinates of the center point O are (xO, yO). In short, if yi of the pixels included in the circle A is yi, yA ≦ yi ≦ yB. Then, yA is held in an appropriate register as an initial value of yi, and similarly yB is held as an upper limit value of yi.

次に、CPU2は、水平ライン描画情報バッファ11を、上端yAから下端yBの各水平ライン、即ちx座標軸に平行なラインに対応する分だけ確保する(S2)。ここで、確保される水平ライン描画情報バッファ11の数は、「yB−yA+1」となる。そして、CPU2は、yiでの第1の円21を構成する画素のうち、最も外側に位置する画素のx座標を、水平ライン描画情報バッファ11に登録する(S3)。このとき、第1の円21を構成する画素の座標は、円描画アルゴリズムとして知られているミッチェナーアルゴリズムを用いて算出される。ミッチェナーアルゴリズムでは、x座標が中心点Oと共通であり上端yAを含む画素を始点とし、次に描画する画素として、中心点Oからの角度が45〜90度に位置する画素のうち数学上の真円に近い画素を特定する演算を行う。そして、0〜45度、90〜360度での画素は、円Aの対称性を用いることで演算可能とされる。要するに、ステップS3では、yiの初期値であるyAをレジスタから読み出し、図4に示すように、yAにおいてx座標x3〜x4の間に含まれる5つの画素をミッチェナーアルゴリズムで算出することになるが、そのうち最も外側に位置する画素のx座標は、中心点Oのx座標からの距離が最も大きいx3、x4となる。このため、CPU2は、yAに対応する水平ライン描画情報バッファ11の座標データ格納部16,17に、それぞれx3、x4を登録する。   Next, the CPU 2 secures the horizontal line drawing information buffer 11 by an amount corresponding to each horizontal line from the upper end yA to the lower end yB, that is, a line parallel to the x coordinate axis (S2). Here, the number of horizontal line drawing information buffers 11 to be secured is “yB−yA + 1”. Then, the CPU 2 registers the x coordinate of the outermost pixel among the pixels constituting the first circle 21 in yi in the horizontal line drawing information buffer 11 (S3). At this time, the coordinates of the pixels constituting the first circle 21 are calculated using a Mitchener algorithm known as a circle drawing algorithm. In the Mitchener algorithm, the x-coordinate is the same as that of the center point O, the pixel including the upper end yA is set as the start point, and the next pixel to be drawn is calculated mathematically among the pixels whose angles from the center point O are 45 to 90 degrees. An operation for specifying a pixel close to a perfect circle is performed. The pixels at 0 to 45 degrees and 90 to 360 degrees can be calculated by using the symmetry of the circle A. In short, in step S3, yA, which is the initial value of yi, is read from the register, and as shown in FIG. 4, five pixels included in xA between x coordinates x3 to x4 are calculated by the Mitchener algorithm. The x coordinate of the pixel located on the outermost side is x3 and x4 having the largest distance from the x coordinate of the center point O. Therefore, the CPU 2 registers x3 and x4 in the coordinate data storage units 16 and 17 of the horizontal line drawing information buffer 11 corresponding to yA, respectively.

次に、CPU2は、yAに対応する水平ライン描画情報バッファ11の登録点数格納部15に、ステップS3で登録されたx座標の数を登録する(S4)。ここでは、ステップS3でx3、x4が登録されているから、登録点数には「2」が登録される。そして、CPU2は、中心点O、半径rに基づいて、yiでの第2の円22を構成する画素のうち、最も内側に位置する画素のx座標、即ち中心点Oのx座標からの距離が最も小さいx座標を、水平ライン描画情報バッファ11に登録する(S5)。第2の円22は、内側の輪郭図形であって、中心点Oを中心とし、半径rよりも小さい第2の半径を有する。第2の半径は、nが奇数であれば、「r−n/2」で示される値の整数部分であり、nが偶数であれば、「r−n/2」で示される値である。yiでの第2の円22を構成する画素の座標は、上記ミッチェナーアルゴリズムで演算可能である。ステップS5では、まず、yAを初期値とするが、図4に示すように、yAには第2の円22を構成する画素が存在しない。   Next, the CPU 2 registers the number of x-coordinates registered in step S3 in the registration point storage unit 15 of the horizontal line drawing information buffer 11 corresponding to yA (S4). Here, since x3 and x4 are registered in step S3, “2” is registered as the registration score. Then, the CPU 2 determines, based on the center point O and the radius r, the x coordinate of the innermost pixel among the pixels constituting the second circle 22 at yi, that is, the distance from the x coordinate of the center point O. Is registered in the horizontal line drawing information buffer 11 (S5). The second circle 22 is an inner contour graphic and has a second radius smaller than the radius r centered on the center point O. The second radius is the integer part of the value indicated by “rn−2 / 2” if n is an odd number, and the value indicated by “rn−2” if n is an even number. . The coordinates of the pixels constituting the second circle 22 in yi can be calculated by the above-mentioned Mitchener algorithm. In step S5, first, yA is set as an initial value. However, as shown in FIG. 4, there is no pixel constituting the second circle 22 in yA.

次に、CPU2は、yAに対応する水平ライン描画情報バッファ11の登録点数格納部15に、ステップS5で登録されたx座標の数を登録する(S6)。しかし、yAにおけるステップS5では、x座標が登録されていないから、登録点数は「2」のままである。そして、CPU2は、yAに対応する水平ライン描画情報バッファ11に登録されたx座標を昇順に並べ替える(S7)。これは、yiでの水平ライン描画情報バッファ11の例えば座標データ格納部16〜19には、x座標がステップS3,S6での登録順で登録されるからである。   Next, the CPU 2 registers the number of x-coordinates registered in step S5 in the registration point storage unit 15 of the horizontal line drawing information buffer 11 corresponding to yA (S6). However, in step S5 in yA, since the x coordinate is not registered, the number of registered points remains “2”. Then, the CPU 2 rearranges the x coordinates registered in the horizontal line drawing information buffer 11 corresponding to yA in ascending order (S7). This is because the x coordinate is registered in the order of registration in steps S3 and S6, for example, in the coordinate data storage units 16 to 19 of the horizontal line drawing information buffer 11 at yi.

そして、CPU2は、画素描画プログラム14Aを実行し、ステップS7で並べ替えられたx座標を、2つずつ参照して1組とし、この1組に含まれる一方のx座標から他方のx座標に至る座標点のデータに基づいて、この座標点毎に混合処理を行いながら、描画データを生成し、水平ラインを描画する(S8)。ここで、座標点のデータとは、例えば画素の中心座標とされる座標点だけでなく、座標点における画素の属性を示すデータ、即ち特定の色等を示すデータをも含む。ステップS8では、y座標がyAである場合、x3からx4に至る座標点、即ちyAにおける円Aの輪郭及び内部を構成する画素の座標点毎の描画データが生成されることになる。このとき、混合処理による画素演算の結果を、描画データとしてフレームバッファ12に書き戻す処理を行うが、yAを有するx3からx4に至る複数の画素の座標点における色を示すデータは、それぞれ1度しか画素演算されない。要するに、yAにおける水平ラインを描画するときに、2度描画される画素は発生しない。   Then, the CPU 2 executes the pixel drawing program 14A, refers to the x coordinates rearranged in step S7 two by one, and makes one set from one x coordinate included in the one set to the other x coordinate. Based on the data of the coordinate points that arrive, drawing data is generated while performing a mixing process for each coordinate point, and a horizontal line is drawn (S8). Here, the data of the coordinate point includes not only the coordinate point which is the center coordinate of the pixel, for example, but also data indicating the attribute of the pixel at the coordinate point, that is, data indicating a specific color or the like. In step S8, when the y coordinate is yA, drawing data is generated for each coordinate point from x3 to x4, that is, the contour of the circle A in yA and the coordinate points of the pixels constituting the inside. At this time, the result of pixel calculation by the mixing process is written back to the frame buffer 12 as drawing data. The data indicating the colors at the coordinate points of a plurality of pixels from x3 to x4 having yA is once each. Only pixel calculation is performed. In short, when drawing a horizontal line in yA, a pixel drawn twice is not generated.

ここで、y座標がyCである場合について説明する。yCでは、ステップS3でyCに対応する水平ライン描画情報バッファ11の座標データ格納部16,17に登録されるx座標は、図4に示すように、第1の円21の最も外側に位置するx1,x2となる。そして、ステップS4では、登録点数格納部15に「2」が加算される。ステップS5では、第2の円22の最も内側に位置するx3,x4が、座標データ格納部18,19に登録される。これにより、ステップS6で登録点数格納部15に「2」が加算されることで、登録点数は「4」となる。そして、ステップS7により、yCに対応する水平ライン描画情報バッファ11には、座標データ格納部16〜19に、昇順にx1,x3,x4,x2が格納される。ステップS8では、並べられた順で、x1,x3を1組、x4,x2を1組とし、それぞれx1からx3に至る座標点のデータと、x4からx2に至る座標点のデータとに基づいて、この座標点毎に混合処理を行いながら、描画データを生成し、水平ラインを描画する。このとき、yCを有するx1からx3、そしてx4からx2に至る複数の画素の座標点における色を示すデータは、それぞれ1度しか画素演算されない。   Here, a case where the y coordinate is yC will be described. In yC, the x-coordinate registered in the coordinate data storage units 16 and 17 of the horizontal line drawing information buffer 11 corresponding to yC in step S3 is located on the outermost side of the first circle 21 as shown in FIG. x1 and x2. In step S 4, “2” is added to the registered score storage unit 15. In step S <b> 5, x3 and x4 located on the innermost side of the second circle 22 are registered in the coordinate data storage units 18 and 19. Accordingly, “2” is added to the registration score storage unit 15 in step S6, so that the registration score becomes “4”. In step S7, x1, x3, x4, and x2 are stored in ascending order in the coordinate data storage units 16 to 19 in the horizontal line drawing information buffer 11 corresponding to yC. In step S8, x1 and x3 are one set and x4 and x2 are one set in the order in which they are arranged. Based on the coordinate point data from x1 to x3 and the coordinate point data from x4 to x2, respectively. While performing the mixing process for each coordinate point, drawing data is generated and a horizontal line is drawn. At this time, data indicating colors at coordinate points of a plurality of pixels from x1 to x3 and from x4 to x2 having yC is subjected to pixel calculation only once.

次に、CPU2は、yiを1つインクリメントして(S9)、yiが上限値である下端yBであるか否かを判定する(S10)。ステップS10において、yiがyBでなければ、再びステップS3に戻って、上記ステップS10までの処理を繰り返す。要するに、始点から終点に至るyiの全てに対してステップS8での水平ラインの描画を行うから、2度描画される画素を発生させずに、指定された太さn、半径rの円Aを描画することが可能な描画データを生成できる。従って、円Aを構成する全ての画素は、1度しか描画されないので、画素の座標点における色のデータが上記したように赤色であり、例えばフレームバッファ12の下地の色が青色であれば、画素演算により生成された描画データが示す色は、全て紫色となる。これにより、CPU2は、描画座標生成プログラム13A及び画素描画プログラム14Aを実行することにより、液晶ディスプレイ7に期待する描画結果を表示させることができる。   Next, the CPU 2 increments yi by 1 (S9) and determines whether yi is the lower end yB which is the upper limit value (S10). In step S10, if yi is not yB, the process returns to step S3 again, and the processing up to step S10 is repeated. In short, since the horizontal line is drawn in step S8 for all yi from the start point to the end point, the circle A having the specified thickness n and radius r is created without generating pixels to be drawn twice. Drawing data that can be drawn can be generated. Accordingly, since all the pixels constituting the circle A are drawn only once, the color data at the pixel coordinate points is red as described above. For example, if the background color of the frame buffer 12 is blue, All the colors indicated by the drawing data generated by the pixel calculation are purple. Thus, the CPU 2 can display the expected drawing result on the liquid crystal display 7 by executing the drawing coordinate generation program 13A and the pixel drawing program 14A.

図5には、本発明の実施形態2に係る描画データ生成方法を示すフローチャートが例示される。実施形態2に係る描画データ生成方法は、例えば描画座標生成プログラム13B及び画素描画プログラム14Bが制御する各処理を含む。ここでは、所望の図形の一例として、太さn、半径rの円の一部である円弧Bの描画データを生成する場合を示している。この円弧Bは、円の一部であるので端点を有する。円弧Bは、外側の輪郭図形とされ、端点23a,23bを有する第1の円弧23を構成する画素と、内側の輪郭図形とされ、端点24a,24bを有する第2の円弧24を構成する画素と、第1の円弧23と第2の円弧24の間に存在する画素とからなる。例えば、実施形態1における描画座標生成プログラム13A及び画素描画プログラム14AをCPU2が実行して、y座標のyi毎に、yiを有する円弧Bを構成する画素に基づいて、水平ラインを描画しようとしても、水平ライン描画情報バッファ11にx座標が1つだけしか登録されない場合がある。   FIG. 5 illustrates a flowchart illustrating a drawing data generation method according to the second embodiment of the present invention. The drawing data generation method according to the second embodiment includes, for example, each process controlled by the drawing coordinate generation program 13B and the pixel drawing program 14B. Here, as an example of a desired figure, a case where drawing data of an arc B that is a part of a circle having a thickness n and a radius r is generated is shown. Since this arc B is a part of a circle, it has end points. The arc B is an outer contour graphic, a pixel constituting the first arc 23 having the end points 23a, 23b, and a pixel constituting the inner contour graphic, the second arc 24 having the end points 24a, 24b. And pixels existing between the first arc 23 and the second arc 24. For example, even if the CPU 2 executes the drawing coordinate generation program 13A and the pixel drawing program 14A according to the first embodiment and tries to draw a horizontal line based on the pixels constituting the arc B having yi for each y coordinate yi. In some cases, only one x coordinate is registered in the horizontal line drawing information buffer 11.

即ち、図6に例示される第1の円弧23の端点23aと第2の円弧24の端点24aとを結ぶ直線Cに含まれ、y座標がydである画素25は、第1の円弧23を構成する画素でもなく、第2の円弧24を構成する画素でもない。しかし、この画素25は、円弧Bを構成する画素である。ここで、描画座標生成プログラム13AをCPU2が実行した場合、ydに対応する水平ライン描画情報バッファ11には、第1の円弧23の最も外側に位置する画素の座標点が1つしか登録されない。従って、ydにおいては上記したステップS8の処理を実行できないことになる。このため、実施形態1の描画データ生成方法では、円弧Bの描画データを完全には生成できない。   That is, the pixel 25 included in the straight line C connecting the end point 23a of the first arc 23 and the end point 24a of the second arc 24 illustrated in FIG. It is neither a pixel constituting the pixel nor a pixel constituting the second arc 24. However, the pixel 25 is a pixel constituting the arc B. Here, when the CPU 2 executes the drawing coordinate generation program 13A, only one coordinate point of the pixel located on the outermost side of the first arc 23 is registered in the horizontal line drawing information buffer 11 corresponding to yd. Therefore, the process of step S8 cannot be executed in yd. For this reason, the drawing data generation method of the first embodiment cannot completely generate the drawing data of the arc B.

これに対して、描画座標生成プログラム13Bでは、上記直線Cに含まれる全ての画素のx座標をyi毎に算出して、このx座標を対応する水平ライン描画情報バッファ11に登録する処理、即ち後述のステップS13の処理を含む。この処理によって、ydに対応する水平ライン描画情報バッファ11には、画素25と第1の円弧23の最も外側に位置する画素からなる1組とが登録される。このため、CPU2は、画素描画プログラム14Bが制御する後述のステップS20の処理を実行できる。以下、具体的に説明する。   On the other hand, the drawing coordinate generation program 13B calculates the x coordinate of all the pixels included in the straight line C for each yi, and registers this x coordinate in the corresponding horizontal line drawing information buffer 11, that is, This includes the process of step S13 described later. As a result of this processing, the horizontal line drawing information buffer 11 corresponding to yd registers a pixel 25 and a set of pixels located on the outermost side of the first arc 23. For this reason, the CPU 2 can execute processing of step S20 described later controlled by the pixel drawing program 14B. This will be specifically described below.

まず、CPU2は、図6に例示されるx座標軸とy座標軸で特定される空間上において指定された線の太さnと、図形のパラメータとして指定された、図示を省略する中心点、半径r、中心角α等に基づいて、第1の円弧23を構成するy座標の上端yaと下端ybを算出する(S11)。第1の円弧23は、上記した第1の円21と比べて、中心角αが例えば90度であって、端点23a,23bを有する点が異なるが、その半径は上記第1の半径の値と同様である。次に、CPU2は、水平ライン描画情報バッファ11を、上端yaから下端ybの各水平ラインに対応する分だけ確保する(S12)。   First, the CPU 2 sets the line thickness n specified in the space specified by the x coordinate axis and the y coordinate axis exemplified in FIG. 6 and the center point, radius r, specified as a graphic parameter, not shown. Based on the central angle α and the like, the upper end ya and the lower end yb of the y-coordinate constituting the first arc 23 are calculated (S11). The first arc 23 is different from the first circle 21 described above in that the central angle α is, for example, 90 degrees and has end points 23a and 23b, but the radius is the value of the first radius. It is the same. Next, the CPU 2 secures the horizontal line drawing information buffer 11 corresponding to each horizontal line from the upper end ya to the lower end yb (S12).

そして、CPU2は、上記したように、第1の円弧23の端点23a,23bと、第2の円弧24の端点24a,24bとを結ぶ直線C,Dを構成する画素のx座標を算出し、水平ライン描画情報バッファ11に登録する(S13)。即ち、ステップS13では、直線Cについては、ya,yd,yeに対応する水平ライン描画情報バッファ11の座標データ格納部16に、端点23aを含む画素、上記画素25、端点24aを含む画素のそれぞれのx座標が登録される。また、直線Dについては、ybに対応する水平ライン描画情報バッファ11の座標データ格納部16,17,18に、端点23bを含む画素、画素26、端点24bを含む画素のそれぞれのx座標が登録される。   Then, as described above, the CPU 2 calculates the x coordinate of the pixels constituting the straight lines C and D connecting the end points 23a and 23b of the first arc 23 and the end points 24a and 24b of the second arc 24, It is registered in the horizontal line drawing information buffer 11 (S13). That is, in step S13, for the straight line C, each of the pixel including the end point 23a, the pixel 25, and the pixel including the end point 24a is stored in the coordinate data storage unit 16 of the horizontal line drawing information buffer 11 corresponding to ya, yd, and ye. The x coordinate of is registered. For the straight line D, the x-coordinates of the pixel including the end point 23b, the pixel 26, and the pixel including the end point 24b are registered in the coordinate data storage units 16, 17, and 18 of the horizontal line drawing information buffer 11 corresponding to yb. Is done.

次に、CPU2は、対応する水平ライン描画情報バッファ11の登録点数格納部15に、登録したx座標の数を登録する(S14)。ここでは、ya,yd,yeに対応する水平ライン描画情報バッファ11の登録点数格納部15に、それぞれ「1」が登録される。さらに、ybに対応する水平ライン描画情報バッファ11の登録点数格納部15に、「3」が登録される。そして、CPU2は、yiでの第1の円弧23を構成する画素のうち、最も外側に位置する画素のx座標を、水平ライン描画情報バッファ11に登録し(S15)、その登録数を登録点数格納部15に登録する(S16)。例えばy座標がycであれば、ycに対応する水平ライン描画情報バッファ11の座標データ格納部16にx4が格納され、登録点数格納部15に「1」が登録される。   Next, the CPU 2 registers the number of registered x coordinates in the registered score storage unit 15 of the corresponding horizontal line drawing information buffer 11 (S14). Here, “1” is registered in the registration point storage unit 15 of the horizontal line drawing information buffer 11 corresponding to ya, yd, and ye, respectively. Furthermore, “3” is registered in the registration point storage unit 15 of the horizontal line drawing information buffer 11 corresponding to yb. Then, the CPU 2 registers the x-coordinate of the outermost pixel among the pixels constituting the first arc 23 in yi in the horizontal line drawing information buffer 11 (S15), and registers the registered number as the registration score. Register in the storage unit 15 (S16). For example, if the y coordinate is yc, x4 is stored in the coordinate data storage unit 16 of the horizontal line drawing information buffer 11 corresponding to yc, and “1” is registered in the registration point storage unit 15.

次に、CPU2は、yiでの第2の円弧24を構成する画素のうち、最も内側に位置する画素のx座標を、水平ライン描画情報バッファ11に登録し(S17)、その登録数を登録点数格納部15に登録する(S18)。例えばycであれば、ycに対応する水平ライン描画情報バッファ11の座標データ格納部17にx3が格納され、登録点数格納部15に「2」が登録される。さらに、CPU2は、y座標に対応する水平ライン描画情報バッファ11に登録されたx座標を昇順に並べ替える(S19)。   Next, the CPU 2 registers the x coordinate of the innermost pixel among the pixels constituting the second arc 24 at yi in the horizontal line drawing information buffer 11 (S17), and registers the number of registrations. It is registered in the score storage unit 15 (S18). For example, in the case of yc, x3 is stored in the coordinate data storage unit 17 of the horizontal line drawing information buffer 11 corresponding to yc, and “2” is registered in the registration point storage unit 15. Further, the CPU 2 rearranges the x coordinates registered in the horizontal line drawing information buffer 11 corresponding to the y coordinate in ascending order (S19).

そして、CPU2は、画素描画プログラム14Bを実行し、並べ替えられたx座標を2つずつ参照して1組とし、この1組に含まれる一方のx座標を始点とし、他方のx座標を終点として、始点から終点に至る座標点のデータに基づいて、この座標点毎に混合処理を行いながら、描画データを生成し、水平ラインを描画する(S20)。例えばycでは、x3からx4に至る座標点毎の描画データが生成されることになる。特に、ydに対応する水平ライン描画情報バッファ11には、ステップS13で画素25のx座標が登録され、ステップS15で第1の円弧23を構成する画素のうち、最も外側に位置する画素のx座標が登録されている。このため、ステップS20によれば、CPU2は、ydにおける円弧Bの輪郭及び内部を構成する画素の座標点毎の描画データを生成できる。要するに、ydにおける水平ラインを描画するとき、2度描画される画素は発生しない。   Then, the CPU 2 executes the pixel drawing program 14B, refers to the rearranged x coordinates two by one, makes one set, one x coordinate included in the one set as a start point, and the other x coordinate as an end point. Then, based on the data of the coordinate points from the start point to the end point, drawing data is generated and a horizontal line is drawn while performing a mixing process for each coordinate point (S20). For example, in yc, drawing data for each coordinate point from x3 to x4 is generated. In particular, in the horizontal line drawing information buffer 11 corresponding to yd, the x coordinate of the pixel 25 is registered at step S13, and the x of the pixel located at the outermost side among the pixels constituting the first arc 23 at step S15. Coordinates are registered. For this reason, according to step S20, CPU2 can produce | generate the drawing data for every coordinate point of the outline of the circular arc B in yd, and the pixel which comprises the inside. In short, when drawing a horizontal line at yd, a pixel drawn twice is not generated.

さらに、CPU2は、yiを1つインクリメントして(S21)、yiが下端ybであるか否かを判定する(S22)。CPU2は、yiがybでなければ、再びステップS15に戻って、上記ステップS22までの処理を繰り返す。要するに、始点から終点に至るyiの全てに対してステップS20での水平ラインの描画を行うから、2度描画される画素を発生させずに、指定された太さn、半径rの円の一部である円弧Bの描画データを生成できる。これにより、CPU2は、描画座標生成プログラム13B及び画素描画プログラム14Bを実行することにより、液晶ディスプレイ7に期待する描画結果を表示させることができる。   Further, the CPU 2 increments yi by 1 (S21), and determines whether yi is the lower end yb (S22). If yi is not yb, the CPU 2 returns to step S15 again and repeats the processing up to step S22. In short, since a horizontal line is drawn in step S20 for all yi from the start point to the end point, a circle having a specified thickness n and radius r is generated without generating pixels to be drawn twice. Drawing data of arc B, which is a part, can be generated. Thus, the CPU 2 can display the expected drawing result on the liquid crystal display 7 by executing the drawing coordinate generation program 13B and the pixel drawing program 14B.

以上、本発明者によってなされた発明を実施形態に基づいて具体的に説明したが、本発明はそれに限定されるものではなく、その要旨を逸脱しない範囲において種々変更可能であることは言うまでもない。   As mentioned above, although the invention made by this inventor was concretely demonstrated based on embodiment, it cannot be overemphasized that this invention is not limited to it and can be variously changed in the range which does not deviate from the summary.

例えば、CPU2は、円Aや円弧Bの描画データを生成するときに、ステップS8,S20を実行した後、y座標を1つだけインクリメントして、y座標の上端から下端に向かって上記各処理を実行したが、これに限定されない。即ち、円Aや円弧Bには対称性があるから、例えば円Aでy座標の上端yAから下端yBまで必ずしも演算する必要はなく、上端yAから中心点Oのy座標まで演算し、残りの座標点については対称性を利用して演算するようにしてもよい。このようにすれば、ステップS1において下端yBを算出する必要がなく、さらに、ステップS2で確保される水平ライン描画情報バッファ11の数は略半分で済むことになる。また、端点の存在する図形としては、円弧Bに限らず、双曲線、高次曲線等であってもよい。このような場合であっても、端点同士を結ぶ直線に含まれる画素の座標点のデータを算出して、水平ライン描画情報バッファ11に格納すればよい。これにより、水平ライン描画情報バッファ11には、直線に含まれる画素のx座標と、例えば外側の輪郭図形を構成する画素のうち最も外側に位置する画素のx座標、又は内側の輪郭図形を構成する画素のうち最も内側に位置する画素のx座標とが登録される。そして、CPU2は、登録された2つのx座標を1組とし、1組に含まれる一方の座標点から他方の座標点に至る座標点のデータに基づいて、描画データを生成できる。また、x座標軸、y座標軸とは、図形が存在する空間を特定するための適宜の座標軸であって、限定されるものではない。   For example, when generating the drawing data for the circle A or the arc B, the CPU 2 increments the y coordinate by one after executing steps S8 and S20, and then performs the above-described processes from the upper end to the lower end of the y coordinate. However, the present invention is not limited to this. That is, since the circle A and the arc B have symmetry, it is not always necessary to calculate from the upper end yA to the lower end yB of the y coordinate in the circle A, for example, and the remaining coordinates are calculated from the upper end yA to the y coordinate of the center point O. The coordinate points may be calculated using symmetry. In this way, it is not necessary to calculate the lower end yB in step S1, and the number of horizontal line drawing information buffers 11 secured in step S2 can be substantially halved. Further, the figure having the end points is not limited to the arc B, but may be a hyperbola, a higher order curve, or the like. Even in such a case, the data of the coordinate points of the pixels included in the straight line connecting the end points may be calculated and stored in the horizontal line drawing information buffer 11. As a result, the horizontal line drawing information buffer 11 is configured with the x coordinate of the pixels included in the straight line and the x coordinate of the outermost pixel among the pixels constituting the outer contour graphic, or the inner contour graphic, for example. The x-coordinate of the innermost pixel among the pixels to be registered is registered. Then, the CPU 2 can generate drawing data based on coordinate point data from one coordinate point to the other coordinate point included in the set, with the two registered x coordinates as one set. Further, the x coordinate axis and the y coordinate axis are appropriate coordinate axes for specifying a space in which a figure exists, and are not limited.

本発明の実施形態1に係る描画データ生成方法を例示するフローチャートである。It is a flowchart which illustrates the drawing data generation method which concerns on Embodiment 1 of this invention. 本発明の実施形態に係るデータプロセッサ1を例示する説明図である。It is explanatory drawing which illustrates the data processor 1 which concerns on embodiment of this invention. 水平ライン描画情報バッファの概略構成を例示する説明図である。It is explanatory drawing which illustrates schematic structure of a horizontal line drawing information buffer. 円を構成する第1の円と第2の円に含まれる画素の位置を例示する説明図である。It is explanatory drawing which illustrates the position of the pixel contained in the 1st circle and 2nd circle which comprise a circle. 本発明の実施形態2に係る描画データ生成方法を例示するフローチャートである。It is a flowchart which illustrates the drawing data generation method which concerns on Embodiment 2 of this invention. 円弧を構成する第1の円弧と第2の円弧に含まれる画素の位置を例示する説明図である。It is explanatory drawing which illustrates the position of the pixel contained in the 1st circular arc and 2nd circular arc which comprise an circular arc.

符号の説明Explanation of symbols

1 データプロセッサ
2 中央処理装置(CPU)
3 液晶ディスプレイ用インタフェース回路(LCDIF)
6 バスステートコントローラ(BSC)
7 液晶ディスプレイ(LCD)
9 外部メモリ
10 プログラム格納部
11 水平ライン描画情報バッファ
12 フレームバッファ
13A,13B 描画座標生成プログラム
14A,14B 画素描画プログラム
15 登録点数格納部
16〜19 座標データ格納部
21 第1の円
22 第2の円
23 第1の円弧
24 第2の円弧
23a,23b,24a,24b 端点
A 円
B 円弧
1 Data processor 2 Central processing unit (CPU)
3 Liquid crystal display interface circuit (LCDIF)
6 Bus state controller (BSC)
7 Liquid crystal display (LCD)
DESCRIPTION OF SYMBOLS 9 External memory 10 Program storage part 11 Horizontal line drawing information buffer 12 Frame buffer 13A, 13B Drawing coordinate generation program 14A, 14B Pixel drawing program 15 Registration point storage part 16-19 Coordinate data storage part 21 1st circle 22 2nd Circle 23 First arc 24 Second arc 23a, 23b, 24a, 24b End point A Circle B Arc

Claims (5)

第1座標軸と第2座標軸で特定される空間上において指定された線の太さ及び図形のパラメータに基づいて、前記図形の描画データを生成する描画データ生成方法であって、
前記線の太さに応じた前記図形の外側の輪郭図形と内側の輪郭図形を含む領域の前記第1座標軸上における始点と終点を演算する第1処理と、
前記始点から前記終点に向かって、前記第1座標軸上の第1座標点毎に前記外側の輪郭図形と前記内側の輪郭図形の各々の前記第2座標軸上の第2座標点を演算する第2処理と、
前記第1座標点毎に演算された前記第2座標点のうち、前記外側の輪郭図形では最も外側の外側座標点と、前記内側の輪郭図形では最も内側の内側座標点とを選択し、前記外側座標点と前記内側座標点を大きい順又は小さい順に並べ替える第3処理と、
並べ替えられた順で、前記外側座標点と前記内側座標点を1組とし、前記1組に含まれる前記外側座標点から前記内側座標点に至る座標点のデータに基づいて、描画データを生成する第4処理と、を含む描画データ生成方法。
A drawing data generation method for generating drawing data of a graphic based on a line thickness and a graphic parameter specified on a space specified by a first coordinate axis and a second coordinate axis,
A first process for calculating a start point and an end point on the first coordinate axis of an area including an outer contour graphic and an inner contour graphic according to the thickness of the line;
A second coordinate point for calculating the second coordinate point on the second coordinate axis of each of the outer contour graphic and the inner contour graphic for each first coordinate point on the first coordinate axis from the start point to the end point; Processing,
Of the second coordinate points calculated for each of the first coordinate points, select the outermost outer coordinate point in the outer contour graphic and the innermost inner coordinate point in the inner contour graphic, A third process of rearranging the outer coordinate point and the inner coordinate point in order of increasing or decreasing;
Drawing data is generated on the basis of the coordinate point data from the outer coordinate point to the inner coordinate point included in the set, with the outer coordinate point and the inner coordinate point as one set in the rearranged order. And a fourth process for generating drawing data.
前記図形に端点が存在するとき、前記外側の輪郭図形に含まれる第1端点と、前記内側の輪郭図形に含まれる第2端点とを結ぶ直線の間の第3座標点を演算する第5処理をさらに含み、
前記第3処理において、前記第2座標点が有する第1座標点と共通の第1座標点を有する前記第3座標点があるとき、前記第3座標点と前記外側座標点又は前記内側座標点を大きい順又は小さい順に並べ替え、
前記第4処理において、前記第3座標点から前記外側座標点又は前記内側座標点に至る座標点のデータに基づいて、描画データを生成する請求項1記載の描画データ生成方法。
Fifth processing for calculating a third coordinate point between a straight line connecting a first end point included in the outer contour graphic and a second end point included in the inner contour graphic when an end point exists in the graphic Further including
In the third process, when there is the third coordinate point having the first coordinate point common to the first coordinate point of the second coordinate point, the third coordinate point and the outer coordinate point or the inner coordinate point Sort in ascending or descending order,
The drawing data generation method according to claim 1, wherein in the fourth process, drawing data is generated based on data of coordinate points from the third coordinate point to the outer coordinate point or the inner coordinate point.
前記図形が円であるとき、前記図形のパラメータは、中心点と半径であり、
前記外側の輪郭図形は、前記中心点を中心とし、前記半径よりも大きい第1の半径を有する第1の円とされ、
前記内側の輪郭図形は、前記中心点を中心とし、前記半径よりも小さく、前記第1の半径との差が前記太さとなる第2の半径を有する第2の円とされる請求項1記載の描画データ生成方法。
When the figure is a circle, the figure parameters are center point and radius;
The outer contour graphic is a first circle centered on the center point and having a first radius larger than the radius,
The inner contour graphic is a second circle having a second radius that is centered on the center point, smaller than the radius, and whose difference from the first radius is the thickness. Drawing data generation method.
前記半径をr、前記太さをnとしたとき、nが奇数であれば、前記第1の半径は、r+n/2で示される値の整数部分であり、前記第2の半径は、r−n/2で示される値の整数部分であり、
nが偶数であれば、前記第1の半径は、r+n/2−1で示される値であり、前記第2の半径は、r−n/2で示される値である請求項3記載の描画データ生成方法。
When the radius is r and the thickness is n, if n is an odd number, the first radius is an integer part of a value represented by r + n / 2, and the second radius is r− the integer part of the value indicated by n / 2,
4. The drawing according to claim 3, wherein if n is an even number, the first radius is a value represented by r + n / 2-1 and the second radius is a value represented by rn / 2. Data generation method.
中央処理装置と、前記中央処理装置が実行するプログラムを格納するプログラムメモリと、を有するデータプロセッサであって、
前記プログラムメモリは、第1座標軸と第2座標軸で特定される空間上において指定された線の太さ及び図形のパラメータに基づいて、前記図形の描画データを生成する描画データ生成プログラムを有し、
前記描画データ生成プログラムは、前記線の太さに応じた前記図形の外側の輪郭図形と内側の輪郭図形を含む領域の前記第1座標軸上における始点と終点を演算する第1処理と、
前記始点から前記終点に向かって、前記第1座標軸上の第1座標点毎に前記外側の輪郭図形と前記内側の輪郭図形の各々の前記第2座標軸上の第2座標点を演算する第2処理と、
前記第1座標点毎に演算された前記第2座標点のうち、前記外側の輪郭図形では最も外側の外側座標点と、前記内側の輪郭図形では最も内側の内側座標点とを選択し、前記外側座標点と前記内側座標点を大きい順又は小さい順に並べ替える第3処理と、
並べ替えられた順で、前記外側座標点と前記内側座標点を1組とし、前記1組に含まれる前記外側座標点から前記内側座標点に至る座標点のデータに基づいて、描画データを生成する第4処理と、を制御するデータプロセッサ。
A data processor having a central processing unit and a program memory for storing a program executed by the central processing unit,
The program memory has a drawing data generation program for generating drawing data of the graphic based on the line thickness and graphic parameters specified in the space specified by the first coordinate axis and the second coordinate axis,
The drawing data generation program includes: a first process for calculating a start point and an end point on the first coordinate axis of an area including an outer contour graphic and an inner contour graphic according to the thickness of the line;
A second coordinate point for calculating the second coordinate point on the second coordinate axis of each of the outer contour graphic and the inner contour graphic for each first coordinate point on the first coordinate axis from the start point to the end point; Processing,
Of the second coordinate points calculated for each of the first coordinate points, select the outermost outer coordinate point in the outer contour graphic and the innermost inner coordinate point in the inner contour graphic, A third process of rearranging the outer coordinate point and the inner coordinate point in order of increasing or decreasing;
Drawing data is generated on the basis of the coordinate point data from the outer coordinate point to the inner coordinate point included in the set, with the outer coordinate point and the inner coordinate point as one set in the rearranged order. A data processor for controlling the fourth process.
JP2006114158A 2006-04-18 2006-04-18 Method for generating drawing data and data processor Withdrawn JP2007286942A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006114158A JP2007286942A (en) 2006-04-18 2006-04-18 Method for generating drawing data and data processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006114158A JP2007286942A (en) 2006-04-18 2006-04-18 Method for generating drawing data and data processor

Publications (1)

Publication Number Publication Date
JP2007286942A true JP2007286942A (en) 2007-11-01

Family

ID=38758649

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006114158A Withdrawn JP2007286942A (en) 2006-04-18 2006-04-18 Method for generating drawing data and data processor

Country Status (1)

Country Link
JP (1) JP2007286942A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11341654B2 (en) 2016-11-23 2022-05-24 Robert Bosch Gmbh Correspondence search between matrix elements

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11341654B2 (en) 2016-11-23 2022-05-24 Robert Bosch Gmbh Correspondence search between matrix elements

Similar Documents

Publication Publication Date Title
JP4234217B2 (en) System, apparatus and method for embedding transparent enable bits as part of resizing bit block transfer processing
JP2637920B2 (en) Computer graphic system and method of using frame buffer
JP2019505939A (en) Performing anti-aliasing operations in computing systems
US8525843B2 (en) Graphic system comprising a fragment graphic module and relative rendering method
JP2006018811A (en) Appropriately rendering graphical object when corresponding outline lacks control point
JP2006202211A (en) Image drawing device and image drawing method
US7439980B2 (en) Image processing method and apparatus
JP2007286942A (en) Method for generating drawing data and data processor
JP2010079883A (en) Information processing apparatus, image processing method, and program
JPH06176122A (en) Graphic editing device
JP2010134654A (en) Image rendering processing apparatus
JP3872056B2 (en) Drawing method
JP3729187B2 (en) Image display device
JP4320604B2 (en) Image processing method and image processing apparatus
JP2011028641A (en) Image processing device and image processing method
JPH05298058A (en) Graphic data processor
JP2010009271A (en) Image processor
CN115049564A (en) Picture sharpening processing method and processing terminal
JPH02270082A (en) Equipment for comparing coordinate pair of x-coordinate y-coordinate of object displayed by graphics subsystem
JP2013015952A (en) Information processor
KR101666131B1 (en) Vector Font Rendering with considering sub-pixel pattern
JP2803235B2 (en) Digital image processing method
JP5885827B2 (en) Drawing control apparatus and drawing control program
WO2017203675A1 (en) Graphics rendering apparatus, graphics rendering method, display system, and graphics rendering program
JP2005202218A (en) Image data processing system

Legal Events

Date Code Title Description
A300 Application deemed to be withdrawn because no request for examination was validly filed

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20090707