JPH07262391A - Method and device for processing image - Google Patents

Method and device for processing image

Info

Publication number
JPH07262391A
JPH07262391A JP7535394A JP7535394A JPH07262391A JP H07262391 A JPH07262391 A JP H07262391A JP 7535394 A JP7535394 A JP 7535394A JP 7535394 A JP7535394 A JP 7535394A JP H07262391 A JPH07262391 A JP H07262391A
Authority
JP
Japan
Prior art keywords
color
closed curve
closed
image
coordinate
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP7535394A
Other languages
Japanese (ja)
Inventor
Tetsuya Hayashi
林  哲也
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.)
Casio Computer Co Ltd
Original Assignee
Casio Computer Co Ltd
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 Casio Computer Co Ltd filed Critical Casio Computer Co Ltd
Priority to JP7535394A priority Critical patent/JPH07262391A/en
Priority to US08/405,521 priority patent/US5611037A/en
Priority to EP95104136A priority patent/EP0675461B1/en
Priority to DE69518180T priority patent/DE69518180T2/en
Publication of JPH07262391A publication Critical patent/JPH07262391A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To display a portrait or animation image in colors at low cost with a little data. CONSTITUTION:When a portrait selection switch is turned on (step S12) in the case of preparing a color portrait image, closed curve data A to F and color data A to F corresponding to a portrait number are loaded to a RAM (step S20), first of all, plural closed curves A to F omitting colors are prepared (step S22), next, colors for painting out the boundary and inside of these closed curves A to F are designated and further, the priority for painting out the respective closed curves A to F in those colors is decided. Afterwards, the boundary and inside of the respective closed curves A to F are painted out in the designated colors according to this priority, and a color image is prepared (step S24) and displayed (step S26). Thus, even when displaying the portrait in the colors, the image can be displayed in the colors by simply providing the closed curve data and their color data even without necessity to provide color data for each pixel.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、画像処理方法およびそ
の装置に係わり、詳しくはアニメーション、似顔絵等を
作成する際に、閉曲線の内部を塗りつぶすことで、少量
のデータによって描画を可能にした画像処理方法および
その方法を実現する装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an image processing method and an apparatus therefor, and more specifically, an image which can be drawn with a small amount of data by filling the inside of a closed curve when creating an animation or a portrait. The present invention relates to a processing method and an apparatus that realizes the method.

【0002】[0002]

【従来の技術】従来、アニメーション、ゲーム等ではビ
ット配列形式の画像データを用いることが多く、この画
像データによりキャラクターや背景データを表示してい
る。そして、このビット配列形式の画像データはドット
で構成され、かつ各ドット毎に表示色番号あるいはパレ
ット番号を持つようになっている。すなわち、コンピュ
ータ画面上などにおいて、似顔絵やアニメーション画像
をカラー表示させるために、ピクセル毎にカラーデータ
を持っている。
2. Description of the Related Art Conventionally, image data in a bit array format is often used in animation, games, etc., and characters and background data are displayed by this image data. The image data in the bit array format is composed of dots, and each dot has a display color number or a palette number. That is, in order to display a portrait or an animation image in color on a computer screen or the like, it has color data for each pixel.

【0003】[0003]

【発明が解決しようとする課題】ところで、従来の画像
処理装置の場合、コンピュータ画面上あるいはテレビ画
面上において、似顔絵やアニメーション画像をカラー表
示させるためには、ピクセル毎にカラーデータを持たな
ければならず、必然的に大量のデータが必要であるとい
う問題点があった。また、大量のデータを処理するため
のメモリ装置の容量が多くなって、この点でコスト高に
もなっていた。
By the way, in the case of the conventional image processing apparatus, in order to display a portrait or an animation image in color on a computer screen or a television screen, it is necessary to have color data for each pixel. However, there was a problem that a large amount of data was inevitably needed. In addition, the capacity of the memory device for processing a large amount of data is increased, and the cost is increased in this respect.

【0004】そこで本発明は、少ないデータで、低コス
トに、似顔絵やアニメーション画像等をカラー表示させ
ることができる画像処理方法およびその装置を提供する
ことを目的としている。
Therefore, an object of the present invention is to provide an image processing method and apparatus capable of displaying a portrait, an animation image, and the like in color with a small amount of data and at low cost.

【0005】[0005]

【課題を解決するための手段】上記目的達成のため、請
求項1記載の発明による画像処理方法は、所定の画像を
色を省略した複数の閉曲線で作成し、これらの閉曲線の
境界および内部を塗りつぶす色を指定し、前記複数の閉
曲線の境界および内部を塗りつぶす場合の各閉曲線の優
先順位を決定し、この優先順位に従って各閉曲線の境界
およびその内部を指定された色で塗りつぶして所定のカ
ラー画像を作成することを特徴とする。
In order to achieve the above object, the image processing method according to the invention as defined in claim 1 creates a predetermined image by a plurality of closed curves in which colors are omitted, and the boundaries and insides of these closed curves are defined. Specify the color to be filled, determine the priority of each closed curve when filling the boundary and the inside of the plurality of closed curves, and fill the boundary and the inside of each closed curve with the specified color according to this priority, and a predetermined color image It is characterized by creating.

【0006】また、好ましい態様として、例えば請求項
2記載のように、前記閉曲線は、直線あるいはベジェ曲
線のうちの1つ以上によって作成されるようにしてもよ
い。例えば請求項3記載のように、前記所定の画像を色
を省略した複数の閉曲線で作成する処理では、複数の閉
曲線を作成する閉曲線データを用い、これら複数の閉曲
線の境界およびその内部を指定された色で塗りつぶす処
理では、塗りつぶしのためのカラーデータを用いるよう
にしてもよい。例えば請求項4記載のように、前記閉曲
線を直線によって作成する処理は、直線を多数のドット
によって形成するものであり、直線の両端を形成する2
つのドット位置を決定するとともに、そのドット位置の
傾きを算出する処理と、この傾きに応じてx座標又はy
座標を1単位ずつ増加させた場合の誤差を累積する処理
と、この誤差が所定値を超えるときにのみ、次のドット
のx座標又はy座標の位置を変更するとともに、前記累
算された誤差から一定値を減算する処理と、を有するよ
うにしてもよい。
As a preferred mode, for example, the closed curve may be formed by one or more of a straight line and a Bezier curve. For example, as described in claim 3, in the process of creating the predetermined image with a plurality of closed curves in which colors are omitted, closed curve data that creates a plurality of closed curves is used, and the boundaries of the plurality of closed curves and the inside thereof are designated. In the process of filling with different colors, color data for filling may be used. For example, as described in claim 4, the process of creating the closed curve by a straight line is to form a straight line by a large number of dots, and to form both ends of the straight line.
The process of determining one dot position and calculating the inclination of that dot position, and the x coordinate or y depending on this inclination.
A process of accumulating the error when the coordinate is increased by one unit, and changing the position of the x-coordinate or the y-coordinate of the next dot only when the error exceeds a predetermined value, and calculating the accumulated error. And a process of subtracting a constant value from.

【0007】請求項5記載の画像処理装置は、所定の画
像を色を省略した複数の閉曲線で作成する閉曲線作成手
段と、閉曲線作成手段によって作成された閉曲線の境界
および内部を塗りつぶす色を指定する色指定手段と、前
記複数の閉曲線の境界および内部を塗りつぶす場合の各
閉曲線に対する優先順位を決定する優先順位決定手段
と、この優先順位に従って各閉曲線の境界およびその内
部を指定された色で塗りつぶして所定のカラー画像を作
成するカラー画像作成手段と、を備えたことを特徴とす
る。
An image processing apparatus according to a fifth aspect of the present invention specifies a closed curve creating means for creating a predetermined image with a plurality of closed curves without colors, and a color for filling the boundary and the inside of the closed curve created by the closed curve creating means. A color designating means, a priority determining means for determining a priority for each closed curve when filling the boundaries and the inside of the plurality of closed curves, and a boundary and the interior of each closed curve are painted in a designated color according to this priority. And a color image creating means for creating a predetermined color image.

【0008】また、例えば請求項6記載のように、前記
閉曲線作成手段は、直線あるいはベジェ曲線のうちの1
つ以上によって閉曲線を作成するようにしてもよい。例
えば請求項7記載のように、前記閉曲線作成手段は、所
定の画像を構成する複数の閉曲線を閉曲線データによっ
て作成し、前記カラー画像作成手段は、複数の閉曲線の
境界およびその内部を、指定されたカラーデータに対応
する色で塗りつぶすようにしてもよい。例えば請求項8
記載のように、前記カラー画像作成手段によって作成さ
れた所定のカラー画像を表示する表示手段を、さらに有
するようにしてもよい。例えば請求項9記載のように、
前記カラー画像作成手段によって作成された所定のカラ
ー画像を印刷する印刷手段を、さらに有するようにして
もよい。例えば請求項10記載のように、前記閉曲線作
成手段は、閉曲線を多数のドットからなる直線によって
作成する場合、直線の両端を形成する2つのドット位置
を決定するとともに、そのドット位置の傾きを算出する
手段と、この傾きに応じてx座標又はy座標を1単位ず
つ増加させた場合の誤差を累積する手段と、この誤差が
所定値を超えるときにのみ、次のドットのx座標又はy
座標の位置を変更するとともに、前記累算された誤差か
ら一定値を減算する手段とを有するようにしてもよい。
Further, as described in claim 6, for example, the closed curve creating means is one of a straight line and a Bezier curve.
A closed curve may be created by one or more. For example, as described in claim 7, the closed curve creating means creates a plurality of closed curves forming a predetermined image by closed curve data, and the color image creating means specifies boundaries of the plurality of closed curves and the inside thereof. The color may be filled with a color corresponding to the color data. For example, claim 8
As described above, the display device may further include display means for displaying the predetermined color image created by the color image creating means. For example, as described in claim 9,
You may make it further have a printing means which prints the predetermined color image produced by the said color image production means. For example, as described in claim 10, when the closed curve creating means creates a closed curve by a straight line composed of a large number of dots, it determines two dot positions forming both ends of the straight line and calculates an inclination of the dot position. And a means for accumulating an error when the x coordinate or the y coordinate is increased by one unit according to the inclination, and an x coordinate or a y of the next dot only when the error exceeds a predetermined value.
A unit for changing the position of the coordinate and subtracting a constant value from the accumulated error may be provided.

【0009】[0009]

【作用】本発明では、カラーの画像(例えば、似顔絵あ
るいはアニメーション画像)を作成する場合、まず色を
省略した複数の閉曲線で画像を作成し、次いで、これら
の閉曲線の境界および内部を塗りつぶす色を指定し、さ
らに各閉曲線を色で塗りつぶす場合の優先順位を決定す
る。次いで、この優先順位に従って各閉曲線の境界およ
びその内部を指定された色で塗りつぶしてカラー画像を
作成する。したがって、例えば似顔絵をカラー表示させ
る場合でも、従来のようにピクセル毎にカラーデータを
持つ必要がなく、単に閉曲線データとカラーデータとを
持てば画像をカラー表示することが可能になる。その結
果、少ないデータ量で、低コストに、似顔絵やアニメー
ション画像等をカラー表示させることが可能になる。
According to the present invention, when a color image (for example, a portrait or an animation image) is created, an image is first created with a plurality of closed curves whose colors are omitted, and then the borders and interiors of these closed curves are filled with colors. Specify and specify the priority when filling each closed curve with color. Then, in accordance with this priority order, the boundary of each closed curve and the inside thereof are filled with a designated color to create a color image. Therefore, for example, even when a portrait is displayed in color, it is not necessary to have color data for each pixel as in the conventional case, and it is possible to display an image in color only by having closed curve data and color data. As a result, it becomes possible to display a portrait, an animation image, or the like in color with a small amount of data and at low cost.

【0010】[0010]

