Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP5900254B2 - Line drawing apparatus, line drawing method, and line drawing program - Google Patents
[go: Go Back, main page]

JP5900254B2 - Line drawing apparatus, line drawing method, and line drawing program - Google Patents

Line drawing apparatus, line drawing method, and line drawing program Download PDF

Info

Publication number
JP5900254B2
JP5900254B2 JP2012196084A JP2012196084A JP5900254B2 JP 5900254 B2 JP5900254 B2 JP 5900254B2 JP 2012196084 A JP2012196084 A JP 2012196084A JP 2012196084 A JP2012196084 A JP 2012196084A JP 5900254 B2 JP5900254 B2 JP 5900254B2
Authority
JP
Japan
Prior art keywords
line
pixel
coordinates
point
start point
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.)
Active
Application number
JP2012196084A
Other languages
Japanese (ja)
Other versions
JP2014052782A (en
Inventor
幸治 西河
幸治 西河
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Socionext Inc
Original Assignee
Socionext Inc
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 Socionext Inc filed Critical Socionext Inc
Priority to JP2012196084A priority Critical patent/JP5900254B2/en
Publication of JP2014052782A publication Critical patent/JP2014052782A/en
Application granted granted Critical
Publication of JP5900254B2 publication Critical patent/JP5900254B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

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

Description

開示の技術は、ライン描画装置、ライン描画方法、及びライン描画プログラムに関する。   The disclosed technology relates to a line drawing apparatus, a line drawing method, and a line drawing program.

従来、コンピュータグラフィックス等の分野における描画方法の一つとしてライン描画がある。ライン描画には、「独立ライン」及び「連続ライン」の二つの描画方法がある。   Conventionally, line drawing is one of drawing methods in the field of computer graphics and the like. There are two drawing methods for line drawing: “independent lines” and “continuous lines”.

独立ラインの描画においては、各ラインは独立しているものとするため、或るラインの終点と次に描画するラインの始点が重なったとしても、それぞれの点(ピクセル)をそのまま描画する。すなわち、独立ラインの場合は、ライン同士の接点を2回描画する「2度打ち」を許容する。   In independent line drawing, since each line is independent, even if the end point of a line overlaps the start point of the next line to be drawn, each point (pixel) is drawn as it is. That is, in the case of an independent line, “twisting” in which a contact point between lines is drawn twice is allowed.

例えば、図20に示すようにA〜F点の座標が指定され、4本のラインL101〜L104を独立ラインとして描画するように指示された場合、ラインL101の始点はA点、終点はB点であり、A点からB点までライン描画する。また、ラインL102の始点はB点、終点はC点であり、B点からC点までライン描画する。ラインL102の始点であるB点はラインL101の終点でもあるが、独立ラインであるため、B点は2度打ちされる。また、ラインL103の始点はC点、終点はD点であり、C点からD点までライン描画する。ラインL103の始点であるC点はラインL102の終点でもあるため、C点もB点と同様に2度打ちされる。また、ラインL104の始点はE点、終点はF点であり、E点からF点までライン描画する。   For example, when the coordinates of points A to F are specified as shown in FIG. 20 and it is instructed to draw four lines L101 to L104 as independent lines, the start point of the line L101 is the point A and the end point is the point B A line is drawn from point A to point B. The start point of the line L102 is point B and the end point is point C, and a line is drawn from point B to point C. The point B, which is the starting point of the line L102, is also the end point of the line L101, but since it is an independent line, the point B is hit twice. The start point of the line L103 is the C point and the end point is the D point, and the line is drawn from the C point to the D point. Since the point C, which is the starting point of the line L103, is also the end point of the line L102, the point C is hit twice in the same manner as the point B. The starting point of the line L104 is the point E and the end point is the point F, and the line is drawn from the point E to the point F.

従って、独立ラインの描画における座標数は、「描画するラインの本数×2」となる。   Therefore, the number of coordinates for drawing an independent line is “the number of lines to be drawn × 2”.

一方、連続ラインの描画においては、ライン同士の接点を隙間なく接続させることが必要であり、ライン同士の接点の2度打ちは許容しない。   On the other hand, in drawing a continuous line, it is necessary to connect the contact points between the lines without any gaps, and it is not allowed to strike the contact points between the lines twice.

従って、図20の例の場合、A点からD点までの3本のラインL101〜L103を1回で描画することにより1本のラインとして扱う。このため、連続ラインの描画においては、最初のラインは始点及び終点の座標が必要となるが、次のラインの始点は前のラインの終点であるため、最初のライン以降のラインについては、終点の座標のみ必要となる。図20の例の場合、最初のラインL101の始点はA点、終点はB点である。次のラインL102の始点は前のラインL101の終点であるB点と同一であるため始点を指定する必要はなく、終点であるC点のみ指定すればよい。同様に、次のラインL103の始点は前のラインL102の終点であるC点と同一であるため始点を指定する必要はなく、終点であるD点のみ指定すればよい。   Therefore, in the example of FIG. 20, the three lines L101 to L103 from the point A to the point D are treated as one line by drawing at a time. For this reason, in the continuous line drawing, the coordinates of the start point and end point are required for the first line, but the start point of the next line is the end point of the previous line. Only the coordinates of are required. In the example of FIG. 20, the first line L101 has a start point A and an end point B. Since the start point of the next line L102 is the same as the B point that is the end point of the previous line L101, it is not necessary to specify the start point, and only the C point that is the end point needs to be specified. Similarly, since the start point of the next line L103 is the same as the point C that is the end point of the previous line L102, it is not necessary to specify the start point, and only the D point that is the end point needs to be specified.

従って、連続ラインの描画における座標数は、「1回で描画するラインを形成するラインの本数+1」となる。   Accordingly, the number of coordinates for drawing continuous lines is “the number of lines forming a line drawn at one time + 1”.

連続ラインの描画においてライン同士の接点における2度打ちを防止する技術として、2本目のラインの始点の座標が1本目のラインの終点の座標と一致するか否かを判断し、一致していれば始点の座標を変更する技術がある。   As a technique for preventing double strike at the contact point between lines in continuous line drawing, it is determined whether or not the coordinates of the start point of the second line coincide with the coordinates of the end point of the first line. For example, there is a technique for changing the coordinates of the starting point.

しかしながら、この技術では、2度打ちが発生すると判断した場合には無条件に始点の座標を変更してしまうので、不必要に座標が補正されてしまう場合があり、本来描画が必要でない位置に描画してしまう場合がある。   However, with this technique, if it is determined that a double strike will occur, the coordinates of the starting point will be unconditionally changed, so the coordinates may be unnecessarily corrected, and at a position where drawing is not originally required. It may be drawn.

また、ライン描画アルゴリズムの一つにDiamondExitRuleという描画方式がある(以下、DERと称する場合がある)。以下、DiamondExitRuleについて説明する。   One of the line drawing algorithms is a drawing method called DiamondExitRule (hereinafter sometimes referred to as DER). Hereinafter, DiamondExitRule will be described.

図21には、ピクセル内に設定されるDiamond枠の一例を示した。同図に示すように、Diamond枠Dmは、正方形状のピクセルPXLの各辺の真ん中の点を結んでできる菱形形状の枠である。   FIG. 21 shows an example of a Diamond frame set in a pixel. As shown in the figure, the diamond frame Dm is a diamond-shaped frame formed by connecting the middle points of the sides of the square pixel PXL.

DiamondExitRuleでは、まず入力された頂点(ラインの始点又は終点)の座標がDiamond枠Dmの枠内か枠外かを判定する。具体的には、まずピクセルPXLの中央位置の座標をP0(X0,Y0)、入力された頂点の座標をP1(X1,Y1)として、座標P1で表される頂点がDiamond枠Dmの枠内か枠外であるかを判定するためのD値を次式により算出する。なお、座標値は小数点を含む実数値で表され、整数部分がピクセルの位置を示し、小数部分がピクセル内の位置を表す。   In DiamondExitRule, first, it is determined whether the coordinates of the input vertex (the start point or end point of the line) are within or outside the frame of the Diamond frame Dm. Specifically, first, the coordinates of the center position of the pixel PXL is P0 (X0, Y0), the coordinates of the input vertex are P1 (X1, Y1), and the vertex represented by the coordinate P1 is within the frame of the Diamond frame Dm. The D value for determining whether the frame is out of the frame is calculated by the following equation. The coordinate value is represented by a real value including a decimal point, the integer part indicates the position of the pixel, and the decimal part indicates the position in the pixel.

D=|X1―X0|+|Y1−Y0| ・・・(1) D = | X1-X0 | + | Y1-Y0 | (1)

上記(1)式により算出されるD値が「0.5」となる点がDiamond枠Dm上の点である。従って、D<0.5を満たす場合は、入力された頂点がDiamond枠Dmの枠内であり、D≧0.5の場合は、入力された頂点がDiamond枠Dmの枠外であると判定する。   The point on the Diamond frame Dm is a point where the D value calculated by the above equation (1) is “0.5”. Therefore, when D <0.5 is satisfied, the input vertex is within the frame of the Diamond frame Dm, and when D ≧ 0.5, it is determined that the input vertex is outside the frame of the Diamond frame Dm. .

DiamondExitRuleでは、始点と終点を結ぶラインが、Diamond枠Dmとピクセル内において少なくとも1回交差するピクセルを描画する。具体的には、Diamond枠Dmの枠内から枠外へ向かうラインが通るピクセルを描画する。   In DiamondExitRule, a pixel in which a line connecting the start point and the end point intersects the Diamond frame Dm at least once in the pixel is drawn. Specifically, a pixel through which a line from the inside of the Diamond frame Dm to the outside of the frame passes is drawn.

図22には、DiamondExitRuleの適用例を示した。同図では、色塗りされたピクセルがDiamondExitRuleに基づいて描画されるピクセルである。同図に示すように、ラインL15の始点S15はDiamond枠Dmの枠外にある。そして、始点S15を含むピクセル上を通るラインは、Diamond枠Dmの枠内から枠外へ向かうラインを含まないため、始点S15を含むピクセルは描画されない。また、ラインL15の終点E15はDiamond枠Dmの枠外にある。そして、終点E15を含むピクセル上を通るラインは、Diamond枠Dmの枠内から枠外へ向かうラインを含まないため、終点E15を含むピクセルは描画されない。   FIG. 22 shows an application example of DiamondExitRule. In the figure, the colored pixels are pixels drawn based on DiamondExitRule. As shown in the figure, the starting point S15 of the line L15 is outside the diamond frame Dm. Since the line passing over the pixel including the start point S15 does not include the line going from the inside of the diamond frame Dm to the outside of the frame, the pixel including the start point S15 is not drawn. The end point E15 of the line L15 is outside the diamond frame Dm. Since the line passing over the pixel including the end point E15 does not include the line going from the inside of the diamond frame Dm to the outside of the frame, the pixel including the end point E15 is not drawn.

また、ラインL16の始点S16はDiamond枠Dmの枠内にある。そして、始点S16を含むピクセル上を通るラインは、Diamond枠Dmの枠内から枠外へ向かうラインを含むため、始点S16を含むピクセルは描画される。また、ラインL16の終点E16はDiamond枠Dmの枠内にある。そして、終点E16を含むピクセル上を通るラインは、Diamond枠Dmの枠内から枠外へ向かうラインを含まないため、終点E16を含むピクセルは描画されない。   The starting point S16 of the line L16 is within the diamond frame Dm. Since the line passing over the pixel including the start point S16 includes a line from the inside of the diamond frame Dm to the outside of the frame, the pixel including the start point S16 is drawn. Further, the end point E16 of the line L16 is within the frame of the Diamond frame Dm. Since the line passing over the pixel including the end point E16 does not include the line going from the inside of the diamond frame Dm to the outside of the frame, the pixel including the end point E16 is not drawn.

また、ラインL17の始点S17はDiamond枠Dmの枠外にある。そして、始点S17を含むピクセル上を通るラインは、Diamond枠Dmの枠内から枠外へ向かうラインを含むため、始点S17を含むピクセルは描画される。また、ラインL17の終点はDiamond枠Dmの枠外にある。そして、終点E17を含むピクセル上を通るラインは、Diamond枠Dmの枠内から枠外へ向かうラインを含むため、終点E17を含むピクセルは描画される。   The starting point S17 of the line L17 is outside the diamond frame Dm. Since the line passing over the pixel including the start point S17 includes a line going from the inside of the diamond frame Dm to the outside of the frame, the pixel including the start point S17 is drawn. In addition, the end point of the line L17 is outside the diamond frame Dm. Since the line passing over the pixel including the end point E17 includes a line from the inside of the Diamond frame Dm to the outside of the frame, the pixel including the end point E17 is drawn.

図23には、DiamondExitRuleを適用して2本のラインL18、L19を連続描画した場合の例を示した。同図に示すように、DiamondExitRuleに従うと、1ライン目のラインL18の始点S18はDiamond枠Dmの枠内から枠外へ向かうラインを含むため描画され、終点E18はDiamond枠Dmの枠内から枠外へ向かうラインを含まないため描画されない。また、1ライン目の終点E18は、2ライン目の始点S19でもある。そして、DiamondExitRuleに従うと2ライン目の始点S19はDiamond枠Dmの枠内から枠外へ向かうラインを含むため描画され、終点E19はDiamond枠Dmの枠内から枠外へ向かうラインを含むため描画される。   FIG. 23 shows an example in which the DiamondExitRule is applied and two lines L18 and L19 are continuously drawn. As shown in the figure, according to DiamondExitRule, the start point S18 of the first line L18 is drawn because it includes a line going from the inside of the Diamond frame Dm to the outside of the frame, and the end point E18 is drawn from the inside of the Diamond frame Dm to the outside of the frame. It is not drawn because it does not include the line to go. The end point E18 of the first line is also the start point S19 of the second line. According to DiamondExitRule, the start point S19 of the second line is drawn because it includes a line that goes from the inside of the Diamond frame Dm to the outside of the frame, and the end point E19 is drawn because it includes a line that goes from the inside of the Diamond frame Dm to the outside of the frame.

特開昭63−245575号公報JP-A 63-245575 特開2010−9350号公報JP 2010-9350 A

一方、例えば図24に示した例の場合、DiamondExitRuleに従うと、1ライン目のラインL20の終点E20はDiamond枠Dmの枠内から枠外へ向かうラインを含むため描画される。また、2ライン目のラインL21の始点S21は1ライン目のラインL20の終点E20でもあり、Diamond枠Dmの枠内から枠外へ向かうラインを含むため描画される。すなわち、1ライン目の終点E20(2ライン目の始点S21)を含むピクセルは2度描画されてしまう(2度打ち)。   On the other hand, in the example shown in FIG. 24, for example, according to DiamondExitRule, the end point E20 of the line L20 of the first line is drawn because it includes a line from the inside of the Diamond frame Dm to the outside of the frame. The start point S21 of the second line L21 is also the end point E20 of the first line L20, and is drawn because it includes a line from the inside of the Diamond frame Dm to the outside of the frame. That is, the pixel including the end point E20 of the first line (start point S21 of the second line) is drawn twice (twice).

このように、DERのアルゴリズムに従って連続ラインを描画すると、ライン同士の接点のピクセルを2度打ちしてしまう場合がある。   As described above, when a continuous line is drawn according to the DER algorithm, a pixel at a contact point between the lines may be hit twice.

ここで、前述した2本目のラインの始点の座標が1本目のラインの終点の座標と一致する場合に始点の座標を変更する技術をDERに適用して連続ラインを描画する場合を考える。この場合、2本目のラインをDERにより仮に描画して2度打ちが発生するか否かを検出し、2度打ちが発生することを検出した場合に2本目のラインの始点を変更する必要があり、処理負荷が高くなる。   Here, a case will be considered in which a continuous line is drawn by applying a technique for changing the coordinates of the start point to the DER when the coordinates of the start point of the second line coincide with the coordinates of the end point of the first line. In this case, it is necessary to temporarily draw the second line by DER and detect whether or not a double strike occurs, and when it is detected that the double strike occurs, the start point of the second line needs to be changed. Yes, the processing load increases.

開示の技術は、連続ラインを描画する場合に、少ない処理負荷でライン同士の接点の2度打ちを防止することが目的である。   The technique of the disclosure is intended to prevent double hitting of contact points between lines with a small processing load when drawing continuous lines.

開示の技術は、描画情報生成部は、第1及び第2ラインの座標情報が入力され、前記第1ラインの描画情報を描画ルールに基づいて生成すると共に、前記第1ラインの終点を次に描画する前記第2ラインの始点として、連続描画するための第1の描画情報を生成する。終点描画判定部は、前記第1ラインの終点を含むピクセル領域内の座標と前記第1ラインの描画方向とに基づいて、前記第1ラインの終点を含む前記ピクセルを描画するか否かを判定する。始点補正判定部は、前記描画判定部が前記第1ラインの終点を含む前記ピクセルを描画すると判定した場合に、前記第1ラインの終点である前記第2ラインの始点の座標と前記第2ラインの終点の座標とに基づいて前記第2ラインの描画方向を判定する。また、始点補正判定部は、前記第2ラインの始点の座標と前記第2ラインの描画方向とに基づいて、前記第2ラインの始点の座標の補正が必要か否かを判定する。座標補正処理部は、前記第2ラインの始点の座標の補正が必要と判定された場合、前記第2ラインの始点の座標を当該始点が含まれるピクセルに隣接するピクセル内の座標に補正する。
ライン消失判定部は、前記第2ラインの主軸方向における長さが1ピクセル以上の場合は、前記座標補正処理部により補正された前記第2ラインの始点の座標を第2の描画情報として出力する。また、ライン消失判定部は、前記第2ラインの主軸方向における長さが1ピクセル未満の場合には、前記第2ラインを消失すべきと判定して前記第2ラインを非描画とする。描画処理部は、前記第1の描画情報あるいは前記第2の描画情報に基づいて描画処理を行なう。
In the disclosed technology, the drawing information generation unit receives the coordinate information of the first and second lines, generates the drawing information of the first line based on the drawing rule, and sets the end point of the first line to the next First drawing information for continuous drawing is generated as the starting point of the second line to be drawn. The end point drawing determination unit determines whether to draw the pixel including the end point of the first line based on the coordinates in the pixel region including the end point of the first line and the drawing direction of the first line. To do. The start point correction determination unit, when the drawing determination unit determines to draw the pixel including the end point of the first line, the coordinates of the start point of the second line that is the end point of the first line and the second line The drawing direction of the second line is determined based on the coordinates of the end point. In addition, the start point correction determination unit determines whether correction of the start point coordinates of the second line is necessary based on the start point coordinates of the second line and the drawing direction of the second line. When it is determined that the correction of the coordinates of the start point of the second line is necessary, the coordinate correction processing unit corrects the coordinates of the start point of the second line to the coordinates in the pixel adjacent to the pixel including the start point.
When the length of the second line in the principal axis direction is 1 pixel or more, the line disappearance determination unit outputs the coordinates of the start point of the second line corrected by the coordinate correction processing unit as second drawing information. . In addition, when the length of the second line in the principal axis direction is less than 1 pixel, the line disappearance determination unit determines that the second line should be disappeared and does not draw the second line. The drawing processing unit performs drawing processing based on the first drawing information or the second drawing information.

開示の技術は、連続ラインを描画する場合に、少ない処理負荷でライン同士の接点の2度打ちを防止することができる、という効果を有する。   The disclosed technology has an effect that, when a continuous line is drawn, it is possible to prevent double contact of the contact points between the lines with a small processing load.

描画装置の機能ブロック図である。It is a functional block diagram of a drawing apparatus. 描画装置が適用されるグラフィックチップの機能ブロック図である。It is a functional block diagram of the graphic chip to which a drawing apparatus is applied. ラインセットアップ部の機能ブロック図である。It is a functional block diagram of a line setup part. ラインセットアップ部として機能するコンピュータの概略ブロック図である。It is a schematic block diagram of the computer which functions as a line setup part. ライン描画プログラムの処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a process of a line drawing program. 主軸判定について説明するための図である。It is a figure for demonstrating spindle determination. 終点描画判定処理の流れを示すフローチャートである。It is a flowchart which shows the flow of an end point drawing determination process. 始点補正判定処理及び座標補正処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a starting point correction | amendment determination process and a coordinate correction process. 始点補正の一例について説明するための図である。It is a figure for demonstrating an example of starting point correction | amendment. ライン消失判定処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a line disappearance determination process. ライン消失の一例について説明するための図である。It is a figure for demonstrating an example of a line loss | disappearance. ライン消失の一例について説明するための図である。It is a figure for demonstrating an example of a line loss | disappearance. ライン消失の一例について説明するための図である。It is a figure for demonstrating an example of a line loss | disappearance. ライン消失の一例について説明するための図である。It is a figure for demonstrating an example of a line loss | disappearance. ライン消失の一例について説明するための図である。It is a figure for demonstrating an example of a line loss | disappearance. ライン消失の一例について説明するための図である。It is a figure for demonstrating an example of a line loss | disappearance. ライン消失の一例について説明するための図である。It is a figure for demonstrating an example of a line loss | disappearance. ライン消失の一例について説明するための図である。It is a figure for demonstrating an example of a line loss | disappearance. 連続ラインを描画した場合について説明するための図である。It is a figure for demonstrating the case where a continuous line is drawn. 独立ライン及び連続ラインについて説明するための図である。It is a figure for demonstrating an independent line and a continuous line. Diamond枠について説明するための図である。It is a figure for demonstrating a Diamond frame. DiamondExitRuleによりラインを描画した場合について説明するための図である。It is a figure for demonstrating the case where a line is drawn by DiamondExitRule. DiamondExitRuleにより連続ラインを描画した場合において2度打ちが発生しない場合について説明するための図である。It is a figure for demonstrating the case where a double strike does not generate | occur | produce when drawing a continuous line by DiamondExitRule. DiamondExitRuleにより連続ラインを描画した場合において2度打ちが発生する場合について説明するための図である。It is a figure for demonstrating the case where a double strike occurs when drawing a continuous line by DiamondExitRule.

以下、図面を参照して開示の技術の実施形態の一例を詳細に説明する。なお、本実施形態では、前述したDiamondExitRuleを適用して連続ラインを描画する場合について説明する。   Hereinafter, an example of an embodiment of the disclosed technology will be described in detail with reference to the drawings. In the present embodiment, a case where a continuous line is drawn by applying the above-described DiamondExitRule will be described.

図1には、本実施形態に係る描画装置10のブロック図を示した。同図に示すように、描画装置10は、頂点処理部12、図形セットアップ部14、及び描画処理部16を備える。   FIG. 1 shows a block diagram of a drawing apparatus 10 according to the present embodiment. As illustrated in FIG. 1, the drawing apparatus 10 includes a vertex processing unit 12, a graphic setup unit 14, and a drawing processing unit 16.

頂点処理部12は、頂点データ(X座標、Y座標、Z座標、RGB値等)を入力し、形成する図形(三角形、直線等)に応じて、図形セットアップ部14に図形を形成するための頂点の座標データを送信する。なお、本実施形態では、座標データがX座標及びY座標で表される場合について説明する。   The vertex processing unit 12 inputs vertex data (X coordinate, Y coordinate, Z coordinate, RGB value, etc.), and forms a figure in the figure setup unit 14 according to the figure to be formed (triangle, straight line, etc.). Send vertex coordinate data. In the present embodiment, a case will be described in which the coordinate data is represented by an X coordinate and a Y coordinate.

図形セットアップ部14は、トライアングルセットアップ部18、ラインセットアップ部20、及びセレクト部22を備える。図形セットアップ部14では、トライアングル(三角形)の描画であればトライアングルセットアップ部18においてセットアップ処理を実行し、ライン(直線)の描画であればラインセットアップ部20においてセットアップ処理を実行する。セットアップ処理とは、例えば、ラインの描画であればラインを描画するのに必要な描画情報(描画を開始する頂点の座標、ラインの傾き値、ラインの長さ、主軸情報等)を座標データに基づいて生成してセレクト部22に出力する。トライアングルの描画の場合ではトライアングルを描画するのに必要な描画情報を頂点データに基づいて算出してセレクト部22に出力する。   The graphic setup unit 14 includes a triangle setup unit 18, a line setup unit 20, and a selection unit 22. The graphic setup unit 14 executes setup processing in the triangle setup unit 18 for triangle (triangle) drawing, and executes setup processing in the line setup unit 20 for line (straight line) drawing. For example, in the case of line drawing, the set-up process uses drawing data (such as vertex coordinates, line inclination value, line length, spindle information, etc.) necessary for drawing a line as coordinate data. Based on this, it outputs to the selector 22. In the case of triangle drawing, drawing information necessary for drawing a triangle is calculated based on the vertex data and output to the selection unit 22.

セレクト部22は、トライアングルセットアップ部18及びラインセットアップ部20から出力された描画情報の何れかを選択して描画処理部16へ出力する。   The selection unit 22 selects any of the drawing information output from the triangle setup unit 18 and the line setup unit 20 and outputs the selected drawing information to the drawing processing unit 16.

描画処理部16は、図形セットアップ部14から出力された描画情報に基づいて、描画処理を実行する。具体的には、例えば画面イメージのバッファであるフレームバッファ(外部メモリ)に対して、各座標に対応したアドレスに表示データとしてのRGB値を格納する。   The drawing processing unit 16 executes drawing processing based on the drawing information output from the graphic setup unit 14. Specifically, for example, an RGB value as display data is stored in an address corresponding to each coordinate in a frame buffer (external memory) which is a buffer for a screen image.

描画装置10は、例えばカーナビゲーションシステム等のグラフィックチップ等に搭載される。図2には、このようなグラフィックチップ30の構成を示した。同図に示すように、グラフィックチップ30は、描画装置10、メモリコントローラー32、キャプチャコントローラー34、ディスプレイコントローラー36がバス38によって接続されている。また、描画装置10は、ホストインタフェース40及びバス42を介して外部インタフェースに接続される。   The drawing apparatus 10 is mounted on, for example, a graphic chip such as a car navigation system. FIG. 2 shows the configuration of such a graphic chip 30. As shown in the figure, the graphic chip 30 includes a drawing device 10, a memory controller 32, a capture controller 34, and a display controller 36 connected by a bus 38. The drawing apparatus 10 is connected to an external interface via the host interface 40 and the bus 42.

描画装置10は、プログラマブルシェーダー44のプログラム内容に従って描画を行う。この際、バス38を介して接続されたメモリコントローラー32、キャプチャコントローラー34から頂点データを取得して上記の処理を実行して描画情報を生成し、ディスプレイコントローラー36に出力する。ディスプレイコントローラー36は、描画装置10から出力された描画情報を格納するフレームバッファを備え、このフレームバッファに格納された描画情報に基づいてディスプレイに画像を表示する。   The drawing apparatus 10 performs drawing according to the program content of the programmable shader 44. At this time, vertex data is acquired from the memory controller 32 and the capture controller 34 connected via the bus 38, the above processing is executed to generate drawing information, and output to the display controller 36. The display controller 36 includes a frame buffer for storing the drawing information output from the drawing device 10 and displays an image on the display based on the drawing information stored in the frame buffer.

図3には、ラインセットアップ部20の構成を示した。同図に示すように、ラインセットアップ部20は、DiamondExitRule処理部(以下DER処理部)50、ライン描画判定部52、及びセレクト部54を備える。   FIG. 3 shows the configuration of the line setup unit 20. As shown in the figure, the line setup unit 20 includes a Diamond ExitRule processing unit (hereinafter referred to as DER processing unit) 50, a line drawing determination unit 52, and a selection unit 54.

DER処理部50は、前述したDiamondExitRuleに基づいて、入力された始点及び終点を結ぶラインを描画するための描画情報を生成してセレクト部54に出力する。なお、DER処理部50は、開示の技術における描画情報生成部の一例である。   The DER processing unit 50 generates drawing information for drawing a line connecting the input start point and end point based on the above-described DiamondExitRule, and outputs the drawing information to the selection unit 54. The DER processing unit 50 is an example of a drawing information generation unit in the disclosed technology.

ライン描画判定部52は、描画方向判定部56、主軸判定部58、終点描画判定部60、始点補正判定部62、座標補正処理部64、及びライン消失判定部66を備える。   The line drawing determination unit 52 includes a drawing direction determination unit 56, a main axis determination unit 58, an end point drawing determination unit 60, a start point correction determination unit 62, a coordinate correction processing unit 64, and a line disappearance determination unit 66.

描画方向判定部56は、ラインの始点及び終点のX座標及びY座標に基づいてラインの描画方向を判定する。   The drawing direction determination unit 56 determines the drawing direction of the line based on the X and Y coordinates of the start point and end point of the line.

主軸判定部58は、始点及び終点の座標に基づいて、始点及び終点を結ぶラインの主軸(詳細は後述)がX軸であるかY主軸であるかを判定する。   Based on the coordinates of the start point and the end point, the main axis determination unit 58 determines whether the main axis (details will be described later) of the line connecting the start point and the end point is the X axis or the Y main axis.

終点描画判定部60は、前ライン(第1ライン)の終点のピクセル領域内の座標と前ラインの描画方向とに基づいて、前ラインの終点が含まれるピクセルを描画するか否かを判定する。   The end point drawing determination unit 60 determines whether to draw a pixel including the end point of the previous line, based on the coordinates in the pixel area of the end point of the previous line (first line) and the drawing direction of the previous line. .

始点補正判定部62は、前ラインの終点を描画すると判定された場合に、前ラインの終点である次ライン(第2ライン)の始点の座標と次ラインの終点の座標とに基づいて次ラインの描画方向を判定する。また、始点補正判定部62は、次ラインの始点のピクセル領域内の座標と次ラインの描画方向とに基づいて、次ラインの始点の補正が必要か否かを判定する。   When it is determined that the end point of the previous line is to be drawn, the start point correction determination unit 62 determines the next line based on the coordinates of the start point of the next line (second line) that is the end point of the previous line and the coordinates of the end point of the next line. The drawing direction is determined. The start point correction determination unit 62 determines whether or not the start point of the next line needs to be corrected based on the coordinates in the pixel area of the start point of the next line and the drawing direction of the next line.

座標補正処理部64は、次ラインの始点の補正が必要と判定された場合、次ラインの始点の座標を当該始点が含まれるピクセルに隣接するピクセル内の座標に補正する。   When it is determined that the start point of the next line needs to be corrected, the coordinate correction processing unit 64 corrects the coordinates of the start point of the next line to the coordinates in the pixel adjacent to the pixel including the start point.

ライン消失判定部66は、次ラインの主軸方向における長さが1ピクセル以上の場合は、座標補正処理部64により補正された次ラインの始点の座標をDER処理部50へ出力する。また、ライン消失判定部66は、次ラインの主軸方向における長さが1ピクセル未満の場合には、次ラインを消失すべきと判定して次ラインを非描画とするようにDER処理部50に通知する。   The line disappearance determination unit 66 outputs the coordinates of the start point of the next line corrected by the coordinate correction processing unit 64 to the DER processing unit 50 when the length of the next line in the principal axis direction is 1 pixel or more. Further, the line disappearance determination unit 66 determines that the next line should be lost when the length of the next line in the principal axis direction is less than 1 pixel, and causes the DER processing unit 50 not to draw the next line. Notice.

セレクト部54は、DER処理部50及びライン描画判定部52から出力された描画情報の何れかを選択して出力する。   The selection unit 54 selects and outputs any of the drawing information output from the DER processing unit 50 and the line drawing determination unit 52.

ラインセットアップ部20は、例えば図4に示すコンピュータ70で実現することができる。コンピュータ70はCPU72、メモリ74、及び不揮発性の記憶部76を備え、これらはバス78を介して互いに接続されている。   The line setup unit 20 can be realized, for example, by a computer 70 shown in FIG. The computer 70 includes a CPU 72, a memory 74, and a nonvolatile storage unit 76, which are connected to each other via a bus 78.

また、記憶部76はHDD(Hard Disk Drive)やフラッシュメモリ等によって実現できる。記録媒体としての記憶部76には、コンピュータ70をラインセットアップ部20として機能させるためのライン描画プログラム80が記憶されている。CPU72は、ライン描画プログラム80を記憶部76から読み出してメモリ74に展開し、ライン描画プログラム80が有するプロセスを順次実行する。   The storage unit 76 can be realized by an HDD (Hard Disk Drive), a flash memory, or the like. A storage unit 76 as a recording medium stores a line drawing program 80 for causing the computer 70 to function as the line setup unit 20. The CPU 72 reads the line drawing program 80 from the storage unit 76 and expands it in the memory 74, and sequentially executes the processes of the line drawing program 80.

ライン描画プログラム80は、描画方向判定プロセス82、主軸判定プロセス84、終点描画判定プロセス86、始点補正判定プロセス88、座標補正処理プロセス90、ライン消失判定プロセス92、及びDER処理プロセス94を有する。CPU72は、CPU62は、描画方向判定プロセス82を実行することで、図3に示す描画方向判定部56として動作する。また、CPU72は、主軸判定プロセス84を実行することで、図3に示す主軸判定部58として動作する。また、CPU72は、終点描画判定プロセス86を実行することで、図3に示す終点描画判定部60として動作する。また、CPU72は、始点補正判定プロセス88を実行することで、図3に示す始点補正判定部62として動作する。また、CPU72は、座標補正処理プロセス90を実行することで、図3に示す座標補正処理部64として動作する。また、CPU72は、ライン消失判定プロセス92を実行することで、図3に示すライン消失判定部66として動作する。また、CPU72は、DER処理プロセス94を実行することで、図3に示すDER処理部50として動作する。   The line drawing program 80 includes a drawing direction determination process 82, a main axis determination process 84, an end point drawing determination process 86, a start point correction determination process 88, a coordinate correction processing process 90, a line disappearance determination process 92, and a DER processing process 94. The CPU 72 operates as the drawing direction determination unit 56 shown in FIG. 3 by executing the drawing direction determination process 82. Further, the CPU 72 operates as the spindle determining unit 58 shown in FIG. 3 by executing the spindle determining process 84. Further, the CPU 72 operates as the end point drawing determination unit 60 shown in FIG. 3 by executing the end point drawing determination process 86. Further, the CPU 72 operates as the start point correction determination unit 62 illustrated in FIG. 3 by executing the start point correction determination process 88. The CPU 72 operates as the coordinate correction processing unit 64 shown in FIG. 3 by executing the coordinate correction processing process 90. Further, the CPU 72 operates as the line disappearance determination unit 66 illustrated in FIG. 3 by executing the line disappearance determination process 92. Further, the CPU 72 operates as the DER processing unit 50 illustrated in FIG. 3 by executing the DER processing process 94.

これにより、ライン描画プログラム80を実行したコンピュータ70が、ラインセットアップ部20として機能することになる。なお、ライン描画プログラム80は開示の技術におけるライン描画プログラムの一例である。また、ラインセットアップ部20は開示の技術におけるライン描画装置の一例である。   As a result, the computer 70 that has executed the line drawing program 80 functions as the line setup unit 20. The line drawing program 80 is an example of a line drawing program in the disclosed technology. The line setup unit 20 is an example of a line drawing apparatus in the disclosed technology.

なお、ラインセットアップ部20は、例えば半導体集積回路、より詳しくはASIC(Application Specific Integrated Circuit)等で実現することも可能である。   The line setup unit 20 can also be realized by, for example, a semiconductor integrated circuit, more specifically, an ASIC (Application Specific Integrated Circuit).

次に、本実施形態の作用を説明する。ラインセットアップ部20は、頂点処理部12から描画すべきラインの始点及び終点の座標データが入力されると、図5に示すライン描画処理を実行する。   Next, the operation of this embodiment will be described. When the coordinate data of the start point and end point of the line to be drawn is input from the vertex processing unit 12, the line setup unit 20 executes the line drawing process shown in FIG.

ステップ100では、頂点処理部12が、描画すべきラインの始点及び終点の座標データを入力する。   In step 100, the vertex processing unit 12 inputs the coordinate data of the start point and end point of the line to be drawn.

ステップ102では、主軸判定部58が、始点及び終点の座標に基づいて、始点及び終点を結ぶラインの主軸がX軸であるかY軸であるかを判定する。具体的には、終点のX座標から始点のX座標を減算した値の絶対値をΔX、終点のY座標から始点のY座標を減算した値の絶対値をΔYとして、ΔX≧ΔYを満たす場合はX軸が主軸であると判定し、ΔX<ΔYを満たす場合はY軸が主軸であると判定する。   In step 102, the main axis determination unit 58 determines whether the main axis of the line connecting the start point and the end point is the X axis or the Y axis based on the coordinates of the start point and the end point. Specifically, ΔX ≧ ΔY is satisfied, where ΔX is the absolute value of the value obtained by subtracting the X coordinate of the start point from the X coordinate of the end point, and ΔY is the absolute value of the value obtained by subtracting the Y coordinate of the start point from the Y coordinate of the end point. Determines that the X axis is the principal axis, and if ΔX <ΔY is satisfied, determines that the Y axis is the principal axis.

例えば図6(A)に示すラインLAの場合、ΔX≧ΔYを満たすのでX軸が主軸と判定され、同図(B)に示すラインLBの場合はΔX<ΔYを満たすのでY軸が主軸であると判定される。   For example, in the case of the line LA shown in FIG. 6A, since ΔX ≧ ΔY is satisfied, the X axis is determined as the main axis, and in the case of the line LB shown in FIG. 6B, ΔX <ΔY is satisfied, so the Y axis is the main axis. It is determined that there is.

そして、X軸が主軸の場合は、X座標を主軸座標、Y座標を副軸座標と定義し、Y軸が主軸の場合は、Y座標を主軸座標、X座標を副軸座標と定義する。   When the X axis is the main axis, the X coordinate is defined as the main axis coordinate and the Y coordinate is defined as the sub axis coordinate. When the Y axis is the main axis, the Y coordinate is defined as the main axis coordinate and the X coordinate is defined as the sub axis coordinate.

ステップ104では、描画方向判定部56が、始点及び終点のX座標及びY座標に基づいてラインの描画方向を判定する。具体的には、X軸が主軸の場合、終点のX座標から始点のX座標を減算した値が正の値であれば、描画方向はX方向の正方向であると判定し、終点のX座標から始点のX座標を減算した負の値であれば、描画方向はX方向の負方向であると判定する。なお、本実施形態では、X方向については図6において右方向を正方向、左方向を負方向とし、Y方向については図6において下方向を正方向、上方向を負方向とする。   In step 104, the drawing direction determination unit 56 determines the line drawing direction based on the X and Y coordinates of the start point and end point. Specifically, when the X axis is the main axis, if the value obtained by subtracting the X coordinate of the start point from the X coordinate of the end point is a positive value, the drawing direction is determined to be the positive direction of the X direction, and the end point X If the negative value is obtained by subtracting the X coordinate of the starting point from the coordinates, it is determined that the drawing direction is the negative direction of the X direction. In the present embodiment, for the X direction, the right direction in FIG. 6 is the positive direction and the left direction is the negative direction, and for the Y direction, the downward direction is the positive direction and the upward direction is the negative direction in FIG.

ステップ106では、終点描画判定部60が、前ラインの終点のピクセル領域内の座標と前ラインの描画方向とに基づいて、前ラインの終点が含まれるピクセルを描画するか否かを判定する。具体的には、終点描画判定部60は、図7に示す終点描画判定処理を実行する。   In step 106, the end point drawing determination unit 60 determines whether to draw a pixel including the end point of the previous line based on the coordinates in the pixel area of the end point of the previous line and the drawing direction of the previous line. Specifically, the end point drawing determination unit 60 executes the end point drawing determination process shown in FIG.

図7のステップ200では、終点描画判定部60が、前ラインの主軸がX軸であるかY軸であるかを判定し、X軸が主軸である場合にはステップ202へ移行し、Y軸が主軸である場合にはステップ212へ移行する。   In step 200 in FIG. 7, the end point drawing determination unit 60 determines whether the main axis of the previous line is the X axis or the Y axis. If the X axis is the main axis, the process proceeds to step 202, where the Y axis If is the main axis, the routine proceeds to step 212.

X軸が主軸の場合、ステップ202では、終点描画判定部60が、前ラインの終点の座標がDiamond枠Dmの枠外であるか否かを判定する。図21に示すように、ピクセル内に設定されたDiamond枠Dmの左上、左下、右上、右下に枠外の領域が存在する。そして、前ラインの終点の座標がDiamond枠Dmの枠内である場合にはステップ206へ移行して、前ラインの終点を含むピクセルは描画しないと判定する。一方、前ラインの終点の座標がDiamond枠Dmの左上又は左下の枠外である場合には、ステップ204へ移行し、前ラインの終点の座標がDiamond枠Dmの右上又は右下の枠外である場合には、ステップ208へ移行する。   When the X axis is the principal axis, in step 202, the end point drawing determination unit 60 determines whether the coordinates of the end point of the previous line are outside the frame of the Diamond frame Dm. As shown in FIG. 21, areas outside the frame exist at the upper left, lower left, upper right, and lower right of the Diamond frame Dm set in the pixel. If the coordinates of the end point of the previous line are within the frame of the Diamond frame Dm, the process proceeds to step 206, and it is determined that the pixel including the end point of the previous line is not drawn. On the other hand, if the coordinates of the end point of the previous line are outside the upper left or lower left frame of the Diamond frame Dm, the process proceeds to step 204, and the coordinates of the end point of the previous line is outside the upper right or lower right frame of the Diamond frame Dm. In step S208, the process proceeds to step 208.

前ラインの終点の座標がDiamond枠Dmの左上又は左下の枠外の場合、ステップ204では、終点描画判定部60が、前ラインの描画方向が正であるか負であるかを判定する。そして、前ラインの描画方向が正である場合には、ステップ206で前ラインの終点を含むピクセルは描画しないと判定し、前ラインの描画方向が負である場合には、ステップ210で前ラインの終点を含むピクセルは描画すると判定する。   When the coordinates of the end point of the previous line are outside the upper left or lower left frame of the Diamond frame Dm, in step 204, the end point drawing determination unit 60 determines whether the drawing direction of the previous line is positive or negative. If the drawing direction of the previous line is positive, it is determined in step 206 that pixels including the end point of the previous line are not drawn. If the drawing direction of the previous line is negative, the previous line is checked in step 210. It is determined that a pixel including the end point of is drawn.

また、前ラインの終点の座標がDiamond枠Dmの右上又は右下の枠外の場合、ステップ208では、終点描画判定部60が、前ラインの描画方向が正であるか負であるかを判定する。そして、前ラインの描画方向が正である場合には、ステップ210で前ラインの終点を含むピクセルは描画すると判定し、前ラインの描画方向が負である場合には、ステップ206で前ラインの終点を含むピクセルは描画しないと判定する。   If the coordinates of the end point of the previous line are outside the upper right or lower right frame of the Diamond frame Dm, in step 208, the end point drawing determination unit 60 determines whether the drawing direction of the previous line is positive or negative. . If the drawing direction of the previous line is positive, it is determined in step 210 that pixels including the end point of the previous line are drawn. If the drawing direction of the previous line is negative, the previous line is determined in step 206. It is determined that the pixel including the end point is not drawn.

すなわち、X軸が主軸で前ラインの終点の座標がDiamond枠Dmの左上又は左下の枠外で且つ描画方向が負の場合は、前ラインの終点を含むピクセル上を通るラインは、Diamond枠Dmの枠内から枠外へ向かうラインであるため、当該ピクセルを描画すると判定する。同様に、X軸が主軸で前ラインの終点の座標がDiamond枠Dmの右上又は右下の枠外で且つ描画方向が正の場合は、前ラインの終点を含むピクセル上を通るラインは、Diamond枠Dmの枠内から枠外へ向かうラインであるため、当該ピクセルを描画すると判定する。   That is, when the X axis is the main axis and the coordinates of the end point of the previous line are outside the upper left or lower left frame of the Diamond frame Dm and the drawing direction is negative, the line passing over the pixel including the end point of the previous line is Since the line goes from the inside of the frame to the outside of the frame, it is determined that the pixel is drawn. Similarly, when the X axis is the main axis and the coordinates of the end point of the previous line are outside the upper right or lower right frame of the Diamond frame Dm and the drawing direction is positive, the line passing over the pixel including the end point of the previous line is the Diamond frame. Since the line goes from the inside of Dm to the outside of the frame, it is determined that the pixel is drawn.

一方、Y軸が主軸の場合、ステップ212では、終点描画判定部60が、前ラインの終点の座標がDiamond枠Dmの枠外であるか否かを判定する。そして、前ラインの終点の座標がDiamond枠Dmの枠内である場合にはステップ216へ移行して、前ラインの終点を含むピクセルは描画しないと判定する。一方、前ラインの終点の座標がDiamond枠Dmの左上又は右上の枠外である場合には、ステップ214へ移行し、前ラインの終点の座標がDiamond枠Dmの左下又は右下の枠外である場合には、ステップ218へ移行する。   On the other hand, when the Y axis is the principal axis, in step 212, the end point drawing determination unit 60 determines whether or not the coordinates of the end point of the previous line are outside the frame of the Diamond frame Dm. If the coordinates of the end point of the previous line are within the frame of the Diamond frame Dm, the process proceeds to step 216, and it is determined that the pixel including the end point of the previous line is not drawn. On the other hand, if the coordinates of the end point of the previous line are outside the upper left or upper right frame of the Diamond frame Dm, the process proceeds to step 214, and the coordinates of the end point of the previous line is outside the lower left or lower right frame of the Diamond frame Dm. In step S218, the process proceeds to step 218.

前ラインの終点の座標がDiamond枠Dmの左上又は右上の枠外の場合、ステップ214では、終点描画判定部60が、前ラインの描画方向が正であるか負であるかを判定する。そして、前ラインの描画方向が正である場合には、ステップ216で前ラインの終点を含むピクセルは描画しないと判定し、前ラインの描画方向が負である場合には、ステップ220で前ラインの終点を含むピクセルは描画すると判定する。   If the coordinates of the end point of the previous line are outside the upper left or upper right frame of the Diamond frame Dm, in step 214, the end point drawing determination unit 60 determines whether the drawing direction of the previous line is positive or negative. If the drawing direction of the previous line is positive, it is determined in step 216 that pixels including the end point of the previous line are not drawn. If the drawing direction of the previous line is negative, the previous line is determined in step 220. It is determined that a pixel including the end point of is drawn.

また、前ラインの終点の座標がDiamond枠Dmの左下又は右下の枠外の場合、ステップ218では、終点描画判定部60が、前ラインの描画方向が正であるか負であるかを判定する。そして、前ラインの描画方向が正である場合には、ステップ220で前ラインの終点を含むピクセルは描画すると判定し、前ラインの描画方向が負である場合には、ステップ216で前ラインの終点を含むピクセルは描画しないと判定する。   If the coordinates of the end point of the previous line are outside the lower left or lower right frame of the Diamond frame Dm, in step 218, the end point drawing determination unit 60 determines whether the drawing direction of the previous line is positive or negative. . If the drawing direction of the previous line is positive, it is determined in step 220 that pixels including the end point of the previous line are drawn. If the drawing direction of the previous line is negative, the previous line is drawn in step 216. It is determined that the pixel including the end point is not drawn.

すなわち、Y軸が主軸で前ラインの終点の座標がDiamond枠Dmの左上又は右上の枠外で且つ描画方向が負の場合は、前ラインの終点を含むピクセル上を通るラインは、Diamond枠Dmの枠内から枠外へ向かうラインであるため、当該ピクセルを描画すると判定する。同様に、X軸が主軸で前ラインの終点の座標がDiamond枠Dmの左下又は右下の枠外で且つ描画方向が正の場合は、前ラインの終点を含むピクセル上を通るラインは、Diamond枠Dmの枠内から枠外へ向かうラインであるため、当該ピクセルを描画すると判定する。   That is, when the Y axis is the main axis and the coordinates of the end point of the previous line are outside the upper left or upper right frame of the Diamond frame Dm and the drawing direction is negative, the line passing over the pixel including the end point of the previous line is Since the line goes from the inside of the frame to the outside of the frame, it is determined that the pixel is drawn. Similarly, when the X axis is the main axis and the coordinates of the end point of the previous line are outside the lower left or lower right frame of the Diamond frame Dm and the drawing direction is positive, the line passing over the pixel including the end point of the previous line is the Diamond frame. Since the line goes from the inside of Dm to the outside of the frame, it is determined that the pixel is drawn.

図5のステップ108では、終点描画判定部60が、前ラインの終点を含むピクセルを描画すると判定されたか否かを判定し、描画有りと判定された場合はステップ110へ移行し、描画無しと判定された場合はステップ116へ移行する。   In step 108 of FIG. 5, the end point drawing determination unit 60 determines whether it is determined to draw a pixel including the end point of the previous line. If it is determined that there is drawing, the process proceeds to step 110, and no drawing is performed. If so, the process proceeds to step 116.

ステップ110では、始点補正判定部62が、前ラインの終点を描画すると判定された場合に、前ラインの終点である次ラインの始点の座標と次ラインの終点の座標とに基づいて次ラインの描画方向を判定する。また、始点補正判定部62は、次ラインの始点のピクセル領域内の座標と次ラインの描画方向とに基づいて、次ラインの始点の補正が必要か否かを判定する。具体的には、始点補正判定部62は、図8に示す始点補正判定処理を実行する。   In step 110, when it is determined that the start point correction determination unit 62 draws the end point of the previous line, the start point of the next line is determined based on the start point coordinates of the next line and the end point coordinates of the next line. Determine the drawing direction. The start point correction determination unit 62 determines whether or not the start point of the next line needs to be corrected based on the coordinates in the pixel area of the start point of the next line and the drawing direction of the next line. Specifically, the start point correction determination unit 62 executes a start point correction determination process shown in FIG.

図8のステップ300では、始点補正判定部62が、次ラインの主軸がX軸であるかY軸であるかを判定し、X軸が主軸である場合にはステップ302へ移行し、Y軸が主軸である場合にはステップ308へ移行する。   In step 300 of FIG. 8, the start point correction determination unit 62 determines whether the main axis of the next line is the X axis or the Y axis. If the X axis is the main axis, the process proceeds to step 302, where the Y axis If is the main axis, the process proceeds to step 308.

X軸が主軸の場合、ステップ302において、始点補正判定部62が、次ラインの始点の座標(前ラインの終点の座標)がDiamond枠Dmのどの位置の枠外であるかを判定する。そして、次ラインの始点の座標が左上又は左下の枠外である場合には、ステップ304へ移行し、次ラインの描画方向が正であるか否かを判定する。ここで、次ラインの始点の座標が左上又は左下の枠外で且つ次ラインの描画方向が正の場合は、次ラインの始点を含むピクセルを描画する、すなわち2度打ちする場合である。従って、ステップ304の判定は、2度打ちするか否か、すなわち、始点を補正する必要があるか否かを判定する処理と言える。そして、次ラインの描画方向が正であり次ラインの始点を補正する必要がある場合には、ステップ400へ移行し、次ラインの描画方向が負であり次ラインの始点を補正する必要がない場合は、図5のステップ116へ移行する。   When the X axis is the principal axis, in step 302, the start point correction determination unit 62 determines at which position of the diamond frame Dm the coordinates of the start point of the next line (the coordinates of the end point of the previous line) are outside the frame. If the coordinates of the start point of the next line is outside the upper left or lower left frame, the process proceeds to step 304 to determine whether the drawing direction of the next line is positive. Here, when the coordinates of the start point of the next line are out of the upper left or lower left frame and the drawing direction of the next line is positive, a pixel including the start point of the next line is drawn, that is, hit twice. Therefore, the determination in step 304 can be said to be a process of determining whether or not to strike twice, that is, whether or not the start point needs to be corrected. If the drawing direction of the next line is positive and the start point of the next line needs to be corrected, the process proceeds to step 400, where the drawing direction of the next line is negative and the start point of the next line need not be corrected. If so, the process proceeds to step 116 in FIG.

また、次ラインの始点の座標が右上又は右下の枠外である場合には、ステップ306へ移行し、次ラインの描画方向が負であるか否かを判定する。ここで、次ラインの始点の座標が右上又は右下の枠外で且つ次ラインの描画方向が負の場合は、次ラインの始点を含むピクセルを描画する、すなわち2度打ちする場合である。従って、ステップ306の判定は、2度打ちするか否か、すなわち、始点を補正する必要があるか否かを判定する処理と言える。そして、次ラインの描画方向が負であり次ラインの始点を補正する必要がある場合には、ステップ402へ移行し、次ラインの描画方向が負であり次ラインの始点を補正する必要がない場合は、図5のステップ116へ移行する。   If the coordinates of the start point of the next line is outside the upper right or lower right frame, the process proceeds to step 306 to determine whether the drawing direction of the next line is negative. Here, when the coordinates of the start point of the next line are out of the upper right or lower right frame and the drawing direction of the next line is negative, the pixel including the start point of the next line is drawn, that is, hit twice. Therefore, the determination in step 306 can be said to be a process of determining whether or not to strike twice, that is, whether or not the start point needs to be corrected. If the drawing direction of the next line is negative and the start point of the next line needs to be corrected, the process proceeds to step 402, and the drawing direction of the next line is negative and there is no need to correct the start point of the next line. If so, the process proceeds to step 116 in FIG.

一方、Y軸が主軸の場合、ステップ308において、始点補正判定部62が、次ラインの始点の座標(前ラインの終点の座標)がDiamond枠Dmのどの位置の枠外であるかを判定する。そして、次ラインの始点の座標が左上又は右上の枠外である場合には、ステップ310へ移行し、次ラインの描画方向が正であるか否かを判定する。ここで、次ラインの始点の座標が左上又は右上の枠外で且つ次ラインの描画方向が正の場合は、次ラインの始点を含むピクセルを描画する、すなわち2度打ちする場合である。従って、ステップ310の判定は、2度打ちするか否か、すなわち、始点を補正する必要があるか否かを判定する処理と言える。そして、次ラインの描画方向が正であり次ラインの始点を補正する必要がある場合には、ステップ406へ移行し、次ラインの描画方向が負であり次ラインの始点を補正する必要がない場合は、図5のステップ116へ移行する。   On the other hand, if the Y-axis is the main axis, in step 308, the start point correction determination unit 62 determines which position of the diamond frame Dm the coordinates of the start point of the next line (the coordinates of the end point of the previous line) are outside the frame. If the coordinates of the start point of the next line is outside the upper left or upper right frame, the process proceeds to step 310 to determine whether the drawing direction of the next line is positive. Here, when the coordinates of the start point of the next line are out of the upper left or upper right frame and the drawing direction of the next line is positive, the pixel including the start point of the next line is drawn, that is, hit twice. Therefore, the determination in step 310 can be said to be a process of determining whether or not to strike twice, that is, whether or not the start point needs to be corrected. If the drawing direction of the next line is positive and the start point of the next line needs to be corrected, the process proceeds to step 406, where the drawing direction of the next line is negative and the start point of the next line need not be corrected. If so, the process proceeds to step 116 in FIG.

また、次ラインの始点の座標が左下又は右下の枠外である場合には、ステップ312へ移行し、次ラインの描画方向が負であるか否かを判定する。ここで、次ラインの始点の座標が左下又は右下の枠外で且つ次ラインの描画方向が負の場合は、次ラインの始点を含むピクセルを描画する、すなわち2度打ちする場合である。従って、ステップ312の判定は、2度打ちするか否か、すなわち、始点を補正する必要があるか否かを判定する処理と言える。そして、次ラインの描画方向が負であり次ラインの始点を補正する必要がある場合は、ステップ408へ移行し、次ラインの描画方向が正であり次ラインの始点を補正する必要がない場合には、図5のステップ116へ移行する。   If the coordinates of the start point of the next line is outside the lower left or lower right frame, the process proceeds to step 312 to determine whether the drawing direction of the next line is negative. Here, when the coordinates of the start point of the next line are out of the lower left or lower right frame and the drawing direction of the next line is negative, the pixel including the start point of the next line is drawn, that is, hit twice. Therefore, the determination in step 312 can be said to be a process of determining whether or not to strike twice, that is, whether or not the start point needs to be corrected. If the drawing direction of the next line is negative and the start point of the next line needs to be corrected, the process proceeds to step 408, where the drawing direction of the next line is positive and the start point of the next line need not be corrected. Then, the process proceeds to step 116 in FIG.

図5のステップ112では、座標補正処理部64が、次ラインの始点の補正が必要と判定された場合、次ラインの始点の座標を当該始点が含まれるピクセルに隣接するピクセル内の座標に補正する。具体的には、座標補正処理部64は、図8のステップ400〜410の処理を実行する。   In step 112 of FIG. 5, when the coordinate correction processing unit 64 determines that the start point of the next line needs to be corrected, the coordinate of the start point of the next line is corrected to the coordinates in the pixel adjacent to the pixel including the start point. To do. Specifically, the coordinate correction processing unit 64 executes the processing of steps 400 to 410 in FIG.

次ラインの始点の座標が左下又は左下の枠外で且つ次ラインの描画方向が正である場合、図8のステップ400では、座標補正処理部64が、次ラインの始点のX座標を補正する。例えば、次ラインの始点のX座標をXsとすると、補正後のX座標AXsを次式により算出する。   When the coordinates of the start point of the next line are outside the lower left or lower left frame and the drawing direction of the next line is positive, in step 400 of FIG. 8, the coordinate correction processing unit 64 corrects the X coordinate of the start point of the next line. For example, if the X coordinate of the starting point of the next line is Xs, the corrected X coordinate AXs is calculated by the following equation.

AXs=Xs+a ・・・(2) AXs = Xs + a (2)

ここで、aは予め定めた補正量であり、例えば1.0が設定される。a=1.0の場合、X座標を正方向に1ピクセル分補正することとなる。なお、補正量はこれに限られるものではなく、例えば隣接するピクセルの中心に補正するための値としてもよい。 Here, a is a predetermined correction amount, for example, 1.0 is set. When a = 1.0, the X coordinate is corrected by one pixel in the positive direction. The correction amount is not limited to this, and may be a value for correcting to the center of adjacent pixels, for example.

次ラインの始点の座標が右上又は右下の枠外で且つ次ラインの描画方向が負である場合、ステップ402では、座標補正処理部64が、次ラインの始点のX座標を補正する。例えば、次ラインの始点のX座標をXsとすると、補正後のX座標AXsを次式により算出する。   When the coordinates of the start point of the next line are outside the upper right or lower right frame and the drawing direction of the next line is negative, in step 402, the coordinate correction processing unit 64 corrects the X coordinate of the start point of the next line. For example, if the X coordinate of the starting point of the next line is Xs, the corrected X coordinate AXs is calculated by the following equation.

AXs=Xs−a ・・・(3) AXs = Xs−a (3)

ここで、aは例えば1.0が設定される。a=1.0の場合、X座標を負方向に1ピクセル分補正することとなる。 Here, a is set to 1.0, for example. When a = 1.0, the X coordinate is corrected by one pixel in the negative direction.

このように、座標補正処理部64は、次ラインの描画方向が正方向であればX座標を正方向に補正し、次ラインの描画方向が負方向であればX座標を負方向に補正する。   As described above, the coordinate correction processing unit 64 corrects the X coordinate in the positive direction if the drawing direction of the next line is positive, and corrects the X coordinate in the negative direction if the drawing direction of the next line is negative. .

ステップ404では、座標補正処理部64が、次ラインの始点のY座標を補正する。例えば、次ラインの始点のY座標をYsとすると、補正後のY座標AYsを次式により算出する。   In step 404, the coordinate correction processing unit 64 corrects the Y coordinate of the start point of the next line. For example, if the Y coordinate of the start point of the next line is Ys, the corrected Y coordinate AYs is calculated by the following equation.

AYs=Ys+(b1×a) ・・・(4) AYs = Ys + (b1 × a) (4)

ここで、b1は次ラインの傾き、すなわちX座標の単位増加量に対するY座標の変化量の割合である。aは例えば1.0が設定される。a=1.0の場合、傾きb1が正の値であればY座標を1ピクセル分正方向に補正することとなる。また、傾きb1が負の値であればY座標を1ピクセル分負方向に補正することとなる。 Here, b1 is the inclination of the next line, that is, the ratio of the change amount of the Y coordinate to the unit increase amount of the X coordinate. For example, 1.0 is set for a. When a = 1.0, if the slope b1 is a positive value, the Y coordinate is corrected in the positive direction by one pixel. If the slope b1 is a negative value, the Y coordinate is corrected in the negative direction by one pixel.

次ラインの始点の座標が左上又は右上の枠外で且つ次ラインの描画方向が正である場合、ステップ406では、座標補正処理部64が、次ラインの始点のY座標を補正する。例えば、次ラインの始点のY座標をYsとすると、補正後のX座標AYsを次式により算出する。   If the coordinates of the start point of the next line are outside the upper left or upper right frame and the drawing direction of the next line is positive, in step 406, the coordinate correction processing unit 64 corrects the Y coordinate of the start point of the next line. For example, if the Y coordinate of the start point of the next line is Ys, the corrected X coordinate AYs is calculated by the following equation.

AYs=Ys+a ・・・(5) AYs = Ys + a (5)

ここで、aは例えば1.0が設定される。a=1.0の場合、Y座標を正方向に1ピクセル分補正することとなる。 Here, a is set to 1.0, for example. When a = 1.0, the Y coordinate is corrected by one pixel in the positive direction.

次ラインの始点の座標が左下又は右下の枠外で且つ次ラインの描画方向が負である場合、ステップ408では、座標補正処理部64が、次ラインの始点のY座標を補正する。例えば、次ラインの始点のY座標をYsとすると、補正後のY座標AYsを次式により算出する。   When the coordinates of the start point of the next line are outside the lower left or lower right frame and the drawing direction of the next line is negative, in step 408, the coordinate correction processing unit 64 corrects the Y coordinate of the start point of the next line. For example, if the Y coordinate of the start point of the next line is Ys, the corrected Y coordinate AYs is calculated by the following equation.

AYs=Ys−a ・・・(6) AYs = Ys−a (6)

ここで、aは例えば1.0が設定される。a=1.0の場合、Y座標を負方向に1ピクセル分補正することとなる。 Here, a is set to 1.0, for example. When a = 1.0, the Y coordinate is corrected by one pixel in the negative direction.

このように、座標補正処理部64は、次ラインの描画方向が正方向であればY座標を正方向に補正し、次ラインの描画方向が負方向であればY座標を負方向に補正する。   As described above, the coordinate correction processing unit 64 corrects the Y coordinate in the positive direction if the drawing direction of the next line is positive, and corrects the Y coordinate in the negative direction if the drawing direction of the next line is negative. .

ステップ410では、次ラインの始点のX座標を補正する。例えば、次ラインの始点のX座標をXsとすると、補正後のX座標AXsを次式により算出する。   In step 410, the X coordinate of the start point of the next line is corrected. For example, if the X coordinate of the starting point of the next line is Xs, the corrected X coordinate AXs is calculated by the following equation.

AXs=Xs+(b2×a) ・・・(7) AXs = Xs + (b2 × a) (7)

ここで、b2は次ラインの傾き、すなわちY座標の単位増加量に対するX座標の変化量の割合である。aは予め定めた補正量であり、例えば1.0が設定される。a=1.0の場合、傾きb2が正の値であればX座標を1ピクセル分正方向に補正することとなる。また、傾きb2が負の値であればX座標を1ピクセル分負方向に補正することとなる。 Here, b2 is the inclination of the next line, that is, the ratio of the change amount of the X coordinate to the unit increase amount of the Y coordinate. a is a predetermined correction amount, for example, 1.0 is set. When a = 1.0, if the slope b2 is a positive value, the X coordinate is corrected in the positive direction by one pixel. If the slope b2 is a negative value, the X coordinate is corrected in the negative direction by one pixel.

図9には、次ラインの始点の座標を補正した場合の一例を示した。同図に示すように、前ライン(1ライン目)L11の終点E11がDiamond枠Dmの右上の枠外の場合に、Y軸が主軸である次ライン(2ライン目)L21の描画方向が正方向の場合、次ラインL21の始点S21のY座標を上記(5)式により補正する。図9では、補正量aをa=1.0として補正しているため、次ラインL21の始点S21のY座標を同図において下方向に1ピクセル分補正する。また、次ラインL21の始点S21のX座標は、上記(7)式により補正する。すなわち、次ラインL21の始点S21のX座標を(次ラインL21の傾き×1.0)分補正する。これにより、次ラインL21の始点S21は始点S22に補正される。なお、次ラインL23、L24については、次ラインの始点を補正する必要はない。   FIG. 9 shows an example when the coordinates of the start point of the next line are corrected. As shown in the figure, when the end point E11 of the previous line (first line) L11 is outside the upper right frame of the diamond frame Dm, the drawing direction of the next line (second line) L21 whose main axis is the Y axis is the positive direction. In this case, the Y coordinate of the start point S21 of the next line L21 is corrected by the above equation (5). In FIG. 9, since the correction amount a is corrected as a = 1.0, the Y coordinate of the start point S21 of the next line L21 is corrected by one pixel in the downward direction in FIG. Further, the X coordinate of the starting point S21 of the next line L21 is corrected by the above equation (7). That is, the X coordinate of the start point S21 of the next line L21 is corrected by (the inclination of the next line L21 × 1.0). Thereby, the starting point S21 of the next line L21 is corrected to the starting point S22. For the next lines L23 and L24, it is not necessary to correct the start point of the next line.

また、同図に示すように、前ラインL11の終点E11がDiamond枠Dmの右上の枠外の場合において、主軸がX軸である次ラインL22の描画方向が負方向の場合、次ラインL22の始点S21のX座標を上記(3)式により補正する。図9では、補正量aをa=1.0として補正しているため、次ラインL22の始点S21のX座標を同図において左方向に1ピクセル分補正する。また、次ラインL22の始点S21のY座標は、上記(4)式により補正する。すなわち、次ラインL22の始点S21のY座標を(次ラインの傾き×1.0)分補正する。これにより、次ラインL22の始点S21は始点S23に補正される。   As shown in the figure, when the end point E11 of the previous line L11 is outside the upper right frame of the diamond frame Dm, and the drawing direction of the next line L22 whose principal axis is the X axis is the negative direction, the start point of the next line L22 The X coordinate of S21 is corrected by the above equation (3). In FIG. 9, since the correction amount a is corrected with a = 1.0, the X coordinate of the start point S21 of the next line L22 is corrected by one pixel in the left direction in the figure. Further, the Y coordinate of the starting point S21 of the next line L22 is corrected by the above equation (4). That is, the Y coordinate of the start point S21 of the next line L22 is corrected by (the inclination of the next line × 1.0). Thereby, the starting point S21 of the next line L22 is corrected to the starting point S23.

また、同図に示すように、前ラインL12の終点E12がDiamond枠Dmの左下の枠外の場合に、Y軸が主軸である次ラインL25の描画方向が負方向の場合、次ラインL25の始点S24のY座標を上記(6)式により補正する。図9では、補正量aをa=1.0として補正しているため、次ラインL25の始点S24のY座標を同図において上方向に1ピクセル分補正する。また、次ラインL25の始点S24のX座標は、上記(7)式により補正する。すなわち、次ラインL25の始点S24のX座標を(次ラインL25の傾き×1.0)分補正する。これにより、次ラインL25の始点S24は始点S25に補正される。   Also, as shown in the figure, when the end point E12 of the previous line L12 is outside the lower left frame of the Diamond frame Dm, and the drawing direction of the next line L25 whose Y axis is the main axis is the negative direction, the start point of the next line L25 The Y coordinate of S24 is corrected by the above equation (6). In FIG. 9, since the correction amount a is corrected as a = 1.0, the Y coordinate of the start point S24 of the next line L25 is corrected by one pixel in the upward direction in FIG. Further, the X coordinate of the start point S24 of the next line L25 is corrected by the above equation (7). That is, the X coordinate of the starting point S24 of the next line L25 is corrected by (the inclination of the next line L25 × 1.0). Thereby, the starting point S24 of the next line L25 is corrected to the starting point S25.

また、同図に示すように、前ラインL12の終点E12がDiamond枠Dmの左下の枠外の場合において、主軸がX軸である次ラインL26の描画方向が正方向の場合、次ラインL26の始点S24のX座標を上記(2)式により補正する。図9では、補正量aをa=1.0として補正しているため、次ラインL26の始点S24のX座標を同図において右方向に1ピクセル分補正する。また、次ラインL26の始点S24のY座標は、上記(4)式により補正する。すなわち、次ラインL26の始点S24のY座標を(次ラインL26の傾き×1.0)分補正する。これにより、次ラインL26の始点S24は始点S26に補正される。なお、次ラインL27、L28については、次ラインの始点を補正する必要はない。   As shown in the figure, when the end point E12 of the previous line L12 is outside the lower left frame of the diamond frame Dm, and the drawing direction of the next line L26 whose main axis is the X axis is the positive direction, the start point of the next line L26 The X coordinate of S24 is corrected by the above equation (2). In FIG. 9, since the correction amount a is corrected as a = 1.0, the X coordinate of the start point S24 of the next line L26 is corrected by one pixel in the right direction in the figure. Further, the Y coordinate of the starting point S24 of the next line L26 is corrected by the above equation (4). That is, the Y coordinate of the starting point S24 of the next line L26 is corrected by (the inclination of the next line L26 × 1.0). As a result, the starting point S24 of the next line L26 is corrected to the starting point S26. For the next lines L27 and L28, it is not necessary to correct the start point of the next line.

上記のように次ラインの始点を補正した後は、図5のステップ114へ移行する。   After correcting the start point of the next line as described above, the routine proceeds to step 114 in FIG.

図5のステップ114では、ライン消失判定部66が、次ラインの主軸方向における長さが1ピクセル以上の場合は、座標補正処理部64により補正された次ラインの始点の座標をDER処理部50へ出力する。また、ライン消失判定部66は、次ラインの主軸方向における長さが1ピクセル未満の場合には、次ラインを消失すべきと判定して次ラインを非描画とするようにDER処理部50に通知する。具体的には、ライン消失判定部66は、図10に示すライン消失判定処理を実行する。   In step 114 of FIG. 5, when the length of the next line in the principal axis direction is 1 pixel or more, the line disappearance determination unit 66 determines the coordinates of the start point of the next line corrected by the coordinate correction processing unit 64 as the DER processing unit 50. Output to. Further, the line disappearance determination unit 66 determines that the next line should be lost when the length of the next line in the principal axis direction is less than 1 pixel, and causes the DER processing unit 50 not to draw the next line. Notice. Specifically, the line disappearance determination unit 66 executes a line disappearance determination process shown in FIG.

図10に示すように、ステップ500では、ライン消失判定部66が、次ラインの補正後の始点の座標と次ラインの終点の座標と、に基づいて、始点補正後の次ラインの描画方向を算出する。この描画方向の判定は、図5のステップ104と同様である。すなわち、補正後の次ラインのX方向が主軸の場合、終点のX座標から補正後の始点のX座標を減算した値が正の値であれば、補正後の次ラインの描画方向は正方向であると判定する。また、終点のX座標から補正後の始点のX座標を減算した負の値であれば、補正後の次ラインの描画方向は負方向であると判定する。   As shown in FIG. 10, in step 500, the line disappearance determination unit 66 determines the drawing direction of the next line after the start point correction based on the coordinates of the start point after the correction of the next line and the coordinates of the end point of the next line. calculate. The determination of the drawing direction is the same as step 104 in FIG. In other words, when the X direction of the next line after correction is the main axis, if the value obtained by subtracting the X coordinate of the start point after correction from the X coordinate of the end point is a positive value, the drawing direction of the next line after correction is the positive direction It is determined that Further, if the negative value is obtained by subtracting the X coordinate of the corrected start point from the X coordinate of the end point, the drawing direction of the next line after correction is determined to be a negative direction.

ステップ502では、始点の座標を補正する前の次ラインの描画方向と、始点を補正した後の次ラインの描画方向と、を比較する。すなわち、図7のステップ304、306、310、312で算出した補正前の次ラインの描画方向と、ステップ500で算出した始点を補正した後の次ラインの描画方向と、を比較する。   In step 502, the drawing direction of the next line before correcting the coordinates of the starting point is compared with the drawing direction of the next line after correcting the starting point. That is, the drawing direction of the next line before correction calculated in steps 304, 306, 310, and 312 in FIG. 7 is compared with the drawing direction of the next line after correcting the start point calculated in step 500.

ステップ504では、ライン消失判定部66が、始点を補正する前の次ラインの描画方向と始点を補正した後の次ラインの描画方向とが同一であるか否かを判定し、同一であった場合にはステップ506へ移行し、同一でなかった場合にはステップ508へ移行する。   In step 504, the line disappearance determination unit 66 determines whether or not the drawing direction of the next line before the start point is corrected and the drawing direction of the next line after the start point is corrected are the same. If so, the process proceeds to step 506, and if not identical, the process proceeds to step 508.

ステップ506では、ライン消失判定部66が、始点を補正した後の次ラインの始点の座標データをDER処理部50へ出力する。図5のステップ116では、DER処理部50が、補正後の次ラインの始点の座標データに基づいてDER処理を実行して描画情報(始点及び終点の座標、ラインの傾き値、ラインの長さ、主軸情報等)を生成し、セレクト部54へ出力する。なお、DER処理部50は、前ラインの終点の座標データを次ラインの始点の座標データとして終点描画判定部60に出力する。これにより、次回図5の処理が実行されると、ステップ106では、前ラインの終点の座標データを次ラインの始点の座標データとして終点描画判定処理を実行する。   In step 506, the line disappearance determination unit 66 outputs the coordinate data of the start point of the next line after correcting the start point to the DER processing unit 50. In step 116 of FIG. 5, the DER processing unit 50 executes DER processing based on the coordinate data of the start point of the next line after correction, and draws the drawing information (start point and end point coordinates, line inclination value, line length). , Main axis information, etc.) and output to the selector 54. The DER processing unit 50 outputs the coordinate data of the end point of the previous line to the end point drawing determination unit 60 as the coordinate data of the start point of the next line. Thus, when the process of FIG. 5 is executed next time, in step 106, the end point drawing determination process is executed using the coordinate data of the end point of the previous line as the coordinate data of the start point of the next line.

