JP2013130998A - Image forming apparatus - Google Patents

Image forming apparatus Download PDF

Info

Publication number
JP2013130998A
JP2013130998A JP2011279178A JP2011279178A JP2013130998A JP 2013130998 A JP2013130998 A JP 2013130998A JP 2011279178 A JP2011279178 A JP 2011279178A JP 2011279178 A JP2011279178 A JP 2011279178A JP 2013130998 A JP2013130998 A JP 2013130998A
Authority
JP
Japan
Prior art keywords
intersection
curve
graphic
bezier curve
line segment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2011279178A
Other languages
Japanese (ja)
Other versions
JP5687612B2 (en
Inventor
Hiroyuki Hara
博幸 原
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.)
Kyocera Document Solutions Inc
Original Assignee
Kyocera Document Solutions 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 Kyocera Document Solutions Inc filed Critical Kyocera Document Solutions Inc
Priority to JP2011279178A priority Critical patent/JP5687612B2/en
Publication of JP2013130998A publication Critical patent/JP2013130998A/en
Application granted granted Critical
Publication of JP5687612B2 publication Critical patent/JP5687612B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Record Information Processing For Printing (AREA)
  • Image Generation (AREA)

Abstract

PROBLEM TO BE SOLVED: To represent diagrams in the same manner before and after division if a diagram including a Bezier curve overlaps.SOLUTION: Orientation of a boundary between two diagrams is performed to determine a point of intersection of the two diagrams (S33, S34); if the point of intersection exists on a tertiary Bezier curve (S38), the tertiary Bezier curve is divided at a position of respective end points and the point of intersection; the respective line segments produced by the division are approximated with a tertiary Bezier curve having a parameter area of [0, 1] (S42); and closed curves of divided portions of the two diagrams are described using the approximated line segments.

Description

本発明は、色属性を持つ図形同士が重畳する場合に、ベクターオブジェクトの段階で、相互に重畳する部分と重畳しない部分とに図形を分割し、重畳部分の色属性を決定する処理を印刷処理の一部として行う画像形成装置に関する。   In the present invention, when graphics having color attributes are overlapped, a process of dividing a figure into a portion that overlaps each other and a portion that does not overlap at the stage of a vector object, and determining a color attribute of the overlapped portion is a printing process The present invention relates to an image forming apparatus performed as a part of the image forming apparatus.

プリンタ機能を備えた画像形成装置において、ベクターオブジェクトで表された2つのカラー図形が互いに重なり、上の図形が透明度を持っている場合、これら2つの図形の各々をラスタライズしてビットマップデータに変換した後に重畳部分の色を決定するという処理を行うと、ワークエリアのメモリサイズが増大するとともに処理時間が長くなるという問題点が生ずる。   In an image forming apparatus equipped with a printer function, when two color figures represented by vector objects overlap each other and the upper figure has transparency, each of these two figures is rasterized and converted into bitmap data. If the process of determining the color of the overlapped part is performed after that, the memory size of the work area increases and the processing time becomes longer.

そこで、発明者が本発明者と同一の下記特許文献1では、ベクターオブジェクトの段階で重畳部分とそれ以外の部分とに図形を分割し、各図形の色を決定した後にラスタライズすることにより、上記問題点を解決している。   Therefore, in the following Patent Document 1 in which the inventor is the same as the inventor, the figure is divided into a superposed portion and other portions at the stage of the vector object, and the color of each figure is determined and then rasterized. The problem is solved.

特許第3935127号Patent No. 3935127

しかしながら、上記特許文献1で例示されている図形は矩形であり、ベジエ曲線を用いて表される図形が重なり合っている場合において、図形分割後の数式による図形表現については開示されていない。曲線図形は一般に3次ベジエ曲線で表されるが、分割の前後で同一のベジエ曲線を用いると、そのパラメータの区域がベジエ曲線毎に異なるので、ラスタライズ処理を今までと同様に統一的に行うことができず、既存のラスタライズ処理を利用できなくなり、これを変更するとラスタライズ処理が複雑になる。   However, the figure illustrated in Patent Document 1 is a rectangle, and when the figures represented by using Bezier curves are overlapped, there is no disclosure of the figure expression by the mathematical expression after the figure division. The curve figure is generally represented by a cubic Bezier curve, but if the same Bezier curve is used before and after the division, the area of the parameter differs for each Bezier curve, so the rasterization process is performed uniformly as before. Cannot be used, and the existing rasterizing process cannot be used, and changing this complicates the rasterizing process.

本発明の目的は、このような問題点に鑑み、ベジエ曲線を含む図形が重畳する場合、分割前後で図形表現を統一することにより、既存のラスタライズ処理を変更する必要がない画像形成装置を提供することにある。   In view of such problems, the object of the present invention is to provide an image forming apparatus in which existing rasterization processing need not be changed by unifying graphic representation before and after division when a graphic including a Bezier curve is superimposed. There is to do.

本発明による画像形成装置の第1態様では、プロセッサと、プログラムが格納された記憶手段とを備え、該プログラムは該プロセッサに対し、色属性を持つ第1図形の上層に、色属性として透明度を持つ第2図形が重畳し、該第1図形と該第2図形とがそれぞれベクターオブジェクトで記述された印刷データについて、
(a)該第1図形及び該第2図形を、相互に重畳する部分と、相互に重畳しない部分とに分割させ、
(b)重畳部分の色属性を少なくとも両図形の色属性に基づいて決定させ、
(c)該重畳部分とそれ以外の部分のそれぞれをビットマップ展開させて画像を形成させる、
画像形成装置において、該第1図形及び該第2図形のそれぞれの境界線が3次ベジエ曲線又は直線で表され、該プログラムは該プロセッサに対しさらにステップ(a)で、
3次ベジエ曲線上に交点が存在すれば、該3次ベジエ曲線を、その各端点及び該交点での位置で分割させ、分割された各線分をパラメータの区域が[0,1]である3次ベジエ曲線で近似させ、該分割された部分の閉曲線の線分が該分割された3次ベジエ曲線であればこれを該近似した3次ベジエ曲線で記述させる。
In a first aspect of the image forming apparatus according to the present invention, a processor and a storage unit storing a program are provided, and the program gives transparency as a color attribute to the upper layer of the first graphic having the color attribute. Regarding the print data in which the second graphic is superimposed and the first graphic and the second graphic are each described by a vector object,
(A) dividing the first graphic and the second graphic into a portion that overlaps each other and a portion that does not overlap each other;
(B) The color attribute of the superimposed portion is determined based on at least the color attributes of both figures,
(C) Bitmap development is performed for each of the overlapped portion and the other portions to form an image.
In the image forming apparatus, each boundary line of the first graphic and the second graphic is represented by a cubic Bézier curve or a straight line, and the program further includes a step (a) for the processor.
If there is an intersection on the cubic Bezier curve, the cubic Bezier curve is divided at each end point and the position at the intersection, and each divided line segment has a parameter area of [0, 1] 3 It is approximated by a second-order Bezier curve, and if the segment of the closed curve of the divided portion is the third-order bezier curve thus divided, this is described by the approximated third-order Bezier curve.

本発明による画像形成装置の第2態様では、第1態様において、該プログラムは該プロセッサに対しステップ(a)でさらに、
該分割されたベジエ曲線のパラメータ値が0及び1の位置のそれぞれで該位置、該位置でのx−y直交座標系におけるyに対するxの1回微分値及び2回微分値が、分割前のベジエ曲線の対応する点でのそれらと一致するように、該分割されたベジエ曲の、該分割前のベジエ曲線に対する近似式を定めさせる。
In a second aspect of the image forming apparatus according to the present invention, in the first aspect, the program is further transmitted to the processor in step (a).
The first and second differential values of x with respect to y in the position where the parameter value of the divided Bezier curve is 0 and 1, respectively, in the xy orthogonal coordinate system at the position are the values before the division. An approximate expression for the Bezier curve before the division of the divided Bezier music is determined so as to coincide with those at corresponding points of the Bezier curve.

本発明による画像形成装置の第3態様では、第1態様において、該プログラムは該プロセッサに対しステップ(a)でさらに、
該分割されたベジエ曲線のパラメータ値が0、0.5及び1の位置のそれぞれで該位置、該位置でのx−y直交座標系におけるyに対するxの1回微分値が、分割前のベジエ曲線の対応する点でのそれらと一致するように、該分割されたベジエ曲の、該分割前のベジエ曲線に対する近似式を定めさせる。
In a third aspect of the image forming apparatus according to the present invention, in the first aspect, the program is further transmitted to the processor in step (a).
The parameter value of the divided Bezier curve is 0, 0.5, and 1 at each position, and the first differential value of x with respect to y in the xy orthogonal coordinate system at the position is the Bezier before division. Let the approximate expression for the bezier curve before the division of the divided Bezier music be determined so as to match those at corresponding points of the curve.