【実施例】以下、図面を参照して本発明の実施例につい
て説明する。似顔絵作成装置の構成 図1は本発明に係る画像処理方法を実現する似顔絵作成
装置(画像処理装置に相当)の一実施例を示す構成図で
ある。図1において、似顔絵作成装置は大きく分けてC
PU1、ROM2、RAM3、スイッチ部4、表示部
5、カラープリンタ6および各部を結ぶバス7によって
構成されている。CPU1は装置全体を制御するもの
で、スイッチ部4から描画指令が入力されると、その指
令情報に対応すべくROM2に格納されている制御プロ
グラムに基づいて似顔絵を作成するために必要な処理
(例えば、似顔絵の輪郭や各部位の描画に必要な直線又
はベジェ曲線のデータ計算および塗りつぶしの処理)を
行う。また、CPU1は内部レジスタを有しており、内
部レジスタにフラグやポインタの値を格納する。
Embodiments of the present invention will be described below with reference to the drawings. Configuration of Portrait Drawing Device FIG. 1 is a block diagram showing an embodiment of a portrait creating device (corresponding to an image processing device) for realizing an image processing method according to the present invention. In FIG. 1, the portrait creation device is roughly divided into C
It comprises a PU 1, a ROM 2, a RAM 3, a switch unit 4, a display unit 5, a color printer 6 and a bus 7 connecting the respective units. The CPU 1 controls the entire apparatus, and when a drawing command is input from the switch unit 4, a process required to create a portrait based on a control program stored in the ROM 2 corresponding to the command information ( For example, the calculation of the data of the straight line or the Bezier curve necessary for drawing the outline of the portrait or each part and the filling process are performed. Further, the CPU 1 has an internal register, and stores the values of flags and pointers in the internal register.

【0011】ROM2はCPU1の制御プログラムを格
納しているとともに、後述の図3に示すように似顔絵の
輪郭や顔の各部位を表す閉曲線作成データ、閉曲線カラ
ーデータ等のパラメータを予め格納している。RAM3
はCPU1が演算処理を行う際のワークエリアとして用
いられ、データを一時的に記憶する。スイッチ部4はオ
ペレータによって操作されるもので、似顔絵を選択する
ときに操作される似顔絵選択スイッチおよび似顔絵作成
処理を開始するときに操作されるスタートスイッチを有
している。なお、各操作スイッチは単独操作のプッシュ
スイッチでもよいし、あるいは複数のスイッチからなる
スイッチボード、キーボード等でもよい。また、スイッ
チ部4としてスイッチボード等の他に、マウス、トラッ
クボール等を用いてもよい。表示部(表示手段)5はC
PU1の演算処理によって作成される似顔絵をそのプロ
セス毎に表示するもので、例えば画像信号発生回路(Vi
deo Display Prosseser:以下VDPという)、VRA
M、TVディスプレイを含んで構成される。なお、画面
の表示はTVディスプレイではなく、カラー表示が可能
なものであれば、LCDでもよい。カラープリンタ(印
刷手段)6は所定の用紙に画像を印刷するもので、例え
ば表示部5に表示された似顔絵をカラーで印刷すること
が可能である。上記CPU1、ROM2およびRAM3
は全体として閉曲線作成手段21、色指定手段22、優
先順位決定手段23、カラー画像作成手段24を構成す
る。
The ROM 2 stores a control program for the CPU 1 and also stores in advance parameters such as closed curve creation data and closed curve color data representing the outline of the portrait and each part of the face, as shown in FIG. 3 described later. . RAM3
Is used as a work area when the CPU 1 performs arithmetic processing, and temporarily stores data. The switch unit 4 is operated by an operator and has a portrait selection switch operated when selecting a portrait and a start switch operated when starting a portrait creation process. Each operation switch may be a push switch that can be operated independently, or a switch board including a plurality of switches, a keyboard, or the like. As the switch unit 4, a mouse, a trackball, or the like may be used instead of the switch board or the like. The display unit (display means) 5 is C
A portrait created by the arithmetic processing of PU1 is displayed for each process. For example, an image signal generation circuit (Vi
deo Display Prosseser: VDP), VRA
It is configured to include M and TV displays. The screen may be displayed on the LCD instead of the TV display as long as color display is possible. The color printer (printing means) 6 prints an image on a predetermined sheet, and can print the portrait displayed on the display unit 5 in color, for example. CPU1, ROM2 and RAM3
Constitutes a closed curve creating means 21, a color designating means 22, a priority order determining means 23, and a color image creating means 24 as a whole.

【0012】次に、作用を説明する。メインプログラム 図2は似顔絵作成処理のメインプログラムを示すフロー
チャートである。このプログラムがスタートすると、ま
ずステップS10でイニシャライズ(初期化処理)を行
う。これにより、例えばCPU1内の各種レジスタのイ
ニシャライズ、RAM3のワークエリアのクリア、サブ
ルーチンのイニシャライズ、フラグのリセット等が行わ
れる。次いで、ステップS12でスイッチ部4の似顔絵
選択スイッチがオンしているか否かを判別する。似顔絵
選択スイッチがオンしていなければ、ステップS26の
表示処理にジャンプする。これにより、最初のルーチン
では、例えば初期画面が表示部5に表示される。また、
既に似顔絵が表示されている場合には、以前の似顔絵が
変更されずに表示されることになる。
Next, the operation will be described. Main Program FIG. 2 is a flowchart showing the main program of the portrait creation process. When this program starts, first, in step S10, initialization (initialization processing) is performed. Thereby, for example, various registers in the CPU 1 are initialized, the work area of the RAM 3 is cleared, a subroutine is initialized, and flags are reset. Next, in step S12, it is determined whether or not the portrait selection switch of the switch unit 4 is turned on. If the portrait selection switch is not turned on, the process jumps to the display process of step S26. Thereby, in the first routine, for example, the initial screen is displayed on the display unit 5. Also,
When the portrait is already displayed, the previous portrait is displayed without being changed.

【0013】似顔絵選択スイッチがオンしている場合に
は、ステップS14に進んで似顔絵番号を変更する。こ
こで、ROM2には図3に示すように(1)から(n)
までのn種類の似顔絵データが格納されており、これら
の似顔絵データは似顔絵の輪郭や顔の各部位を表す閉曲
線作成データA〜Fと、閉曲線の色を指定する閉曲線カ
ラーデータA〜Fとに区分されて所定のエリアに格納さ
れている。なお、閉曲線カラーデータA〜Fは、閉曲線
作成データA〜Fのそれぞれの色(閉曲線の境界および
内部を塗りつぶす色)を指定するものである。したがっ
て、例えば似顔絵(1)〜(n)のデータは男の似顔絵
や女の似顔絵に対応させて、自由に設定しておくことが
可能である。
If the portrait selection switch is turned on, the flow advances to step S14 to change the portrait number. Here, in the ROM 2, as shown in FIG. 3, (1) to (n)
Up to n types of caricature data are stored. These caricature data are closed curve creation data A to F representing the contour of the caricature and each part of the face, and closed curve color data A to F designating the color of the closed curve. It is divided and stored in a predetermined area. The closed curve color data A to F specify the colors of the closed curve creation data A to F (colors that fill the boundary and the inside of the closed curve). Therefore, for example, the data of the portraits (1) to (n) can be freely set in correspondence with the portraits of the man and the portraits of the woman.

【0014】ステップS14で、例えば似顔絵番号=
(2)が選択された場合には、後述のようにROM2に
格納されている似顔絵番号(2)に対応する似顔絵デー
タ(すなわち、閉曲線作成データおよび閉曲線カラーデ
ータ)が読み出されることになる。次いで、ステップS
16でスイッチ部4のスタートスイッチがオンしたか否
かを判別する。スタートスイッチがオンしていなけれ
ば、ステップS26の表示処理にジャンプする。これに
より、最初のルーチンでは、例えば初期画面が表示部5
に表示されたままの状態となる。また、既に似顔絵が表
示されている場合には、以前の似顔絵が変更されずに表
示されたままである。スタートスイッチがオンした場合
には、ステップS18に進んで表示部5の表示をクリア
する。これにより、最初のルーチンでは初期画面がクリ
アされる。また、既に似顔絵が表示されている場合に
は、以前の似顔絵がクリアされる。次いで、ステップS
20で似顔絵番号に対応する閉曲線作成データA〜Fお
よび閉曲線カラーデータA〜FをROM2から読み出し
て、RAM3にロードする。
In step S14, for example, portrait number =
When (2) is selected, the portrait data (that is, the closed curve creation data and the closed curve color data) corresponding to the portrait number (2) stored in the ROM 2 is read as described later. Then, step S
At 16, it is determined whether or not the start switch of the switch unit 4 is turned on. If the start switch is not turned on, the process jumps to the display process of step S26. Accordingly, in the first routine, for example, the initial screen is displayed on the display unit 5.
It remains as it is displayed in. In addition, when the portrait is already displayed, the previous portrait remains displayed without being changed. When the start switch is turned on, the process proceeds to step S18 and the display on the display unit 5 is cleared. As a result, the initial screen is cleared in the first routine. If the portrait is already displayed, the previous portrait is cleared. Then, step S
At 20, the closed curve creation data A to F and the closed curve color data A to F corresponding to the portrait number are read from the ROM 2 and loaded into the RAM 3.

【0015】ここで、RAM3には図4に示すような各
種のワークエリアが設けられており、ROM2から読み
出されたデータは対応するエリアにロードされる。RA
M3のワークエリアを説明すると、以下のようになって
いる。 似顔絵選択NO.……似顔絵選択スイッチによって選択
された似顔絵番号を格納するエリア 閉曲線A作成データ……閉曲線Aを作成するためのデー
タを格納するエリア 閉曲線B作成データ……閉曲線Bを作成するためのデー
タを格納するエリア 閉曲線C作成データ……閉曲線Cを作成するためのデー
タを格納するエリア 閉曲線D作成データ……閉曲線Dを作成するためのデー
タを格納するエリア 閉曲線E作成データ……閉曲線Eを作成するためのデー
タを格納するエリア 閉曲線F作成データ……閉曲線Fを作成するためのデー
タを格納するエリア
Here, the RAM 3 is provided with various work areas as shown in FIG. 4, and the data read from the ROM 2 is loaded into the corresponding area. RA
The work area of M3 will be described below. Portrait selection NO. ...... Area for storing the portrait number selected by the portrait selection switch Closed curve A creation data ...... Area for storing data for creating the closed curve A Closed curve B creation data ...... Stores data for creating the closed curve B Area closed curve C creation data: Area for storing data for creating closed curve C Area closed curve D creation data: Area for storing data for creating closed curve D Creation data for closed curve E: Creation of closed curve E Area for storing data Closed curve F creation data: Area for storing data for creating closed curve F

【0016】閉曲線Aカラーデータ……閉曲線Aを塗り
つぶす色(カラー)を指定するデータを格納するエリア 閉曲線Bカラーデータ……閉曲線Bを塗りつぶす色(カ
ラー)を指定するデータを格納するエリア 閉曲線Cカラーデータ……閉曲線Cを塗りつぶす色(カ
ラー)を指定するデータを格納するエリア 閉曲線Dカラーデータ……閉曲線Dを塗りつぶす色(カ
ラー)を指定するデータを格納するエリア 閉曲線Eカラーデータ……閉曲線Eを塗りつぶす色(カ
ラー)を指定するデータを格納するエリア 閉曲線Fカラーデータ……閉曲線Fを塗りつぶす色(カ
ラー)を指定するデータを格納するエリア
Closed curve A color data: Area for storing data that specifies the color (color) for filling the closed curve A. Closed curve B color data: Area for storing data for specifying color (color) for the closed curve B. Closed curve C color Data: Area for storing data that specifies the color (color) for filling closed curve C Color data for closed curve D: Area for storing data that specifies the color (color) for filling closed curve D Color data for closed curve E Area that stores data that specifies the color to fill (closed curve F color data ... Area that stores data that specifies the color (color) to fill closed curve F

【0017】カラー状態フラグ(A)……閉曲線Aをカ
ラー設定エリアに指定(つまり、色で塗りつぶす)する
か否かを決定するフラグを格納するエリア カラー状態フラグ(B)……閉曲線Bをカラー設定エリ
アに指定(つまり、色で塗りつぶす)するか否かを決定
するフラグを格納するエリア カラー状態フラグ(C)……閉曲線Cをカラー設定エリ
アに指定(つまり、色で塗りつぶす)するか否かを決定
するフラグを格納するエリア カラー状態フラグ(D)……閉曲線Dをカラー設定エリ
アに指定(つまり、色で塗りつぶす)するか否かを決定
するフラグを格納するエリア カラー状態フラグ(E)……閉曲線Eをカラー設定エリ
アに指定(つまり、色で塗りつぶす)するか否かを決定
するフラグを格納するエリア カラー状態フラグ(F)……閉曲線Fをカラー設定エリ
アに指定(つまり、色で塗りつぶす)するか否かを決定
するフラグを格納するエリア バックグラウンドカラー番号……背景となる部分を塗り
つぶす色(カラー)を指定するデータを格納するエリア
Color status flag (A): an area for storing a flag for determining whether the closed curve A is designated (that is, filled with a color) in the color setting area. Color status flag (B): the closed curve B is colored. Area that stores a flag that determines whether to specify (that is, paint with a color) in the setting area Color status flag (C) ... Whether or not the closed curve C is specified (that is, paint with a color) in the color setting area Area for storing a flag for determining the color state flag (D) ... Area for storing a flag for determining whether the closed curve D is designated (that is, filled with a color) in the color setting area Color state flag (E) ... The area color state flag (F that stores a flag that determines whether or not the closed curve E is designated (that is, filled with a color) in the color setting area ...... Area that stores a flag that determines whether to specify (that is, paint with a color) the closed curve F in the color setting area Background color number …… Data that specifies the color (color) to paint the background part Area to store

【0018】また、その他に作成した似顔絵の各部位に
対応する閉曲線を色で塗りつぶして格納するエリア11
〜16がある。例えば、エリア11は前髪を格納するエ
リア、エリア12は髪型を格納するエリア、エリア13
は髪における光沢部分を格納するエリア、エリア14は
顔の輪郭を格納するエリア、エリア15は顔のパーツを
格納するエリア、エリア16は首を格納するエリアであ
る。次いで、ステップS22でロードした閉曲線作成デ
ータA〜Fに基づいて閉曲線A〜Fをそれぞれ作成する
処理(詳細はサブルーチンで後述)を行うとともに、ス
テップS24で作成した閉曲線A〜Fを塗りつぶす処理
(詳細はサブルーチンで後述)を行う。これにより、選
択された似顔絵番号に対応する閉曲線A〜Fが作成され
るとともに、作成された各閉曲線A〜Fを所定の色で塗
りつぶす処理が行われて似顔絵が作成される。次いで、
ステップS26で表示処理を行う。これにより、作成さ
れた似顔絵が表示部5に表示される。ステップS26を
経ると、ステップS12に戻って同様のループを繰り返
す。このように、似顔絵選択スイッチによって選択され
た似顔絵番号に対応する似顔絵が作成されて表示され
る。
An area 11 for storing the closed curve corresponding to each part of the created portrait in addition to the color is stored.
There are ~ 16. For example, area 11 is an area for storing bangs, area 12 is an area for storing hairstyles, and area 13 is
Is an area for storing a glossy part of hair, area 14 is an area for storing the outline of a face, area 15 is an area for storing face parts, and area 16 is an area for storing a neck. Next, a process of creating closed curves A to F based on the closed curve creation data A to F loaded in step S22 (details will be described later in a subroutine), and a process of filling the closed curves A to F created in step S24 (details) Will be described later in a subroutine). As a result, closed curves A to F corresponding to the selected portrait numbers are created, and the created closed curves A to F are filled with a predetermined color to create a portrait. Then
Display processing is performed in step S26. As a result, the created portrait is displayed on the display unit 5. After step S26, the process returns to step S12 and the same loop is repeated. In this way, the portrait corresponding to the portrait number selected by the portrait selection switch is created and displayed.

【0019】閉曲線A〜Fの作成処理のサブルーチン 図5はメインプログラムの閉曲線A〜Fの作成処理(ス
テップS22)のサブルーチンを示すフローチャートで
ある。このサブルーチンに移行すると、ステップS50
で閉曲線Aを作成する処理を行う。例えば、閉曲線Aが
前髪に相当する場合には、前髪の閉曲線(図4のエリア
11に格納される画像)が作成される。次いで、ステッ
プS52で閉曲線Bを作成する処理を行う。例えば、閉
曲線Bが髪型に相当する場合には、髪型の閉曲線(図4
のエリア12に格納される画像)が作成される。次い
で、ステップS54で閉曲線Cを作成する処理を行う。
例えば、閉曲線Cが髪における光沢部分に相当する場合
には、光沢部分の閉曲線(図4のエリア13に格納され
る画像)が作成される。次いで、ステップS56で閉曲
線Dを作成する処理を行う。例えば、閉曲線Dが顔の輪
郭に相当する場合には、輪郭の閉曲線(図4のエリア1
4に格納される画像)が作成される。次いで、ステップ
S58で閉曲線Eを作成する処理を行う。例えば、閉曲
線Eが顔のパーツに相当する場合には、顔のパーツの閉
曲線(図4のエリア15に格納される画像)が作成され
る。なお、顔のパーツとしては、眉毛、目、鼻、口があ
る。次いで、ステップS60で閉曲線Fを作成する処理
を行う。例えば、閉曲線Fが首に相当する場合には、首
の閉曲線(図4のエリア16に格納される画像)が作成
される。ステップS60を経ると、メインプログラムに
リターンする。このようにして、似顔絵を作成するため
の各閉曲線A〜Fが作成される。
Subroutine for Creating Closed Curves A to F FIG. 5 is a flowchart showing a subroutine of a process for creating closed curves A to F (step S22) of the main program. If this subroutine is entered, step S50
The process for creating the closed curve A is performed. For example, when the closed curve A corresponds to the front hair, the closed curve of the front hair (the image stored in the area 11 in FIG. 4) is created. Next, in step S52, a process of creating the closed curve B is performed. For example, when the closed curve B corresponds to the hairstyle, the closed curve of the hairstyle (see FIG.
Image stored in the area 12) is created. Next, in step S54, a process of creating the closed curve C is performed.
For example, when the closed curve C corresponds to the glossy portion of the hair, a closed curve of the glossy portion (the image stored in the area 13 of FIG. 4) is created. Next, in step S56, the process of creating the closed curve D is performed. For example, when the closed curve D corresponds to the contour of the face, the closed curve of the contour (area 1 in FIG.
4) is created. Next, in step S58, a process of creating the closed curve E is performed. For example, when the closed curve E corresponds to a face part, a closed curve of the face part (an image stored in the area 15 of FIG. 4) is created. The face parts include eyebrows, eyes, nose, and mouth. Next, in step S60, a process of creating the closed curve F is performed. For example, when the closed curve F corresponds to the neck, a closed curve of the neck (the image stored in the area 16 in FIG. 4) is created. After step S60, the process returns to the main program. In this way, the closed curves A to F for creating the portrait are created.

【0020】ドット算出処理のサブルーチン 図6、図7は閉曲線A〜Fを作成する場合のドット算出
処理のサブルーチンを示すフローチャートである。この
処理は、2点間を結ぶ直線を表示部5のTVディスプレ
イ(例えば、コンピュータ画面やテレビ画面に相当)に
表示させるために行うもので、2点間を結ぶ直線は多数
のドットを算出して結ぶことによって表示される。な
お、この技術はコンピュータの直線描画に用いられてい
るいわゆる「整数型Bresenham」のアルゴリズムを応用
したものである。通常の「Bresenham」のアルゴリズム
では、直線の傾きや誤差用の判定に、浮動小数点の加減
算と除算を行う必要があるが、整数計算を用いるととも
に、さらに除算を無くしてアルゴリズムの処理速度を高
めたのが、「整数型Bresenham」のアルゴリズムであ
る。なお、以下のフローチャートの説明では、コンピュ
ータで使用される「C言語」の記述方式を用いており、
各ステップの内容は必要に応じて「C言語」の記述で表
すこととする。これは、後述の各フローチャートについ
ても、同様である。
Subroutine of Dot Calculation Processing FIGS. 6 and 7 are flowcharts showing a subroutine of dot calculation processing when the closed curves A to F are created. This processing is performed in order to display a straight line connecting the two points on the TV display of the display unit 5 (e.g., a computer screen or a television screen), and the straight line connecting the two points calculates a large number of dots. It is displayed by tying together. This technique is an application of the so-called "integer Bresenham" algorithm used for straight line drawing of computers. In the usual "Bresenham" algorithm, it is necessary to perform addition and subtraction and division of floating point to judge the inclination of the straight line and the error, but the integer calculation is used and the processing speed of the algorithm is improved by eliminating the division. Is the "integer Bresenham" algorithm. In the following description of the flow chart, the description method of "C language" used in a computer is used.
The contents of each step will be described in "C language" as necessary. The same applies to each of the flowcharts described below.

【0021】このサブルーチンでは、まずステップS1
00で直線の始点、終点の座標の差(すなわち、傾き)
を演算する。直線の始点、終点はx座標およびy座標を
用いて表される。例えば、直線の始点、終点をそれぞれ
(x1、y1)および(x2、y2)とし、互いに等しくな
いものとする。また、全ての変数は整数とする。そし
て、 x=x1 y=y1 Δx=x2−x1 Δy=y2−y1とし、アルゴリズムの誤差項eに対して e=2eΔx(初期値=−1/2)として演算を進め、
直線の傾きが1/2以上の場合は1単位だけ離れた次の
ポイントに変数yを増加させ、直線の傾きが1/2未満
の場合は次のポイントに変数yを増加させないようにす
る。なお、1単位だけ離れた次のポイントに変数yを増
加させた場合には、次のピクセルを決定する前に誤差項
eを再度初期化するために、誤差項eから「1」を減算
する。
In this subroutine, first, step S1
00 is the difference between the start and end coordinates of the line (that is, the slope)
Is calculated. The starting point and the ending point of the straight line are represented by using the x coordinate and the y coordinate. For example, assume that the starting point and the ending point of the straight line are (x 1 , y 1 ) and (x 2 , y 2 ), respectively, and they are not equal to each other. All variables are integers. Then, x = x 1 y = y 1 Δx = x 2 −x 1 Δy = y 2 −y 1 is set, and the error term e of the algorithm is set to e = 2eΔx (initial value = −1 / 2) to proceed the calculation. ,
When the slope of the straight line is 1/2 or more, the variable y is increased to the next point separated by one unit, and when the slope of the straight line is less than 1/2, the variable y is not increased to the next point. Note that when the variable y is increased to the next point separated by one unit, “1” is subtracted from the error term e in order to re-initialize the error term e before determining the next pixel. .

【0022】さて、ステップS100では直線の始点、
終点の座標の差として、x座標については、gainxを算
出し、y座標については、gainyを算出する。この場
合、開始点のx座標はfromx、開始点のy座標はfromy、
終点のx座標はto.x、終点のy座標はto.yで表してい
る。そして、x座標についての差の演算式は、終点のx
座標to.xから開始点のx座標fromxを減算したもの、つ
まり(to.x−fromx)として表される。同様に、y座標
についての差の演算式は、終点のy座標to.yから開始点
のy座標fromyを減算したもの、つまり(to.y−fromy)
として表される。次いで、ステップS102で直線の始
点、終点の座標の差(すなわち、傾き)の絶対値Δ(de
lta)をそれぞれx座標およびy座標について演算す
る。例えば、x座標ではdeltax=abs(gainx)として
演算する。deltaxはΔx=x2−x1に相当する。y座
標ではdeltay=abs(gainy)として演算する。delta
yはΔy=y2−y1に相当する。
Now, in step S100, the starting point of the straight line,
As the difference between the coordinates of the end points, gainx is calculated for the x coordinate and gainy is calculated for the y coordinate. In this case, the x coordinate of the starting point is fromx, the y coordinate of the starting point is fromy,
The x coordinate of the end point is represented by to.x, and the y coordinate of the end point is represented by to.y. Then, the calculation formula of the difference about the x coordinate is x at the end point.
It is represented as a value obtained by subtracting the x coordinate fromx of the starting point from the coordinate to.x, that is, (to.x-fromx). Similarly, the arithmetic expression of the difference about the y coordinate is obtained by subtracting the y coordinate fromy of the start point from the y coordinate to.y of the end point, that is, (to.y-fromy)
Expressed as Next, in step S102, the absolute value Δ (de) of the difference (that is, the slope) between the coordinates of the start point and the end point of the straight line
lta) for each of the x and y coordinates. For example, in the x coordinate, deltax = abs (gainx) is calculated. deltax corresponds to Δx = x 2 −x 1 . In the y coordinate, deltay = abs (gainy) is calculated. delta
y corresponds to Δy = y 2 −y 1 .

【0023】次いで、ステップS104で直線の始点、
終点の座標のx座標の差gainxの符号を判別する。gain
xが正のときはステップS106に進んでratex=1に
セットし、gainxが「0」のときはステップS108に
進んでratex=0にセットし、さらにgainxが負のとき
はステップS110に進んでratex=−1にセットす
る。ステップS106〜ステップS110の何れかを経
ると、ステップS112に進む。ステップS112では
同様に直線の始点、終点の座標のy座標の差gainyの符
号を判別する。gainyが正のときはステップS114に
進んでratey=1にセットし、gainyが「0」のときは
ステップS116に進んでratey=0にセットし、さら
にgainyが負のときはステップS118に進んでratey
=−1にセットする。ステップS114〜ステップS1
18の何れかを経ると、ステップS120に進む。
Then, in step S104, the starting point of the straight line,
The sign of the difference gainx of the x coordinate of the coordinates of the end point is determined. gain
When x is positive, the process proceeds to step S106 to set ratex = 1, when gainx is “0”, the process proceeds to step S108 to set ratex = 0, and when gainx is negative, the process proceeds to step S110. Set ratex = -1. After any of steps S106 to S110, the process proceeds to step S112. Similarly, in step S112, the sign of the gainy difference between the y-coordinates of the start and end coordinates of the straight line is determined. When gainy is positive, the process proceeds to step S114 to set rate = 1, when gainy is "0", the process proceeds to step S116 to set ratey = 0, and when gainy is negative, the process proceeds to step S118. ratey
Set to -1. Step S114 to Step S1
When any of 18 is passed, the process proceeds to step S120.

【0024】ステップS120では直線のx座標方向の
傾きの絶対値deltaxと、y座標方向の傾きの絶対値del
tayとを比較し、deltaxがdeltayより大きいか否かを
判別する。これは、x座標方向とy座標方向のどちらを
メインの誤差項にするかを決定するためである。delta
x>deltayのとき(すなわち、TRUEのとき、いわ
ゆるYESに相当)は、ステップS122に進んでメイ
ン誤差項(main delta)をdeltaxにする。なお、図面
上では(main_delta)としてアンダーバーを付加してい
るが、本文中では繁雑になるので、このアンダーバーを
省略する。次いで、ステップS124でサブ誤差項(su
b delta)をdeltayにする。なお、図面上では(sub_de
lta)としてアンダーバーを付加しているが、本文中で
は繁雑になるので、このアンダーバーを省略する。次い
で、ステップS126でメイン決定フラグ(flag)をT
RUEにして図7のステップS134に進む。メイン決
定フラグ(flag)はメイン誤差項(main delta)をdelt
axにしたか、あるいはdeltayにしたかを示すものであ
る。一方、deltax≦deltayのとき(すなわち、FAL
SEのとき、いわゆるNOに相当)は、ステップS12
8に進んでメイン誤差項(main delta)をdeltayにす
る。次いで、ステップS130でサブ誤差項(sub delt
a)をdeltaxにする。次いで、ステップS132でメイ
ン決定フラグ(flag)をFALSEにして図7のステッ
プS134に進む。
In step S120, the absolute value deltax of the inclination of the straight line in the x coordinate direction and the absolute value del of the inclination of the y coordinate direction del
It is compared with tay to determine whether deltax is larger than deltay. This is to determine which of the x-coordinate direction and the y-coordinate direction should be the main error term. delta
When x> deltay (that is, when TRUE, it corresponds to so-called YES), the process proceeds to step S122, and the main error term (main delta) is set to deltax. Although an underbar is added as (main_delta) in the drawing, this underbar is omitted because it becomes complicated in the text. Then, in step S124, the sub error term (su
b delta) to deltay. In the drawing, (sub_de
lta) is added with an underbar, but it is complicated in the text, so this underbar is omitted. Next, in step S126, the main determination flag (flag) is set to T.
Set it to RUE and proceed to step S134 in FIG. The main decision flag (flag) delt the main error term (main delta)
It indicates whether it is set to ax or deltay. On the other hand, when deltax ≦ deltay (that is, FAL
In SE, so-called NO) corresponds to step S12.
In step 8, the main error term (main delta) is set to deltay. Next, in step S130, the sub error term (sub delt
Let a) be deltax. Next, in step S132, the main determination flag (flag) is set to FALSE, and the process proceeds to step S134 in FIG.

【0025】図7に移り、ステップS134では直線の
始点のx座標に相当するドットdotx[0]を開始点のx座
標fromxにセットするとともに、直線の始点のy座標に
相当するドットdoty[0]を開始点のy座標fromyにセッ
トする。これにより、始点のドットの各座標が決定され
る。次いで、ステップS136で同じくx座標方向のパ
ラメータpxを開始点のx座標fromxにセットするとと
もに、y座標方向のパラメータpyを開始点のy座標fr
omyにセットする。次いで、ステップS138で誤差項
eをerror=2×(sub delta)−(main delta)なる式
から求める。この式によると、例えばe=2*Δy−Δ
xのようになる。
Turning to FIG. 7, in step S134, the dot dotx [0] corresponding to the x coordinate of the starting point of the straight line is set to the x coordinate fromx of the starting point, and the dot doty [0 corresponding to the y coordinate of the starting point of the straight line is set. ] To the y coordinate fromy of the start point. As a result, each coordinate of the starting point dot is determined. Next, in step S136, similarly, the parameter px in the x coordinate direction is set to the x coordinate fromx of the starting point, and the parameter py in the y coordinate direction is set to the y coordinate fr of the starting point.
Set to omy. Next, in step S138, the error term e is obtained from the expression error = 2 × (sub delta) − (main delta). According to this formula, for example, e = 2 * Δy−Δ
It becomes like x.

【0026】次いで、ステップS140でポインタiを
初期値[0]にセットする。ポインタiは直線を形成す
るドットを順次指定していくもので、[1]なる整数に
よってインクリメントされる。次いで、ステップS14
2でポインタiがメイン誤差項(main delta)より小さ
いか否かを判別する。TRUEのときはステップS14
4に進んで誤差項errorがerror≧0であるか否かを判別
する。error≧0のときは、ステップS146でメイン
決定フラグ(flag)を判別する。メイン決定フラグ(fl
ag)がTRUEであればx座標の方がメイン誤差項(ma
in delta)に設定されているから、ステップS148に
進んで今回のルーチンのy座標方向のパラメータpyを
次式に従って演算する。 py=py+ratey
Then, in step S140, the pointer i is set to the initial value [0]. The pointer i sequentially designates dots forming a straight line, and is incremented by an integer of [1]. Then, step S14
At 2, it is determined whether the pointer i is smaller than the main error term (main delta). If TRUE, step S14
In step 4, it is determined whether the error term error is error ≧ 0. If error ≧ 0, the main determination flag (flag) is determined in step S146. Main decision flag (fl
If ag) is TRUE, the x coordinate is the main error term (ma
in delta), the process proceeds to step S148, and the parameter py in the y-coordinate direction of this routine is calculated according to the following equation. py = py + ratey

【0027】次いで、ステップS150で今回のルーチ
ンの誤差項eを次式に従って演算する。 error=error−2×(main delta) これにより、誤差項eがメインの誤差によって変化す
る。次いで、再びステップS144に戻って同様のルー
プを繰り返す。一方、ステップS146でメイン決定フ
ラグ(flag)の判別結果がFALSEであれば、y座標
の方がメイン誤差項(main delta)に設定されていると
判断して、ステップS144からステップS152に分
岐し、今回のルーチンのx座標方向のパラメータpxを
次式に従って演算する。 px=px+ratex 次いで、ステップS150に進み、今回のルーチンの誤
差項eを前記演算式に従って演算する。その後、ステッ
プS144に戻って同様のループを繰り返す。そして、
ステップS144で誤差項errorがerror<0になると、
ステップS154に抜ける。以上のステップS144〜
ステップS152の処理により、メイン誤差項(main d
elta)の処理が行われる。
Next, in step S150, the error term e of this routine is calculated according to the following equation. error = error−2 × (main delta) As a result, the error term e changes depending on the main error. Then, the process returns to step S144 again to repeat the same loop. On the other hand, if the determination result of the main determination flag (flag) is FALSE in step S146, it is determined that the y coordinate is set as the main error term (main delta), and the process branches from step S144 to step S152. , The parameter px in the x-coordinate direction of this routine is calculated according to the following equation. px = px + ratex Then, the process proceeds to step S150, and the error term e of this routine is calculated in accordance with the above-described calculation formula. Then, it returns to step S144 and repeats the same loop. And
When the error term error becomes error <0 in step S144,
Exit to step S154. Step S144-
By the process of step S152, the main error term (main d
elta) processing is performed.

【0028】次いで、サブ誤差項(sub delta)の処理
に移る。まず、ステップS154でメイン決定フラグ
(flag)を判別し、メイン決定フラグ(flag)がTRU
Eであれば、x座標の方がメイン誤差項(main delta)
に設定されているから、ステップS156に進んで今回
のルーチンのx座標方向のパラメータpxを次式に従っ
て演算する。 px=px+ratex 次いで、ステップS160で今回のルーチンの誤差項e
を次式に従って演算する。 error=error+2×(sub delta) これにより、誤差項eがサブ誤差sub deltaによって変
化する。次いで、ステップS162でx座標方向の今回
のルーチンのパラメータpxの値を直線のx座標に対応
するドットdotx[i+1]とする。最初のルーチンでは
i=0であるから、dotx[i+1]=dotx[1]となる。
つまり、始点から1ドットだけ離れたx座標のドットdo
txが算出される。次いで、ステップS164でポイン
タiを整数[1]だけインクリメントし、再びステップ
S142に戻ってループを繰り返す。
Next, the processing of the sub error term (sub delta) is started. First, in step S154, the main determination flag (flag) is determined, and the main determination flag (flag) is set to TRU.
If E, the x coordinate is the main error term (main delta)
Therefore, the process proceeds to step S156, and the parameter px in the x-coordinate direction of this routine is calculated according to the following equation. px = px + ratex Next, in step S160, the error term e of this routine is set.
Is calculated according to the following equation. error = error + 2 × (sub delta) As a result, the error term e changes depending on the sub error sub delta. Next, in step S162, the value of the parameter px of this routine in the x coordinate direction is set to the dot dotx [i + 1] corresponding to the x coordinate of the straight line. Since i = 0 in the first routine, dotx [i + 1] = dotx [1].
That is, the dot do of the x coordinate that is one dot away from the starting point
tx is calculated. Next, in step S164, the pointer i is incremented by the integer [1], and the process returns to step S142 to repeat the loop.

【0029】一方、ステップS154でメイン決定フラ
グ(flag)の判別結果がFALSEであれば、y座標の
方がメイン誤差項(main delta)に設定されていると判
断して、ステップS154からステップS158に分岐
し、今回のルーチンのy座標方向のパラメータpyを次
式に従って演算する。 py=py+ratey その後、ステップS160に進み、今回のルーチンのサ
ブ誤差項eを前記演算式に従って演算し、次いで、ステ
ップS162、ステップS164を経て、再びステップ
S142に戻ってループを繰り返す。そして、順次ポイ
ンタiをインクリメントして、上記ループを繰り返し、
ステップS142でポインタiがメイン誤差項(main d
elta)以上になると、このサブルーチンを終了する。こ
のようにして、2点間を結ぶ直線のドットが算出され、
これらのドットを結ぶことによって、2点間を結ぶ直線
を表示させる処理が行われる。この場合、本実施例では
「整数型Bresenham」のアルゴリズムを用いて、整数計
算を主に行っているため、アルゴリズムの処理速度が速
い。
On the other hand, if the determination result of the main determination flag (flag) is FALSE in step S154, it is determined that the y coordinate is set as the main error term (main delta), and steps S154 to S158 are performed. And the parameter py in the y-coordinate direction of this routine is calculated according to the following equation. py = py + ratey Then, it progresses to step S160, the sub error term e of this routine is calculated according to the said arithmetic expression, Then, through step S162 and step S164, it returns to step S142 again and repeats a loop. Then, the pointer i is sequentially incremented and the above loop is repeated,
In step S142, the pointer i is set to the main error term (main d
(elta) When this is over, this subroutine ends. In this way, the straight line dot connecting the two points is calculated,
By connecting these dots, a process of displaying a straight line connecting the two points is performed. In this case, in this embodiment, since the integer calculation is mainly performed using the “integer Bresenham” algorithm, the processing speed of the algorithm is high.

【0030】ベジェ曲線データ計算処理のサブルーチン 図8、図9はベジェ曲線を作成する場合のデータ計算処
理のサブルーチンを示すフローチャートである。ベジェ
曲線は2点のコントロールポイント(P2、P3)と、2
点のアンカーポイント(P1、P4)によって定義され、
一般的には次式のように表される。ここで、アンカーポ
イント(P1、P4)とは曲線の両端の2点で、各点の座
標は、例えばP1(x1、y1)、P4(x4、y4)のよう
に表される。また、コントロールポイント(P2、P3
とは曲線の曲がり方を制御する2点のことで、各点の座
標は、例えばP2(x2、y2)、P3(x3、y3)のよう
に表される。 B(t)=(1−t)3・P1+3t・(1−t)2・P2
+3t2・(1−t)・P3+t3・P4 ただし、0≦t≦1 tは0から1の間の任意に変化するため、0から1の間
を細かく分けることによって、ベジェ曲線上の点が精度
良く算出される。なお、計算の回数が多くなるため、そ
こで適当な個数の曲線上の点を算出した後に、それらを
直線によって補間する方法を採るようにしている。な
お、例えばt=0を上式に代入すると、P1(x1
1)となり、これは一方の端点を表す。また、t=1
を上式に代入すると、P4(x4、y4)となり、これは
他方の端点を表す。なお、直線は幅の無い真っ直ぐなベ
ジェ曲線として表示することも可能である。
Subroutine of Bezier Curve Data Calculation Processing FIGS. 8 and 9 are flowcharts showing a subroutine of data calculation processing when a Bezier curve is created. Bezier curve has two control points (P 2 , P 3 ) and 2
Defined by the anchor points (P 1 , P 4 ) of the point,
Generally, it is expressed as the following equation. Here, the anchor points (P 1 , P 4 ) are two points at both ends of the curve, and the coordinates of each point are, for example, P 1 (x 1 , y 1 ) and P 4 (x 4 , y 4 ). Represented by. Also, control points (P 2 , P 3 )
Is two points that control the bending of the curve, and the coordinates of each point are expressed as P 2 (x 2 , y 2 ) and P 3 (x 3 , y 3 ). B (t) = (1- t) 3 · P 1 + 3t · (1-t) 2 · P 2
+ 3t 2 · (1−t) · P 3 + t 3 · P 4 However, 0 ≦ t ≦ 1 t can be changed arbitrarily between 0 and 1. Therefore, by dividing between 0 and 1 finely, the Bezier curve The upper point is calculated with high accuracy. Since the number of calculations increases, an appropriate number of points on the curve are calculated, and then a method of interpolating them with a straight line is adopted. Note that, for example, substituting t = 0 into the above equation, P 1 (x 1 ,
y 1 ), which represents one end point. Also, t = 1
Is substituted into the above equation, P 4 (x 4 , y 4 ), which represents the other end point. The straight line can be displayed as a straight Bezier curve with no width.

【0031】まず、ステップS200でポインタiを
[0]にセットし、ステップS202で変数tをt=i
/nとして算出する。ポインタiは[1]毎にインクリ
メントされるものであるため、変数tをnによって除算
することで、0から1の間に細かく分けるものである。
次いで、ステップS204で偏差tnをtn=1.0−
tなる式によって演算する。次いで、ステップS206
でベジェ曲線B(t)の変数tの0乗の項(すなわち、
t=1)のx座標について次式に従って演算する。 sx[0]=tn×tn×tn×px[0] =(1−t)3・px[0] =(1−t)3・P1(x) px[0]はアンカーポイントP1のx座標である。次い
で、ステップS208でベジェ曲線B(t)の変数tの
1乗の項(すなわち、t)のx座標について次式に従っ
て演算する。 sx[1]=3.0×t×tn×tn×px[1] =3t・(1−t)2・px[1] =3t・(1−t)2・P2(x) px[1]はコントロールポイントP2のx座標である。
First, the pointer i is set to [0] in step S200, and the variable t is set to t = i in step S202.
Calculate as / n. Since the pointer i is incremented for each [1], the variable t is divided by n so as to be finely divided between 0 and 1.
Then, in step S204, the deviation tn is tn = 1.0-
It is calculated by the formula t. Then, step S206
And the term to the power of 0 of the variable t of the Bezier curve B (t) (ie,
The x coordinate of t = 1) is calculated according to the following equation. sx [0] = tn × tn × tn × px [0] = (1-t) 3 · px [0] = (1-t) 3 · P 1 (x) px [0] is the anchor point P 1 The x coordinate. Then, in step S208, the x-coordinate of the first term of the variable t (that is, t) of the Bezier curve B (t) is calculated according to the following equation. sx [1] = 3.0 × t × tn × tn × px [1] = 3t · (1-t) 2 · px [1] = 3t · (1-t) 2 · P 2 (x) px [ 1] is the x coordinate of the control point P 2 .

【0032】次いで、ステップS210でベジェ曲線B
(t)の変数tの2乗の項(すなわち、t2)のx座標
について次式に従って演算する。 sx[2]=3.0×t×t×tn×px[2] =3t2・(1−t)・px[2] =3t2・(1−t)・P3(x) px[2]はコントロールポイントP3のx座標である。次
いで、ステップS212でベジェ曲線B(t)の変数t
の3乗の項(すなわち、t3)のx座標について次式に
従って演算する。 sx[3]=t×t×t×px[3] =t3・px[3] =t3・P4(x) px[3]はアンカーポイントP4のx座標である。
Next, in step S210, Bezier curve B
The x-coordinate of the variable t squared term of (t) (that is, t 2 ) is calculated according to the following equation. sx [2] = 3.0 × t × t × tn × px [2] = 3t 2 · (1-t) · px [2] = 3t 2 · (1-t) · P 3 (x) px [ 2] is the x coordinate of the control point P 3 . Next, in step S212, the variable t of the Bezier curve B (t) is
The x-coordinate of the third power term (ie, t 3 ) is calculated according to the following equation. sx [3] = t × t × t × px [3] = t 3 · px [3] = t 3 · P 4 (x) px [3] is the x-coordinate of the anchor point P 4.

【0033】次いで、ステップS214〜ステップS2
00において、ベジェ曲線B(t)の変数tのy座標に
ついて上記同様の演算を行う。すなわち、ステップS2
14でベジェ曲線B(t)の変数tの0乗の項(すなわ
ち、t=1)のy座標について次式に従って演算する。 sy[0]=tn×tn×tn×py[0] =(1−t)3・py[0] =(1−t)3・P1(y) py[0]はアンカーポイントP1のy座標である。次い
で、ステップS216でベジェ曲線B(t)の変数tの
1乗の項(すなわち、t)のy座標について次式に従っ
て演算する。 sy[1]=3.0×t×tn×tn×py[1] =3t・(1−t)2・py[1] =3t・(1−t)2・P2(y) py[1]はコントロールポイントP2のy座標である。
Then, steps S214 to S2
At 00, the same calculation as above is performed for the y coordinate of the variable t of the Bezier curve B (t). That is, step S2
In step 14, the y coordinate of the 0th power of the variable t of the Bezier curve B (t) (that is, t = 1) is calculated according to the following equation. sy [0] = tn × tn × tn × py [0] = (1-t) 3 · py [0] = (1-t) 3 · P 1 (y) py [0] is the anchor point P 1 It is the y coordinate. Next, in step S216, the y coordinate of the first term of the variable t of the Bezier curve B (t) (that is, t) is calculated according to the following equation. sy [1] = 3.0 × t × tn × tn × py [1] = 3t · (1-t) 2 · py [1] = 3t · (1-t) 2 · P 2 (y) py [ 1] is the y coordinate of the control point P 2 .

【0034】次いで、ステップS218でベジェ曲線B
(t)の変数tの2乗の項(すなわち、t2)のy座標
について次式に従って演算する。 sy[2]=3.0×t×t×tn×py[2] =3t2・(1−t)・py[2] =3t2・(1−t)・P3(y) py[2]はコントロールポイントP3のy座標である。次
いで、ステップS220でベジェ曲線B(t)の変数t
の3乗の項(すなわち、t3)のy座標について次式に
従って演算する。 sy[3]=t×t×t×py[3] =t3・py[3] =t3・P4(y) py[3]はアンカーポイントP4のy座標である。
Next, in step S218, Bezier curve B
The y-coordinate of the variable t squared of (t) (that is, t 2 ) is calculated according to the following equation. sy [2] = 3.0 × t × t × tn × py [2] = 3t 2 · (1-t) · py [2] = 3t 2 · (1-t) · P 3 (y) py [ 2] is the y coordinate of the control point P 3 . Next, in step S220, the variable t of the Bezier curve B (t) is
The y-coordinate of the third power of the term (that is, t 3 ) is calculated according to the following equation. sy [3] = t × t × t × py [3] = t 3 · py [3] = t 3 · P 4 (y) py [3] is the y coordinate of the anchor point P 4.

【0035】図9に移り、ステップS222でベジェ曲
線B(t)上のポイントとポイント間を直線によって補
間する場合の補間定数のx座標bx[i]、y座標by
[i]を最初は共に、bx[i]=by[i]=0にセ
ットする。次いで、ステップS224でポインタjを初
期値[0]におき、続くステップS226で補間定数の
x座標bx[i]およびy座標by[i]をそれぞれ次
式に従って演算する。 bx[i]=bx[i]+sx[j] by[i]=by[i]+sy[j] 次いで、ステップS228でポインタjが[4]以上に
なったか否かを判別し、[4]未満のときはステップS
230に進んでポインタjを[1]だけインクリメント
し、ステップS226に戻り、ループを繰り返す。そし
て、ステップS228でポインタjが[4]以上になる
と、ステップS232に抜ける。
Turning to FIG. 9, in step S222, the x-coordinate bx [i] and y-coordinate by of the interpolation constants for interpolating points on the Bezier curve B (t) with a straight line.
Initially, both [i] are set to bx [i] = by [i] = 0. Next, in step S224, the pointer j is set to the initial value [0], and in the following step S226, the x-coordinate bx [i] and the y-coordinate by [i] of the interpolation constant are calculated according to the following equations. bx [i] = bx [i] + sx [j] by [i] = by [i] + sy [j] Then, in step S228, it is determined whether the pointer j is equal to or more than [4], and [4] If less than, step S
The routine proceeds to 230, the pointer j is incremented by [1], the routine returns to step S226, and the loop is repeated. Then, when the pointer j becomes [4] or more in step S228, the process exits to step S232.

【0036】次いで、ステップS232でポインタiが
n以上になったか否かを判別し、n未満のときはステッ
プS234に進んでポインタiを[1]だけインクリメ
ントし、図8のステップS202に戻り、同様のループ
を繰り返す。そして、ステップS232でポインタiが
n以上になると、本サブルーチンを終了する。このよう
にして、ポインタiを[0]からnまでインクリメント
することによって2点のコントロールポイント(P2
3)と、2点のアンカーポイント(P 1、P4)によっ
て定義されるベジェ曲線B(t)上の点を算出し、この
ときtを0から1の間に分けて細かく変化させることに
より、ベジェ曲線上の点を精度良く算出することができ
る。また、ベジェ曲線B(t)上のポイントとポイント
間を4つの点で適切に補間することにより、一層精度が
高められる。
Next, at step S232, the pointer i
If it is less than n, it is judged whether it is more than n.
In step S234, the pointer i is incremented by [1].
And returns to step S202 in FIG. 8 to perform a similar loop.
repeat. Then, in step S232, the pointer i
When it becomes n or more, this subroutine is finished. like this
And increment pointer i from [0] to n
Two control points (P2,
P3) And two anchor points (P 1, PFour) By
The point on the Bezier curve B (t) defined by
When t is divided into 0 to 1 and finely changed
Therefore, the points on the Bezier curve can be calculated accurately.
It Also, points and points on the Bezier curve B (t)
By properly interpolating between the four points, the accuracy can be further improved.
To be enhanced.

【0037】カラー設定処理のサブルーチン 図10、図11はメインプログラムにおけるステップS
24の塗りつぶし処理のうち、カラー設定処理のサブル
ーチンを示すフローチャートである。この処理は、作成
された閉曲線に対して指定された色を塗っていくもので
ある。このサブルーチンでは、まずステップS300で
カラーエリアをクリアする。これにより、最初は色を塗
る対象となる全てのエリアが一旦クリアされ、無色にな
る。次いで、ステップS302でカラー状態フラグCfl
agを初期設定する。カラー状態フラグCflagとは、対応
する閉曲線をカラー設定エリアに指定(つまり、色で塗
りつぶす)するか否かを決定するフラグであり、初期設
定されると、図12に示すように、すべて[−1]にな
る。カラー状態フラグ=[−1]とは、カラーを指定す
るカラー番号で取り得ない番号に設定することである。
Color Setting Process Subroutine FIG. 10 and FIG. 11 show step S in the main program.
12 is a flowchart showing a subroutine of color setting processing in the 24 filling processing. This process is to paint a specified color on the created closed curve. In this subroutine, the color area is first cleared in step S300. As a result, at first, all areas to be colored are once cleared and become colorless. Then, in step S302, the color state flag Cfl
Initialize ag. The color state flag Cflag is a flag that determines whether or not the corresponding closed curve is designated (that is, filled with a color) in the color setting area, and when initialized, as shown in FIG. 1]. The color status flag = [− 1] is to set a color that cannot be a color number that specifies a color.

【0038】図12の例では、オブジェクト1のカラー
〜オブジェクトn(各オブジェクトは、例えば似顔絵の
各部位に相当)のカラーが全て初期状態に設定され、バ
ックグラウンドのカラーだけ何等かのカラー番号が入
り、色で塗られるようになっている。そして、各オブジ
ェクトのカラー切替フラグが[1]になるたびに、それ
に対応するカラー状態フラグが反転(例えば、[−1]
から[1]になる)するようになっている。ステップS
304ではポインタiを[0]にクリアし、ステップS
306でポインタjを[0]にクリアする。ポインタi
は画面上のライン(例えば、0から524までのライン
がある)を順次指定するもので、ポインタjはライン上
のドットを順次指定するものである。ポインタi=
[0]にすることによりライン0が指定され、ポインタ
j=[0]にすることによりライン0上のドット0が指
定される。
In the example of FIG. 12, the colors of the object 1 to the object n (each object corresponds to each part of a portrait, for example) are all set to the initial state, and only the background color has some color number. Comes in and is painted in color. Then, every time the color switching flag of each object becomes [1], the corresponding color state flag is inverted (for example, [-1]
To [1]). Step S
At 304, the pointer i is cleared to [0], and step S
At 306, the pointer j is cleared to [0]. Pointer i
Is to sequentially specify lines on the screen (for example, there are lines from 0 to 524), and the pointer j is to sequentially specify dots on the line. Pointer i =
Line 0 is designated by setting [0], and dot 0 on line 0 is designated by setting pointer j = [0].

【0039】次いで、ステップS308でラインカラー
lcolorを[−1]に設定するとともに、ラインナンバー
(ライン番号)lnumを[−1]に設定する。ラインカラ
ーlcolorは閉曲線のカラーを指定するものである。ま
た、ラインナンバーlnumは閉曲線の境界線の番号を指定
するものである。何れも、[−1]に設定されることに
より、初期状態となる。次いで、ステップS310で閉
曲線ナンバーkを(n−1)に設定する。例えば、閉曲
線が6個あるとすると、閉曲線ナンバーkを[5]に設
定する。閉曲線ナンバーkは値が小さい程、優先度が高
くなるものである。したがって、k=0が最も優先度が
高く、以下、順次低くなる。これにより、ステップS3
10では2番目に優先度の低い状態に設定されることに
なる。
Then, in step S308, the line color
The lcolor is set to [-1] and the line number (line number) lnum is set to [-1]. The line color lcolor specifies the color of the closed curve. The line number lnum designates the boundary line number of the closed curve. Both are set to the initial state by being set to [-1]. Next, in step S310, the closed curve number k is set to (n-1). For example, if there are six closed curves, the closed curve number k is set to [5]. The smaller the closed curve number k, the higher the priority. Therefore, k = 0 has the highest priority, and subsequently becomes lower. As a result, step S3
In the case of 10, the state is set to the second lowest priority state.

【0040】次いで、ステップS312で閉曲線関数C
[k][i][j]を判断する。閉曲線関数C[k]
[i][j]は閉曲線ナンバーkの優先度と、今回の閉
曲線が何れかの閉曲線の中にあるか(つまり、何れかの
閉曲線の境界線が検出されたか)否かを判断可能なもの
である。閉曲線関数C[k][i][j]の判断結果が
TRUEのときは、ステップS314に進んでカラー状
態フラグCflag[k]を反転する。これにより、今回の
閉曲線ナンバーkによって指定された閉曲線のカラー状
態フラグが[−1]から反転して[1]になる。したが
って、対応する閉曲線に対して色が塗られることにな
る。次いで、ステップS316でラインカラーlcolorに
カラー番号を入れるとともに、ラインナンバーlnumに閉
曲線ナンバーkを入れる。これにより、今回の閉曲線に
対してカラー番号(塗るべき色を指定するもの)が与え
られるとともに、その閉曲線の優先度が付与される。次
いで、ステップS318で閉曲線ナンバーkを[1]だ
けデクリメントする。これにより、1つだけ優先度が高
くなる。
Then, in step S312, the closed curve function C
Judge [k] [i] [j]. Closed curve function C [k]
[I] and [j] can determine the priority of the closed curve number k and whether or not the closed curve this time is in any closed curve (that is, which closed curve boundary line is detected). Is. When the determination result of the closed curve function C [k] [i] [j] is TRUE, the process proceeds to step S314 and the color state flag Cflag [k] is inverted. As a result, the color state flag of the closed curve specified by the closed curve number k this time is inverted from [-1] to [1]. Therefore, the corresponding closed curve is colored. Next, in step S316, the color number is entered in the line color lcolor, and the closed curve number k is entered in the line number lnum. As a result, the color number (which specifies the color to be painted) is given to the closed curve this time, and the priority of the closed curve is given. Next, in step S318, the closed curve number k is decremented by [1]. This gives only one higher priority.

【0041】一方、ステップS312で閉曲線関数C
[k][i][j]の判断結果がFALSEのときは、
ステップS314、ステップS316をジャンプしてス
テップS318に進む。したがって、このときは直ちに
閉曲線ナンバーkが[1]だけデクリメントされ、1つ
上の優先度に移行することになる。ステップS318を
経ると、続くステップS320で閉曲線ナンバーkが
[0]未満である(つまり、未だ一番高い優先度にはな
っていない状態である)か否かを判別する。k=0でな
ければ(最初のルーチンでは優先度は最高になっていな
い)、TRUEに分岐してステップS312に戻ってル
ープを繰り返す。そして、ループの繰り返しにより、閉
曲線ナンバーkが5から4、3、2、1というように順
次上がって、k=0になると、一番高い優先度になった
と判断して図11のステップS322に抜ける。このよ
うにして、各閉曲線に対してカラー状態フラグCflag
[k]が反転することにより、色を塗る許可が与えられ
るとともに、カラー番号によって塗るべき色が指定さ
れ、その閉曲線の優先度が付与される。
On the other hand, in step S312, the closed curve function C
When the judgment result of [k] [i] [j] is FALSE,
The process jumps from step S314 and step S316 and proceeds to step S318. Therefore, at this time, the closed curve number k is immediately decremented by [1], and the priority is moved up by one. After step S318, it is determined in the following step S320 whether the closed curve number k is less than [0] (that is, it is in a state where it has not yet become the highest priority). If k = 0 (priority is not highest in the first routine), the process branches to TRUE and returns to step S312 to repeat the loop. Then, by repeating the loop, the closed curve number k sequentially increases from 5 to 4, 3, 2, 1, and when k = 0, it is determined that the highest priority is given, and the process proceeds to step S322 in FIG. Get out. In this way, for each closed curve, the color state flag Cflag
By reversing [k], the permission to paint the color is given, the color to be painted is designated by the color number, and the priority of the closed curve is given.

【0042】図11に移り、閉曲線のラインに対して今
度はドット毎に処理するプロセスを実行する。まず、ス
テップS322では閉曲線ナンバーkを(n)に設定す
る。例えば、閉曲線が6個あるとすると、閉曲線ナンバ
ーkを[6]に設定する。閉曲線ナンバーkは値が小さ
い程、優先度が高くなるものであるから、ステップS3
22では一番優先度の低い状態に設定されることにな
る。次いで、ステップS324でカラー状態フラグCfl
ag[k]が[−1]に等しくない状態であるか、すなわ
ち閉曲線が色で塗りつぶされる状態になった否かを判別
する。なお、この判別はフローチャートではCflag
[k]!=−1として表され、「!」の符号は「C言
語」で否定(not)を示すものである。ステップS3
24の判別は優先度の低い閉曲線からカラー状態フラグ
Cflag[k]を判断することを意味している。
Turning to FIG. 11, the process of processing dot by dot is executed for the line of the closed curve. First, in step S322, the closed curve number k is set to (n). For example, if there are six closed curves, the closed curve number k is set to [6]. The smaller the closed curve number k, the higher the priority. Therefore, step S3
In 22, the state has the lowest priority. Next, in step S324, the color status flag Cfl
It is determined whether ag [k] is not equal to [−1], that is, whether the closed curve is filled with color. Note that this determination is based on Cflag
[K]! The sign "!" Represents "not" in "C language". Step S3
The determination of 24 means that the color state flag Cflag [k] is determined from the closed curve of low priority.

【0043】カラー状態フラグCflag[k]が[−1]
に等しくない状態(TRUE)であれば、ステップS3
26に進んでカラーバッファCbufに閉曲線ナンバーk
を入れる。これにより、今回指定された閉曲線ナンバー
kの閉曲線に対して色が塗られることになる。次いで、
ステップS328で閉曲線ナンバーkを[1]だけデク
リメントする。これにより、1つだけ優先度が高くな
る。次いで、ステップS330で閉曲線ナンバーkが
[0]未満である(つまり、未だ一番高い優先度にはな
っていない状態である)か否かを判別する。k=0でな
ければ(最初のルーチンでは優先度は最高になっていな
い)、TRUEに分岐してステップS324に戻ってル
ープを繰り返す。そして、ループの繰り返しにより、閉
曲線ナンバーkが6から4、3、2、1というように順
次上がって、k=0になると、一番高い優先度になった
と判断してステップS332に抜ける。一方、ステップ
S324でカラー状態フラグCflag[k]が[−1]に
等しい状態(FAUSE)であれば、ステップS326
をジャンプしてステップS328に進む。したがって、
このときはカラーバッファCbufに閉曲線ナンバーkが
入れられず、今回指定された閉曲線ナンバーkの閉曲線
に対して色が塗られないことになる。このようにして、
優先度の低い閉曲線からカラーバッファCbufに閉曲線
ナンバーkが入れられる。
The color status flag Cflag [k] is [-1].
If not equal to (TRUE), step S3
Go to step 26 and put the closed curve number k in the color buffer Cbuf.
Put in. As a result, the closed curve of the closed curve number k designated this time is colored. Then
In step S328, the closed curve number k is decremented by [1]. This gives only one higher priority. Next, in step S330, it is determined whether or not the closed curve number k is less than [0] (that is, in a state in which the highest priority is not yet reached). If k = 0 (priority is not the highest in the first routine), the process branches to TRUE and returns to step S324 to repeat the loop. By repeating the loop, the closed curve number k sequentially increases from 6 to 4, 3, 2, 1, and when k = 0, it is determined that the highest priority has been reached, and the process proceeds to step S332. On the other hand, if the color state flag Cflag [k] is equal to [-1] (FAUSE) in step S324, step S326.
And jump to step S328. Therefore,
At this time, the closed curve number k is not put in the color buffer Cbuf, and the color is not painted on the closed curve of the closed curve number k designated this time. In this way
The closed curve number k is put into the color buffer Cbuf from the closed curve having the lower priority.

【0044】ステップS332ではラインカラーlcolor
が[−1]に等しくない状態であるか、すなわち閉曲線
のカラーが指定されたか否かを判別する。なお、この判
別はフローチャートではlcolor!=−1として表され、
「!」の符号は「C言語」で否定(not)を示す。ラ
インカラーlcolorが[−1]に等しくない状態であれば
(閉曲線のカラーが指定されていれば)、ステップS3
34に進んでラインナンバー(ライン番号)lnumがカラ
ーバッファCbufより小さいか否かを判別する。カラー
バッファCbufには優先度の高い曲線の色が入るから、
ラインナンバー(ライン番号)lnumがカラーバッファC
bufよりも小さければ、TRUEに分岐してステップS
336に進み、ポインタi、jによって指定されるライ
ンおよびドットのカラーcolor[i][j](以下、ポ
インタ指定カラーという)を優先度の高いラインカラー
lcolorにセットし、その後、ステップS338に進む。
これにより、優先度の高い曲線の色がその閉曲線に塗ら
れることになる。
In step S332, the line color lcolor
Is not equal to [−1], that is, whether the color of the closed curve is designated. Note that this determination is lcolor! = -1 and
The sign "!" Indicates "not" in "C language". If the line color lcolor is not equal to [-1] (if the color of the closed curve is specified), step S3
In step 34, it is determined whether the line number (line number) lnum is smaller than the color buffer Cbuf. Color buffer Cbuf contains the color of the curve with high priority,
Line number (line number) lnum is color buffer C
If smaller than buf, branch to TRUE and step S
Proceeding to step 336, the line and dot colors designated by the pointers i and j, color [i] [j] (hereinafter referred to as pointer designated colors), are line colors with high priority.
Set to lcolor, and then the process proceeds to step S338.
As a result, the color of the higher priority curve is painted on the closed curve.

【0045】一方、ステップS332でラインカラーlc
olorが[−1]に等しい状態(閉曲線のカラーが指定さ
れていない状態)であれば、ステップS340に分岐し
てポインタ指定カラーcolor[i][j]をカラー状態
フラグCflag[Cbuf]にセットしてステップS338
に進む。カラー状態フラグCflag[Cbuf]はバックグ
ラウンド(背景)の色を塗る状態を示すフラグである。
したがって、この場合にはその閉曲線にバックグラウン
ド(背景)の色が塗られる。また、ステップS334で
ラインナンバー(ライン番号)lnumがカラーバッファC
buf以上のときには、FALSEに分岐してステップS
340に進み、同様にポインタ指定カラーcolor[i]
[j]をカラー状態フラグCflag[Cbuf]にセットし
てステップS338に進む。したがって、この場合もそ
の閉曲線にバックグラウンド(背景)の色が塗られる。
このようにして、今回のポインタi、jによって指定さ
れたラインおよびドットに対して優先度の高い閉曲線の
色が塗られたり、あるいはバックグラウンド(背景)の
色が塗られたりする。
On the other hand, in step S332, the line color lc
If olor is equal to [−1] (the color of the closed curve is not designated), the process branches to step S340 and the pointer designated color color [i] [j] is set in the color state flag Cflag [Cbuf]. Then step S338
Proceed to. The color state flag Cflag [Cbuf] is a flag indicating a state in which the background color is applied.
Therefore, in this case, the closed curve is painted with the background color. Further, in step S334, the line number (line number) lnum is the color buffer C.
If buf or more, branch to FALSE and step S
In step 340, the pointer designation color color [i] is similarly set.
[J] is set to the color status flag Cflag [Cbuf], and the process proceeds to step S338. Therefore, also in this case, the background color is applied to the closed curve.
In this way, the line and dot designated by the pointers i and j this time are painted with the color of the closed curve having a high priority or the color of the background (background).

【0046】次いで、ステップS338でポインタjを
[1]だけインクリメントして次のドットに移行する。
次いで、ステップS342でインクリメント後のポイン
タjがndot(例えば、1ラインの最大値でndot=25
6ドット)まで到達したか否かを判別し、到達していな
ければ図10のステップS308に戻って同様のルーチ
ンを繰り返す。これにより、次回のルーチンでは同じラ
イン上の次のドットに対して同様の処理が行われる。そ
して、ステップS342でポインタjがndot(例え
ば、256ドット)まで到達すると、1ラインの全ての
ドットについてカラー設定処理が終了したと判断してス
テップS344に抜ける。ステップS344ではポイン
タiを[1]だけインクリメントして次のラインに移行
する。次いで、ステップS346でインクリメント後の
ポインタiがnline(例えば、1画面の最大値でnline
=525本)まで到達したか否かを判別し、到達してい
なければ図10のステップS306に戻って再びドット
を指定するポインタjを[0]に戻して同様のルーチン
を繰り返す。これにより、次回のルーチンでは次のライ
ンに移行して同様の処理が行われる。そして、ステップ
S346でポインタiがnline(例えば、525本)ま
で到達すると、全てのラインについてカラー設定処理が
終了したと判断して本ルーチンを終了する。
Then, in step S338, the pointer j is incremented by [1] to move to the next dot.
Next, in step S342, the pointer j after increment is ndot (for example, ndot = 25 at the maximum value of one line).
(6 dots) is determined, and if not, the process returns to step S308 in FIG. 10 and the same routine is repeated. As a result, in the next routine, similar processing is performed on the next dot on the same line. Then, when the pointer j reaches ndot (for example, 256 dots) in step S342, it is determined that the color setting process has been completed for all the dots in one line, and the process exits to step S344. In step S344, the pointer i is incremented by [1] to move to the next line. Next, in step S346, the pointer i after being incremented is nline (for example, the maximum value of one screen is nline.
= 525 lines) is determined, and if not reached, the process returns to step S306 in FIG. 10 and the pointer j for designating the dot is returned to [0] and the same routine is repeated. As a result, in the next routine, the same process is performed by shifting to the next line. Then, when the pointer i reaches nline (for example, 525 lines) in step S346, it is determined that the color setting process has been completed for all lines, and this routine is ended.

【0047】このように、1画面をラインとドットに分
けて、カラー設定処理が行われ、このとき描画する全て
の閉曲線(例えば、似顔絵の各部位に対応する閉曲線)
についてのフラグ設定を終了した後、全ての閉曲線のフ
ラグを参考にしてカラー設定エリアにカラー番号が設定
される。この場合、何れかの閉曲線の境界線が検出され
たときには、その境界線がいま属している閉曲線よりも
優先度の高い閉曲線の内部にあるときには、優先度の高
い内部カラーをカラー設定エリアに設定するようにカラ
ー状態フラグが制御される。したがって、常に優先度の
高い閉曲線のカラーで塗りつぶされることになり、似顔
絵を簡単なデータ構成で作成することができる。具体的
には、例えば図4に示すように似顔絵の各部位(前髪、
髪型、髪の光沢、顔の輪郭、顔のパーツ、首)に対応す
る閉曲線を作成するとともに、各部位のカラー設定エリ
アにカラー番号を設定していき、画面に表示するときに
は、優先度の高い各部位のカラーでその閉曲線を塗りつ
ぶす処理が行われる。これにより、図13に示すような
似顔絵100の完成画面が表示部5に表示される。この
場合、本実施例では表示部5(例えば、コンピュータ画
面あるいはテレビ画面)上に似顔絵をカラー表示させる
ために、ピクセル毎にカラーデータを持つ必要がなく、
データ量が少なくて済み、メモリ装置の容量を少なくす
ることができ、低コストにすることができる。また、似
顔絵でなく、アニメーション画像をカラー表示させる場
合にも本実施例と同様の効果を得ることができる。
In this way, one screen is divided into lines and dots and color setting processing is performed, and all closed curves drawn at this time (for example, closed curves corresponding to each part of a portrait).
After finishing the flag setting for, the color number is set in the color setting area with reference to the flags of all the closed curves. In this case, when the boundary line of any closed curve is detected, if the boundary line is inside a closed curve having a higher priority than the closed curve to which it belongs, a high priority internal color is set in the color setting area. The color status flag is controlled so that Therefore, the color of the closed curve having a high priority is always applied, and the portrait can be created with a simple data structure. Specifically, for example, as shown in FIG. 4, each part of the portrait (bangs,
Create a closed curve corresponding to hairstyle, hair gloss, face contour, face parts, neck) and set the color number in the color setting area of each part, and when displaying it on the screen, it has a high priority. The closed curve is filled with the color of each part. As a result, a completed screen of the portrait 100 as shown in FIG. 13 is displayed on the display unit 5. In this case, in the present embodiment, it is not necessary to have color data for each pixel in order to display a portrait on the display unit 5 (for example, a computer screen or a TV screen) in color.
The amount of data is small, the capacity of the memory device can be reduced, and the cost can be reduced. Further, the same effect as that of the present embodiment can be obtained even when an animation image is displayed in color instead of a portrait.

【0048】なお、上記実施例では閉曲線を作成する場
合の曲線パラメータとしてベジェ曲線のパラメータを使
用しているが、これに限るものではなく、例えばBスプ
ライン曲線等の任意の曲線を用いることも可能である。
また、この他に放物線、双曲線、三角関数等のようなパ
ラメータを適宜使用することも可能である。この場合、
作成する閉曲線の形状に応じて放物線、双曲線、三角関
数等の適切な数式を用いればよい。このようにすると、
その時々に応じた適切な閉曲線を作成することができ
る。また、表示するカラー画像は似顔絵やアニメーショ
ン画像に限らず、ゲーム等で使用する各種の画像、キャ
ラクターや背景データであってもよい。さらに、本発明
はコンピュータ画面上あるいはテレビ画面上において、
似顔絵やアニメーション画像をカラー表示させる場合に
限らず、他の分野、他の画像の表示にも適用できる。
In the above embodiment, the Bezier curve parameter is used as the curve parameter when creating a closed curve, but the present invention is not limited to this, and an arbitrary curve such as a B-spline curve may be used. Is.
In addition to these, parameters such as parabola, hyperbola, trigonometric function and the like can be used as appropriate. in this case,
An appropriate mathematical formula such as a parabola, a hyperbola, a trigonometric function or the like may be used depending on the shape of the closed curve to be created. This way,
It is possible to create an appropriate closed curve according to the occasion. Further, the color image to be displayed is not limited to a portrait or an animation image, but may be various images used in a game or the like, a character, or background data. Further, the present invention is provided on a computer screen or a television screen.
The present invention can be applied not only to displaying a portrait or an animated image in color, but also to displaying other fields or images.

【0049】[0049]

【発明の効果】本発明によれば、カラーの画像(例え
ば、似顔絵あるいはアニメーション画像)を作成する場
合、まず色を省略した複数の閉曲線で画像を作成し、次
いで、この閉曲線の境界および内部を塗りつぶす色を指
定し、さらに各閉曲線を色で塗りつぶす場合の優先順位
を決定し、この優先順位に従って各閉曲線の境界および
その内部を指定された色で塗りつぶしてカラー画像を作
成しているので、以下の効果を得ることができる。 例えば、似顔絵をカラー表示させる場合でも、従来の
ようにピクセル毎にカラーデータを持つ必要がなく、単
に閉曲線データとカラーデータとを持てば画像をカラー
表示することができる。 その結果、少ないデータ量で、低コストに、似顔絵や
アニメーション画像等をカラー表示させることができ
る。
According to the present invention, when a color image (for example, a portrait or an animation image) is created, first, an image is created by a plurality of closed curves in which colors are omitted, and then the boundary and inside of the closed curve are created. The color to be filled is specified, the priority when filling each closed curve with a color is determined, and the boundary of each closed curve and its inside are filled with the specified color to create a color image. The effect of can be obtained. For example, even when a portrait is displayed in color, it is not necessary to have color data for each pixel as in the conventional case, and an image can be displayed in color simply by having closed curve data and color data. As a result, it is possible to display a portrait, an animation image, and the like in color with a small amount of data and at low cost.

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

【図1】本発明による似顔絵作成装置の一実施例を示す
構成図である。
FIG. 1 is a configuration diagram showing an embodiment of a portrait creation device according to the present invention.

【図2】同実施例の似顔絵作成処理のメインプログラム
を示すフローチャートである。
FIG. 2 is a flowchart showing a main program of a portrait creation process of the embodiment.

【図3】同実施例のROMに格納されているデータを示
す図である。
FIG. 3 is a diagram showing data stored in a ROM of the same embodiment.

【図4】同実施例のRAMに格納されるデータを示す図
である。
FIG. 4 is a diagram showing data stored in a RAM of the same embodiment.

【図5】同実施例の閉曲線A〜F作成処理のサブルーチ
ンを示すフローチャートである。
FIG. 5 is a flowchart showing a subroutine of closed curve A to F creation processing of the embodiment.

【図6】同実施例のドット算出処理のサブルーチンを示
すフローチャートである。
FIG. 6 is a flowchart showing a subroutine of dot calculation processing of the same embodiment.

【図7】同実施例のドット算出処理のサブルーチンを示
すフローチャートである。
FIG. 7 is a flowchart showing a subroutine of dot calculation processing of the same embodiment.

【図8】同実施例のベジェ曲線を作成する場合のデータ
計算処理のサブルーチンを示すフローチャートである。
FIG. 8 is a flowchart showing a subroutine of a data calculation process when creating a Bezier curve according to the same embodiment.

【図9】同実施例のベジェ曲線を作成する場合のデータ
計算処理のサブルーチンを示すフローチャートである。
FIG. 9 is a flowchart showing a subroutine of data calculation processing when creating a Bezier curve of the same embodiment.

【図10】同実施例のカラー設定処理のサブルーチンを
示すフローチャートである。
FIG. 10 is a flowchart showing a subroutine of color setting processing of the embodiment.

【図11】同実施例のカラー設定処理のサブルーチンを
示すフローチャートである。
FIG. 11 is a flowchart showing a subroutine of color setting processing of the embodiment.

【図12】同実施例のカラー状態フラグを説明する図で
ある。
FIG. 12 is a diagram illustrating a color state flag of the embodiment.

【図13】同実施例の似顔絵の一例を示す図である。FIG. 13 is a diagram showing an example of a portrait of the embodiment.

【符号の説明】[Explanation of symbols]

1 CPU 2 ROM 3 RAM 4 スイッチ部 5 表示部(表示手段) 6 印刷部(印刷手段) 21 閉曲線作成手段 22 色指定手段 23 優先順位決定手段 24 カラー画像作成手段 1 CPU 2 ROM 3 RAM 4 switch section 5 display section (display means) 6 printing section (printing means) 21 closed curve creating means 22 color designating means 23 priority order determining means 24 color image creating means

Claims (10)

【特許請求の範囲】[Claims] 【請求項1】 所定の画像を色を省略した複数の閉曲線
で作成し、これらの閉曲線の境界および内部を塗りつぶ
す色を指定し、 前記複数の閉曲線の境界および内部を塗りつぶす場合の
各閉曲線の優先順位を決定し、 この優先順位に従って各閉曲線の境界およびその内部を
指定された色で塗りつぶして所定のカラー画像を作成す
ることを特徴とする画像処理方法。
1. A specified image is created by a plurality of closed curves with omitted colors, a color for filling the boundaries and the inside of these closed curves is specified, and priority is given to each closed curve when filling the boundaries and the inside of the plurality of closed curves. An image processing method, characterized in that the order is determined, and the boundary of each closed curve and the inside thereof are filled with a specified color in accordance with the order of priority to create a predetermined color image.
【請求項2】 前記閉曲線は、直線あるいはベジェ曲線
のうちの1つ以上によって作成されることを特徴とする
請求項1記載の画像処理方法。
2. The image processing method according to claim 1, wherein the closed curve is created by one or more of a straight line and a Bezier curve.
【請求項3】 前記所定の画像を色を省略した複数の閉
曲線で作成する処理では、複数の閉曲線を作成する閉曲
線データを用い、 これら複数の閉曲線の境界およびその内部を指定された
色で塗りつぶす処理では、塗りつぶしのためのカラーデ
ータを用いることを特徴とする請求項1記載の画像処理
方法。
3. In the process of creating the predetermined image with a plurality of closed curves with colors omitted, closed curve data that creates a plurality of closed curves is used, and the boundaries of the plurality of closed curves and the inside thereof are filled with a specified color. The image processing method according to claim 1, wherein color data for filling is used in the processing.
【請求項4】 前記閉曲線を直線によって作成する処理
は、直線を多数のドットによって形成するものであり、 直線の両端を形成する2つのドット位置を決定するとと
もに、そのドット位置の傾きを算出する処理と、 この傾きに応じてx座標又はy座標を1単位ずつ増加さ
せた場合の誤差を累積する処理と、 この誤差が所定値を超えるときにのみ、次のドットのx
座標又はy座標の位置を変更するとともに、前記累算さ
れた誤差から一定値を減算する処理と、を有することを
特徴とする請求項1記載の画像処理方法。
4. The process of creating the closed curve by a straight line is to form a straight line by a large number of dots. The two dot positions forming both ends of the straight line are determined, and the inclination of the dot position is calculated. The process and the process of accumulating the error when the x-coordinate or the y-coordinate is increased by one unit according to this inclination, and the x-dot of the next dot only when the error exceeds a predetermined value.
The image processing method according to claim 1, further comprising: a process of changing a position of a coordinate or ay coordinate and subtracting a constant value from the accumulated error.
【請求項5】 所定の画像を色を省略した複数の閉曲線
で作成する閉曲線作成手段と、 閉曲線作成手段によって作成された閉曲線の境界および
内部を塗りつぶす色を指定する色指定手段と、 前記複数の閉曲線の境界および内部を塗りつぶす場合の
各閉曲線に対する優先順位を決定する優先順位決定手段
と、 この優先順位に従って各閉曲線の境界およびその内部を
指定された色で塗りつぶして所定のカラー画像を作成す
るカラー画像作成手段と、を備えたことを特徴とする画
像処理装置。
5. A closed curve creating means for creating a predetermined image with a plurality of closed curves without colors, a color specifying means for specifying a color for filling the boundary and the inside of the closed curve created by the closed curve creating means, and the plurality of the plurality of closed curves. A priority determining means for determining the priority for each closed curve when filling the boundary and the inside of the closed curve, and a color for creating a predetermined color image by filling the boundary and the inside of each closed curve with a specified color according to this priority. An image processing apparatus comprising: an image creating unit.
【請求項6】 前記閉曲線作成手段は、直線あるいはベ
ジェ曲線のうちの1つ以上によって閉曲線を作成するこ
とを特徴とする請求項6記載の画像処理装置。
6. The image processing apparatus according to claim 6, wherein the closed curve creating means creates the closed curve by one or more of a straight line and a Bezier curve.
【請求項7】 前記閉曲線作成手段は、所定の画像を構
成する複数の閉曲線を閉曲線データによって作成し、 前記カラー画像作成手段は、複数の閉曲線の境界および
その内部を、指定されたカラーデータに対応する色で塗
りつぶすことを特徴とする請求項6記載の画像処理装
置。
7. The closed curve creating means creates a plurality of closed curves forming a predetermined image by closed curve data, and the color image creating means sets boundaries of the plurality of closed curves and the inside thereof to designated color data. The image processing apparatus according to claim 6, wherein the image processing apparatus fills with a corresponding color.
【請求項8】 前記カラー画像作成手段によって作成さ
れた所定のカラー画像を表示する表示手段を、さらに有
することを特徴とする請求項6記載の画像処理装置。
8. The image processing apparatus according to claim 6, further comprising display means for displaying a predetermined color image created by said color image creating means.
【請求項9】 前記カラー画像作成手段によって作成さ
れた所定のカラー画像を印刷する印刷手段を、さらに有
することを特徴とする請求項6記載の画像処理装置。
9. The image processing apparatus according to claim 6, further comprising a printing unit that prints a predetermined color image created by the color image creating unit.
【請求項10】 前記閉曲線作成手段は、閉曲線を多数
のドットからなる直線によって作成する場合、 直線の両端を形成する2つのドット位置を決定するとと
もに、そのドット位置の傾きを算出する手段と、 この傾きに応じてx座標又はy座標を1単位ずつ増加さ
せた場合の誤差を累積する手段と、 この誤差が所定値を超えるときにのみ、次のドットのx
座標又はy座標の位置を変更するとともに、前記累算さ
れた誤差から一定値を減算する手段とを有することを特
徴とする請求項6記載の画像処理装置。
10. The closed curve creating means, when the closed curve is created by a straight line composed of a large number of dots, means for determining two dot positions forming both ends of the straight line and calculating an inclination of the dot position, Means for accumulating the error when the x coordinate or the y coordinate is increased by one unit according to this inclination, and the x of the next dot only when the error exceeds a predetermined value.
The image processing apparatus according to claim 6, further comprising means for changing a position of a coordinate or ay coordinate and subtracting a constant value from the accumulated error.
JP7535394A 1994-03-22 1994-03-22 Method and device for processing image Pending JPH07262391A (en)

Priority Applications (4)

Application Number Priority Date Filing Date Title
JP7535394A JPH07262391A (en) 1994-03-22 1994-03-22 Method and device for processing image
US08/405,521 US5611037A (en) 1994-03-22 1995-03-16 Method and apparatus for generating image
EP95104136A EP0675461B1 (en) 1994-03-22 1995-03-21 Method and apparatus for generating image
DE69518180T DE69518180T2 (en) 1994-03-22 1995-03-21 Process and apparatus for imaging

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP7535394A JPH07262391A (en) 1994-03-22 1994-03-22 Method and device for processing image

Publications (1)

Publication Number Publication Date
JPH07262391A true JPH07262391A (en) 1995-10-13

Family

ID=13573795

Family Applications (1)

Application Number Title Priority Date Filing Date
JP7535394A Pending JPH07262391A (en) 1994-03-22 1994-03-22 Method and device for processing image

Country Status (1)

Country Link
JP (1) JPH07262391A (en)

Similar Documents

Publication Publication Date Title
JP4385524B2 (en) Polygon data generation method and image display apparatus using the same
US5786822A (en) Method and apparatus for mapping texture on an object displayed at a varying view angle from an observer
US5611037A (en) Method and apparatus for generating image
JPH06266847A (en) Method and equipment for displaying object changed into raster
EP1203351B1 (en) System for rapidly performing scan conversion with anti-aliasing upon outline fonts and other graphic elements
US5640589A (en) Method and device for generating graphic data using a writing motion model
CA2050651C (en) Integrated hardware generator for area fill, conics and vectors in a graphics rendering processor
US5870107A (en) Character and symbol pattern generator based on skeleton data including thickness calculation
US5642476A (en) Computer generated variable line width of a vector graphic
US5351315A (en) Apparatus for smoothing outlines of images
JP3351093B2 (en) Image processing method and apparatus
US5850488A (en) Character generating method and apparatus using discrimination of stored font data
JPH07262391A (en) Method and device for processing image
EP0749099B1 (en) Blend control system
JPH07262399A (en) Method and device for processing image
JPH07262398A (en) Method and device for processing image
JPH09180000A (en) Three-dimensional graphics controller
JP2748787B2 (en) Curve generator
EP0454125B1 (en) Method of producing characters and figures using computer
JPS63303477A (en) Vector character and graphic processing system
JP2897721B2 (en) Polygon duplexer
JP2666552B2 (en) Line width control method for outline characters
JP2538631B2 (en) How to handle vector characters
JP3034391B2 (en) Electronic typesetting device that calculates the number of characters
JP2000338959A (en) Image processing device