一方、ステップ508では、次ラインを消失したものと判定し、その旨をセレクト部54へ通知し、次の座標データの処理に移行する。セレクト部54は、ライン消失判定部66からラインを消失した旨が通知されなかった場合は、DER処理部50からの描画情報を出力し、ライン消失判定部66からラインを消失した旨が通知された場合は、DER処理部50からの描画情報を出力しない。   On the other hand, in step 508, it is determined that the next line has disappeared, and a notification to that effect is sent to the next coordinate data processing. When the selection unit 54 is not notified of the disappearance of the line from the line disappearance determination unit 66, the selection unit 54 outputs the drawing information from the DER processing unit 50, and is notified of the disappearance of the line from the line disappearance determination unit 66. In the case where the DER processing unit 50 has received, the drawing information from the DER processing unit 50 is not output.

図11には、次ラインが消失する場合の一例を示した。同図に示すように、主軸がY軸で描画方向が正方向の前ラインL1の終点E1がDiamond枠Dmの左下の枠外の場合、終点E1を含むピクセルPXLは描画すると判定される。   FIG. 11 shows an example where the next line disappears. As shown in the figure, when the end point E1 of the front line L1 whose main axis is the Y axis and the drawing direction is the positive direction is outside the lower left frame of the Diamond frame Dm, the pixel PXL including the end point E1 is determined to be drawn.