本発明による画像形成装置の第4態様では、第1乃至3態様のいずれか1つにおいて、該プログラムは該プロセッサに対しステップ(a)でさらに、
(a1)該第1図形及び該第2図形のそれぞれについて、境界線上を一方向に回るように境界線に方向情報を付加させておき、
(a2)該交点で境界線の線分を分割した際に、分割後の線分の方向情報を、分割前の線分の方向情報と一致させ、
(a3)交点毎に、該交点を始点とし該一方向が該始端から離れる方向である方向情報を持つ線分を1つ選択させ、移動方向を該一方向と決定させ、
(a4)該線分上を論理的に次の交点まで該決定した方向へ移動させ、
(a5)移動後の交点が該始点でなければ、該交点で他方の図形の対応する点に移らせ、移動方向をステップ(a4)での方向と逆方向に決定させ、次いでステップ(a4)へ戻らさせ、該始点であれば、一巡した閉曲線を該相互に重畳しない部分の閉曲線と決定させる。
In a fourth aspect of the image forming apparatus according to the present invention, in any one of the first to third aspects, the program is further transmitted to the processor in step (a).
(A1) For each of the first graphic and the second graphic, direction information is added to the boundary line so as to turn in one direction on the boundary line,
(A2) When dividing the line segment of the boundary line at the intersection, the direction information of the line segment after the division is matched with the direction information of the line segment before the division,
(A3) For each intersection, select one line segment having direction information whose starting point is the direction in which the one direction is away from the starting end, and determine the moving direction as the one direction.
(A4) logically move on the line segment to the next intersection in the determined direction;
(A5) If the intersection after movement is not the start point, the intersection is moved to the corresponding point of the other figure, the movement direction is determined to be opposite to the direction in step (a4), and then step (a4) If it is the start point, the closed curve is determined as the closed curve of the portion that does not overlap with each other.

本発明による画像形成装置の第5態様では、第1乃至4態様のいずれか1つにおいて、該プログラムは該プロセッサに対しステップ(a)で、1つの交点及び一方向に関し、
(a6)該交点を始点とする該一方向の線分を1つ選択させ、
(a7)該線分上を論理的に次の交点まで該一方向へ移動させ、
(a8)移動後の交点が該始点でなければ、該交点で他方の図形の対応する点に移らせ、次いでステップ(a7)へ戻らさせ、該始点であれば、一巡した閉曲線を保存させ、ステップ(a6)〜(a8)の処理により保存された閉曲線が1つであればステップ(a6)に戻らさせ、2つであれば両閉曲線の一方に包含される他方の閉曲線を該相互に重畳する部分の閉曲線と決定させ、
該一方向は、線分の方向情報が示す方向又はこれと逆方向のいずれか一方である。
According to a fifth aspect of the image forming apparatus of the present invention, in any one of the first to fourth aspects, the program executes a step (a) for the processor with respect to one intersection and one direction.
(A6) One line segment in the one direction starting from the intersection is selected,
(A7) Move on the line segment in the one direction logically to the next intersection,
(A8) If the intersection after movement is not the start point, move to the corresponding point of the other figure at the intersection, and then return to step (a7). If there is one closed curve stored by the processing of steps (a6) to (a8), the process returns to step (a6). If there are two closed curves, the other closed curves included in one of both closed curves are superimposed on each other. The closed curve of the part to be
The one direction is either the direction indicated by the direction information of the line segment or the opposite direction.

上記第1態様の構成によれば、2図形の境界線の一部である3次ベジエ曲線上に交点が存在するとき、該3次ベジエ曲線を、その各端点及び該交点での位置で分割し、分割された各線分をパラメータの区域が[0,1]である3次ベジエ曲線で近似し、これを用いて、2図形の分割された部分の閉曲線を記述するので、分割前後で図形表現が統一されて、既存のラスタライズ処理を変更せずに用いることができるという効果を奏する。   According to the configuration of the first aspect, when an intersection exists on a cubic Bezier curve that is a part of a boundary line between two figures, the cubic Bezier curve is divided at each end point and the position at the intersection. Then, each divided line segment is approximated by a cubic Bezier curve whose parameter area is [0, 1], and this is used to describe the closed curve of the divided part of two figures. The expression is unified, and there is an effect that the existing rasterizing process can be used without being changed.

上記第2態様の構成によれば、該分割されたベジエ曲線のパラメータ値が0及び1の位置のそれぞれで該位置、該位置でのx−y直交座標系におけるyに対するxの1回微分値及び2回微分値が、分割前のベジエ曲線の対応する点でのそれらと一致するように、該分割されたベジエ曲の、該分割前のベジエ曲線に対する近似式を定めるので、分割されたベジエ曲線の式を効率よく求めることができるという効果を奏する。   According to the configuration of the second aspect, the one-time differential value of x with respect to y in the xy orthogonal coordinate system at the position where the parameter value of the divided Bezier curve is 0 and 1 respectively. And an approximate expression for the pre-division Bezier curve of the divided Bezier curve so that the differential values thereof coincide with those at the corresponding points of the pre-division Bezier curve. There is an effect that the equation of the curve can be obtained efficiently.

上記第3態様の構成によれば、該分割されたベジエ曲線のパラメータ値が0、0.5及び1の位置のそれぞれで該位置、該位置でのx−y直交座標系におけるyに対するxの1回微分値が、分割前のベジエ曲線の対応する点でのそれらと一致するように、該分割されたベジエ曲の、該分割前のベジエ曲線に対する近似式を定めるので、前記同様に、分割されたベジエ曲線の式を効率よく求めることができるという効果を奏する。   According to the configuration of the third aspect, the parameter value of the divided Bezier curve is 0, 0.5, and 1 at each of the positions, and x relative to y in the xy orthogonal coordinate system at the position. Since an approximate expression for the Bezier curve before the division of the divided Bezier music is determined so that the differential value of one time coincides with those at corresponding points of the Bezier curve before the division, the division is performed in the same manner as described above. There is an effect that the equation of the Bezier curve thus obtained can be obtained efficiently.

上記第4態様の構成によれば、図形の境界線の方向付けを行ってから、上記簡単な処理で、相互に重畳しない図形の部分を求めることができるという効果を奏する。   According to the configuration of the fourth aspect, after directing the boundary line of the graphic, there is an effect that it is possible to obtain graphic parts that do not overlap with each other by the simple process.

上記第5態様の構成によれば、図形の境界線の方向付けを行ってから、上記簡単な処理で、相互に重畳する図形の部分を求めることができるという効果を奏する。   According to the configuration of the fifth aspect, after the orientation of the boundary line of the graphic is performed, there is an effect that it is possible to obtain graphic parts to be superimposed on each other by the simple process.

本発明の他の目的、特徴的な構成及び効果は、以下の説明を特許請求の範囲及び図面の記載と関係づけて読むことにより明らかになる。   Other objects, characteristic configurations and effects of the present invention will become apparent from the following description read in connection with the appended claims and the drawings.

本発明が適用された実施例1に係る画像形成システムの概略図である。1 is a schematic diagram of an image forming system according to a first embodiment to which the present invention is applied. 主に画像形成装置のハードウェア構成を示す概略ブロック図である。FIG. 2 is a schematic block diagram mainly showing a hardware configuration of an image forming apparatus. PDLデータに含まれるベクターオブジェクトをラスタライズする前の重畳図形分割処理を示す概略フローチャートである。It is a schematic flowchart which shows the superimposition figure division | segmentation process before rasterizing the vector object contained in PDL data. (A)及び(B)はいずれも、閉曲線トレース方向判定説明図である。(A) and (B) are both explanatory diagrams of closed curve trace direction determination. 図3のステップS1の詳細フローチャートである。It is a detailed flowchart of step S1 of FIG. 処理対象の2つの図形の説明図である。It is explanatory drawing of two figures of a process target. 図6の図形の各線分の時計回り方向付説明図である。It is explanatory drawing with the clockwise direction of each line segment of the figure of FIG. 図3のステップS17の大きい方の閉曲線判定説明図である。FIG. 4 is an explanatory diagram for determining a larger closed curve in step S <b> 17 of FIG. 3. (A)〜(C)はそれぞれ2つの図形が包含関係にある場合の例外的処理説明図である。(A)-(C) is an exceptional process explanatory drawing in case two figures have an inclusion relation, respectively. 2つの図形の交点が4つである場合の処理対象説明図である。It is processing object explanatory drawing in case the intersection of two figures is four. 図10の図形の各線分の時計回り方向付説明図である。It is explanatory drawing with the clockwise direction of each line segment of the figure of FIG.

図1は、本発明が適用された実施例1に係る画像形成システムの概略図である。   FIG. 1 is a schematic diagram of an image forming system according to a first embodiment to which the present invention is applied.

このシステムでは、画像形成装置10とPC(Personal Computer)20とがネットワーク30で結合されている。ユーザが、PC20でアプリケーションを起動させて文書を作成し、印刷開始の指示を与えと、このアプリケーションは、プリンタドライバを介して文書をPDL(Page Description Language)データに変換し、これを、OS(Operating System)のスプーラ機能及び通信機能を介してプリンタに送信する。   In this system, an image forming apparatus 10 and a PC (Personal Computer) 20 are connected by a network 30. When a user activates an application on the PC 20 to create a document and gives an instruction to start printing, the application converts the document into PDL (Page Description Language) data via a printer driver. It is sent to the printer via the spooler function and communication function of the Operating System.

図2は、主に画像形成装置10のハードウェア構成を示す概略ブロック図である。   FIG. 2 is a schematic block diagram mainly showing a hardware configuration of the image forming apparatus 10.

この画像形成装置10では、CPU11がインターフェイス12を介してPROM13、DRAM14、補助記憶装置15、ネットワークインターフェイス16、操作パネル17、スキャナ18、プリンタ19及びファックスモデム1Aに結合されている。図5では、簡単化の為に、複数種のインターフェイスを1つのブロック12で表している。   In the image forming apparatus 10, a CPU 11 is coupled to a PROM 13, a DRAM 14, an auxiliary storage device 15, a network interface 16, an operation panel 17, a scanner 18, a printer 19, and a fax modem 1 </ b> A through an interface 12. In FIG. 5, a plurality of types of interfaces are represented by one block 12 for the sake of simplicity.

PROM13は、例えばフラッシュメモリであり、BIOS(Basic Input/Output System)、OS、各種ドライバ、及び、画像形成装置として機能させるための各種アプリケーションが格納されている。   The PROM 13 is, for example, a flash memory, and stores a basic input / output system (BIOS), an OS, various drivers, and various applications for functioning as an image forming apparatus.

このアプリケーションには、PDLデータをラスタライズしてDRAM14上のビットマップデータに変換し、プリンタ19に供給することにより画像を用紙上に転移する印刷処理プログラムが含まれる。   This application includes a print processing program that rasterizes PDL data, converts it into bitmap data on the DRAM 14, and supplies the data to the printer 19 to transfer the image onto a sheet.

DRAM14は、主記憶装置として用いられる。補助記憶装置15には、印刷用データ、スキャナ18で読み取った画像データ及びファクシミリ受信データが保存される。ネットワークインターフェイス16は、ネットワーク30に結合され、PDLデータの送信等に用いられる。操作パネル17は、入力部及び表示部を供えている。スキャナ18は、画像ファイル生成のために用いられ、このファイルは印刷、ファクシミリ送信又はファイル送信のために用いられる。プリンタ19は、プリントエンジン並びに用紙の給紙部、搬送部及び排紙部を備え、DRAM14に生成されたビットマップデータが供給され、このデータに基づいて感光ドラムに静電潜像を形成し、この像をトナーで現像し、トナー像を用紙に転移し定着させ、排紙する。   The DRAM 14 is used as a main storage device. The auxiliary storage device 15 stores printing data, image data read by the scanner 18, and facsimile reception data. The network interface 16 is coupled to the network 30 and is used for transmitting PDL data. The operation panel 17 includes an input unit and a display unit. The scanner 18 is used for generating an image file, and this file is used for printing, facsimile transmission, or file transmission. The printer 19 includes a print engine, a paper feed unit, a conveyance unit, and a paper discharge unit. The bitmap data generated in the DRAM 14 is supplied, and an electrostatic latent image is formed on the photosensitive drum based on the data. This image is developed with toner, and the toner image is transferred and fixed on paper, and discharged.

図3は、上記印刷処理プログラムにおいて、印刷データとしてのPDLデータに含まれるベクターオブジェクトをラスタライズする前の重畳図形分割処理を示す概略フローチャートである。以下、括弧内は図中のステップ識別符号である。   FIG. 3 is a schematic flowchart showing a superimposed graphic division process before rasterizing a vector object included in PDL data as print data in the print processing program. In the following, the step identification codes in the figure are shown in parentheses.

(S0)後で閉曲線のトレース方向を利用するので、ここで各図形境界線の一方向回り、例えば時計回りの方向付けを行う。   (S0) Since the trace direction of the closed curve is used later, the orientation of each figure boundary line is made one direction, for example, clockwise.

例えば図4(A)に示すような直線P1P2と曲線P2P1とを境界線とする図形40について、X−Y直交座標系の定義域と値域とから定まる外接矩形R1を求め、座標原点Oを(矩形R1の定義域の中点,矩形R1の値域の中点)とする。接点の1つ、例えば点P1から図形40上を一方向へ回り、順に通過する接点列(P1、P2、P8、P7)の象限値(第1〜4象限の値1〜4)を記述していくと、(3,2,4,4)となり、これが時計回りのパターンであると判定できる。   For example, for a figure 40 having a straight line P1P2 and a curve P2P1 as a boundary line as shown in FIG. 4A, a circumscribed rectangle R1 determined from the definition area and the value area of the XY orthogonal coordinate system is obtained, and the coordinate origin O is defined as ( The midpoint of the definition area of the rectangle R1 and the midpoint of the range of the rectangle R1). Describe the quadrant value (values 1 to 4 in the first to fourth quadrants) of one of the contact points, for example, the point of contact sequence (P1, P2, P8, P7) that passes around the figure 40 in one direction from the point P1. As a result, (3, 2, 4, 4) is obtained, and it can be determined that this is a clockwise pattern.

この場合、直線P1P2は直線の端点P1から端点P2への方向が時計回りであり、曲線P2P1は曲線の端点P2から端点P1への方向が時計回りであると、境界線の線分を方向付ける。象限値順のパターンから反時計回りであると判定した場合には、その逆方向で線分を方向付ける。   In this case, the straight line P1P2 is directed clockwise from the end point P1 to the end point P2, and the curved line P2P1 is directed to the line segment of the boundary line when the direction from the end point P2 to the end point P1 is clockwise. . If it is determined that the pattern is in the counterclockwise direction from the quadrant value order pattern, the line segment is directed in the opposite direction.

この方向付けは、図4(B)のようにして行ってもよい。すなわち、図形40上の同一直線上に無い3点、例えば点P1、P2、P9の三角形P1P2P9が内接する矩形R2について、上記同様に、X−Y直交座標系の座標原点Oを(矩形R2の定義域の中点,矩形R2の値域の中点)とする。三角形P1P2P9の1つ、例えば点P1から図形40上を一方向へ回り、順に通過する点(P1、P2、P9)の象限値を記述していくと、(3,2,1)となり、これが時計回りのパターンであると判定でき、上記同様に線分を方向付ける。   This orientation may be performed as shown in FIG. That is, for the rectangle R2 inscribed by the triangle P1P2P9 of the three points that are not on the same straight line on the figure 40, for example, the points P1, P2, and P9, the coordinate origin O of the XY orthogonal coordinate system is set to (the rectangle R2 The midpoint of the definition area and the midpoint of the range of the rectangle R2). Describe the quadrant value of one of the triangles P1P2P9, for example, the point (P1, P2, P9) that passes from the point P1 to the figure 40 in one direction and passes in order, it becomes (3, 2, 1). It can be determined that the pattern is clockwise, and the line segment is oriented as described above.

(S1)一方の図形と他方の図形との交点処理を行う。図5は、この交点処理の詳細フローチャートである。   (S1) Intersection processing between one graphic and the other graphic is performed. FIG. 5 is a detailed flowchart of this intersection processing.

交点処理には、交点座標を求める処理と、線分を交点で分割して分割後の各線分を表す式を求める処理とがあり、前者は以下のステップS31〜S37で行われ、後者は以下のステップS39〜S44で行われる。上記方向付けの結果は、後者のステップS42、S43で考慮する。線分は、3次ベジエ曲線又は直線であるとする。   The intersection process includes a process for obtaining intersection coordinates and a process for obtaining an expression representing each divided line segment by dividing the line segment at the intersection. The former is performed in steps S31 to S37 below, and the latter is performed as follows. The steps S39 to S44 are performed. The result of the orientation is considered in the latter steps S42 and S43. It is assumed that the line segment is a cubic Bezier curve or a straight line.