そして、例えば次ラインL21〜L23の終点E21〜E23の場合のように、次ラインL21〜L23の主軸がX軸で描画方向が正方向となる場合は、次ラインL21〜L23の始点S2は、隣接するピクセル内の始点S21〜S23に補正される。   And, for example, when the main axes of the next lines L21 to L23 are the X axis and the drawing direction is the positive direction, as in the case of the end points E21 to E23 of the next lines L21 to L23, the start point S2 of the next lines L21 to L23 is Correction is made to the start points S21 to S23 in the adjacent pixels.

また、次ラインL24〜L26の終点E24〜26の場合のように、次ラインL24〜L26の主軸がY軸で描画方向が負方向となる場合は、次ラインL24〜L26の始点S2は、隣接するピクセル内の始点S24〜S26に補正される。   Also, as in the case of the end points E24 to L26 of the next lines L24 to L26, when the main axis of the next lines L24 to L26 is the Y axis and the drawing direction is negative, the start point S2 of the next lines L24 to L26 is adjacent. The starting points S24 to S26 in the pixel to be corrected are corrected.

ここで、始点を補正する前の次ラインL21〜L26は、主軸方向における長さが1ピクセル未満の長さであるため、始点を補正した後の次ラインL21’〜L26’の描画方向と同一ではない。このため、次ラインL21〜L26は消失するラインと判定される。   Here, since the next lines L21 to L26 before the start point is corrected have a length in the main axis direction of less than one pixel, they are the same as the drawing directions of the next lines L21 ′ to L26 ′ after the start point is corrected. is not. For this reason, the next lines L21 to L26 are determined to disappear.