(S30)交点カウンタNcpに初期値0を代入する。   (S30) The initial value 0 is substituted into the intersection counter Ncp.

一方の図形の線分毎に、以下のステップS31からステップS37までの処理を行う。例えば図6において、図形40を一方の図形とすると、図形40の線分である直線P1P2及び曲線P2P1のそれぞれについて、以下の処理を行う。   The following processing from step S31 to step S37 is performed for each line segment of one figure. For example, in FIG. 6, if the graphic 40 is one graphic, the following processing is performed for each of the straight line P1P2 and the curve P2P1 that are line segments of the graphic 40.

(S31)該一方の図形の1つの線分を選択する。   (S31) One line segment of the one figure is selected.

他方の図形の線分毎に、以下のステップS32〜S36の処理を行う。例えば図6の図形41の直線P3P4及び曲線P4P3のそれぞれについて、以下の処理を行う。   The following steps S32 to S36 are performed for each line segment of the other graphic. For example, the following processing is performed for each of the straight line P3P4 and the curve P4P3 of the graphic 41 in FIG.

(S32)該他方の図形の1つの線分を選択する。   (S32) One line segment of the other graphic is selected.

(S33)ステップS31とステップS32で選択した線分間に交点が存在すればステップS34へ進み、そうでなければステップS36へ進む。図6の場合、直線P1P2と、直線P3P4及び曲線P4P3のそれぞれとの間には交点が存在しないので、ステップS33で否定判定され、曲線P2P1と、直線P3P4及び曲線P4P3とのそれぞれの間には交点が存在するので、ステップS34へ進む。   (S33) If an intersection exists between the line segments selected in step S31 and step S32, the process proceeds to step S34, and if not, the process proceeds to step S36. In the case of FIG. 6, since there is no intersection between the straight line P1P2 and each of the straight line P3P4 and the curve P4P3, a negative determination is made in step S33, and between the curve P2P1, the straight line P3P4, and the curve P4P3, respectively. Since there is an intersection, the process proceeds to step S34.

(S34)選択されている線分間の交点の座標を、例えば2分法で方程式を解くことにより求める。   (S34) The coordinates of the intersection of the selected line segment are obtained by solving the equation by, for example, a bisection method.

(S35)交点カウンタNcpを1だけインクリメントする。   (S35) The intersection counter Ncp is incremented by one.

(S36)該他方の図形について、未選択の線分が有ればステップS32へ戻り、無ければステップS37へ進む。   (S36) If there is an unselected line segment for the other graphic, the process returns to step S32; otherwise, the process proceeds to step S37.

(S37)該一方の図形について、未選択の線分が有ればステップS31へ戻り、無ければステップS38へ進む。   (S37) If there is an unselected line segment for the one figure, the process returns to step S31, and if not, the process proceeds to step S38.

(S38)交点カウンタNcpが正であればステップS39へ進み、そうでなければ図5の処理を終了する。   (S38) If the intersection counter Ncp is positive, the process proceeds to step S39; otherwise, the process of FIG. 5 is terminated.

以下、各図形の線分毎、ステップS39〜S44の処理を行う。   Thereafter, the processes of steps S39 to S44 are performed for each line segment of each figure.

(S39)1つの線分を選択する。   (S39) One line segment is selected.

(S40)この線分上に、ステップS34で求めた交点座標が存在すればステップS41へ進み、そうでなければステップS44へ進む。   (S40) If the intersection coordinates obtained in step S34 exist on this line segment, the process proceeds to step S41, and if not, the process proceeds to step S44.

(S41)この線分がベジエ曲線であればステップS42へ進み、直線であればステップS43へ進む。   (S41) If this line segment is a Bezier curve, the process proceeds to step S42, and if it is a straight line, the process proceeds to step S43.

(S42)ベジエ曲線を交点で分割し、分割された各ベジエ曲線の近似式を求める。   (S42) The Bezier curve is divided at the intersections, and an approximate expression of each divided Bezier curve is obtained.

例えば図6の曲線P2P1については、交点P5、P6が存在するので、パラメータtの区域が[0,1]のベジエ曲線P2P5の式と、パラメータtの区域が[0,1]のベジエ曲線P5P6の式と、パラメータtの区域が[0,1]のベジエ曲線P6P1の式とを求める。   For example, with respect to the curve P2P1 in FIG. 6, there are intersections P5 and P6. Therefore, the expression of the Bezier curve P2P5 where the area of the parameter t is [0, 1] and the Bezier curve P5P6 where the area of the parameter t is [0, 1]. And a Bezier curve P6P1 with a parameter t of [0, 1].

より具体的には、x−y直交座標系での曲線P2P1上の任意の点の座標を(f(t),g(t))、曲線P2P1の制御点Qiの座標を(xi,yi)、iを1〜4の範囲の整数とすると、
f(t)=(1−t)3x1+3(1−t)2tx2+3(1−t)t2x3+t3x4 ・・・(1)
g(t)=(1−t)3y1+3(1−t)2ty2+3(1−t)t2y3+t3y4 ・・・(2)
と表される。ここにパラメータtの区域は[0,1]であり、t=0で始点P2=Q1=(x1,y1)、t=1で終点P1=Q5=(x4,y4)となる。交点P5のtの値をt1と表す。
More specifically, the coordinates of an arbitrary point on the curve P2P1 in the xy orthogonal coordinate system are (f (t), g (t)), and the coordinates of the control point Qi of the curve P2P1 are (xi, yi). , I is an integer in the range of 1-4,
f (t) = (1-t) 3 x1 + 3 (1-t) 2 tx2 + 3 (1-t) t 2 x3 + t 3 x4 (1)
g (t) = (1-t) 3 y1 + 3 (1-t) 2 ty2 + 3 (1-t) t 2 y3 + t 3 y4 (2)
It is expressed. Here, the area of the parameter t is [0, 1]. When t = 0, the start point P2 = Q1 = (x1, y1), and when t = 1, the end point P1 = Q5 = (x4, y4). The value of t at the intersection P5 is represented as t1.

パラメータtの区域が[0,1]のベジエ曲線P2P5上の任意の点の座標(u(t),v(t))のu及びvを、
u(t)=a1・t3+b1・t2+c1・t+d1 ・・・(3)
v(t)=a2・t3+b2・t2+c2・t+d2 ・・・(4)
と表し、8つの未知数a1、b1、c1、d1、a2、b2、c2、d2を以下の8つの条件式である連立方程式の解として求めることで、ベジエ曲線P2P5の式を決定する。
U and v of coordinates (u (t), v (t)) of an arbitrary point on the Bezier curve P2P5 whose parameter t is [0, 1],
u (t) = a1 · t 3 + b1 · t 2 + c1 · t + d1 (3)
v (t) = a2 · t 3 + b2 · t 2 + c2 · t + d2 (4)
The eight unknowns a1, b1, c1, d1, a2, b2, c2, and d2 are obtained as solutions of simultaneous equations that are the following eight conditional expressions to determine the expression of the Bezier curve P2P5.

(a)始点P2及び交点P5の座標が両曲線で等しいことから、
(f(0),g(0))=(u(0),v(0))
(f(t1),g(t1))=(u(1),v(1))
という4つの条件式が得られる。
(A) Since the coordinates of the start point P2 and the intersection point P5 are equal in both curves,
(F (0), g (0)) = (u (0), v (0))
(F (t1), g (t1)) = (u (1), v (1))
The following four conditional expressions are obtained.

(b)始点P2及び交点P5での傾きが両曲線で等しいという条件を与える。’をtでの微分記号とすると、この条件は、t=0でのf'(t)/g'(t)の値と、t=0でのu'(t)/v'(t)の値とが互いに等しくなり、t=t1でのf'(t)/g'(t)の値と、t=1でのu'(t)/v'(t)の値とが互いに等しくなるという式で表され、さらに2つの条件式が得られる。   (B) The condition that the slopes at the start point P2 and the intersection point P5 are equal in both curves is given. If 'is the differential symbol at t, then this condition is that f' (t) / g '(t) at t = 0 and u' (t) / v '(t) at t = 0. The values of f ′ (t) / g ′ (t) at t = t1 and the values of u ′ (t) / v ′ (t) at t = 1 are equal to each other. And two more conditional expressions are obtained.

(c)また、始点P2及び交点P5での傾きの変化率が両曲線で等しいという条件を与える。この条件は、t=0での(f'(t)/g'(t))'/g'(t)の値と、t=0での(u'(t)/v'(t))'/v'(t)の値とが互いに等しくなり、t=t1での(f'(t)/g'(t))'/g'(t)の値と、t=1での(u'(t)/v'(t))'/v'(t)の値とが互いに等しくなるという式で表され、さらに2つの条件式が得られる。   (C) Further, a condition is given that the rate of change in slope at the start point P2 and the intersection point P5 is the same for both curves. The condition is that the value of (f ′ (t) / g ′ (t)) ′ / g ′ (t) at t = 0 and (u ′ (t) / v ′ (t) at t = 0. ) ′ / V ′ (t) and the values of (f ′ (t) / g ′ (t)) ′ / g ′ (t) at t = t1 and t = 1 (U ′ (t) / v ′ (t)) ′ / v ′ (t) is expressed by an equation that the values are equal to each other, and two conditional expressions are obtained.

上記8つの未知数は、以上の8つの条件式により定まる。   The eight unknowns are determined by the above eight conditional expressions.

このような処理により、分割後のベジエ曲線の制御点を決定することなく該ベジエ曲線を求めることができるので、分割されたベジエ曲線の式を効率よく求めることができるという効果を奏する。   By such processing, since the Bezier curve can be obtained without determining the control points of the divided Bezier curve, the divided Bezier curve formula can be obtained efficiently.

条件(c)の替わりに、次のような条件を与えて近似してもよい。すなわち、ベジエ曲線P2P1がベジエ曲線P2P5上のパラメータ中点t=0.5での座標(u(0.5),v(0.5))を通るように定める。すなわち、f(t2)=u(0.5)、g(t2)=v(0.5)という拘束条件を与える。新たな未知数t2を導入したので、この座標での両傾きが互いに等しいという条件を与える。すなわち、t=t2での(f'(t)/g'(t))'/g'(t)の値と、t=0.5での(u'(t)/v'(t))'/v'(t)の値とが互いに等しくなるという条件を与える。   Instead of the condition (c), the following conditions may be given for approximation. That is, the Bezier curve P2P1 is determined so as to pass through the coordinates (u (0.5), v (0.5)) at the parameter midpoint t = 0.5 on the Bezier curve P2P5. That is, the constraint conditions of f (t2) = u (0.5) and g (t2) = v (0.5) are given. Since a new unknown t2 has been introduced, a condition is given that both slopes at this coordinate are equal to each other. That is, the value of (f ′ (t) / g ′ (t)) ′ / g ′ (t) at t = t2, and (u ′ (t) / v ′ (t) at t = 0.5. ) The condition that the values of '/ v' (t) are equal to each other is given.

この場合も、上記同様の効果を奏する。   In this case, the same effect as described above can be obtained.

なお、上式(3)、(4)を式(1)、(2)のように変形して制御点で表すことにより、制御点の座標列でベジエ曲線を表して、ラスタライザに受け渡すようにしてもよい。   The above equations (3) and (4) are transformed into equations (1) and (2) and expressed by control points, so that a Bezier curve is represented by the coordinate sequence of the control points and is passed to the rasterizer. It may be.

次に、交点で分割されたそれぞれのベジエ曲線を、図7に示すように分割前のベジエ曲線P2P1と同じ方向(時計回り方向)に方向付ける。この方向付けは、線分に方向情報を付加することにより行う。例えば、パラメータtが0から1に変化するとき座標が時計回り方向へ移動するようにした場合、この方向情報はパラメータtに付加されていることになる。パラメータtが0から1に変化するとき座標が反時計回り方向へ移動する場合には、パラメータを1次変換することにより、パラメータtが0から1に変化するとき座標が時計回り方向へ移動するようにする。方向情報は、パラメータtが0から1又は1から0のどちらに変化するときに座標が時計回り方向へ移動するかを示すフラグであってもよい。   Next, each Bezier curve divided at the intersection is oriented in the same direction (clockwise direction) as the Bezier curve P2P1 before the division as shown in FIG. This orientation is performed by adding direction information to the line segment. For example, when the coordinates are moved in the clockwise direction when the parameter t changes from 0 to 1, this direction information is added to the parameter t. When the coordinate moves in the counterclockwise direction when the parameter t changes from 0 to 1, the coordinate moves in the clockwise direction when the parameter t changes from 0 to 1 by performing a linear transformation on the parameter. Like that. The direction information may be a flag indicating whether the coordinate moves in the clockwise direction when the parameter t changes from 0 to 1 or from 1 to 0.

次にステップS44へ進む。   Next, the process proceeds to step S44.

(S33)直線を交点で分割し、分割されたそれぞれの定義域を求め、それぞれの直線の式は分割前のものと同一にする。また、それぞれの直線を、図7に示すように分割前の直線と同じ方向に方向付ける。図6の直線P3P4については、交点P5が存在するので、直線P3P4を、線分P3P5と線分P5P4とに分割し、それぞれの定義域を求め、また、それぞれの線分を図7に示すように、分割前の直線P3P4と同じ時計回り方向に方向付ける。   (S33) The straight lines are divided at the intersections to obtain the divided domains, and the formulas of the respective straight lines are the same as those before the division. Each straight line is oriented in the same direction as the straight line before the division as shown in FIG. For the straight line P3P4 in FIG. 6, there is an intersection point P5. Therefore, the straight line P3P4 is divided into a line segment P3P5 and a line segment P5P4 to obtain respective definition areas, and the respective line segments are shown in FIG. In the same direction as the straight line P3P4 before division.

なお、直線についてもパラメータtを用いて表し、いずれの直線もtの区域が[0,1]となるようにして、ベジエ曲線の場合と同様に表現することにより、その後のラスタライザでの処理を統一して行えるようにしてもよい。   It should be noted that straight lines are also expressed using the parameter t, and each straight line is expressed in the same manner as in the case of a Bezier curve so that the area of t is [0, 1]. You may be able to do it uniformly.

(S34)全図形について、未選択の線分が有ればステップS39へ戻り、無ければ図3のステップS2へ進む。   (S34) If there is an unselected line segment for all figures, the process returns to step S39, and if not, the process proceeds to step S2 in FIG.

(S2)交点カウンタNcpが正であればステップS3へ進み、そうでなければステップS19へ進む。   (S2) If the intersection counter Ncp is positive, the process proceeds to step S3, and if not, the process proceeds to step S19.

以下、ステップS1で求めた交点毎に、ステップS3〜S9の、重畳しない部分の図形分割・登録処理を行う。   Thereafter, for each intersection obtained in step S1, the graphic division / registration process for the non-overlapping portion in steps S3 to S9 is performed.

(S3)交点の1つを選択する。   (S3) One of the intersection points is selected.

(S4)この交点を始点とする時計回り方向の線分を1つ選択し、移動方向を時計回り方向と決める。   (S4) One clockwise line segment starting from this intersection is selected, and the moving direction is determined as the clockwise direction.

(S5)この線分上を、決められた方向へ移動し、次の交点まで移動する。「移動」は、線分の端点のみを追っていけばよい(以下同様)。   (S5) Move on this line segment in the determined direction and move to the next intersection. For “move”, it is only necessary to follow the end point of the line segment (the same applies hereinafter).

図7において、例えばステップS3で交点P5が選択され、ステップS4で線分P5P4が選択された場合、点P4から曲線P4P6の点P6まで移動する。   In FIG. 7, for example, when the intersection point P5 is selected in step S3 and the line segment P5P4 is selected in step S4, the point P4 moves to the point P6 of the curve P4P6.

(S6)この交点が始点でなければステップS7へ進み、始点であればステップS8へ進む。   (S6) If this intersection is not the start point, the process proceeds to step S7, and if it is the start point, the process proceeds to step S8.

(S7)この交点から、他方の図形の同一点へ移る。移動方向は、移る前と逆方向と決め、ステップS5へ戻る。   (S7) Move from this intersection to the same point on the other graphic. The moving direction is determined to be the reverse direction before moving, and the process returns to step S5.

前記の場合、図形41の曲線P4P6の点P6から図形40の曲線P5P6の点P6へ移り、移動方向を反時計回りと決定する。次にステップS5では、曲線P5P6の交点P6から交点P5へ移動し、ステップS6で交点P5が始点であると判定されてステップS8へ進む。   In the above case, the point P6 of the curve P4P6 of the figure 41 moves to the point P6 of the curve P5P6 of the figure 40, and the moving direction is determined to be counterclockwise. Next, in step S5, the curve P5P6 moves from the intersection point P6 to the intersection point P5. In step S6, the intersection point P5 is determined to be the starting point, and the process proceeds to step S8.

(S8)始点まで戻った閉曲線を、分割閉曲線として登録する。この分割閉曲線の色属性は、図形重畳部分ではないので、該分割閉曲線を含む分割前の図形の色属性と同じにする。   (S8) The closed curve returned to the start point is registered as a divided closed curve. Since the color attribute of this divided closed curve is not a graphic overlapping portion, it is made the same as the color attribute of the graphic before division including the divided closed curve.