図12には、次ラインが消失する場合の他の例を示した。同図は、前ラインL1の主軸がX軸で描画方向が負方向であること以外は、図11と同様である。この場合も、補正前の次ラインL21〜L26の主軸方向における長さは全て1ピクセル未満であり、補正前後の描画方向が同一でないため、全て消失するラインと判定される。   FIG. 12 shows another example where the next line disappears. This figure is the same as FIG. 11 except that the main axis of the front line L1 is the X axis and the drawing direction is the negative direction. Also in this case, the lengths of the next lines L21 to L26 before correction are all less than one pixel, and the drawing directions before and after correction are not the same, so that all the lines are determined to disappear.

図13には、次ラインが消失する場合の他の例を示した。同図は、前ラインL1の主軸がY軸で描画方向が正方向であること、前ラインL1の終点E1がDiamond枠Dmの右下の枠外であること以外は、図11と同様である。この場合も、補正前の次ラインL21〜L26の主軸方向における長さは全て1ピクセル未満であり、補正前後の描画方向が同一でないため、全て消失するラインと判定される。   FIG. 13 shows another example when the next line disappears. This figure is the same as FIG. 11 except that the main axis of the front line L1 is the Y axis and the drawing direction is the positive direction, and the end point E1 of the front line L1 is outside the lower right frame of the Diamond frame Dm. Also in this case, the lengths of the next lines L21 to L26 before correction are all less than one pixel, and the drawing directions before and after correction are not the same, so that all the lines are determined to disappear.