(S9)未選択の交点が有ればステップS3へ戻り、無ければステップS10へ進む。   (S9) If there is an unselected intersection, the process returns to step S3, and if not, the process proceeds to step S10.

ステップS3で図7の交点P6を選択し、ステップS4で曲線P6P1を選択した場合には、ステップS5で点P1からP2、P5と移動し、ステップS6で否定判定されてステップS7へ進み、図形40の交点P5から図形41の点P5、P3、P6と移動し、ステップS6で肯定判定されてステップS8で閉曲線P6P1P2P5P3P6を登録し、その色属性を上記同様にして定める。   If the intersection point P6 of FIG. 7 is selected in step S3 and the curve P6P1 is selected in step S4, the point P1 is moved from P1 to P2 and P5 in step S5, a negative determination is made in step S6, and the process proceeds to step S7. It moves from the intersection P5 of 40 to the points P5, P3, P6 of the figure 41, affirmative determination is made in step S6, closed curve P6P1P2P5P3P6 is registered in step S8, and its color attribute is determined in the same manner as described above.

以下のステップS10〜S17は、図形論理積と図形論理和とを見つけて一端登録しておき、いずれが図形論理和であるかを判定してこれを削除することにより、図形論理積を重畳部分の分割図形として求める処理である。   In the following steps S10 to S17, the figure logical product and the graphic logical sum are found and registered, and the figure logical product is superimposed by determining which one is the graphic logical sum and deleting it. This is a process for obtaining a divided figure.

(S10)交点の1つを選択する。   (S10) One of the intersection points is selected.

(S11)この交点を始点とする時計回り方向の線分を1つ選択し、移動方向を時計回り方向と決める。   (S11) One line segment in the clockwise direction starting from this intersection is selected, and the moving direction is determined as the clockwise direction.

(S12)この線分上を、該方向へ移動し、次の交点まで移動する。   (S12) This line segment is moved in this direction and moved to the next intersection.

図7において、例えばステップS10で交点P5が選択され、ステップS11で曲線P5P6が選択された場合、交点P5から曲線P5P6の交点P6まで移動する。   In FIG. 7, for example, when the intersection point P5 is selected in step S10 and the curve P5P6 is selected in step S11, the movement is made from the intersection point P5 to the intersection point P6 of the curve P5P6.

(S13)この交点が始点でなければステップS14へ進み、始点であればステップS15へ進む。   (S13) If this intersection is not the start point, the process proceeds to step S14, and if it is the start point, the process proceeds to step S15.

(S14)この交点から、他方の図形の時計回り方向の線分の同一点へ移り、移動方向を前回と同じ時計回り方向と決め、ステップS12へ戻る。   (S14) From this intersection, it moves to the same point in the clockwise line segment of the other graphic, determines the moving direction as the same clockwise direction as the previous time, and returns to step S12.

前記の場合、図形40の曲線P5P6の交点P6から図形41の曲線P6P3の交点P6へ移る。次にステップS12では、交点P6から点P3、交点P5へと移動し、ステップS13で交点P5が始点であると判定されてステップS15へ進む。   In the above case, the process moves from the intersection P6 of the curve P5P6 of the graphic 40 to the intersection P6 of the curve P6P3 of the graphic 41. Next, in step S12, it moves from the intersection point P6 to the point P3 and the intersection point P5. In step S13, it is determined that the intersection point P5 is the start point, and the process proceeds to step S15.

(S15)始点まで戻った閉曲線を分割閉曲線として登録する。   (S15) The closed curve returned to the start point is registered as a divided closed curve.

(S16)始点で未選択の時計回り線分があればステップS11へ戻り、無ければステップS17へ進む。   (S16) If there is an unselected clockwise line segment at the start point, the process returns to step S11, and if not, the process proceeds to step S17.

ステップS11で図7の曲線P5P4を選択した場合には、ステップS12で交点P5から点P4、P6と移動し、ステップS13で否定判定されてステップS14へ進み、図形41の交点P6から図形40の交点P6、点P1、P2、P5と移動し、ステップS13で肯定判定されてステップS15で閉曲線P5P4P6P1P2P5を登録する。   If the curve P5P4 in FIG. 7 is selected in step S11, the point moves from the intersection point P5 to the points P4 and P6 in step S12, and a negative determination is made in step S13 to proceed to step S14. It moves to intersection point P6, points P1, P2, and P5, affirmative determination is made in step S13, and closed curve P5P4P6P1P2P5 is registered in step S15.

(S17)ステップS15で登録された2つの閉曲線のうち、大きい方(図形論理和の閉曲線)を削除する。どちらが大きいかは、例えば図8に点線矩形で示すように、2つの閉曲線のそれぞれについて、定義域と値域とから定まる外接矩形R3、R4を求め、包含関係に基づいて決定する。   (S17) Of the two closed curves registered in step S15, the larger one (closed curve of figure logical sum) is deleted. Which is larger is determined on the basis of the inclusion relation by obtaining circumscribed rectangles R3 and R4 determined from the definition range and the value range for each of the two closed curves, for example, as indicated by dotted rectangles in FIG.

(S18)ステップS15で登録された2つの閉曲線のうち、小さい方(図形論理積の閉曲線)が分割前の2図形の重畳部分であり、その色属性を、該2図形のそれぞれの色属性及び予め設定されたブレンドモードに基づいて決定する。   (S18) Of the two closed curves registered in step S15, the smaller one (closed curve of the figure logical product) is the overlapping part of the two figures before the division, and the color attribute is assigned to each color attribute of the two figures. This is determined based on a preset blend mode.

例えば図8において図形40の上に図形41が重なり、図形41の色属性が透明度を持っている場合、閉曲線P5P6P3P5について、図形40の色属性である塗り色と、図形41の色属性である塗り色及び透明度と、既定値又はユーザが設定したブレンドモードとに基づいて、ブレンドカラーを決定する。この透明度が0(不透明)であれば、図形41の色属性である塗り色を該閉曲線の色属性と決定する。   For example, in FIG. 8, when the figure 41 overlaps the figure 40 and the color attribute of the figure 41 has transparency, for the closed curve P5P6P3P5, the paint color that is the color attribute of the figure 40 and the paint attribute that is the color attribute of the figure 41 The blend color is determined based on the color and transparency and a default value or a blend mode set by the user. If the transparency is 0 (opaque), the paint color that is the color attribute of the graphic 41 is determined as the color attribute of the closed curve.

以上で図3の処理を終了する。   Thus, the process of FIG. 3 is completed.

(S19)図9(A)に示すように、図形40と図形41Aとの関係が包含関係、即ち一方の図形に他方の図形が含まれているという関係がある場合には、ステップS20へ進み、そうでなければステップS22へ進む。   (S19) As shown in FIG. 9A, if the relationship between the graphic 40 and the graphic 41A is an inclusion relationship, that is, one graphic contains the other graphic, the process proceeds to step S20. Otherwise, the process proceeds to step S22.

包含関係があるか否かは、図形41A内の任意の点、例えば点P3を通る任意の直線、例えば横方向の直線が、点P3の両側のそれぞれについて図形40と交差するか否かで判定することができる。   Whether or not there is an inclusion relationship is determined by whether or not an arbitrary point in the graphic 41A, for example, an arbitrary straight line passing through the point P3, for example, a horizontal straight line intersects the graphic 40 on both sides of the point P3. can do.

(S20)内側の閉曲線と、内側を刳り抜いた外側の閉曲線とに分割して、それぞれを分割閉曲線として登録する。   (S20) Dividing into an inner closed curve and an outer closed curve hollowed out on the inner side, and registering each as a divided closed curve.

(S21)内側の閉曲線についてはステップS18と同様にしてブレンドカラーを決定し、図3の処理を終了する。   (S21) For the inner closed curve, the blend color is determined in the same manner as in step S18, and the processing in FIG. 3 is terminated.

(S22)それぞれの閉曲線40、41を登録し、図3の処理を終了する。   (S22) The respective closed curves 40 and 41 are registered, and the processing of FIG.

なお、図9(B)に示すように図形41Bの一辺が図形40の辺と重なり交点(交差点)を有しない場合や、図9(C)に示すように図形41Cの1点P4が図形41の辺上に存在し交点を有しない場合は、図8に関し述べたことと同様にして包含関係を決定し、図9(A)の場合と同様に処理する。   9B, one side of the figure 41B overlaps the side of the figure 40 and does not have an intersection (intersection), or one point P4 of the figure 41C is the figure 41 as shown in FIG. 9C. If there is no intersection point, the inclusion relation is determined in the same manner as described with reference to FIG. 8, and the same processing as in FIG.

図10は、図形40と図形41とが重なって交点を4個有する場合を示す。   FIG. 10 shows a case where the figure 40 and the figure 41 overlap to have four intersections.

この場合、図5の処理により図11に示すような方向付線分が得られる。また、図3のステップS3〜S9の繰り返し処理により、重畳しない閉曲線P5P4P6P5、閉曲線P6P7P6、閉曲線P7P8P7及び閉曲線P8P1P2P5P3P8が得られる。また、図3のステップS10〜S16の処理により、図形論理和の閉曲線P5P4P6P7P8P1P2P5及び図形論理積の閉曲線P5P6P7P8P3P5が得られる。   In this case, the directional line segment as shown in FIG. 11 is obtained by the process of FIG. In addition, the closed curve P5P4P6P5, the closed curve P6P7P6, the closed curve P7P8P7, and the closed curve P8P1P2P5P3P8 that do not overlap are obtained by repeating the processes of steps S3 to S9 in FIG. 3, the graphic logical OR closed curve P5P4P6P7P8P1P2P5 and the graphic AND closed curve P5P6P7P8P3P5 are obtained.

本実施例1によれば、2図形40、41の境界線の一部である3次ベジエ曲線上に交点が存在するとき、この3次ベジエ曲線を、その各端点及び該交点での位置で分割し、分割された各線分をパラメータの区域が[0,1]である3次ベジエ曲線で近似し、これを用いて、2図形40、41の分割された部分の閉曲線を記述するので、分割前後で図形表現が統一されて、既存のラスタライズ処理を変更せずに用いることができるという効果を奏する。   According to the first embodiment, when an intersection exists on a cubic Bezier curve that is a part of the boundary line between the two figures 40 and 41, the cubic Bezier curve is represented at each end point and the position at the intersection. Since each divided line segment is approximated by a cubic Bezier curve whose parameter area is [0, 1], and this is used to describe the closed curve of the divided parts of the two figures 40 and 41, The graphic representation is unified before and after the division, and the existing rasterization process can be used without being changed.

また、図3のステップS0で図形境界線の方向付けを行ってから、ステップS3〜S9の簡単な処理で、相互に重畳しない図形の部分を求めることができるという効果を奏する。   Further, after the orientation of the figure boundary line is performed in step S0 in FIG. 3, it is possible to obtain the parts of the figure that do not overlap each other with the simple processing in steps S3 to S9.

さらに、この方向付けを行ってから、ステップS10〜S18の簡単な処理で、相互に重畳する図形の部分を求めることができるという効果を奏する。   Furthermore, after performing this orientation, there is an effect that it is possible to obtain graphic parts to be superimposed on each other by simple processing of steps S10 to S18.

以上において、本発明の好適な実施例を説明したが、本発明には他にも種々の変形例が含まれ、上記実施例で述べた各構成要素の機能を実現する他の構成を用いたもの、当業者であればこれらの構成又は機能から想到するであろう他の構成も、本発明に含まれる。   In the above, preferred embodiments of the present invention have been described. However, the present invention includes various modifications, and other configurations that realize the functions of the respective components described in the above embodiments are used. However, other configurations that would be conceived by those skilled in the art from these configurations or functions are also included in the present invention.

例えば、図3のステップS11及びS14での一方向は、方向情報が示す方向と逆の方向であってもよい。   For example, one direction in steps S11 and S14 in FIG. 3 may be a direction opposite to the direction indicated by the direction information.

また、ステップS42において、分割された各ベジエ曲線のt=0.5で分割前のベジエ曲線の対応する点(x座標が両者で同一の点)での近似誤差(両者のy座標の差の絶対値)がしきい値、例えば1画素以上であれば、この点でさらにベジエ曲線を同様に分割することにより、近似精度を向上させてもよい。この2分割処理は、誤差がしきい値未満になるまで、分割点の両側のそれぞれについて続けてもよい。   In step S42, an approximation error (the difference between the two y coordinates) at the corresponding point (the x coordinate is the same point) of the Bezier curve before division at t = 0.5 of each divided Bezier curve. If the absolute value) is a threshold value, for example, one pixel or more, the approximation accuracy may be improved by further dividing the Bezier curve at this point. This two-part dividing process may be continued for each of both sides of the dividing point until the error becomes less than the threshold value.

さらに、3図形以上の場合には、レイヤーが下の方からまず2図形を取り出して上記実施例で述べた処理を行い、ついで3図形目を取り出して、これと、登録されている分割図形の各々について順に、上記実施例で述べた処理を行い、その後4図形目以降も同様に処理するようにしてもよい。本発明は、少なくとも2図形について適用することにより、上記効果が得られる。   Furthermore, if there are more than three figures, the first two figures are taken out from the lower layer and the processing described in the above embodiment is performed, then the third figure is taken out, and this is divided into the registered divided figures. The processing described in the above embodiment may be performed in order for each, and thereafter the fourth and subsequent figures may be processed in the same manner. By applying the present invention to at least two figures, the above effect can be obtained.

10 画像形成装置
11 CPU
12 インターフェイス
13 PROM
14 DRAM
15 補助記憶装置
16 ネットワークインターフェイス
17 操作パネル
18 スキャナ
19 プリンタ
1A ファックスモデム
20 PC
30 ネットワーク
40、41、41A〜41C 図形
P1〜P4 点
P5〜P8 交点
10 Image forming apparatus 11 CPU
12 Interface 13 PROM
14 DRAM
15 Auxiliary storage device 16 Network interface 17 Operation panel 18 Scanner 19 Printer 1A Fax modem 20 PC
30 network 40, 41, 41A-41C figure P1-P4 point P5-P8 intersection

Claims (5)