図14には、次ラインが消失する場合の他の例を示した。同図は、前ラインL1の主軸がX軸で描画方向が正方向であること以外は、図13と同様である。この場合も、補正前の次ラインL21〜L26の主軸方向における長さは全て1ピクセル未満であり、補正前後の描画方向が同一でないため、全て消失するラインと判定される。   FIG. 14 shows another example when the next line disappears. This figure is the same as FIG. 13 except that the main axis of the front line L1 is the X axis and the drawing direction is the positive direction. Also in this case, the lengths of the next lines L21 to L26 before correction are all less than one pixel, and the drawing directions before and after correction are not the same, so that all the lines are determined to disappear.

図15には、次ラインが消失する場合の他の例を示した。同図は、前ラインL1の主軸がY軸で描画方向が負方向であること、前ラインL1の終点E1がDiamond枠Dmの左上の枠外であること以外は、図11と同様である。この場合も、補正前の次ラインL21〜L26の主軸方向における長さは全て1ピクセル未満であり、補正前後の描画方向が同一でないため、全て消失するラインと判定される。   FIG. 15 shows another example in which the next line disappears. This figure is the same as FIG. 11 except that the main axis of the front line L1 is the Y axis and the drawing direction is negative, and the end point E1 of the front line L1 is outside the upper left frame of the Diamond frame Dm. Also in this case, the lengths of the next lines L21 to L26 before correction are all less than one pixel, and the drawing directions before and after correction are not the same, so that all the lines are determined to disappear.

図16には、次ラインが消失する場合の他の例を示した。同図は、前ラインL1の主軸がX軸で描画方向が負方向であること以外は、図15と同様である。この場合も、補正前の次ラインL21〜L26の主軸方向における長さは全て1ピクセル未満であり、補正前後の描画方向が同一でないため、全て消失するラインと判定される。   FIG. 16 shows another example when the next line disappears. This figure is the same as FIG. 15 except that the main axis of the front line L1 is the X axis and the drawing direction is the negative direction. Also in this case, the lengths of the next lines L21 to L26 before correction are all less than one pixel, and the drawing directions before and after correction are not the same, so that all the lines are determined to disappear.

図17には、次ラインが消失する場合の他の例を示した。同図は、前ラインL1の主軸がY軸で描画方向が負方向であること、前ラインL1の終点E1がDiamond枠Dmの右上の枠外であること以外は、図11と同様である。この場合も、補正前の次ラインL21〜L26の主軸方向における長さは全て1ピクセル未満であり、補正前後の描画方向が同一でないため、全て消失するラインと判定される。   FIG. 17 shows another example in which the next line disappears. This figure is the same as FIG. 11 except that the main axis of the front line L1 is the Y axis and the drawing direction is negative, and the end point E1 of the front line L1 is outside the upper right frame of the Diamond frame Dm. Also in this case, the lengths of the next lines L21 to L26 before correction are all less than one pixel, and the drawing directions before and after correction are not the same, so that all the lines are determined to disappear.

図18には、次ラインが消失する場合の他の例を示した。同図は、前ラインL1の主軸がX軸で描画方向が正方向であること以外は、図17と同様である。この場合も、補正前の次ラインL21〜L26の主軸方向における長さは全て1ピクセル未満であり、補正前後の描画方向が同一でないため、全て消失するラインと判定される。   FIG. 18 shows another example where the next line disappears. This figure is the same as FIG. 17 except that the main axis of the front line L1 is the X axis and the drawing direction is the positive direction. Also in this case, the lengths of the next lines L21 to L26 before correction are all less than one pixel, and the drawing directions before and after correction are not the same, so that all the lines are determined to disappear.

このように、本実施形態では、DiamondExitRuleをそのまま適用すると前ラインの終点、すなわち次ラインの始点を含むピクセルを2度打ちしてしまう場合には、次ラインの始点の座標を隣接するピクセル内の座標に補正する。このため、図19に示すように、前ラインL1の終点E1(次ラインL2の始点S2)を含むピクセルPXLが2度打ちされてしまうのを防止することができる。   As described above, in this embodiment, when the DiamondExitRule is applied as it is, the end point of the previous line, that is, the pixel including the start point of the next line is hit twice, the coordinates of the start point of the next line are set in the adjacent pixels. Correct to coordinates. For this reason, as shown in FIG. 19, it is possible to prevent the pixel PXL including the end point E1 of the previous line L1 (start point S2 of the next line L2) from being hit twice.

また、次ラインの主軸方向における始点の座標と終点の座標との差が1ピクセル未満の場合に、次ラインの始点を補正したままDiamondExitRuleを適用すると、補正後の次ラインの始点を含むピクセルを描画してしまう。これに対し、本実施形態では、次ラインの主軸方向における長さが1ピクセル未満の場合、すなわち補正前後の次ラインの描画方向が同一でない場合には、次ラインを消失したものとして扱うので、余分なピクセルが描画されてしまうのを防ぐことができる。   Also, if the difference between the start point coordinate and the end point coordinate of the next line in the main axis direction is less than 1 pixel, applying DiamondExitRule with the start point of the next line corrected will result in the pixels including the start point of the corrected next line. Will draw. On the other hand, in this embodiment, when the length of the next line in the principal axis direction is less than 1 pixel, that is, when the drawing direction of the next line before and after correction is not the same, the next line is treated as having been lost. It is possible to prevent extra pixels from being drawn.

なお、本実施形態では、補正前後の次ラインの描画方向が同一であるか否かを判定することにより、補正前の次ラインの主軸方向における長さが1ピクセル未満か否かを判定するようにしたが、判定方法はこれに限られるものではない。例えば、補正前の次ラインの始点及び終点の座標に基づいて補正前の次ラインの主軸方向の長さを算出し、その長さが1ピクセル未満の場合に次ラインを消失したものとして扱うようにしてもよい。   In the present embodiment, it is determined whether the length of the next line before correction in the main axis direction is less than 1 pixel by determining whether the drawing direction of the next line before and after correction is the same. However, the determination method is not limited to this. For example, the length in the main axis direction of the next line before correction is calculated based on the coordinates of the start point and end point of the next line before correction, and if the length is less than 1 pixel, the next line is treated as lost. It may be.

また、本実施形態では、Diamond枠Dmの枠内から枠外へ向かうラインが通るピクセルを描画する場合について説明したが、Diamond枠Dmの枠外から枠内へ向かうラインが通るピクセルを描画するようにしてもよい。   Further, in the present embodiment, the case where the pixel passing through the line from the inside of the diamond frame Dm to the outside of the frame is described, but the pixel passing through the line from the outside of the diamond frame Dm to the inside of the frame is drawn. Also good.

また、本実施形態では、DiamondExitRuleを用いて連続ラインを描画する場合について説明したが、ピクセル内に予め設定された枠とピクセル内において少なくとも1回交差するピクセルを描画するルールであれば、これに限られるものではない。例えば、ピクセル内に設定する枠は、ダイアモンド枠、すなわち菱形形状の枠に限らず、三角形や五角形等の多角形状でもよく、円等の曲線を含む形状でもよい。   Further, in this embodiment, the case of drawing a continuous line using DiamondExitRule has been described. However, if the rule draws a pixel that intersects at least once in a pixel with a frame preset in the pixel, It is not limited. For example, the frame set in the pixel is not limited to a diamond frame, that is, a diamond-shaped frame, but may be a polygonal shape such as a triangle or a pentagon, or a shape including a curve such as a circle.

また、上記では開示の技術に係るライン描画プログラムの一例であるライン描画プログラム80が記憶部76に予め記憶(インストール)されている態様を説明したが、これに限定されるものではない。開示の技術に係る画像処理プログラムは、CD−ROMやDVD−ROM等の記録媒体に記録されている形態で提供することも可能である。   In the above description, the line drawing program 80, which is an example of the line drawing program according to the disclosed technique, is stored (installed) in the storage unit 76 in advance. However, the present invention is not limited to this. The image processing program according to the disclosed technology can be provided in a form recorded on a recording medium such as a CD-ROM or a DVD-ROM.

本明細書に記載された全ての文献、特許出願及び技術規格は、個々の文献、特許出願及び技術規格が参照により取り込まれることが具体的かつ個々に記された場合と同程度に、本明細書中に参照により取り込まれる。   All documents, patent applications and technical standards mentioned in this specification are to the same extent as if each individual document, patent application and technical standard were specifically and individually stated to be incorporated by reference. Incorporated by reference in the book.

以上の実施形態に関し、更に以下の付記を開示する。   Regarding the above embodiment, the following additional notes are disclosed.

(付記1)
第1及び第2ラインの座標情報が入力され、前記第1ラインの描画情報を描画ルールに基づいて生成すると共に、前記第1ラインの終点を次に描画する前記第2ラインの始点として、連続描画するための第1の描画情報を生成する描画情報生成部と、
前記第1ラインの終点を含むピクセル領域内の座標と前記第1ラインの描画方向とに基づいて、前記第1ラインの終点を含む前記ピクセルを描画するか否かを判定する終点描画判定部と、
前記描画判定部が前記第1ラインの終点を含む前記ピクセルを描画すると判定した場合に、前記第1ラインの終点である前記第2ラインの始点の座標と前記第2ラインの終点の座標とに基づいて前記第2ラインの描画方向を判定し、前記第2ラインの始点の座標と前記第2ラインの描画方向とに基づいて、前記第2ラインの始点の座標の補正が必要か否かを判定する始点補正判定部と、
前記第2ラインの始点の座標の補正が必要と判定された場合、前記第2ラインの始点の座標を当該始点が含まれるピクセルに隣接するピクセル内の座標に補正する座標補正処理部と、
前記第2ラインの主軸方向における長さが1ピクセル以上の場合は、前記座標補正処理部により補正された前記第2ラインの始点の座標を第2の描画情報として出力し、前記第2ラインの主軸方向における長さが1ピクセル未満の場合には、前記第2ラインを消失すべきと判定して前記第2ラインを非描画とするライン消失判定部と、
前記第1の描画情報あるいは前記第2の描画情報に基づいて描画処理を行なう描画処理部と、
を備えたことを特徴とするライン描画装置。
(Appendix 1)
The coordinate information of the first and second lines is input, the drawing information of the first line is generated based on the drawing rule, and the end point of the first line is continuously used as the starting point of the second line to be drawn next. A drawing information generation unit that generates first drawing information for drawing;
An end point drawing determination unit for determining whether to draw the pixel including the end point of the first line based on the coordinates in the pixel region including the end point of the first line and the drawing direction of the first line; ,
When the drawing determination unit determines to draw the pixel including the end point of the first line, the coordinates of the start point of the second line, which is the end point of the first line, and the coordinates of the end point of the second line And determining whether the second line start point coordinate needs to be corrected based on the second line start point coordinate and the second line drawing direction. A starting point correction determination unit for determining;
A coordinate correction processing unit that corrects the coordinates of the start point of the second line to the coordinates in the pixel adjacent to the pixel including the start point when it is determined that the correction of the start point of the second line is necessary;
When the length of the second line in the principal axis direction is 1 pixel or more, the coordinates of the start point of the second line corrected by the coordinate correction processing unit are output as second drawing information, When the length in the main axis direction is less than 1 pixel, a line disappearance determination unit that determines that the second line should be disappeared and makes the second line non-drawn;
A drawing processing unit for performing drawing processing based on the first drawing information or the second drawing information;
A line drawing apparatus comprising:

(付記2)
前記ライン消失判定部は、前記第2ラインの始点を補正する前の前記第2ラインの描画方向と、前記第2ラインの始点を補正した後の前記第2ラインの描画方向と、が同一であるか否かを判定し、同一である場合に、前記第2ラインの主軸方向における長さが1ピクセル以上であると判定し、同一でない場合に、前記次ラインの主軸方向における長さが1ピクセル未満であると判定する
ことを特徴とする付記1記載のライン描画装置。
(Appendix 2)
The line disappearance determination unit has the same drawing direction of the second line before correcting the starting point of the second line and the drawing direction of the second line after correcting the starting point of the second line. If it is the same, it is determined that the length of the second line in the principal axis direction is 1 pixel or more. If not, the length of the next line in the principal axis direction is 1 The line drawing apparatus according to appendix 1, wherein the line drawing device is determined to be less than a pixel.

(付記3)
前記始点及び前記終点の座標に基づいて、前記始点及び前記終点を結ぶラインの主軸がX軸であるか前記X軸と直交するY軸であるかを判定する主軸判定部と、
前記ラインの前記始点及び前記終点のX座標及びY座標の各々に基づいて前記ラインの描画方向を判定する描画方向判定部と、
を備えることを特徴とする付記1又は付記2記載のライン描画装置。
(Appendix 3)
Based on the coordinates of the start point and the end point, a main axis determination unit that determines whether the main axis of the line connecting the start point and the end point is the X axis or the Y axis orthogonal to the X axis;
A drawing direction determination unit that determines a drawing direction of the line based on each of the X coordinate and the Y coordinate of the start point and the end point of the line;
The line drawing apparatus according to Supplementary Note 1 or Supplementary Note 2, characterized by comprising:

(付記4)
前記終点描画判定部は、前記主軸判定部により判定された前記第1ラインの主軸と、前記第1ラインの終点の前記ピクセル内の位置と、前記描画判定部により判定された前記第1ラインの描画方向と、に基づいて、前記第1ラインの終点が含まれるピクセルを描画するか否かを判定する
ことを特徴とする付記3記載のライン描画装置。
(Appendix 4)
The end point drawing determination unit includes the main axis of the first line determined by the main axis determination unit, the position of the end point of the first line in the pixel, and the first line determined by the drawing determination unit. The line drawing apparatus according to claim 3, wherein whether or not to draw a pixel including the end point of the first line is determined based on a drawing direction.

(付記5)
前記始点補正判定部は、前記第1ラインの終点を描画すると判定された場合に、前記主軸判定部により判定された前記第2ラインの主軸と、前記描画方向判定部により判定された前記第2ラインの描画方向と、前記第2ラインの始点の前記ピクセル内の位置と、に基づいて、前記第2ラインの始点の座標の補正が必要か否かを判定する
ことを特徴とする付記3又は付記4記載のライン描画装置。
(Appendix 5)
When it is determined that the end point of the first line is drawn, the start point correction determination unit determines the main axis of the second line determined by the main axis determination unit and the second determined by the drawing direction determination unit. The supplementary note 3 or 3, wherein whether or not the correction of the coordinates of the start point of the second line is necessary is determined based on the drawing direction of the line and the position in the pixel of the start point of the second line. The line drawing apparatus according to appendix 4.

(付記6)
前記座標補正処理部は、前記第2ラインの主軸が前記X軸の場合は、前記第2ラインの始点のX座標を1ピクセル分補正すると共に前記第2ラインの始点のY座標を前記第2ラインの傾きに応じた分補正し、前記第2ラインの主軸が前記Y軸の場合は、前記第2ラインの始点のY座標を1ピクセル分補正すると共に前記第2ラインの始点のX座標を前記第2ラインの傾きに応じた分補正する
ことを特徴とする付記1〜5の何れか1項に記載のライン描画装置。
(付記7)
前記描画ルールは、前記始点と終点とを結ぶ第1ラインが、ピクセル内に予め設定された枠と前記ピクセル内において少なくとも1回交差するピクセルを描画するルールである
ことを特徴とする付記1〜6の何れか1項に記載のライン描画装置。
(Appendix 6)
When the principal axis of the second line is the X axis, the coordinate correction processing unit corrects the X coordinate of the start point of the second line by one pixel and sets the Y coordinate of the start point of the second line to the second If the main axis of the second line is the Y axis, the Y coordinate of the starting point of the second line is corrected by one pixel and the X coordinate of the starting point of the second line is corrected. The line drawing apparatus according to any one of appendices 1 to 5, wherein correction is performed in accordance with an inclination of the second line.
(Appendix 7)
The drawing rule is a rule for drawing a pixel in which a first line connecting the start point and the end point intersects with a frame preset in the pixel at least once in the pixel. The line drawing apparatus according to any one of 6.

(付記8)
コンピュータが、
第1及び第2ラインの座標情報が入力され、前記第1ラインの描画情報を描画ルールに基づいて生成すると共に、前記第1ラインの終点を次に描画する前記第2ラインの始点として、連続描画するための第1の描画情報を生成し、
前記第1ラインの終点を含むピクセル領域内の座標と前記第1ラインの描画方向とに基づいて、前記第1ラインの終点を含む前記ピクセルを描画するか否かを判定し、
前記第1ラインの終点を含む前記ピクセルを描画すると判定した場合に、前記第1ラインの終点である前記第2ラインの始点の座標と前記第2ラインの終点の座標とに基づいて前記第2ラインの描画方向を判定し、前記第2ラインの始点の座標と前記第2ラインの描画方向とに基づいて、前記第2ラインの始点の座標の補正が必要か否かを判定し、
前記第2ラインの始点の座標の補正が必要と判定された場合、前記第2ラインの始点の座標を当該始点が含まれるピクセルに隣接するピクセル内の座標に補正し、
前記第2ラインの主軸方向における長さが1ピクセル以上の場合は、補正された前記第2ラインの始点の座標を第2の描画情報として出力し、前記第2ラインの主軸方向における長さが1ピクセル未満の場合には、前記第2ラインを消失すべきと判定して前記第2ラインを非描画とし、
前記第1の描画情報あるいは前記第2の描画情報に基づいて描画処理を行なう
ことを含むライン描画方法。
(Appendix 8)
Computer
The coordinate information of the first and second lines is input, the drawing information of the first line is generated based on the drawing rule, and the end point of the first line is continuously used as the starting point of the second line to be drawn next. Generating first drawing information for drawing;
Determining whether to draw the pixel including the end point of the first line based on the coordinates in the pixel region including the end point of the first line and the drawing direction of the first line;
When it is determined that the pixel including the end point of the first line is to be drawn, the second line is determined based on the coordinates of the start point of the second line, which is the end point of the first line, and the end point of the second line. Determining the drawing direction of the line, determining whether or not the correction of the coordinates of the starting point of the second line is necessary based on the coordinates of the starting point of the second line and the drawing direction of the second line;
If it is determined that the correction of the coordinates of the start point of the second line is necessary, the coordinates of the start point of the second line are corrected to the coordinates in the pixel adjacent to the pixel including the start point;
When the length of the second line in the principal axis direction is 1 pixel or more, the corrected coordinates of the start point of the second line are output as second drawing information, and the length of the second line in the principal axis direction is If it is less than one pixel, it is determined that the second line should be lost, the second line is not drawn,
A line drawing method comprising: performing drawing processing based on the first drawing information or the second drawing information.

(付記9)
前記第2ラインの始点を補正する前の前記第2ラインの描画方向と、前記第2ラインの始点を補正した後の前記第2ラインの描画方向と、が同一であるか否かを判定し、同一である場合に、前記第2ラインの主軸方向における長さが1ピクセル以上であると判定し、同一でない場合に、前記次ラインの主軸方向における長さが1ピクセル未満であると判定する
ことを特徴とする付記8記載のライン描画方法。
(Appendix 9)
It is determined whether the drawing direction of the second line before correcting the starting point of the second line is the same as the drawing direction of the second line after correcting the starting point of the second line. When the length is the same, it is determined that the length of the second line in the principal axis direction is 1 pixel or more. When the length is not the same, the length of the next line is determined to be less than one pixel. The line drawing method according to appendix 8, wherein

(付記10)
前記始点及び前記終点の座標に基づいて、前記始点及び前記終点を結ぶラインの主軸がX軸であるか前記X軸と直交するY軸であるかを判定し、
前記ラインの前記始点及び前記終点のX座標及びY座標の各々に基づいて前記ラインの描画方向を判定する
ことを特徴とする付記8又は付記9記載のライン描画方法。
(Appendix 10)
Based on the coordinates of the start point and the end point, determine whether the main axis of the line connecting the start point and the end point is the X axis or the Y axis orthogonal to the X axis,
The line drawing method according to claim 8 or 9, wherein a drawing direction of the line is determined based on each of the X coordinate and the Y coordinate of the start point and the end point of the line.

(付記11)
判定された前記第1ラインの主軸と、前記第1ラインの終点の前記ピクセル内の位置と、前記描画判定部により判定された前記第1ラインの描画方向と、に基づいて、前記第1ラインの終点が含まれるピクセルを描画するか否かを判定する
ことを特徴とする付記10記載のライン描画方法。
(Appendix 11)
Based on the determined principal axis of the first line, the position of the end point of the first line in the pixel, and the drawing direction of the first line determined by the drawing determining unit. The line drawing method according to claim 10, wherein it is determined whether or not to draw a pixel including the end point.

(付記12)
前記第1ラインの終点を描画すると判定された場合に、前記第2ラインの主軸と、前記第2ラインの描画方向と、前記第2ラインの始点の前記ピクセル内の位置と、に基づいて、前記第2ラインの始点の座標の補正が必要か否かを判定する
ことを特徴とする付記10又は付記11記載のライン描画方法。
(Appendix 12)
When it is determined to draw the end point of the first line, based on the main axis of the second line, the drawing direction of the second line, and the position in the pixel of the start point of the second line, The line drawing method according to appendix 10 or appendix 11, wherein it is determined whether or not correction of the coordinates of the start point of the second line is necessary.

(付記13)
前記第2ラインの主軸が前記X軸の場合は、前記第2ラインの始点のX座標を1ピクセル分補正すると共に前記第2ラインの始点のY座標を前記第2ラインの傾きに応じた分補正し、前記第2ラインの主軸が前記Y軸の場合は、前記第2ラインの始点のY座標を1ピクセル分補正すると共に前記第2ラインの始点のX座標を前記第2ラインの傾きに応じた分補正する
ことを特徴とする付記8〜12の何れか1項に記載のライン描画方法。
(Appendix 13)
When the main axis of the second line is the X-axis, the X coordinate of the start point of the second line is corrected by one pixel, and the Y coordinate of the start point of the second line is divided according to the inclination of the second line. When the principal axis of the second line is the Y axis, the Y coordinate of the starting point of the second line is corrected by one pixel, and the X coordinate of the starting point of the second line is changed to the inclination of the second line. The line drawing method according to any one of appendices 8 to 12, wherein correction is performed in accordance with the amount corresponding thereto.

(付記14)
前記描画ルールは、前記始点と終点とを結ぶ第1ラインが、ピクセル内に予め設定された枠と前記ピクセル内において少なくとも1回交差するピクセルを描画するルールである
ことを特徴とする付記8〜13の何れか1項に記載のライン描画装置。
(Appendix 14)
The drawing rule is a rule for drawing a pixel in which a first line connecting the start point and the end point intersects with a frame preset in the pixel at least once in the pixel. 14. The line drawing apparatus according to any one of items 13.

(付記15)
コンピュータに、
第1及び第2ラインの座標情報が入力され、前記第1ラインの描画情報を描画ルールに基づいて生成すると共に、前記第1ラインの終点を次に描画する前記第2ラインの始点として、連続描画するための第1の描画情報を生成し、
前記第1ラインの終点を含むピクセル領域内の座標と前記第1ラインの描画方向とに基づいて、前記第1ラインの終点を含む前記ピクセルを描画するか否かを判定し、
前記第1ラインの終点を含む前記ピクセルを描画すると判定した場合に、前記第1ラインの終点である前記第2ラインの始点の座標と前記第2ラインの終点の座標とに基づいて前記第2ラインの描画方向を判定し、前記第2ラインの始点の座標と前記第2ラインの描画方向とに基づいて、前記第2ラインの始点の座標の補正が必要か否かを判定し、
前記第2ラインの始点の座標の補正が必要と判定された場合、前記第2ラインの始点の座標を当該始点が含まれるピクセルに隣接するピクセル内の座標に補正し、
前記第2ラインの主軸方向における長さが1ピクセル以上の場合は、補正された前記第2ラインの始点の座標を第2の描画情報として出力し、前記第2ラインの主軸方向における長さが1ピクセル未満の場合には、前記第2ラインを消失すべきと判定して前記第2ラインを非描画とし、
前記第1の描画情報あるいは前記第2の描画情報に基づいて描画処理を行なう
ことを含む処理を実行させるためのライン描画プログラム。
(Appendix 15)
On the computer,
The coordinate information of the first and second lines is input, the drawing information of the first line is generated based on the drawing rule, and the end point of the first line is continuously used as the starting point of the second line to be drawn next. Generating first drawing information for drawing;
Determining whether to draw the pixel including the end point of the first line based on the coordinates in the pixel region including the end point of the first line and the drawing direction of the first line;
When it is determined that the pixel including the end point of the first line is to be drawn, the second line is determined based on the coordinates of the start point of the second line, which is the end point of the first line, and the end point of the second line. Determining the drawing direction of the line, determining whether or not the correction of the coordinates of the starting point of the second line is necessary based on the coordinates of the starting point of the second line and the drawing direction of the second line;
If it is determined that the correction of the coordinates of the start point of the second line is necessary, the coordinates of the start point of the second line are corrected to the coordinates in the pixel adjacent to the pixel including the start point;
When the length of the second line in the principal axis direction is 1 pixel or more, the corrected coordinates of the start point of the second line are output as second drawing information, and the length of the second line in the principal axis direction is If it is less than one pixel, it is determined that the second line should be lost, the second line is not drawn,
A line drawing program for executing processing including performing drawing processing based on the first drawing information or the second drawing information.

10 描画装置
12 頂点処理部
16 描画処理部
18 トライアングルセットアップ部
20 ラインセットアップ部
22 セレクト部
50 DER処理部
52 ライン描画判定部
54 セレクト部
56 描画方向判定部
58 主軸判定部
60 終点描画判定部
62 始点補正判定部
64 座標補正処理部
66 ライン消失判定部
70 コンピュータ
74 メモリ
76 記憶部
DESCRIPTION OF SYMBOLS 10 Drawing apparatus 12 Vertex processing part 16 Drawing processing part 18 Triangle setup part 20 Line setup part 22 Select part 50 DER processing part 52 Line drawing determination part 54 Select part 56 Drawing direction determination part 58 Main axis determination part 60 End point drawing determination part 62 Start point Correction determination unit 64 Coordinate correction processing unit 66 Line disappearance determination unit 70 Computer 74 Memory 76 Storage unit

Claims (9)

第1及び第2ラインの座標情報が入力され、前記第1ラインの描画情報を描画ルールに基づいて生成すると共に、前記第1ラインの終点を次に描画する前記第2ラインの始点として、連続描画するための第1の描画情報を生成する描画情報生成部と、
前記第1ラインの終点を含むピクセル領域内の座標と前記第1ラインの描画方向とに基づいて、前記第1ラインの終点を含む前記ピクセルを描画するか否かを判定する終点描画判定部と、
前記描画判定部が前記第1ラインの終点を含む前記ピクセルを描画すると判定した場合に、前記第1ラインの終点である前記第2ラインの始点の座標と前記第2ラインの終点の座標とに基づいて前記第2ラインの描画方向を判定し、前記第2ラインの始点の座標と前記第2ラインの描画方向とに基づいて、前記第2ラインの始点の座標の補正が必要か否かを判定する始点補正判定部と、
前記第2ラインの始点の座標の補正が必要と判定された場合、前記第2ラインの始点の座標を当該始点が含まれるピクセルに隣接するピクセル内の座標に補正する座標補正処理部と、
前記第2ラインの主軸方向における長さが1ピクセル以上の場合は、前記座標補正処理部により補正された前記第2ラインの始点の座標を第2の描画情報として出力し、前記第2ラインの主軸方向における長さが1ピクセル未満の場合には、前記第2ラインを消失すべきと判定して前記第2ラインを非描画とするライン消失判定部と、
前記第1の描画情報あるいは前記第2の描画情報に基づいて描画処理を行なう描画処理部と、
を備えたことを特徴とするライン描画装置。
The coordinate information of the first and second lines is input, the drawing information of the first line is generated based on the drawing rule, and the end point of the first line is continuously used as the starting point of the second line to be drawn next. A drawing information generation unit that generates first drawing information for drawing;
An end point drawing determination unit for determining whether to draw the pixel including the end point of the first line based on the coordinates in the pixel region including the end point of the first line and the drawing direction of the first line; ,
When the drawing determination unit determines to draw the pixel including the end point of the first line, the coordinates of the start point of the second line, which is the end point of the first line, and the coordinates of the end point of the second line And determining whether the second line start point coordinate needs to be corrected based on the second line start point coordinate and the second line drawing direction. A starting point correction determination unit for determining;
A coordinate correction processing unit that corrects the coordinates of the start point of the second line to the coordinates in the pixel adjacent to the pixel including the start point when it is determined that the correction of the start point of the second line is necessary;
When the length of the second line in the principal axis direction is 1 pixel or more, the coordinates of the start point of the second line corrected by the coordinate correction processing unit are output as second drawing information, When the length in the main axis direction is less than 1 pixel, a line disappearance determination unit that determines that the second line should be disappeared and makes the second line non-drawn;
A drawing processing unit for performing drawing processing based on the first drawing information or the second drawing information;
A line drawing apparatus comprising:
前記ライン消失判定部は、前記第2ラインの始点を補正する前の前記第2ラインの描画方向と、前記第2ラインの始点を補正した後の前記第2ラインの描画方向と、が同一であるか否かを判定し、同一である場合に、前記第2ラインの主軸方向における長さが1ピクセル以上であると判定し、同一でない場合に、前記次ラインの主軸方向における長さが1ピクセル未満であると判定する
ことを特徴とする請求項1記載のライン描画装置。
The line disappearance determination unit has the same drawing direction of the second line before correcting the starting point of the second line and the drawing direction of the second line after correcting the starting point of the second line. If it is the same, it is determined that the length of the second line in the principal axis direction is 1 pixel or more. If not, the length of the next line in the principal axis direction is 1 The line drawing device according to claim 1, wherein the line drawing device is determined to be less than a pixel.
前記始点及び前記終点の座標に基づいて、前記始点及び前記終点を結ぶラインの主軸がX軸であるか前記X軸と直交するY軸であるかを判定する主軸判定部と、
前記ラインの前記始点及び前記終点のX座標及びY座標の各々に基づいて前記ラインの描画方向を判定する描画方向判定部と、
を備えることを特徴とする請求項1又は請求項2記載のライン描画装置。
Based on the coordinates of the start point and the end point, a main axis determination unit that determines whether the main axis of the line connecting the start point and the end point is the X axis or the Y axis orthogonal to the X axis;
A drawing direction determination unit that determines a drawing direction of the line based on each of the X coordinate and the Y coordinate of the start point and the end point of the line;
The line drawing apparatus according to claim 1, further comprising:
前記終点描画判定部は、前記主軸判定部により判定された前記第1ラインの主軸と、前記第1ラインの終点の前記ピクセル内の位置と、前記描画判定部により判定された前記第1ラインの描画方向と、に基づいて、前記第1ラインの終点が含まれるピクセルを描画するか否かを判定する
ことを特徴とする請求項3記載のライン描画装置。
The end point drawing determination unit includes the main axis of the first line determined by the main axis determination unit, the position of the end point of the first line in the pixel, and the first line determined by the drawing determination unit. The line drawing apparatus according to claim 3, wherein it is determined whether or not to draw a pixel including an end point of the first line based on a drawing direction.
前記始点補正判定部は、前記第1ラインの終点を描画すると判定された場合に、前記主軸判定部により判定された前記第2ラインの主軸と、前記描画方向判定部により判定された前記第2ラインの描画方向と、前記第2ラインの始点の前記ピクセル内の位置と、に基づいて、前記第2ラインの始点の座標の補正が必要か否かを判定する
ことを特徴とする請求項3又は請求項4記載のライン描画装置。
When it is determined that the end point of the first line is drawn, the start point correction determination unit determines the main axis of the second line determined by the main axis determination unit and the second determined by the drawing direction determination unit. 4. It is determined whether correction of the coordinates of the start point of the second line is necessary based on the drawing direction of the line and the position of the start point of the second line in the pixel. Or the line drawing apparatus of Claim 4.
前記座標補正処理部は、前記第2ラインの主軸が前記X軸の場合は、前記第2ラインの始点のX座標を1ピクセル分補正すると共に前記第2ラインの始点のY座標を前記第2ラインの傾きに応じた分補正し、前記第2ラインの主軸が前記Y軸の場合は、前記第2ラインの始点のY座標を1ピクセル分補正すると共に前記第2ラインの始点のX座標を前記第2ラインの傾きに応じた分補正する
ことを特徴とする請求項3〜5の何れか1項に記載のライン描画装置。
When the principal axis of the second line is the X axis, the coordinate correction processing unit corrects the X coordinate of the start point of the second line by one pixel and sets the Y coordinate of the start point of the second line to the second If the main axis of the second line is the Y axis, the Y coordinate of the starting point of the second line is corrected by one pixel and the X coordinate of the starting point of the second line is corrected. The line drawing apparatus according to claim 3, wherein correction is performed in accordance with an inclination of the second line.
前記描画ルールは、前記始点と終点とを結ぶ第1ラインが、ピクセル内に予め設定された枠と前記ピクセル内において少なくとも1回交差するピクセルを描画するルールである
ことを特徴とする請求項1〜6の何れか1項に記載のライン描画装置。
The drawing rule is a rule for drawing a pixel in which a first line connecting the start point and the end point intersects a frame set in advance in the pixel at least once in the pixel. The line drawing apparatus according to claim 1.
コンピュータが、
第1及び第2ラインの座標情報が入力され、前記第1ラインの描画情報を描画ルールに基づいて生成すると共に、前記第1ラインの終点を次に描画する前記第2ラインの始点として、連続描画するための第1の描画情報を生成し、
前記第1ラインの終点を含むピクセル領域内の座標と前記第1ラインの描画方向とに基づいて、前記第1ラインの終点を含む前記ピクセルを描画するか否かを判定し、
前記第1ラインの終点を含む前記ピクセルを描画すると判定した場合に、前記第1ラインの終点である前記第2ラインの始点の座標と前記第2ラインの終点の座標とに基づいて前記第2ラインの描画方向を判定し、前記第2ラインの始点の座標と前記第2ラインの描画方向とに基づいて、前記第2ラインの始点の座標の補正が必要か否かを判定し、
前記第2ラインの始点の座標の補正が必要と判定された場合、前記第2ラインの始点の座標を当該始点が含まれるピクセルに隣接するピクセル内の座標に補正し、
前記第2ラインの主軸方向における長さが1ピクセル以上の場合は、補正された前記第2ラインの始点の座標を第2の描画情報として出力し、前記第2ラインの主軸方向における長さが1ピクセル未満の場合には、前記第2ラインを消失すべきと判定して前記第2ラインを非描画とし、
前記第1の描画情報あるいは前記第2の描画情報に基づいて描画処理を行なう
ことを含むライン描画方法。
Computer
The coordinate information of the first and second lines is input, the drawing information of the first line is generated based on the drawing rule, and the end point of the first line is continuously used as the starting point of the second line to be drawn next. Generating first drawing information for drawing;
Determining whether to draw the pixel including the end point of the first line based on the coordinates in the pixel region including the end point of the first line and the drawing direction of the first line;
When it is determined that the pixel including the end point of the first line is to be drawn, the second line is determined based on the coordinates of the start point of the second line, which is the end point of the first line, and the end point of the second line. Determining the drawing direction of the line, determining whether or not the correction of the coordinates of the starting point of the second line is necessary based on the coordinates of the starting point of the second line and the drawing direction of the second line;
If it is determined that the correction of the coordinates of the start point of the second line is necessary, the coordinates of the start point of the second line are corrected to the coordinates in the pixel adjacent to the pixel including the start point;
When the length of the second line in the principal axis direction is 1 pixel or more, the corrected coordinates of the start point of the second line are output as second drawing information, and the length of the second line in the principal axis direction is If it is less than one pixel, it is determined that the second line should be lost, the second line is not drawn,
A line drawing method comprising: performing drawing processing based on the first drawing information or the second drawing information.
コンピュータに、
第1及び第2ラインの座標情報が入力され、前記第1ラインの描画情報を描画ルールに基づいて生成すると共に、前記第1ラインの終点を次に描画する前記第2ラインの始点として、連続描画するための第1の描画情報を生成し、
前記第1ラインの終点を含むピクセル領域内の座標と前記第1ラインの描画方向とに基づいて、前記第1ラインの終点を含む前記ピクセルを描画するか否かを判定し、
前記第1ラインの終点を含む前記ピクセルを描画すると判定した場合に、前記第1ラインの終点である前記第2ラインの始点の座標と前記第2ラインの終点の座標とに基づいて前記第2ラインの描画方向を判定し、前記第2ラインの始点の座標と前記第2ラインの描画方向とに基づいて、前記第2ラインの始点の座標の補正が必要か否かを判定し、
前記第2ラインの始点の座標の補正が必要と判定された場合、前記第2ラインの始点の座標を当該始点が含まれるピクセルに隣接するピクセル内の座標に補正し、
前記第2ラインの主軸方向における長さが1ピクセル以上の場合は、補正された前記第2ラインの始点の座標を第2の描画情報として出力し、前記第2ラインの主軸方向における長さが1ピクセル未満の場合には、前記第2ラインを消失すべきと判定して前記第2ラインを非描画とし、
前記第1の描画情報あるいは前記第2の描画情報に基づいて描画処理を行なう
ことを含む処理を実行させるためのライン描画プログラム。
On the computer,
The coordinate information of the first and second lines is input, the drawing information of the first line is generated based on the drawing rule, and the end point of the first line is continuously used as the starting point of the second line to be drawn next. Generating first drawing information for drawing;
Determining whether to draw the pixel including the end point of the first line based on the coordinates in the pixel region including the end point of the first line and the drawing direction of the first line;
When it is determined that the pixel including the end point of the first line is to be drawn, the second line is determined based on the coordinates of the start point of the second line, which is the end point of the first line, and the end point of the second line. Determining the drawing direction of the line, determining whether or not the correction of the coordinates of the starting point of the second line is necessary based on the coordinates of the starting point of the second line and the drawing direction of the second line;
If it is determined that the correction of the coordinates of the start point of the second line is necessary, the coordinates of the start point of the second line are corrected to the coordinates in the pixel adjacent to the pixel including the start point;
When the length of the second line in the principal axis direction is 1 pixel or more, the corrected coordinates of the start point of the second line are output as second drawing information, and the length of the second line in the principal axis direction is If it is less than one pixel, it is determined that the second line should be lost, the second line is not drawn,
A line drawing program for executing processing including performing drawing processing based on the first drawing information or the second drawing information.
JP2012196084A 2012-09-06 2012-09-06 Line drawing apparatus, line drawing method, and line drawing program Active JP5900254B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012196084A JP5900254B2 (en) 2012-09-06 2012-09-06 Line drawing apparatus, line drawing method, and line drawing program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012196084A JP5900254B2 (en) 2012-09-06 2012-09-06 Line drawing apparatus, line drawing method, and line drawing program

Publications (2)

Publication Number Publication Date
JP2014052782A JP2014052782A (en) 2014-03-20
JP5900254B2 true JP5900254B2 (en) 2016-04-06

Family

ID=50611240

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012196084A Active JP5900254B2 (en) 2012-09-06 2012-09-06 Line drawing apparatus, line drawing method, and line drawing program

Country Status (1)

Country Link
JP (1) JP5900254B2 (en)

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6242273A (en) * 1985-08-20 1987-02-24 Toshiba Corp Drawing control system by xor mode
JPS63245575A (en) * 1987-03-31 1988-10-12 Pfu Ltd Plotting system for connecting point of continuous segment
JPH0916787A (en) * 1995-06-27 1997-01-17 Nippon Denki Micom Technol Kk How to draw the start and end points of the frame line for figure filling
US7307628B1 (en) * 2004-08-06 2007-12-11 Nvidia Corporation Diamond culling of small primitives
JP4998386B2 (en) * 2008-06-27 2012-08-15 富士通セミコンダクター株式会社 Line drawing method
JP4766576B2 (en) * 2009-03-25 2011-09-07 株式会社ソニー・コンピュータエンタテインメント Drawing method, image generation apparatus, and electronic information device

Also Published As

Publication number Publication date
JP2014052782A (en) 2014-03-20

Similar Documents

Publication Publication Date Title
CN105701852B (en) Apparatus and method for rendering
CN108701235B (en) Perform anti-aliasing operations in computing systems
CN105006010B (en) Method and apparatus for performing path rendering
JP2016212859A (en) Rendering method and apparatus for binocular parallax image
US8130234B2 (en) Computer graphics rendering apparatus and method
CN111951348B (en) Method, device and electronic device for determining frame selection area
JP4998386B2 (en) Line drawing method
US8570321B2 (en) Rasterization engine and three-dimensional graphics system for rasterizing in order adapted to characteristics of polygon
KR20060131389A (en) Pixel rasterization processing method and apparatus therefor in 3D graphics engine
JP2010287110A (en) Information processor, information processing method, program, and recording medium
US10776896B2 (en) Graphics processing unit that performs path rendering, and a method of operating the same
JP3892016B2 (en) Image processing apparatus and image processing method
JP5900254B2 (en) Line drawing apparatus, line drawing method, and line drawing program
JP3756888B2 (en) Graphics processor, graphics card and graphics processing system
JP6361267B2 (en) Image processing device
US7508397B1 (en) Rendering of disjoint and overlapping blits
JP4372066B2 (en) Drawing method, data broadcast receiving apparatus and program
US8934736B2 (en) Image processing apparatus, image processing system, and method for having computer process image
JP5290138B2 (en) Mesh changing device, mesh changing method, and program
KR102699047B1 (en) An apparatus for rendering objects including path, computing device including the same, and rendering method thereof
JP5719157B2 (en) Graphic processing chip
CN121785950A (en) Data reading methods and apparatus, computer equipment and computer-readable storage media
JP5510018B2 (en) Data inspection apparatus and program
KR101305036B1 (en) Apparatus and method for morphing
JP6375683B2 (en) Image processing device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20150525

A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20150608

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20160201

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20160209

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20160222

R150 Certificate of patent or registration of utility model

Ref document number: 5900254

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150