プロセッサと、プログラムが格納された記憶手段とを備え、該プログラムは該プロセッサに対し、色属性を持つ第1図形の上層に、色属性として透明度を持つ第2図形が重畳し、該第1図形と該第2図形とがそれぞれベクターオブジェクトで記述された印刷データについて、
(a)該第1図形及び該第2図形を、相互に重畳する部分と、相互に重畳しない部分とに分割させ、
(b)重畳部分の色属性を少なくとも両図形の色属性に基づいて決定させ、
(c)該重畳部分とそれ以外の部分のそれぞれをビットマップ展開させて画像を形成させる、
画像形成装置において、該第1図形及び該第2図形のそれぞれの境界線が3次ベジエ曲線又は直線で表され、該プログラムは該プロセッサに対しさらにステップ(a)で、
3次ベジエ曲線上に交点が存在すれば、該3次ベジエ曲線を、その各端点及び該交点での位置で分割させ、分割された各線分をパラメータの区域が[0,1]である3次ベジエ曲線で近似させ、該分割された部分の閉曲線の線分が該分割された3次ベジエ曲線であればこれを該近似した3次ベジエ曲線で記述させる、
ことを特徴とする画像形成装置。
A processor and storage means for storing a program, the program superimposing a second graphic having transparency as a color attribute on top of the first graphic having a color attribute to the processor; And print data in which the second graphic is described by a vector object.
(A) dividing the first graphic and the second graphic into a portion that overlaps each other and a portion that does not overlap each other;
(B) The color attribute of the superimposed portion is determined based on at least the color attributes of both figures,
(C) Bitmap development is performed for each of the overlapped portion and the other portions to form an image.
In the image forming apparatus, each boundary line of the first graphic and the second graphic is represented by a cubic Bézier curve or a straight line, and the program further includes a step (a) for the processor.
If there is an intersection on the cubic Bezier curve, the cubic Bezier curve is divided at each end point and the position at the intersection, and each divided line segment has a parameter area of [0, 1] 3 Approximated by a second-order Bezier curve, and if the line segment of the closed curve of the divided portion is the third-order Bezier curve divided, this is described by the approximated third-order Bezier curve.
An image forming apparatus.
該プログラムは該プロセッサに対しステップ(a)においてさらに、
該分割されたベジエ曲線のパラメータ値が0及び1の位置のそれぞれで該位置、該位置でのx−y直交座標系におけるyに対するxの1回微分値及び2回微分値が、分割前のベジエ曲線の対応する点でのそれらと一致するように、該分割されたベジエ曲の、該分割前のベジエ曲線に対する近似式を定めさせる、
ことを特徴とする請求項1に記載の画像形成装置。
The program is further sent to the processor in step (a),
The first and second differential values of x with respect to y in the position where the parameter value of the divided Bezier curve is 0 and 1, respectively, in the xy orthogonal coordinate system at the position are the values before the division. Let the approximate expression of the divided Bezier curve to the Bezier curve before the division be determined so as to match those at corresponding points of the Bezier curve.
The image forming apparatus according to claim 1.
該プログラムは該プロセッサに対しステップ(a)においてさらに、
該分割されたベジエ曲線のパラメータ値が0、0.5及び1の位置のそれぞれで該位置、該位置でのx−y直交座標系におけるyに対するxの1回微分値が、分割前のベジエ曲線の対応する点でのそれらと一致するように、該分割されたベジエ曲の、該分割前のベジエ曲線に対する近似式を定めさせる、
ことを特徴とする請求項1に記載の画像形成装置。
The program is further sent to the processor in step (a),
The parameter value of the divided Bezier curve is 0, 0.5, and 1 at each position, and the first differential value of x with respect to y in the xy orthogonal coordinate system at the position is the Bezier before division. Let the approximate expression of the divided Bezier curve to the Bezier curve before the division be determined so as to match those at corresponding points of the curve.
The image forming apparatus according to claim 1.
該プログラムは該プロセッサに対しステップ(a)においてさらに、
(a1)該第1図形及び該第2図形のそれぞれについて、境界線上を一方向に回るように境界線に方向情報を付加させておき、
(a2)該交点で境界線の線分を分割した際に、分割後の線分の方向情報を、分割前の線分の方向情報と一致させ、
(a3)交点毎に、該交点を始点とし該一方向が該始端から離れる方向である方向情報を持つ線分を1つ選択させ、移動方向を該一方向と決定させ、
(a4)該線分上を論理的に次の交点まで該決定した方向へ移動させ、
(a5)移動後の交点が該始点でなければ、該交点で他方の図形の対応する点に移らせ、移動方向をステップ(a4)での方向と逆方向に決定させ、次いでステップ(a4)へ戻らさせ、該始点であれば、一巡した閉曲線を該相互に重畳しない部分の閉曲線と決定させる、
ことを特徴とする請求項1乃至3のいずれか1つに記載の画像形成装置。
The program is further sent to the processor in step (a),
(A1) For each of the first graphic and the second graphic, direction information is added to the boundary line so as to turn in one direction on the boundary line,
(A2) When dividing the line segment of the boundary line at the intersection, the direction information of the line segment after the division is matched with the direction information of the line segment before the division,
(A3) For each intersection, select one line segment having direction information whose starting point is the direction in which the one direction is away from the starting end, and determine the moving direction as the one direction.
(A4) logically move on the line segment to the next intersection in the determined direction;
(A5) If the intersection after movement is not the start point, the intersection is moved to the corresponding point of the other figure, the movement direction is determined to be opposite to the direction in step (a4), and then step (a4) If it is the start point, it is determined that the closed curves that have made one round are the closed curves that do not overlap each other.
The image forming apparatus according to claim 1, wherein the image forming apparatus is an image forming apparatus.
該プログラムは該プロセッサに対しステップ(a)において、1つの交点及び一方向に関し、
(a6)該交点を始点とする該一方向の線分を1つ選択させ、
(a7)該線分上を論理的に次の交点まで該一方向へ移動させ、
(a8)移動後の交点が該始点でなければ、該交点で他方の図形の対応する点に移らせ、次いでステップ(a7)へ戻らさせ、該始点であれば、一巡した閉曲線を保存させ、ステップ(a6)〜(a8)の処理により保存された閉曲線が1つであればステップ(a6)に戻らさせ、2つであれば両閉曲線の一方に包含される他方の閉曲線を該相互に重畳する部分の閉曲線と決定させ、
該一方向は、線分の方向情報が示す方向又はこれと逆方向のいずれか一方であることを特徴とする請求項1乃至4のいずれか1つに記載の画像形成装置。
The program for the processor in step (a) for one intersection and one direction,
(A6) One line segment in the one direction starting from the intersection is selected,
(A7) Move on the line segment in the one direction logically to the next intersection,
(A8) If the intersection after movement is not the start point, move to the corresponding point of the other figure at the intersection, and then return to step (a7). If there is one closed curve stored by the processing of steps (a6) to (a8), the process returns to step (a6). If there are two closed curves, the other closed curves included in one of both closed curves are superimposed on each other. The closed curve of the part to be
5. The image forming apparatus according to claim 1, wherein the one direction is one of a direction indicated by direction information of a line segment and a direction opposite thereto.
JP2011279178A 2011-12-21 2011-12-21 Image forming apparatus Expired - Fee Related JP5687612B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011279178A JP5687612B2 (en) 2011-12-21 2011-12-21 Image forming apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011279178A JP5687612B2 (en) 2011-12-21 2011-12-21 Image forming apparatus

Publications (2)

Publication Number Publication Date
JP2013130998A true JP2013130998A (en) 2013-07-04
JP5687612B2 JP5687612B2 (en) 2015-03-18

Family

ID=48908510

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011279178A Expired - Fee Related JP5687612B2 (en) 2011-12-21 2011-12-21 Image forming apparatus

Country Status (1)

Country Link
JP (1) JP5687612B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017102931A (en) * 2013-09-25 2017-06-08 日本電信電話株式会社 Data analysis device, method, and program

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04289977A (en) * 1991-03-18 1992-10-14 Dainippon Printing Co Ltd Graphic data converter
US5269000A (en) * 1990-01-12 1993-12-07 Nec Corporation Curve generator
JPH08235368A (en) * 1995-02-23 1996-09-13 Canon Inc Method for calculating intersection point of bezer curve and two-dimentional graphic and graphic processor therefor
JPH1049690A (en) * 1996-08-07 1998-02-20 Fuji Xerox Co Ltd Picture forming device
JP2005109987A (en) * 2003-09-30 2005-04-21 Kyocera Mita Corp Image forming method
US20070139429A1 (en) * 2005-12-20 2007-06-21 Xerox Corporation Normalization of vector-based graphical representations

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5269000A (en) * 1990-01-12 1993-12-07 Nec Corporation Curve generator
JPH04289977A (en) * 1991-03-18 1992-10-14 Dainippon Printing Co Ltd Graphic data converter
JPH08235368A (en) * 1995-02-23 1996-09-13 Canon Inc Method for calculating intersection point of bezer curve and two-dimentional graphic and graphic processor therefor
JPH1049690A (en) * 1996-08-07 1998-02-20 Fuji Xerox Co Ltd Picture forming device
JP2005109987A (en) * 2003-09-30 2005-04-21 Kyocera Mita Corp Image forming method
US20070139429A1 (en) * 2005-12-20 2007-06-21 Xerox Corporation Normalization of vector-based graphical representations

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017102931A (en) * 2013-09-25 2017-06-08 日本電信電話株式会社 Data analysis device, method, and program

Also Published As

Publication number Publication date
JP5687612B2 (en) 2015-03-18

Similar Documents

Publication Publication Date Title
AU2018247213B2 (en) Robust and efficient method for generating high-quality triangle mesh representation for geometry bounded by bezier splines
US8634659B2 (en) Image processing apparatus, computer readable medium storing program, and image processing method
US11320975B2 (en) Automatically generating and applying graphical user interface resize-constraints based on design semantics
JP2006331191A (en) Image forming apparatus, printing apparatus, display apparatus, plotting processing method, and program
JP5377685B2 (en) Image forming apparatus and image forming program
JP2017151493A (en) Image processing device, image reading device, and program
JP7035656B2 (en) Information processing equipment and programs
TW202022485A (en) Hessian free calculation of product of hessian matrix and vector for lithography optimization
JP5687612B2 (en) Image forming apparatus
JP2019062258A (en) Image forming apparatus and image forming method
JP2008003994A (en) Printing system
JP4789828B2 (en) Printing system
JP2005142614A (en) Scanner driver program, information processing apparatus, and copy system
US7301539B2 (en) Method and apparatus for translating an arc definition into a series of conic curve definitions
JP2019148846A (en) Information processing apparatus, information processing method and program
CN112991221B (en) Method and device for correcting UV expansion diagram of specially-shaped customized area
US20230005195A1 (en) Free Form Radius Editing
JP2012060532A (en) Electronic document processing device and program
JP4804181B2 (en) Image processing device
JP2022063956A (en) Control method and program
JP2023153238A (en) Digital ink generation apparatus, method, and program
JP2012043276A (en) Information processing unit and program
JP2023047180A (en) Information processing device and information processing program
JP2007060551A (en) Deviation measuring method, deviation correcting apparatus, and deviation correction program
JP2020144453A (en) Image editing device and image editing method

Legal Events

Date Code Title Description
RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20130426

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20131125

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20140922

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20141007

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20141205

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: 20141224

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20150122

R150 Certificate of patent or registration of utility model

Ref document number: 5687612

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees