JPH07192122A - Image deforming method and device therefor - Google Patents

Image deforming method and device therefor

Info

Publication number
JPH07192122A
JPH07192122A JP5347814A JP34781493A JPH07192122A JP H07192122 A JPH07192122 A JP H07192122A JP 5347814 A JP5347814 A JP 5347814A JP 34781493 A JP34781493 A JP 34781493A JP H07192122 A JPH07192122 A JP H07192122A
Authority
JP
Japan
Prior art keywords
small
line
deformation
error
image data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Abandoned
Application number
JP5347814A
Other languages
Japanese (ja)
Inventor
Tatsuya Iijima
達也 飯島
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 JP5347814A priority Critical patent/JPH07192122A/en
Publication of JPH07192122A publication Critical patent/JPH07192122A/en
Abandoned legal-status Critical Current

Links

Abstract

PURPOSE:To provide an image deforming method which is capable of freely and smoothly deforming image of a bit array form with a little memory capacity, and a device for the method. CONSTITUTION:When the vertexes of plural small polygons forming the same line (p line) inside a deforming object are moved according to the parameter of a Bezier curve, the vertexes of small other polygons are moved so that the whole of the deforming object may be smoothly deformed and the vetexes of the other small moved polygons are calculated based on the vertex after the small polygon of the p line is moved. At this time, as the parameters of a curve, the both ends cordinates of the curve (xb1, yb1) and (xb4, yb4) and cordinates of (xb2, yb2) and (xb3, yb3) controlling the bending way of the curve are used. The shape of each small polygon after a deformation corresponding to each calculated vertex is determined, an original image is deformed so as to correspond to the data of the small polygon after the deformation and the whole of the image is prepared.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、画像変形方法およびそ
の装置に係わり、詳しくはアニメーション、ゲーム等で
用いられるキャラクター、背景データを始めとするドッ
トで構成され、かつ各ドット毎に表示色番号あるいはパ
レット番号を持つようないわゆるビット配列形式の画像
データの配列を変更することにより、画像を変形する画
像変形方法およびその方法を実現する装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an image transformation method and an apparatus therefor, and more specifically, it is composed of dots such as characters used in animation, games, background data, and the display color number for each dot. Alternatively, the present invention relates to an image transforming method for transforming an image by changing an array of so-called bit array format image data having a palette number, and an apparatus for realizing 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.

【0003】[0003]

【発明が解決しようとする課題】ところで、従来の画像
変形方法において、アニメーション、ゲーム等でキャラ
クター又は背景に動きを与えたり、その形を変えるとき
には、全く異なる画像データを予めメモリに持ってお
き、例えば動きを与えるときには一定時間毎に、あるい
はその形を変えるときには何かのきっかけでメモリ上に
ある画像データそのものを表示し直していた。そのた
め、多くのメモリを消費するという欠点があった。ま
た、画像の拡大、縮小処理あるいはある形状の四角形か
ら異なる形状の四角形への変形(例えば、正方形から台
形への変形)等の単純な変形処理は、従来のゲーム中に
も多く用いられているが、変形の度合いが限られ、滑ら
かな変形が困難であった。さらに、変形を使用する範囲
が限定されてしまい(自由に変形できない)、予めメモ
リに多くのデータを持っておく方法を採らざるを得ず、
この点でコスト高にもなっていた。
By the way, in the conventional image transforming method, when a character or background is moved or changed in animation, game, etc., completely different image data is stored in the memory in advance, For example, when a motion is given, the image data itself on the memory is redisplayed at certain intervals or when the shape is changed, for some reason. Therefore, there is a drawback that it consumes a lot of memory. Further, simple transformation processing such as image enlargement / reduction processing or transformation from a quadrilateral of a certain shape to a quadrilateral of a different shape (for example, transformation from a square to a trapezoid) is often used in conventional games. However, the degree of deformation was limited, and smooth deformation was difficult. In addition, the range in which transformation is used is limited (it cannot be transformed freely), so there is no choice but to adopt a method of storing a large amount of data in memory in advance.
In this respect, the cost was high.

【0004】そこで本発明は、少ないメモリ容量で、ビ
ット配列形式の画像を自由にかつ滑らかに変形できる画
像変形方法およびその装置を提供することを目的として
いる。
SUMMARY OF THE INVENTION Therefore, an object of the present invention is to provide an image transforming method and an image transforming apparatus capable of freely and smoothly transforming an image in a bit array format with a small memory capacity.

【0005】[0005]

【課題を解決するための手段】上記目的達成のため、請
求項1記載の発明による画像変形方法は、ビット配列形
式の画像データを有する変形対象を、複数の小多角形に
分割し、この各小多角形を所定の変形処理に従って異な
る小多角形に変形し、変形前の小多角形に含まれるビッ
ト配列形式の画像データの配列を、各小多角形毎に、所
定のデータ変換処理に従って、変形後の小多角形のデー
タに対応するように順次変更して変更後の全体画像デー
タを作成するとともに、前記小多角形の変形処理では、
変形対象の内部にある同一行あるい同一列のうちの少な
くとも1つを形成する複数個の小多角形の頂点を、所定
の曲線パラメータに従い、少なくとも変形後に再び内部
に位置するような任意の位置に移動したとき、前記複数
個の小多角形の移動に応じて他の小多角形の頂点を移動
させ、移動した他の小多角形の頂点を前記複数個の小多
角形の移動後の頂点に基づいて算出し、この算出した頂
点に対応して各小多角形を変形することを特徴とする。
請求項2記載の発明による画像変形方法は、前記小多角
形の変形処理では、変形対象の内部にある複数の行ある
い複数の列のうちの少なくとも1つを形成する複数個の
小多角形の群の各小多角形の頂点を、所定の曲線パラメ
ータに従い、少なくとも変形後に再び内部に位置するよ
うな任意の位置に移動したとき、前記複数個の小多角形
のの移動に応じて他の小多角形の頂点を移動させ、移動
した他の小多角形の頂点を前記複数個の小多角形の移動
後の頂点に基づいて算出し、この算出した頂点に対応し
て各小多角形を変形することを特徴とする。
In order to achieve the above object, the image transforming method according to the invention of claim 1 divides a transform object having image data in a bit array format into a plurality of small polygons, and The small polygons are transformed into different small polygons according to a predetermined transformation process, and the array of image data in the bit array format included in the small polygons before the transformation is processed for each small polygon according to a predetermined data conversion process. The whole image data after the change is created by sequentially changing so as to correspond to the data of the small polygon after deformation, and in the deformation processing of the small polygon,
Arbitrary positions where the vertices of a plurality of small polygons forming at least one of the same row or the same column inside the deformation target are positioned inside again at least after the deformation according to predetermined curve parameters. When the plurality of small polygons are moved, the vertices of the other small polygons are moved according to the movement of the plurality of small polygons, and the vertices of the other small polygons that are moved are the vertices after the movement of the plurality of small polygons. It is characterized in that each small polygon is deformed according to the calculated vertices.
The image transformation method according to the present invention is the image transformation method according to claim 2, wherein in the transformation processing of the small polygon, a plurality of small polygons forming at least one of a plurality of rows or a plurality of columns inside the transformation target. When the vertices of each small polygon of the group of are moved to an arbitrary position such that they are located inside again at least after the deformation, according to the predetermined curve parameters, other small polygons are moved according to the movement of the plurality of small polygons. The vertices of the small polygon are moved, the vertices of the other small polygons that have been moved are calculated based on the vertices after the movement of the plurality of small polygons, and each small polygon is calculated in correspondence with the calculated vertices. It is characterized by being deformed.

【0006】また、好ましい態様として、例えば請求項
3記載のように、前記変形処理における複数個の小多角
形の頂点を移動配置する所定の曲線パラメータは、ベジ
ェ曲線あるいは三角関数の少なくとも一方によって規定
される任意のパラメータであるようにしてもよい。例え
ば請求項4記載のように、前記所定の変形処理は、座標
変換処理であり、この座標変換処理では、分割された各
小多角形の頂点の座標を求め、次いで、変形後の各小多
角形の頂点の座標を算出し、この算出した座標に基づい
て変形後の異なる小多角形の形状を決定することによ
り、分割された各小多角形を異なる小多角形に変形する
ようにしてもよい。例えば請求項5記載のように、前記
所定のデータ変換処理は、変形対象となる各小多角形に
含まれるビット配列形式の画像データを複数のラインに
分割する処理と、この分割された各ラインの変形後の小
多角形上での端点を算出する処理と、前記分割された各
ラインを、変形後の小多角形の対応するラインの大きさ
に合せて拡大又は縮小する処理と、この拡大又は縮小さ
れたラインを変形後の小多角形の対応するライン上の端
点を起点として順次転送して配置する処理と、を有する
ようにしてもよい。
In a preferred embodiment, the predetermined curve parameter for moving and arranging the vertices of a plurality of small polygons in the transformation process is defined by at least one of Bezier curve and trigonometric function. It may be any parameter that is set. For example, as described in claim 4, the predetermined transforming process is a coordinate transforming process. In this coordinate transforming process, the coordinates of the vertices of each of the divided small polygons are obtained, and then each transformed small polygon is processed. Even if the divided small polygons are transformed into different small polygons by calculating the coordinates of the vertices of the polygon and determining the shape of the different small polygons after transformation based on the calculated coordinates. Good. For example, as described in claim 5, the predetermined data conversion process is a process of dividing the image data in the bit array format included in each small polygon to be transformed into a plurality of lines, and each of the divided lines. Of calculating the end points on the deformed small polygon, and enlarging or reducing each of the divided lines according to the size of the corresponding line of the deformed small polygon, Alternatively, a process of sequentially transferring and arranging the reduced lines with the end points on the corresponding lines of the deformed small polygon as the starting points may be included.

【0007】例えば請求項6記載のように、前記端点を
算出する処理は、変形前および変形後のラインの端点の
位置に基づいて、変形前の各ラインの端点の位置を変化
させずに順次変形後の小多角形の対応するラインの端点
の位置とした場合の誤差を順次累算する処理と、この誤
差が所定値を超えるときにのみ、ラインの端点の位置を
変更するとともに、前記累算された誤差から一定値を減
算する処理と、を有するようにしてもよい。例えば請求
項7記載のように、前記拡大又は縮小する処理は、変形
前および変形後のラインに含まれるビット配列形式の画
像データおよび変形後のラインに含まれるビット配列形
式の画像データの数に基づいて、変形前の各ラインに含
まれるビット配列形式の各画像データを変形後のライン
に順次指定して配列したときの誤差を累算する処理と、
この誤差が所定値を超えるときには、現在指定されてい
る画像データを変形後のラインに転送配置して次の画像
データを指定するとともに、前記累算された誤差から一
定値を減算する動作を前記誤差が所定値以下になるまで
繰り返す処理と、前記誤差が所定値以下のときに、前記
指定された画像データを変形後のラインに転送して配置
する処理と、を有するようにしてもよい。
For example, as described in claim 6, the processing for calculating the end points is performed on the basis of the positions of the end points of the lines before and after the deformation, without changing the positions of the end points of the lines before the deformation. The process of sequentially accumulating the error when the position of the end point of the corresponding line of the deformed small polygon is calculated, and the position of the end point of the line is changed only when the error exceeds a predetermined value. And a process of subtracting a constant value from the calculated error. For example, as described in claim 7, the process of enlarging or reducing the number of image data in the bit array format included in the lines before and after the transformation and the image data in the bit array format included in the line after the transformation is performed. Based on the process of accumulating errors when sequentially designating and arranging each image data in the bit array format included in each line before deformation in the line after deformation,
When this error exceeds a predetermined value, the currently specified image data is transferred to the transformed line to specify the next image data, and the operation of subtracting a constant value from the accumulated error is performed. You may make it have the process repeated until an error becomes below a predetermined value, and the process of transferring the said designated image data to a line after a deformation | transformation, and arrange | positioning when the said error is below a predetermined value.

【0008】例えば請求項8記載のように、前記転送す
る処理は、変形前および変形後のラインの数に基づい
て、変形前の各ラインを指定して変形後の小多角形の対
応するラインの位置に順次配列したときの誤差を累算す
る処理と、この誤差が所定値を超えるときには、現在指
定されているラインを変形後の小多角形のラインとして
転送配置して次のラインを指定するとともに、前記累算
された誤差から一定値を減算する動作を前記誤差が所定
値以下になるまで繰り返す処理と、前記誤差が所定値以
下のときに、前記指定されたラインを変形後のラインと
して転送配置する処理と、を有するようにしてもよい。
For example, according to the eighth aspect of the present invention, in the transfer processing, each line before deformation is designated based on the number of lines before and after deformation, and the corresponding line of the small polygon after deformation is designated. The process of accumulating the error when sequentially arranging at the position of, and when this error exceeds the predetermined value, the currently specified line is transferred and arranged as the modified small polygon line and the next line is specified. In addition, a process of subtracting a constant value from the accumulated error is repeated until the error is equal to or less than a predetermined value, and when the error is equal to or less than a predetermined value, the designated line is a modified line. And a process of arranging the transfer may be included.

【0009】請求項9記載の画像変形装置は、ビット配
列形式の画像データを有する変形対象を、複数の小多角
形に分割する分割手段と、変形対象の内部にある同一行
あるい同一列のうちの少なくとも1つを形成する複数個
の小多角形の頂点を、所定の曲線パラメータに従い、少
なくとも変形後に再び内部に位置するような任意の位置
に移動したとき、前記複数個の小多角形の移動に応じて
他の小多角形の頂点を移動させ、移動した他の小多角形
の頂点を前記複数個の小多角形の移動後の頂点に基づい
て算出し、この算出した頂点に対応して分割手段によっ
て分割した各小多角形を異なる小多角形に変形する変形
手段と、変形前の小多角形に含まれるビット配列形式の
画像データの配列を、各小多角形毎に、所定のデータ変
換処理に従って、変形後の小多角形のデータに対応する
ように順次変更して変更後の全体画像データを作成する
画像データ作成手段と、を備えたことを特徴とする。
According to a ninth aspect of the present invention, there is provided an image transformation apparatus which divides a transformation object having image data in a bit array format into a plurality of small polygons, and a dividing means inside the transformation object in the same row or the same column. When the vertices of a plurality of small polygons forming at least one of the plurality of small polygons are moved to an arbitrary position such that they are located inside again after at least deformation, according to a predetermined curve parameter, The vertices of the other small polygons are moved according to the movement, and the vertices of the other small polygons that have been moved are calculated based on the moved vertices of the plurality of small polygons. The deforming means for deforming each small polygon divided by the dividing means into different small polygons, and the array of the image data in the bit array format included in the small polygons before the deformation are provided in a predetermined manner for each small polygon. According to the data conversion process, Characterized in that and an image data generation means for generating an entire image data after changed sequentially changed to correspond to the data of the small polygons after form.

【0010】請求項10記載の画像変形装置は、前記変
形手段は、変形対象の内部にある複数の行あるい複数の
列のうちの少なくとも1つを形成する複数個の小多角形
の群の各小多角形の頂点を、所定の曲線パラメータに従
い、少なくとも変形後に再び内部に位置するような任意
の位置に移動させるような変形処理を行うことを特徴と
する。また、好ましい態様として、例えば請求項11記
載のように、前記変形手段における複数個の小多角形の
頂点を移動配置する所定の曲線パラメータは、ベジェ曲
線あるいは三角関数の少なくとも一方によって規定され
る任意のパラメータであるようにしてもよい。例えば請
求項12記載のように、前記変形手段は、分割手段によ
って分割した各小多角形を異なる小多角形に変形する所
定の変形処理を実行可能な座標変換手段を備え、この座
標変換手段は、分割された各小多角形の頂点の座標を求
めるとともに、変形後の各小多角形の頂点の座標を算出
し、この算出した座標に基づいて変形後の異なる小多角
形の形状を決定することにより、分割された各小多角形
を異なる小多角形に変形するようにしてもよい。
According to a tenth aspect of the present invention, in the image transformation apparatus, the transformation means includes a group of a plurality of small polygons forming at least one of a plurality of rows or a plurality of columns inside the transformation target. It is characterized in that the apex of each small polygon is deformed according to a predetermined curve parameter so as to be moved to an arbitrary position that is located inside again at least after the deformation. In a preferred aspect, for example, the predetermined curve parameter for moving and arranging the vertices of a plurality of small polygons in the deforming means is defined by at least one of Bezier curve and trigonometric function. Parameter may be used. For example, as described in claim 12, the transforming means includes coordinate transforming means capable of performing a predetermined transforming process of transforming each small polygon divided by the dividing means into different small polygons. , The coordinates of the vertices of the divided small polygons are calculated, the coordinates of the vertices of the deformed small polygons are calculated, and the shapes of the different small polygons after the deformation are determined based on the calculated coordinates. By doing so, each of the divided small polygons may be transformed into a different small polygon.

【0011】例えば請求項13記載のように、前記画像
データ作成手段は、前記所定のデータ変換処理を実行可
能なデータ変換手段を備え、このデータ変換手段は、変
形対象となる各小多角形に含まれるビット配列形式の画
像データを複数のラインに分割する手段と、この分割さ
れた各ラインの変形後の小多角形上での端点を算出する
手段と、前記分割された各ラインを、変形後の小多角形
の対応するラインの大きさに合せて拡大又は縮小する手
段と、この拡大又は縮小されたラインを変形後の小多角
形の対応するライン上の端点を起点として順次転送して
配置する手段と、を有するようにしてもよい。例えば請
求項14記載のように、前記端点を算出する手段は、変
形前および変形後のラインの端点の位置に基づいて、変
形前の各ラインの端点の位置を変化させずに順次変形後
の小多角形の対応するラインの端点の位置とした場合の
誤差を順次累算する手段と、この誤差が所定値を超える
ときにのみ、ラインの端点の位置を変更するとともに、
前記累算された誤差から一定値を減算する手段と、を有
するようにしてもよい。
For example, as described in claim 13, the image data creating means is provided with a data converting means capable of executing the predetermined data converting process, and the data converting means applies to each small polygon to be deformed. A means for dividing the included image data in the bit array format into a plurality of lines, a means for calculating the end points of the respective divided lines on the deformed small polygon, and a means for deforming each of the divided lines. A means for enlarging or reducing according to the size of the corresponding line of the subsequent small polygon, and transferring this enlarged or reduced line sequentially starting from the end point on the corresponding line of the deformed small polygon. And means for arranging. For example, as described in claim 14, the means for calculating the end points is based on the positions of the end points of the pre-deformation line and the post-deformation line and does not change the positions of the end points of the pre-deformation lines. A means for sequentially accumulating the error when the position of the end point of the corresponding line of the small polygon, and the position of the end point of the line are changed only when this error exceeds a predetermined value,
Means for subtracting a constant value from the accumulated error.

【0012】例えば請求項15記載のように、前記拡大
又は縮小する手段は、変形前および変形後のラインに含
まれるビット配列形式の画像データおよび変形後のライ
ンに含まれるビット配列形式の画像データの数に基づい
て、変形前の各ラインに含まれるビット配列形式の各画
像データを変形後のラインに順次指定して配列したとき
の誤差を累算する手段と、この誤差が所定値を超えると
きには、現在指定されている画像データを変形後のライ
ンに転送配置して次の画像データを指定するとともに、
前記累算された誤差から一定値を減算する動作を前記誤
差が所定値以下になるまで繰り返す手段と、前記誤差が
所定値以下のときに、前記指定された画像データを変形
後のラインに転送して配置する手段と、を有するように
してもよい。例えば請求項16記載のように、前記転送
する手段は、変形前および変形後のラインの数に基づい
て、変形前の各ラインを指定して変形後の小多角形の対
応するラインの位置に順次配列したときの誤差を累算す
る手段と、この誤差が所定値を超えるときには、現在指
定されているラインを変形後の小多角形のラインとして
転送配置して次のラインを指定するとともに、前記累算
された誤差から一定値を減算する動作を前記誤差が所定
値以下になるまで繰り返す手段と、前記誤差が所定値以
下のときに、前記指定されたラインを変形後のラインと
して転送配置する手段と、を有するようにしてもよい。
For example, as described in claim 15, the means for enlarging or reducing is image data in bit array format included in lines before and after transformation and image data in bit array format included in lines after transformation. And a means for accumulating the error when sequentially designating and arranging each image data of the bit array format included in each line before transformation on the line after transformation, and this error exceeds a predetermined value. Sometimes, the currently specified image data is transferred to the transformed line, and the next image data is specified.
Means for repeating an operation of subtracting a constant value from the accumulated error until the error becomes a predetermined value or less; and, when the error is a predetermined value or less, transferring the designated image data to the transformed line And a means for arranging the same. For example, as described in claim 16, the transfer means specifies each line before deformation based on the number of lines before and after deformation and positions the corresponding lines of the small polygon after deformation. A means for accumulating the error when sequentially arranged, and when this error exceeds a predetermined value, the currently specified line is transferred and arranged as a deformed small polygonal line to specify the next line, A means for repeating an operation of subtracting a constant value from the accumulated error until the error becomes a predetermined value or less; and a transfer arrangement in which the designated line is a modified line when the error is a predetermined value or less. And a means for doing so.

【0013】例えば請求項17記載のように、前記画像
データ作成手段によって作成された変形後の画像データ
を表示する表示手段を、さらに有するようにしてもよ
い。例えば請求項18記載のように、変形対象を変形す
る場合の変形態様を指定する変形態様指定手段を有し、
前記変形手段は、この変形態様指定手段の出力に基づい
て前記各小多角形を異なる小多角形にそれぞれ変形処理
するようにしてもよい。例えば請求項19記載のよう
に、前記変形態様指定手段は、変形対象を第1の変形態
様に指定する第1の変形スイッチと、変形対象を第2の
変形態様に指定する第2の変形スイッチとを有するよう
にしてもよい。例えば請求項20記載のように、変形対
象のビット配列形式の画像データと、変形対象をどのよ
うに分割するかを示す分割データと、分割した各小多角
形をどのように変形するかを示す変形データとを記憶す
る記憶手段と、前記変形態様指定手段により変形態様が
指定されたとき、記憶手段に記憶された各データを読み
出し画像変形の制御を行う画像変形制御手段と、を備え
るようにしてもよい。
For example, as described in claim 17, a display means for displaying the transformed image data created by the image data creating means may be further provided. For example, as set forth in claim 18, there is provided a modification mode designating unit for designating a modification mode when the modification target is modified,
The deforming means may deform the small polygons into different small polygons based on the output of the deforming mode designating means. For example, as described in claim 19, the modification mode designating means specifies a first modification mode for the modification target and a second modification switch for designating the modification target as the second modification mode. You may have and. For example, as described in claim 20, the image data in the bit array format to be transformed, the division data indicating how to divide the transformation target, and the how to transform each of the divided small polygons are shown. Storage means for storing the deformation data, and image deformation control means for reading out each data stored in the storage means and controlling the image deformation when the deformation mode is designated by the deformation mode designating means. May be.

【0014】[0014]

【作用】本発明では、まずビット配列形式の画像データ
を有する変形対象を複数の小多角形に分割し、各小多角
形を所定の変形処理(例えば、座標変換処理)に従って
異なる小多角形にそれぞれ変形する。このとき、小多角
形の変形処理では、変形対象の内部にある同一行あるい
同一列のうちの少なくとも1つを形成する複数個の小多
角形の頂点を、所定の曲線パラメータに従い、少なくと
も変形後に再び内部に位置するような任意の位置に移動
したとき、前記複数個の小多角形の移動に応じて他の小
多角形の頂点を移動させ(例えば、変形対象全体が滑ら
かに変形されるように他の小多角形の頂点を移動さ
せ)、移動した他の小多角形の頂点を前記任意の小多角
形の移動後の頂点に基づいて算出し、この算出した頂点
に対応して各小多角形を変形することが行われる。次い
で、変形前の小多角形に含まれるビット配列形式の画像
データの配列を、各小多角形毎に、所定のデータ変換処
理に従って変形後の小多角形のデータに対応するように
順次変更して変更後の全体画像データが作成される。
In the present invention, first, a transformation target having image data in the bit array format is divided into a plurality of small polygons, and each small polygon is transformed into different small polygons according to a predetermined transformation process (for example, coordinate conversion process). Each transforms. At this time, in the small polygon deformation process, at least one of the vertices of the small polygons forming at least one of the same row or the same column inside the deformation target is deformed at least according to a predetermined curve parameter. When it moves to an arbitrary position that is located inside again later, the vertices of the other small polygons are moved according to the movement of the plurality of small polygons (for example, the entire deformation target is smoothly deformed). As described above, the vertices of the other small polygons are moved), and the vertices of the moved other small polygons are calculated based on the moved vertices of the arbitrary small polygons. Deformation of the small polygon is performed. Then, the array of the image data in the bit array format included in the small polygon before deformation is sequentially changed for each small polygon so as to correspond to the data of the small polygon after deformation according to a predetermined data conversion process. The whole image data after the change is created.

【0015】したがって、変形対象の画像は各小多角形
毎に変形処理が行われるから、従来のように全く異なる
全体の画像データを予め持つ必要がなくなり、少ないメ
モリ容量で、ビット配列形式の画像データの配列を自由
に変更できる。また、変形対象を複数の小多角形に分割
し、各小多角形毎に変形処理が行われるので、変形に自
由度があり、予めメモリに多くのデータを持たなくて
も、画像を滑らかに変形できる。特に、変形対象の内部
にある同一行あるい同一列のうちの少なくとも1つを形
成する複数個の小多角形の頂点を所定の曲線パラメータ
に従って移動させる変形法を使用することにより、曲線
パラメータとして数点(例えば、4点)分の座標だけを
持っていればよく、変形後のすべての小多角形の頂点の
位置データ(例えば、座標)を持っておく必要がない。
よって、極めて少ない変形データで非常に滑らかな画像
変形を行わせることができる。
Therefore, since the image to be transformed is subjected to the transformation process for each small polygon, it is not necessary to previously have the totally different image data as in the prior art, and the image of bit array format can be formed with a small memory capacity. You can freely change the arrangement of data. Further, since the transformation target is divided into a plurality of small polygons and the transformation process is performed for each small polygon, there is a degree of freedom in the transformation, and the image can be smoothed even if there is not much data in memory beforehand. It can be transformed. In particular, by using a deformation method in which the vertices of a plurality of small polygons forming at least one of the same row or the same column inside the deformation target are moved according to a predetermined curve parameter, It is only necessary to have coordinates for several points (for example, four points), and it is not necessary to have position data (for example, coordinates) of the vertices of all the small polygons after transformation.
Therefore, it is possible to perform a very smooth image transformation with very little transformation data.

【0016】また、他の請求項記載の発明では、変形対
象の内部にある複数の行あるい複数の列のうちの少なく
とも1つを形成する複数個の小多角形の群の各小多角形
の頂点を、所定の曲線パラメータに従って移動させる変
形法を使用した場合も、同様に変形後のすべての小多角
形の頂点の位置データ(例えば、座標)を持っておく必
要がなく、少ない変形データで滑らかな画像変形を行わ
せることができる。さらに、上記変形法で、曲線の両端
の座標を変形対象の外枠上に設定すると、外枠の形を変
えることなく、内部の小多角形のみを変形することがで
き、画像データの外形(例えば、大きさ)を変えずに、
内部の形のみを変えたい場合に有効である。また、複数
の行毎に、あるいは複数の列に対して列毎に曲線のパラ
メータを割り当てれば、さらに複雑な変形を行うことが
できる。
According to another aspect of the present invention, each small polygon of a group of a plurality of small polygons forming at least one of a plurality of rows or a plurality of columns inside the deformation target. Even when using the deformation method that moves the vertices of the vertices according to the predetermined curve parameters, it is not necessary to have the position data (for example, coordinates) of the vertices of all the small polygons after the transformation as well. It is possible to make smooth image transformation. Furthermore, when the coordinates of both ends of the curve are set on the outer frame to be transformed by the above-mentioned transformation method, only the small polygon inside can be transformed without changing the shape of the outer frame, and the outer shape of the image data ( For example, without changing the size)
This is effective when you want to change only the internal shape. Further, if a curve parameter is assigned to each of a plurality of rows or a plurality of columns, a more complicated transformation can be performed.

【0017】[0017]

【実施例】以下、図面を参照して本発明の実施例につい
て説明する。本発明の原理説明 最初に、本発明の原理から説明する。図1は多角形分割
変形方法の原理を示す図である。図1(a)は変形前の
画像データを有する変形対象を示し、この変形対象の画
像データはビット配列形式であり、「目」の画像(絵)
Aを表している。この画像データを変形するために、ま
ず変形対象全体を予め縦4分割、横6分割して合計で2
4個の小矩形(1)、(2)、(3)、・・・・・(24)を作成す
る。このとき、各小矩形(1)、(2)、(3)、・・・・・(2
4)の画像データは複数のドットによって構成され、かつ
複数の各ドット毎に表示色番号あるいはパレット番号を
持っている。そして、各小矩形(1)、(2)、(3)、・・・
・・(24)毎の画像はそのドット全体によって表示され
る。次いで、変形対象全体が滑らかに変形されるよう
に、所定の変形処理(例えば、後述の座標変換処理)に
従って各小矩形(1)、(2)、(3)、・・・・・(24)を図1
(b)に示すような異なる四角形(1)’、(2)’、
(3)’、・・・・・(24)’にそれぞれ変形する。例え
ば、図2に示すように小矩形(6)は四角形(6)’に変形さ
れ、小矩形(1)は四角形(1)’に変形される。
Embodiments of the present invention will be described below with reference to the drawings. Description of Principle of the Present Invention First, the principle of the present invention will be described. FIG. 1 is a diagram showing the principle of the polygon division transformation method. FIG. 1A shows a transformation target having image data before transformation, and the transformation target image data is in a bit array format, and the image (picture) of the “eye” is shown.
It represents A. In order to transform this image data, first, the entire transformation target is divided into 4 vertically and 6 horizontally and a total of 2
Create four small rectangles (1), (2), (3), ... (24). At this time, each small rectangle (1), (2), (3), ... (2
The image data of 4) is composed of a plurality of dots, and each of the plurality of dots has a display color number or a palette number. And each small rectangle (1), (2), (3), ...
..The image in every (24) is displayed by the whole dot. Then, the small rectangles (1), (2), (3), ... (24) are subjected to a predetermined transformation process (for example, coordinate conversion process described later) so that the entire transformation target is smoothly transformed. ) To Figure 1
Different squares (1) ', (2)', as shown in (b),
It is transformed into (3) ', ... (24)'. For example, as shown in FIG. 2, the small rectangle (6) is transformed into a quadrangle (6) ', and the small rectangle (1) is transformed into a quadrangle (1)'.

【0018】この過程では、各小矩形(1)、(2)、(3)、
・・・・・(24)の変形に伴って、それぞれの小矩形に含
まれるビット配列形式の画像データの配列が所定のデー
タ変換処理(例えば、後述のいわゆるライン貼り付け処
理)に従って変形する。すなわち、ドットの配列が変形
の程度に応じて変わることになる。したがって、変形後
の四角形(1)’、(2)’、(3)’、・・・・・(24)を全体
として合成すると、図1(b)に示すように、変形した
「目」の画像(絵)Bが得られる。この場合、変形対象
の画像データの配列に対して各小矩形(1)、(2)、(3)、
・・・・・(24)毎に変形処理が行われるから、従来のよ
うに全く異なる全体の画像データを予め持つ必要がな
く、少ないメモリ容量でビット配列形式の画像を自由に
変形できる。また、変形対象を複数の小矩形(1)、(2)、
(3)、・・・・・(24)に分割し、各小矩形(1)、(2)、
(3)、・・・・・(24)毎に変形処理が行われるので、変
形に自由度があり、予めメモリに多くのデータを持たな
くても、画像を滑らかに変形することが可能になる。
In this process, each small rectangle (1), (2), (3),
.. (24), the array of the image data in the bit array format included in each small rectangle is modified according to a predetermined data conversion process (for example, so-called line pasting process described later). That is, the dot arrangement changes depending on the degree of deformation. Therefore, when the deformed squares (1) ', (2)', (3) ', ... (24) are combined as a whole, as shown in FIG. The image (picture) B is obtained. In this case, each small rectangle (1), (2), (3), for the array of image data to be transformed,
Since the transformation process is performed for each (24), it is not necessary to previously have completely different whole image data as in the conventional case, and a bit array format image can be freely transformed with a small memory capacity. In addition, the transformation target is a plurality of small rectangles (1), (2),
Divide into (3), (24) and each small rectangle (1), (2),
(3) The deformation process is performed every (24), so there is a degree of freedom in deformation, and it is possible to smoothly deform an image without having a large amount of data in memory beforehand. Become.

【0019】特に、変形対象の内部にある同一行あるい
同一列のうちの少なくとも1つを形成する複数個の小多
角形の頂点を所定の曲線パラメータに従って移動させる
変形法を使用すれば、変形後のすべての四角形(1)’、
(2)’、(3)’、・・・・・(24)の位置データ(例えば、
座標)を持っておく必要がなく、例えば曲線パラメータ
として数点(例えば、4点)分の座標だけを持っていれ
ばよく、少ない変形データで滑らかな画像変形を行わせ
ることができる。さらに、この変形法で、曲線の両端の
座標を変形対象の外枠上に設定すると、外枠の形を変え
ることなく、内部の小多角形のみを変形することがで
き、画像データの外形(例えば、大きさ)を変えずに、
内部の形のみを変えたい場合に有効である。
In particular, if the deformation method of moving the vertices of a plurality of small polygons forming at least one of the same row or the same column inside the object to be deformed according to a predetermined curve parameter is used, All subsequent squares (1) ',
Position data of (2) ', (3)', ... (24) (for example,
It is not necessary to have the coordinates), and for example, only the coordinates of several points (for example, four points) need to be provided as the curve parameters, and smooth image transformation can be performed with a small amount of transformation data. Furthermore, if the coordinates of both ends of the curve are set on the outer frame to be transformed by this transformation method, only the small polygon inside can be transformed without changing the shape of the outer frame. For example, without changing the size)
This is effective when you want to change only the internal shape.

【0020】次に、上記原理に基づく本発明の具体的な
実施例について説明する。画像変形装置の構成 図3は本発明に係る画像変形方法を実現する画像変形装
置の第1実施例を示す構成図である。図3において、画
像変形装置は大きく分けてCPU31、入力操作子3
2、記憶装置33、画像信号発生回路(Video Display
Prosseser:以下VDPという)34、VRAM35お
よびTVディスプレイ36によって構成される。CPU
31は装置全体を制御するもので、入力操作子32から
画像変形指令が入力されると、その指令情報に対応すべ
く内部のメモリに格納されている制御プログラムに基づ
いて記憶装置33に記憶されている変形対象としてのビ
ット配列形式の画像データ41を読み出してVDP34
に出力するとともに、この画像データ41に対して多角
形分割変形処理を施した後、変形後のビット配列形式の
画像データをVDP34に出力する。また、CPU31
は内部レジスタ31aを有しており、内部レジスタ31
aには後述の図4に示すような各小矩形の格子点座標等
が格納されるようになっている。
Next, a specific embodiment of the present invention based on the above principle will be described. Configuration of Image Deformation Apparatus FIG. 3 is a configuration diagram showing a first embodiment of an image transformation apparatus for realizing the image transformation method according to the present invention. In FIG. 3, the image transformation apparatus is roughly divided into a CPU 31 and an input operator 3.
2. Storage device 33, image signal generation circuit (Video Display
Prosseser: VDP) 34, VRAM 35 and TV display 36. CPU
Reference numeral 31 controls the entire apparatus. When an image deformation command is input from the input operator 32, it is stored in the storage device 33 based on the control program stored in the internal memory so as to correspond to the command information. The image data 41 in the bit array format as the transformation target is read out by the VDP 34
In addition to outputting the image data 41 to the VDP 34, the image data 41 is subjected to the polygon division transformation process, and the transformed image data in the bit array format is output to the VDP 34. Also, the CPU 31
Has an internal register 31a.
In a, the coordinates of the grid points of each small rectangle as shown in FIG. 4 to be described later are stored.

【0021】入力操作子(変形態様指定手段)32はオ
ペレータによって操作されるもので、ビット配列形式の
画像データの配列をどのように変形させるかを指定する
(つまり、変形を行わせるきっかけを与えるための)第
1の変形スイッチ51および第2の変形スイッチ52を
有している。第1の変形スイッチ51は、例えば変形前
の格子点座標42で表される原画像に対して、変形後の
格子点座標43で表される第1の変形画像のような変形
(変形データ1)を与える指令を出力する。第2の変形
スイッチ52は、例えば変形前の格子点座標42で表さ
れる原画像に対して、変形後の格子点座標44で表され
る第2の変形画像のような変形(変形データ2)を与え
る指令を出力する。なお、各変形スイッチ51、52は
単独操作のプッシュスイッチでもよいし、あるいは複数
のスイッチからなるスイッチボード、キーボード等でも
よい。また、入力操作子32としてスイッチボード等の
他に、マウス、トラックボール等を用いてもよい。
The input operator (deformation mode designating means) 32 is operated by an operator and designates how the array of image data in the bit array format is to be deformed (that is, gives an opportunity to perform the deformation). (For the purpose) and a second deformation switch 52. The first transformation switch 51, for example, transforms the original image represented by the grid point coordinates 42 before the transformation into a transformation (transformation data 1) like the first transformed image represented by the grid point coordinates 43 after the transformation. ) Is output. The second transformation switch 52, for example, transforms the original image represented by the lattice point coordinates 42 before transformation into a second transformed image represented by the lattice point coordinates 44 after transformation (deformation data 2 ) Is output. Each of the transformation switches 51 and 52 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 input operator 32, a mouse, a trackball, or the like may be used instead of the switch board or the like.

【0022】記憶装置(記憶手段)33は変形対象とな
るビット配列形式の画像データ41、変形対象(原画
像)をどのように矩形分割するかを示す変形前の格子点
座標(変形前の小多角形の頂点の座標)42、矩形分割
された各小矩形をどのように変形するかを示す変形デー
タ1に対応する変形後の格子点座標(変形後の異なる小
多角形の頂点の座標)43および矩形分割された各小矩
形をどのように変形するかを示す変形データ2に対応す
る変形後の格子点座標(変形後の異なる小多角形の頂点
の座標)44を記憶している。例えば、格子点座標43
は第1の変形画像に対応し、格子点座標44は第2の変
形画像に対応しているとともに、これらの変形画像を処
理する指令はそれぞれ第1の変形スイッチ51、第2の
変形スイッチ52から出力される。VDP34はCPU
31から与えられた変形前のビット配列形式の画像デー
タや変形後のビット配列形式の画像データをVRAM3
4に書き込む。VRAM34としては、例えば半導体メ
モリが用いられ、表示する画像を1画面単位で記憶す
る。VRAM34に書き込まれた画像データはTVディ
スプレイ(表示手段)36によって表示される。上記C
PU31は分割手段、変形手段、画像データ作成手段、
座標変換手段、データ変換手段を構成するとともに、さ
らに画像変形制御手段を構成する。
The storage device (storage means) 33 stores the image data 41 in the bit array format to be deformed and the grid point coordinates before deformation (small coordinates before deformation) indicating how to divide the deformation target (original image) into rectangles. (The coordinates of the vertices of the polygon) 42, the coordinates of the grid points after the deformation corresponding to the deformation data 1 indicating how to deform each of the small rectangles that have been divided into rectangles (the coordinates of the vertices of the different small polygons after the deformation) 43 and the transformed grid point coordinates (the coordinates of the vertices of different small polygons after transformation) 44 corresponding to the transformation data 2 indicating how to transform each of the small rectangles divided into rectangles are stored. For example, the grid point coordinates 43
Corresponds to the first deformed image, the grid point coordinates 44 correspond to the second deformed image, and the commands for processing these deformed images are the first deforming switch 51 and the second deforming switch 52, respectively. Is output from. VDP34 is a CPU
The image data in the bit array format before the transformation and the image data in the bit array format after the transformation given from 31 are stored in the VRAM 3
Write to 4. A semiconductor memory, for example, is used as the VRAM 34, and stores an image to be displayed on a screen-by-screen basis. The image data written in the VRAM 34 is displayed on the TV display (display means) 36. C above
PU31 is a dividing means, a deforming means, an image data creating means,
The coordinate transformation means and the data transformation means are constituted, and further the image deformation control means is constituted.

【0023】ここで、本実施例では変形前のビット配列
形式の画像データを有する変形対象に対して図4に示す
ように、多数の小矩形に分割する処理が施される。この
場合、矩形分割された各小矩形の頂点に当る部分を格子
点と呼ぶことにする。図4の例では、変形対象を縦方向
にm分割し、横方向にn分割している。したがって、変
形対象は(m×n)個の小矩形に分割されることにな
り、各小矩形は左上端から右下端に行くに従って、小矩
形(0、0)、小矩形(0、1)、小矩形(0、2)、
・・・・・・・小矩形(m−1、n−1)としてそれぞ
れ表される。また、変形対象の左上端の格子点を格子点
(0、0)、その右隣の格子点を格子点(0、1)と呼
び、以下同様に右に行くに従って格子点(0、2)、格
子点(0、3)、と呼ぶことにする。したがって、右上
端の格子点は格子点(0、n)になる。次いで、格子点
(0、0)のすぐ下の格子点を格子点(1、0)と呼
び、以下同様に下に行くに従って格子点(2、0)、格
子点(3、0)と呼ぶことにする。したがって、左下端
の格子点は格子点(m、0)になる。また、右下端の格
子点は格子点(m、n)になる。
Here, in this embodiment, as shown in FIG. 4, the transformation target having the image data in the bit array format before transformation is divided into a large number of small rectangles. In this case, the portions corresponding to the vertices of each of the rectangle-divided small rectangles will be referred to as grid points. In the example of FIG. 4, the transformation target is vertically divided into m parts and horizontally divided into n parts. Therefore, the transformation target is divided into (m × n) small rectangles, and the small rectangles (0, 0) and small rectangles (0, 1) go from the upper left end to the lower right end. , Small rectangle (0, 2),
..... Represented as small rectangles (m-1, n-1), respectively. Further, the grid point at the upper left end of the transformation target is called a grid point (0, 0), and the grid point on the right side thereof is called a grid point (0, 1). , Grid point (0, 3). Therefore, the grid point at the upper right end becomes the grid point (0, n). Next, the grid point immediately below the grid point (0, 0) is called a grid point (1, 0), and hereinafter, the grid point (2, 0) and the grid point (3, 0) are also called downward. I will decide. Therefore, the grid point at the lower left corner becomes the grid point (m, 0). The grid point at the lower right corner is the grid point (m, n).

【0024】CPU31の内部レジスタ31aには図4
に示す各小矩形の格子点座標が記憶され、その様子は図
5のように示される。図5において、内部レジスタ31
aには各小矩形(0、0)、小矩形(0、1)、小矩形
(0、2)、・・・・・・・小矩形(m−1、n−1)
に対応する格子点の座標として、以下のように格納され
ている。なお、各格子点の座標はX軸(横方向)および
Y軸(縦方向)を基準とする2つの数値で表される。 格子点(0、0)のX座標 格子点(0、0)のY座標 格子点(0、1)のX座標 格子点(0、1)のY座標 ・ ・ 格子点(m、n)のX座標 格子点(m、n)のY座標
The internal register 31a of the CPU 31 has the configuration shown in FIG.
The grid point coordinates of each small rectangle shown in are stored, and the state is shown in FIG. In FIG. 5, the internal register 31
a is each small rectangle (0, 0), small rectangle (0, 1), small rectangle (0, 2), ... Small rectangle (m-1, n-1)
The coordinates are stored as follows as the coordinates of the grid point corresponding to. The coordinates of each grid point are represented by two numerical values based on the X axis (horizontal direction) and the Y axis (vertical direction). X coordinate of grid point (0,0) Y coordinate of grid point (0,0) X coordinate of grid point (0,1) Y coordinate of grid point (0,1) X coordinate Y coordinate of grid point (m, n)

【0025】一方、記憶装置33には変形対象(原画像
データを有する)をどのように矩形分割するかを示す変
形前の格子点座標42が格納されているが、この格子点
座標42をCPU31の内部レジスタ31aに記憶され
ている各小矩形(0、0)、小矩形(0、1)、小矩形
(0、2)、・・・・・・・小矩形(m−1、n−1)
の格子点座標にそれぞれ対応させて示すと、例えば図5
の右端に表すようになる。すなわち、両者は以下のよう
な対応関係になる。 格子点(0、0)のX座標……100(変形前の格子点
座標、以下同様) 格子点(0、0)のY座標……100 格子点(0、1)のX座標……110 格子点(0、1)のY座標……100 ・ ・ 格子点(m、n)のX座標……160 格子点(m、n)のY座標……140
On the other hand, the storage device 33 stores the grid point coordinates 42 before the deformation which indicates how the object to be transformed (having the original image data) is divided into rectangles. The grid point coordinates 42 are stored in the CPU 31. Small rectangles (0, 0), small rectangles (0, 1), small rectangles (0, 2), ... Small rectangles (m-1, n-) stored in the internal register 31a of 1)
When shown in correspondence with the respective grid point coordinates of
It will be shown on the right edge of. That is, the two have the following correspondence. X coordinate of grid point (0, 0) ... 100 (grid point coordinate before deformation, the same applies below) Y coordinate of grid point (0, 0) ... 100 X coordinate of grid point (0, 1) ... 110 Y coordinate of grid point (0, 1) ... 100 ... X coordinate of grid point (m, n) ... 160 Y coordinate of grid point (m, n) ... 140

【0026】また、記憶装置33には前述したように第
1の変形スイッチ51からの指令に対応する第1の変形
画像を矩形分割した場合の格子点座標43および第2の
変形スイッチ52からの指令に対応する第2の変形画像
を矩形分割した場合の格子点座標44が記憶されてい
る。例えば、第1の変形スイッチ51が操作されると、
このスイッチ51によって選択された変形番号に相当す
る変形後の格子点座標がCPU31の内部レジスタ31
aに格納され、第2の変形スイッチ52が操作される
と、このスイッチ52によって選択された変形番号に相
当する変形後の格子点座標がCPU31の内部レジスタ
31aに格納される。これらの格子点座標43、44を
CPU31の内部レジスタ31aに記憶されている各小
矩形(0、0)、小矩形(0、1)、小矩形(0、
2)、・・・・・・・小矩形(m−1、n−1)の格子
点座標にそれぞれ対応させて示すと、例えば図5の中央
の図のように表される。なお、変形1とは、第1の変形
スイッチ51からの指令に対応する第1の画像変形処理
のことであり、変形2とは、第2の変形スイッチ52か
らの指令に対応する第2の画像変形処理のことである。
したがって、変形1の格子点座標とは、第1の変形スイ
ッチ51からの指令に対応する第1の変形画像を矩形分
割した場合の格子点座標のことである。同様に、変形2
の格子点座標とは、第2の変形スイッチ52からの指令
に対応する第2の変形画像を矩形分割した場合の格子点
座標のことである。
As described above, the storage device 33 stores the grid point coordinates 43 and the second transformation switch 52 when the first transformation image corresponding to the instruction from the first transformation switch 51 is divided into rectangles. Lattice point coordinates 44 when the second modified image corresponding to the command is divided into rectangles are stored. For example, when the first transformation switch 51 is operated,
The transformed grid point coordinates corresponding to the transformation number selected by the switch 51 are the internal register 31 of the CPU 31.
When the second deformation switch 52 is stored in a and the second deformation switch 52 is operated, the grid point coordinates after deformation corresponding to the deformation number selected by this switch 52 are stored in the internal register 31a of the CPU 31. These grid point coordinates 43, 44 are stored in the internal register 31a of the CPU 31 as small rectangles (0, 0), small rectangles (0, 1), small rectangles (0, 0).
2), ... Shown in correspondence with the grid point coordinates of the small rectangle (m-1, n-1), for example, it is represented as shown in the center of FIG. The modification 1 is the first image modification process corresponding to the command from the first modification switch 51, and the modification 2 is the second image modification process corresponding to the command from the second modification switch 52. This is image transformation processing.
Therefore, the grid point coordinates of modification 1 are the grid point coordinates when the first modified image corresponding to the command from the first modification switch 51 is divided into rectangles. Similarly, modification 2
The grid point coordinates are the grid point coordinates when the second modified image corresponding to the command from the second modification switch 52 is divided into rectangles.

【0027】次に、作用を説明する。メインプログラム 図6は画像変形処理のメインプログラムを示すフローチ
ャートである。このプログラムがスタートすると、まず
ステップS10でキー情報取り込み処理を行う。これ
は、入力操作子32における第1の変形スイッチ51あ
るいは第2の変形スイッチ52の操作情報を入力するも
のである。次いで、ステップS12で変形スイッチが押
されたか否かを判別し、何れのスイッチも押されていな
ければ、今回のルーチンを終了し、次回のルーチンで再
びステップS10を実行する。このとき、例えばスイッ
チフラグが設けられ、何れのスイッチも押されていなけ
れば、スイッチフラグが[0]のままである。一方、何
れかのスイッチが押されると、スイッチフラグを[1]
にセットするとともに、ステップS14で押された変形
スイッチの番号を判別する。その後、ステップS16あ
るいはステップS18で押された変形スイッチの番号に
応じた変形後の格子点座標をCPU31の内部レジスタ
31aに格納し、次いで、ステップS20に進む。
Next, the operation will be described. Main Program FIG. 6 is a flowchart showing the main program of the image transformation process. When this program starts, first in step S10, key information fetching processing is performed. This is for inputting operation information of the first deformation switch 51 or the second deformation switch 52 in the input operator 32. Next, in step S12, it is determined whether or not the deformation switch is pressed. If neither switch is pressed, the routine of this time is ended, and step S10 is executed again in the next routine. At this time, for example, a switch flag is provided, and if none of the switches is pressed, the switch flag remains [0]. On the other hand, when any switch is pressed, the switch flag is set to [1].
And the number of the deformation switch pressed in step S14 is determined. After that, the lattice point coordinates after deformation corresponding to the number of the deformation switch pressed in step S16 or step S18 are stored in the internal register 31a of the CPU 31, and then the process proceeds to step S20.

【0028】具体的には、第1の変形スイッチ51が押
された場合には、ステップS16に進んで記憶装置33
内の第1の変形画像を矩形分割した場合の格子点座標
(つまり、変形データ1に対応する変形後の格子点座
標)43をコピーしてCPU31の内部レジスタ31a
に格子点毎に格納する。したがって、例えば図5に示さ
れるような変形前の格子点座標が記憶されていたとする
と、以下に示すように格子点座標43の値が内部レジス
タ31aに順次格納されることになる。 格子点(0、0)のX座標……90(変形データ1の格
子点座標、以下同様) 格子点(0、0)のY座標……100 格子点(0、1)のX座標……105 格子点(0、1)のY座標……95 ・ ・ 格子点(m、n)のX座標……140 格子点(m、n)のY座標……130
Specifically, when the first deformation switch 51 is pressed, the process proceeds to step S16 and the storage device 33.
Internal coordinate 31a of the CPU 31 by copying the grid point coordinates (that is, the grid point coordinates after deformation corresponding to the deformation data 1) 43 when the first deformed image in the above is divided into rectangles.
It stores in every grid point in. Therefore, if the grid point coordinates before deformation as shown in FIG. 5 are stored, the values of the grid point coordinates 43 are sequentially stored in the internal register 31a as shown below. X coordinate of grid point (0, 0) ... 90 (coordinate of grid point of deformation data 1, the same applies below) Y coordinate of grid point (0, 0) ... 100 X coordinate of grid point (0, 1). 105 Y coordinate of grid point (0, 1) ... 95 ... X coordinate of grid point (m, n) ... 140 Y coordinate of grid point (m, n) ... 130

【0029】一方、第2の変形スイッチ52が押された
場合には、ステップS18に進んで記憶装置33内の第
2の変形画像を矩形分割した場合の格子点座標(つま
り、変形データ2に対応する変形後の格子点座標)44
をコピーしてCPU31の内部レジスタ31aに格子点
毎に格納する。したがって、例えば図5に示されるよう
な変形前の格子点座標が記憶されていたとすると、以下
に示すように格子点座標44の値が内部レジスタ31a
に順次格納されることになる。 格子点(0、0)のX座標……90(変形データ2の格
子点座標、以下同様) 格子点(0、0)のY座標……100 格子点(0、1)のX座標……105 格子点(0、1)のY座標……100 ・ ・ 格子点(m、n)のX座標……170 格子点(m、n)のY座標……140
On the other hand, if the second transformation switch 52 is pressed, the process proceeds to step S18, where the second transformation image in the storage device 33 is divided into rectangles, that is, the grid point coordinates (that is, transformation data 2 Corresponding lattice point coordinates after deformation) 44
Is stored in the internal register 31a of the CPU 31 for each grid point. Therefore, if the grid point coordinates before deformation as shown in FIG. 5 are stored, the value of the grid point coordinates 44 is stored in the internal register 31a as shown below.
Will be stored in sequence. X coordinate of grid point (0, 0) ... 90 (coordinate of grid point of deformation data 2, the same applies below) Y coordinate of grid point (0, 0) ... 100 X coordinate of grid point (0, 1). 105 Y coordinate of grid point (0, 1) ... 100 ... X coordinate of grid point (m, n) ... 170 Y coordinate of grid point (m, n) ... 140

【0030】ステップS16あるいはステップS18を
経ると、続くステップS20に進み、記憶装置33から
変形対象となる画像データの中から、処理すべき小矩形
(i、j)に含まれる画像データを読み込んで小矩形の
変形処理を行う(詳細はサブルーチンで後述)。これに
より、小矩形(i、j)についてビット配列形式の画像
データの配列が変形し、変形後の画像が得られることに
なる。小矩形(i、j)とは、例えば図1(a)に示す
ように変形対象を複数に分割した場合の小矩形(1)、
(2)、(3)、・・・・・(24)の何れかを表す一般的な指定
状態を示すものである。なお、ステップS20の処理で
は、小矩形(i、j)で示される変形後の画像データを
VDP34に順次転送することが行われ、これにより、
最終的にすべての小矩形(i、j)に対応する変形した
画像データが合成されて変形画像が得られることにな
る。次いで、ステップS22ですべての小矩形(i、
j)に対して画像の変形処理をしたか否かを判別し、N
OであればステップS20に戻って同様の処理を繰り返
す。そして、すべての小矩形(i、j)に対して画像の
変形処理が終了すると、ステップS22からYESに抜
けて本ルーチンを終了する。このようにして、ステップ
S20およびステップS22において各小矩形単位で画
像の変形処理が行われる。
After step S16 or step S18, the process proceeds to the following step S20, and the image data contained in the small rectangle (i, j) to be processed is read from the image data to be transformed from the storage device 33. Deformation processing of a small rectangle is performed (details will be described later in a subroutine). As a result, the array of image data in the bit array format for the small rectangle (i, j) is transformed, and the transformed image is obtained. The small rectangle (i, j) is, for example, a small rectangle (1) when the transformation target is divided into a plurality of pieces as shown in FIG.
(2), (3), ... It shows a general designated state indicating any one of (24). In the process of step S20, the transformed image data indicated by the small rectangle (i, j) is sequentially transferred to the VDP 34, and as a result,
Finally, the transformed image data corresponding to all the small rectangles (i, j) are combined to obtain a transformed image. Then, in step S22, all small rectangles (i,
It is determined whether or not the image transformation process is performed on j), and N
If it is O, the process returns to step S20 to repeat the same processing. When the image transformation processing is completed for all the small rectangles (i, j), the process exits from step S22 to YES, and this routine is completed. In this way, in steps S20 and S22, the image transformation process is performed for each small rectangle.

【0031】小矩形変形処理のサブルーチン 次に、図7はメインプログラムの小矩形変形処理(ステ
ップS20)のサブルーチンを示すフローチャートであ
る。このサブルーチンに移行すると、ステップS30で
小矩形(i、j)の周囲4点の変形前の座標を、記憶装
置33内の変形前の格子点座標42より得る処理を行
う。言換えれば、記憶装置33に記憶されている変形前
の格子点座標42から、処理すべき小矩形の頂点に当る
4つの座標を読み出す。例えば、小矩形(i、j)の場
合、頂点は格子点(i、j)、(i、j+1)、格子点
(i+1、j)、格子点(i+1、j+1)となり、こ
れらが変形前の小矩形の座標である。
Subroutine of Small Rectangle Deformation Processing Next, FIG. 7 is a flowchart showing a subroutine of the small rectangle transformation processing (step S20) of the main program. In this subroutine, in step S30, the coordinates before deformation of the four points around the small rectangle (i, j) are obtained from the grid point coordinates 42 before deformation in the storage device 33. In other words, the four coordinates corresponding to the vertices of the small rectangle to be processed are read from the grid point coordinates 42 before deformation stored in the storage device 33. For example, in the case of a small rectangle (i, j), the vertices are grid points (i, j), (i, j + 1), grid points (i + 1, j), grid points (i + 1, j + 1), and these are The coordinates of the small rectangle.

【0032】次いで、ステップS32で小矩形(i、
j)の周囲4点の変形後の座標を、CPU31における
内部レジスタ31aの格子点座標より得る処理を行う。
言換えれば、CPU31の内部レジスタ31aに格納さ
れている変形後の格子点座標から、処理すべき小矩形の
頂点に当る4つの座標を読み出す。例えば、同様に小矩
形(i、j)の場合、頂点は格子点(i、j)、(i、
j+1)、格子点(i+1、j)、格子点(i+1、j
+1)となり、これらが変形後の四角形の座標である。
ステップS30、ステップS32により、変形対象の画
像全体が滑らかに変形されるように、各小矩形を異なる
四角形にそれぞれ変形する処理が行われる。この処理
(変形処理に相当)は座標変換処理であり、この座標変
換処理では、分割された各小矩形の頂点の座標を求め、
次いで、変形対象全体が滑らかに変形されるような変形
後の各小四角形の頂点の座標を算出し、この算出した座
標に基づいて変形後の異なる小四角形の形状を決定する
ことにより、分割された各小矩形を異なる小四角形に変
形する。
Then, in step S32, a small rectangle (i,
Processing for obtaining the transformed coordinates of the four surrounding points of j) from the grid point coordinates of the internal register 31a in the CPU 31 is performed.
In other words, four coordinates corresponding to the vertices of the small rectangle to be processed are read from the transformed grid point coordinates stored in the internal register 31a of the CPU 31. For example, similarly, in the case of a small rectangle (i, j), the vertices are grid points (i, j), (i, j
j + 1), grid point (i + 1, j), grid point (i + 1, j
+1), which are the coordinates of the quadrangle after the transformation.
In steps S30 and S32, processing is performed to transform each small rectangle into a different quadrangle so that the entire image to be transformed is smoothly transformed. This process (corresponding to the transformation process) is a coordinate conversion process. In this coordinate conversion process, the coordinates of the vertices of the divided small rectangles are calculated,
Then, the coordinates of the vertices of each small quadrangle after the deformation are calculated so that the entire deformation target is smoothly deformed, and the shape of the different small quadrangle after the deformation is determined based on the calculated coordinates, so that the divided small quadrangle is divided. Each small rectangle is transformed into a different small rectangle.

【0033】次いで、ステップS34でいわゆるライン
貼り付け法(データ変換処理に相当)により各小矩形内
の画像データの配列を変形する処理を行う。ライン貼り
付け法とは、変形元である分割した各小多角形のビット
配列形式の画像データの配列を複数のラインに分割し、
分割した各ラインを変形先の各多角形の対応する位置に
順次転送するとともに、転送に際して転送先の大きさに
合うように拡大又は縮小させながらそれぞれラインとし
て貼り付けていくことにより、変形後の各小多角形の画
像データの配列を作成することをいう。なお、いわゆる
ライン貼り付け法の処理内容は、実施例を説明した後に
まとめて詳述する(図19〜図36参照)。ライン貼り
付け法は、具体的には図8(a)に示すように変形元と
なるビット配列形式の画像データを有する小矩形Cの画
像データの配列を複数のライン1〜ラインnに分割し、
分割した各ライン1〜nを変形先の四角形Dの対応する
位置に、転送先の大きさに合うように拡大又は縮小させ
ながらそれぞれライン1’〜ラインn’として貼り付け
ていくものである。このように、小矩形Cの画像データ
の配列を複数のライン1〜ラインnに分けて変形させな
がら貼り付けることで、画像の変形処理を行うことによ
り、元画像を滑らかに変形させることが可能になる。
Next, in step S34, the so-called line pasting method (corresponding to the data conversion process) is performed to modify the array of image data in each small rectangle. The line pasting method divides the array of the image data in the bit array format of each divided small polygon that is the transformation source into a plurality of lines,
Each of the divided lines is sequentially transferred to the corresponding position of each polygon of the transformation destination, and each line is pasted while being enlarged or reduced so as to fit the size of the destination at the time of the transformation. This refers to creating an array of image data for each small polygon. The processing contents of the so-called line pasting method will be described in detail collectively after describing the embodiment (see FIGS. 19 to 36). Specifically, as shown in FIG. 8A, the line pasting method divides an array of image data of a small rectangle C having image data in a bit array format which is a transformation source into a plurality of lines 1 to n. ,
Each of the divided lines 1 to n is pasted as a line 1'to a line n'to a corresponding position of the transformation destination quadrangle D while enlarging or reducing it so as to match the size of the transfer destination. In this way, the original image can be smoothly deformed by performing the image deformation processing by dividing the array of the image data of the small rectangle C into a plurality of lines 1 to line n and attaching them while deforming them. become.

【0034】これにより、各小矩形は四角形へと変形処
理され、最終的にすべての小矩形(i、j)に対応する
画像データの配列が変形し、変形画像が得られることに
なる。次いで、ステップS36でVDP34に変形済み
の画像データを逐次転送する。これにより、小矩形
(i、j)で示される変形後の画像データがVDP34
に転送され、最終的にすべての小矩形(i、j)に対応
する変形した画像を合成することにより、TVディスプ
レイ36に変形後の画像が表示される。ステップS36
の処理を経ると、メインプログラムにリターンする。
As a result, each small rectangle is transformed into a quadrangle, and finally the image data array corresponding to all the small rectangles (i, j) is transformed to obtain a transformed image. Next, in step S36, the transformed image data is sequentially transferred to the VDP 34. As a result, the transformed image data represented by the small rectangle (i, j) becomes VDP34.
Then, the transformed images corresponding to all the small rectangles (i, j) are finally combined to display the transformed image on the TV display 36. Step S36
After the processing of, returns to the main program.

【0035】本実施例の格子点算出処理 次に、本実施例の特徴部分である変形処理(つまり、変
形対象の内部にある同一行あるい同一列のうちの少なく
とも1つを形成する複数個の小多角形の頂点を、所定の
曲線パラメータに従って移動したとき、変形対象が滑ら
かに変形されるように他の各格子点を移動させ、移動後
の各格子点の座標を算出する処理)について説明する。
まず、この変形処理の対象となる変形対象の例は図9
(a)に示され、変形後の例は図9(b)に示される。
図9(a)に示すように、変形対象を予め縦m分割(例
えば、4分割)、横n分割(例えば、6分割)して合計
でm×n個(例えば、24個)の小矩形に分割する。こ
のとき、各小矩形の画像データはドットによって構成さ
れ、かつ各ドット毎に表示色番号あるいはパレット番号
を持っている。そして、各小矩形毎の画像はそのドット
全体によって表示される。
Lattice point calculation processing of this embodiment Next, a modification processing (that is, a plurality of forming at least one of the same row or the same column inside the object to be modified) which is a characteristic part of this embodiment. When the vertices of the small polygon are moved according to the prescribed curve parameters, the other grid points are moved so that the deformation target is smoothly deformed, and the coordinates of the moved grid points are calculated. explain.
First, an example of a transformation target that is the target of this transformation processing is shown in FIG.
FIG. 9B shows the example shown in FIG. 9A after the deformation.
As shown in FIG. 9A, the transformation target is divided vertically m (for example, 4 divisions) and horizontal n (for example, 6 divisions) in advance, and a total of m × n (for example, 24) small rectangles. Split into. At this time, the image data of each small rectangle is composed of dots, and each dot has a display color number or a palette number. Then, the image for each small rectangle is displayed by the entire dots.

【0036】さて、変形対象の内部にある同一行を形成
する複数個の小多角形の頂点を所定の曲線パラメータに
従って移動したときのその他の各小矩形の頂点の座標を
算出する処理について説明する。この例は、あたかも変
形対象の内部の同1行にある複数の小矩形の頂点を上方
に緩やかに持ち上げたような変形を行うケースに相当す
る。ここで、本実施例では格子点の表し方と、格子点の
座標とについて、次のような取り決めにしている。後述
の実施例においても同様である。例えば、格子点(p、
q)という場合、最初の記号でy軸方向の位置を表示
し、次の記号でx軸方向の位置を表示する。すなわち、
格子点(p、q)=(y軸方向の位置、x軸方向の位
置)となり、pはy軸方向の位置に相当し、qはx軸方
向の位置に相当する。これに対して、座標の表示は数学
上で一般的に用いられているものと同様に、最初の記号
でx軸方向の位置を表示し、次の記号でy軸方向の位置
を表示する。したがって、格子点(p、q)の座標が座
標(xd、yd)という場合、xdがx軸方向の位置
で、ydがy軸方向の位置となる。すなわち、(xd、
yd)=(x軸方向の位置、y軸方向の位置)となる。
このように、両者の表示方法が逆になっているので、後
述のフローチャートでは間違えないように理解する必要
がある。なお、適宜、説明の都合上、例えば格子点(座
標:x2、yp)というようにして該当する格子点につ
いて、その座標のみを表示することも行う。
Now, the process of calculating the coordinates of the vertices of other small rectangles when the vertices of a plurality of small polygons forming the same line inside the transformation target are moved according to a predetermined curve parameter will be described. . This example corresponds to a case in which the vertices of a plurality of small rectangles in the same line inside the deformation target are gently lifted upward. Here, in the present embodiment, the following arrangement is made regarding how to represent the grid points and the coordinates of the grid points. The same applies to the examples described below. For example, grid points (p,
In the case of q), the first symbol indicates the position in the y-axis direction, and the second symbol indicates the position in the x-axis direction. That is,
Lattice point (p, q) = (position in y-axis direction, position in x-axis direction), p corresponds to position in y-axis direction, and q corresponds to position in x-axis direction. On the other hand, the coordinates are displayed in the same manner as generally used in mathematics, with the first symbol indicating the position in the x-axis direction and the second symbol indicating the position in the y-axis direction. Therefore, when the coordinates of the grid point (p, q) are coordinates (xd, yd), xd is the position in the x-axis direction and yd is the position in the y-axis direction. That is, (xd,
yd) = (position in the x-axis direction, position in the y-axis direction).
As described above, since the display methods of the both are reversed, it is necessary to understand so as not to make a mistake in the flowchart described later. For convenience of description, only the coordinates of the corresponding grid point such as a grid point (coordinates: x2, yp) may be displayed as appropriate.

【0037】さて、変形データとして予め位置が判明し
ているために、位置データの保有が可能なものは、図9
(a)に示す変形前における変形対象の小矩形の頂点で
あり、これらの外枠の2つの頂点の位置データは(x
1、y1)、(x2、y2)なる座標で表される。ま
た、変形前における変形対象の同一行を形成する2つの
小多角形の頂点(x1、p)、(x2、p)も変形デー
タとして予め位置が判明している。なお、これらの小矩
形の頂点は、移動の基準となるものであり、以下、移動
基準格子点という。なお、各小矩形の頂点を、適宜、格
子点という。さらに、図面の説明上、横方向をx座標、
縦方向をy座標とし、x座標は図面上、左から右へ大き
く、y座標は上から下へ大きくなるものとする。
As shown in FIG. 9, the position data can be retained because the position is known in advance as the deformation data.
The position data of the two vertices of these outer frames are the vertices of the small rectangle to be transformed before the transformation shown in (a).
It is represented by the coordinates 1, y1) and (x2, y2). Further, the positions of the vertices (x1, p) and (x2, p) of the two small polygons forming the same row to be deformed before the deformation are known in advance as the deformation data. The vertices of these small rectangles serve as a reference for movement, and are hereinafter referred to as movement reference grid points. The vertices of each small rectangle are referred to as grid points as appropriate. Further, in the description of the drawings, the horizontal direction is x coordinate,
It is assumed that the vertical direction is the y coordinate, the x coordinate is larger from left to right and the y coordinate is larger from top to bottom on the drawing.

【0038】一方、変形対象の同一行を形成する複数の
小多角を曲線パラメータに従って移動させるために変形
データとして持っているものは、図9(b)に示すよう
に、曲線パラメータとしての曲線の両端の座標(xb
1、yb1)、(xb4、yb4)と、曲線の曲がり方
を制御する座標(xb2、yb2)、(xb3、yb
3)というデータである。記憶装置33には図10に示
すように、上記各情報を格納する変形データエリアがあ
る。 曲線のパラメータ1のx座標……xb1 曲線のパラメータ1のy座標……yb1 曲線のパラメータ2のx座標……xb2 曲線のパラメータ2のy座標……yb2 曲線のパラメータ3のx座標……xb3 曲線のパラメータ3のy座標……yb3 曲線のパラメータ4のx座標……xb4 曲線のパラメータ4のy座標……yb4
On the other hand, a plurality of small polygons forming the same row to be deformed, which have deformation data for moving in accordance with the curve parameters, have a curve as a curve parameter as shown in FIG. 9B. Coordinates of both ends (xb
1, yb1), (xb4, yb4), and coordinates (xb2, yb2), (xb3, yb) that control how the curve bends.
The data is 3). As shown in FIG. 10, the storage device 33 has a modified data area for storing the above information. X-coordinate of parameter 1 of curve ... xb1 y-coordinate of parameter 1 of curve ... yb1 x-coordinate of parameter 2 of curve ... xb2 y-coordinate of parameter 2 of curve ... yb2 x-coordinate of parameter 3 of curve ... xb3 Y-coordinate of parameter 3 of curve ... yb3 x-coordinate of parameter 4 of curve ... xb4 y-coordinate of parameter 4 of curve ... yb4

【0039】図11は変形後の格子点座標算出処理のル
ーチンを示すフローチャートである。このルーチンは、
変形対象の内部にある同一行を形成する複数個の小多角
形の頂点を所定の曲線パラメータに従って移動したと
き、変形対象全体が滑らかに変形されるように他の小多
角形の頂点を移動させ、移動した他の小多角形の頂点を
基準となる格子点の移動後の頂点(適宜、変形移動格子
点という)に基づいて算出するものである。そして、そ
の後、算出した各頂点に対応して変形後の各小多角形の
形状が決定され、変形後の小多角形に対応するように元
画像が順次変形処理されて変形後の全体画像が作成され
ることになる。
FIG. 11 is a flow chart showing the routine of the lattice point coordinate calculation processing after the transformation. This routine
When the vertices of a plurality of small polygons forming the same line inside the transformation target are moved according to the predetermined curve parameters, the vertices of the other small polygons are moved so that the transformation target is deformed smoothly. The calculated vertexes of the other small polygons are calculated based on the vertexes after the movement of the lattice points serving as the reference (appropriately referred to as deformed movement lattice points). Then, the shape of each deformed small polygon is determined corresponding to each calculated vertex, and the original image is sequentially deformed so as to correspond to the deformed small polygon. Will be created.

【0040】最初に、ベジェ曲線の発生方法について説
明する。図12に示すように曲線の両端の座標(x1、
y1)、(x4、y4)と、曲線の曲がり方を制御する
座標(x2、y2)、(x3、y3)とを決めると、同
図(a)、(b)にそれぞれ示すようなベジェ曲線10
1、102を描くことが可能である。ベジェ曲線の場
合、その座標(x、y)は以下に示す(1)式、(2)
式によって求めることができる。 x=(1−t)3・x1+3t・(1−t)2・x2 +3t2・(1−t)・x3+t3・x4……(1) y=(1−t)3・y1+3t・(1−t)2・y2 +3t2(1−t)・y3+t3・y4……(2) ただし、0≦t≦1 ここで、t=0のとき上記(1)式、(2)式に代入す
ると、x=x1、y=y1となり、これは一方の端点を
表す。また、t=1のとき上記(1)式、(2)式に代
入すると、x=x4、y=y4となり、これは他方の端
点を表す。
First, a method of generating a Bezier curve will be described. As shown in FIG. 12, the coordinates (x1,
If y1), (x4, y4) and the coordinates (x2, y2), (x3, y3) that control the bending of the curve are determined, Bezier curves as shown in FIGS. 10
It is possible to draw 1, 102. In the case of a Bezier curve, its coordinates (x, y) are expressed by equations (1) and (2) below.
It can be calculated by a formula. x = (1-t) 3 · x1 + 3t · (1-t) 2 · x2 + 3t 2 · (1-t) · x3 + t 3 · x4 ...... (1) y = (1-t) 3 · y1 + 3t · (1 -T) 2 · y2 + 3t 2 (1-t) · y3 + t 3 · y4 (2) where 0 ≦ t ≦ 1 where t = 0 is substituted into the above formulas (1) and (2). Then, x = x1 and y = y1, which represent one end point. Further, when t = 1, when substituting into the equations (1) and (2), x = x4 and y = y4, which represent the other end point.

【0041】本ルーチンでは、上記ベジェ曲線の発生方
法に基づいて、変形対象の内部に含まれる同一行(p
行)を形成する格子点(p、j)(ただし、0≦j≦
n)を、ベジェ曲線のパラメータに従って移動したとき
の他の格子点の移動後の座標を算出する処理を説明す
る。まず、変形対象の左上側の外枠の頂点の座標を(x
1、y1)とし、右下側の外枠の頂点の座標を(x2、
y2)とする。そして、ステップS110でポインタj
を[0]にセットする。ポインタjは格子点をx軸方向
に沿って順次指定するものである。次いで、ステップS
112で変形対象の内部に含まれる同一行(p行)を形
成する格子点(p、j)(ただし、0≦j≦n)の移動
後の座標(xd(j)、yd(j))を、以下に示す
(3)式および(4)式に従って算出する。この格子点
(p、j)は、図9(b)において△印で示される。 xd(j)=(1−j/n)3・xb1+3(j/n)
・(1−j/n)2・xb2+3(j/n)2・(1−j
/n)・xb3+(j/n)3・xb4……(3) yd(j)=(1−j/n)3・yb1+3(j/n)
・(1−j/n)2・yb2+3(j/n)2・(1−j
/n)・yb3+(j/n)3・yb4……(4)
In this routine, the same line (p) included in the inside of the transformation target is based on the generation method of the Bezier curve.
Lattice points (p, j) forming a row (where 0 ≦ j ≦
The process of calculating the coordinate after movement of another grid point when n) is moved according to the parameter of the Bezier curve will be described. First, let the coordinates of the vertex of the outer frame on the upper left side of the transformation target be (x
1, y1), and the coordinates of the vertex of the lower right outer frame are (x2,
y2). Then, in step S110, the pointer j
Is set to [0]. The pointer j is for sequentially designating grid points along the x-axis direction. Then, step S
At 112, the coordinates (xd (j), yd (j)) of the lattice point (p, j) (where 0 ≦ j ≦ n) forming the same row (p row) included in the transformation target after movement are moved. Is calculated according to the following equations (3) and (4). This lattice point (p, j) is indicated by a mark in FIG. 9 (b). xd (j) = (1-j / n) 3 xb1 + 3 (j / n)
・ (1-j / n) 2・ xb2 + 3 (j / n) 2・ (1-j
/ N) · xb3 + (j / n) 3 · xb4 ...... (3) yd (j) = (1-j / n) 3 · yb1 + 3 (j / n)
・ (1-j / n) 2・ yb2 + 3 (j / n) 2・ (1-j
/ N) ・ yb3 + (j / n) 3・ yb4 …… (4)

【0042】最初のルーチンではj=0であるから、格
子点(p、0)の移動後の座標(xd(0)、yd
(0))が(3)式および(4)式に従って算出され
る。この格子点(p、0)の座標位置は、図9(b)に
おいて△印で示される。次いで、ステップS114でポ
インタjをインクリメントし(1だけ進める)、続くス
テップS116でポインタjがn+1に等しくなったか
(つまり外枠の右側の辺まで到達したか)否かを判別す
る。今回はNOであるから、ステップS112に戻って
同様のループを繰り返す。したがって、次回のループで
は変形対象の内部に含まれる同一行(p行)を形成する
格子点(p、1)の移動後の座標(xd(1)、yd
(1))が(3)式および(4)式に従って算出され
る。そして、同様のループを繰り返すことにより、j=
n+1になると、格子点(p、n)の位置までポインタ
jが進んでその移動後の座標(xd(n)、yd
(n))が算出されたと判断してステップS118に抜
ける。このようにして、変形対象の内部に含まれる同一
行(p行)を形成する格子点(p、j)(ただし、0≦
j≦n)の移動後の座標(xd(j)、yd(j))が
すべて順次算出される。その結果、図9(b)に示すよ
うに変形対象の内部に含まれる同一行(p行)を形成す
る各格子点をベジェ曲線のパラメータに従った曲線に変
形させることができる。
Since j = 0 in the first routine, the coordinates (xd (0), yd after the movement of the grid point (p, 0) are moved.
(0)) is calculated according to equations (3) and (4). The coordinate position of this lattice point (p, 0) is indicated by a triangle mark in FIG. 9 (b). Next, in step S114, the pointer j is incremented (advanced by 1), and in the following step S116, it is determined whether or not the pointer j has become equal to n + 1 (that is, has reached the right side of the outer frame). Since this time is NO, the process returns to step S112 and the same loop is repeated. Therefore, in the next loop, the coordinates (xd (1), yd after movement of the grid points (p, 1) forming the same row (p row) included in the deformation target are moved.
(1)) is calculated according to equations (3) and (4). Then, by repeating the same loop, j =
When it becomes n + 1, the pointer j advances to the position of the grid point (p, n), and the coordinates (xd (n), yd after the movement).
It is determined that (n)) has been calculated, and the process proceeds to step S118. In this way, lattice points (p, j) forming the same row (p row) included in the transformation target (where 0 ≦
All the coordinates (xd (j), yd (j)) after the movement of j ≦ n) are sequentially calculated. As a result, as shown in FIG. 9B, each lattice point forming the same row (p row) included in the transformation target can be transformed into a curve according to the parameters of the Bezier curve.

【0043】次いで、ステップS118で再びポインタ
jを[1]にセットする。これにより、ポインタjによ
って格子点をx軸方向に沿って順次指定していくための
準備をする。次いで、ステップS120で以下に示す
(5)式に従って格子点(0、j)、格子点(m、j)
のx座標(xe(j))を算出する。 xe(j)=x1・(n−j)/n+x2・j/n……(5) このとき、格子点(0、j)、格子点(m、j)のy座
標は、それぞれy1、y2となる。次いで、ステップS
122でポインタiを[1]にセットする。ポインタi
は格子点をy軸方向に沿って順次指定するものである。
次いで、ステップS124でポインタiの値を判別す
る。これは、変形対象の内部に含まれる同一行(p行)
を形成する格子点(p、j)を境として、その上下に存
在する格子点(i、j)の座標を算出するために、ポイ
ンタiの位置がp行に対してどこにあるかを判断するた
めのものである。
Then, in step S118, the pointer j is set to [1] again. As a result, preparation is made for sequentially specifying the lattice points by the pointer j along the x-axis direction. Then, in step S120, the grid point (0, j) and the grid point (m, j) are calculated according to the following equation (5).
The x coordinate (xe (j)) of is calculated. xe (j) = x1 · (n−j) / n + x2 · j / n (5) At this time, the y coordinates of the grid point (0, j) and the grid point (m, j) are y1 and y2, respectively. Becomes Then, step S
At 122, the pointer i is set to [1]. Pointer i
Indicates that grid points are sequentially designated along the y-axis direction.
Next, in step S124, the value of the pointer i is determined. This is the same line (p lines) included inside the transformation target.
In order to calculate the coordinates of the grid points (i, j) existing above and below the grid point (p, j) forming the boundary, it is determined where the position of the pointer i is with respect to the p row. It is for.

【0044】A.格子点(i、j)がp行の上方にある
場合 この場合は、0<i<pとなるので、ステップS124
からステップS126に分岐する。そして、ステップS
126で格子点(0、j)と格子点(p、j)を結ぶ線
分上の格子点(i、j)(ただし、0<i<p)の座標
を、以下に示す(6)式および(7)式に従って算出す
る。 x=xe(j)・(m−i)/m+xd(j)・i/m……(6) y=y1・(m−i)/m+yd(j)・i/m……(7) この格子点(i、j)は、図9(b)において○印で示
される格子点と同様の上側領域にある。次いで、ステッ
プS130でポインタiをインクリメントし(1だけ進
める)、続くステップS132でポインタiがmに等し
くなったか(つまり外枠の下辺まで到達したか)否かを
判別する。最初のルーチンではNOであるから、ステッ
プS124に戻って同様のループを繰り返す。最初のル
ーチンでは、格子点(0、j)と格子点(p、j)を結
ぶ線上にある第1の(つまり、一番上側にある)格子点
(1、j)の座標(x、y)が算出されることになるの
で、ポインタiをインクリメントすることにより、次回
は格子点(1、j)と格子点(p、j)を結ぶ線上にあ
る第2の(つまり、2番目の)格子点(2、j)の座標
(x、y)が算出される。以後、ステップS124〜ス
テップS132のループを繰り返すことにより、i=p
になると、格子点(1、j)と格子点(p、j)を結ぶ
線上にある格子点(i、j)の座標(x、y)がすべて
算出されたので、ステップS24からステップS130
にジャンプする。i=pのときは変形対象の内部に含ま
れる同一行(p行)を指定することになるからである。
次いで、ステップS132の判別結果から再びステップ
S124に戻る。
A. When the grid point (i, j) is above the p row In this case, 0 <i <p, and thus step S124.
To S126. And step S
The coordinates of the grid point (i, j) (where 0 <i <p) on the line segment connecting the grid point (0, j) and the grid point (p, j) at 126 are expressed by the following formula (6). And calculated according to equation (7). x = xe (j). (m-i) / m + xd (j) .i / m (6) y = y1. (m-i) / m + yd (j) .i / m .. (7) The grid point (i, j) is in the same upper region as the grid point indicated by a circle in FIG. 9B. Next, in step S130, the pointer i is incremented (advanced by 1), and in the following step S132, it is determined whether or not the pointer i has become equal to m (that is, has reached the lower side of the outer frame). Since the first routine is NO, the routine returns to step S124 and the same loop is repeated. In the first routine, the coordinates (x, y) of the first (that is, the uppermost) grid point (1, j) on the line connecting the grid point (0, j) and the grid point (p, j) are set. ) Is calculated, by incrementing the pointer i, next time, the second (that is, the second) position on the line connecting the grid point (1, j) and the grid point (p, j) will be calculated. The coordinates (x, y) of the grid point (2, j) are calculated. After that, by repeating the loop of steps S124 to S132, i = p
Then, since all the coordinates (x, y) of the grid points (i, j) on the line connecting the grid points (1, j) and the grid points (p, j) have been calculated, steps S24 to S130.
Jump to. This is because when i = p, the same row (p row) included inside the transformation target is designated.
Next, the process returns to step S124 again from the determination result of step S132.

【0045】B.格子点(i、j)がp行の下方にある
場合 この場合は、p<i<mとなるので、ステップS124
からステップS128に分岐する。そして、ステップS
128で格子点(p、j)と格子点(m、j)を結ぶ線
分上の格子点(i、j)(ただし、p<i<m)の座標
を、以下に示す(8)式および(9)式に従って算出す
る。 x=xd(j)・(m−i)/(m−p) +xe(j)・(i−p)/(m−p)……(8) y=yd(j)・(m−i)/(m−p) +y2・(i−p)/(m−p)……(9) この格子点(i、j)は、図9(b)において●印で示
される格子点と同様の下側領域にある。次いで、ステッ
プS130でポインタiをインクリメントし(1だけ進
める)、続くステップS132でポインタiがmに等し
くなったか(つまり外枠の下辺まで到達したか)否かを
判別する。ステップS128を通過する最初のルーチン
ではNOであるから、ステップS124に戻って同様の
ループを繰り返す。このときステップS128を通過す
る最初のルーチンでは、格子点(p、j)と格子点
(m、j)を結ぶ線分上にある第1の格子点(1、j)
の座標(x、y)が算出されることになるので、ポイン
タiをインクリメントすることにより、次回は格子点
(p、j)と格子点(m、j)を結ぶ線分上にある第2
の(つまり、2番目の)格子点(2、j)の座標(x、
y)が算出される。以後、ステップS124〜ステップ
S132のループを繰り返すことにより、i=mになる
と、格子点(p、j)と格子点(m、j)を結ぶ線分上
にある格子点(i、j)の座標(x、y)がすべて算出
されたので、ステップS124からステップS132か
らYESに分岐してステップS134に進む。
B. When the grid point (i, j) is below the p-th row In this case, p <i <m, and thus step S124.
To S128. And step S
The coordinate of the grid point (i, j) (where p <i <m) on the line segment connecting the grid point (p, j) and the grid point (m, j) at 128 is expressed by the following formula (8). And calculated according to equation (9). x = xd (j) · (m−i) / (m−p) + xe (j) · (i−p) / (m−p) (8) y = yd (j) · (m−i) ) / (M-p) + y2. (I-p) / (m-p) (9) This grid point (i, j) is the same as the grid point indicated by the ● mark in FIG. 9 (b). In the lower area. Next, in step S130, the pointer i is incremented (advanced by 1), and in the following step S132, it is determined whether or not the pointer i has become equal to m (that is, has reached the lower side of the outer frame). Since the first routine is NO in step S128, the process returns to step S124 and the same loop is repeated. At this time, in the first routine that passes through step S128, the first grid point (1, j) on the line segment connecting the grid point (p, j) and the grid point (m, j)
Since the coordinates (x, y) of the grid point are calculated, the pointer i is incremented, so that the second time on the line segment connecting the grid point (p, j) and the grid point (m, j) next time.
(That is, the second) grid point (2, j) coordinates (x,
y) is calculated. After that, by repeating the loop of steps S124 to S132, when i = m, the grid point (i, j) on the line segment connecting the grid point (p, j) and the grid point (m, j) Since all the coordinates (x, y) have been calculated, the process branches from step S124 to step S132 to YES and proceeds to step S134.

【0046】ステップS134ではポインタjをインク
リメントし(1だけ進める)、続くステップS136で
ポインタjがn+1に等しくなったか(つまり外枠の右
側の辺まで到達したか)否かを判別する。最初のルーチ
ンでは(0、1)と格子点(p、1)を結ぶ線分上の格
子点(i、j)の座標を同一行(p行)の上下の領域で
すべて算出したのみであるから、今回はNOであり、ス
テップS120に戻って同様のループを繰り返す。した
がって、次回のループでは(0、2)と格子点(p、
2)を結ぶ線分上の格子点(i、j)の座標を算出する
ことになる。以下、同様にしてポインタjを順次インク
リメントして同様のループを繰り返すことにより、j=
n+1になると、格子点(0、n)の位置および格子点
(p、n)の位置までポインタjが進んで(0、j)と
格子点(p、j)を結ぶ線分上の格子点(i、j)の座
標がすべて算出されたと判断して本ルーチンを終了す
る。以上のルーチンを実行することにより、変形対象の
内部にある同一行(p行)を形成する複数個の小多角形
の頂点をベジェ曲線のパラメータに従って移動させたと
き、他の格子点の移動後の座標を算出する処理が行わ
れ、その結果、図9(b)に示すように変形対象の内部
をベジェ曲線のパラメータに従った曲線に変形させるこ
とができる。
In step S134, the pointer j is incremented (advanced by 1), and in the following step S136, it is determined whether or not the pointer j is equal to n + 1 (that is, whether the right side of the outer frame has been reached). In the first routine, the coordinates of the grid point (i, j) on the line segment connecting (0, 1) and the grid point (p, 1) are all calculated in the upper and lower regions of the same line (p line). Therefore, this time is NO, and the process returns to step S120 to repeat the same loop. Therefore, in the next loop, (0, 2) and the grid point (p,
The coordinates of the grid point (i, j) on the line segment connecting 2) will be calculated. Thereafter, similarly, the pointer j is sequentially incremented and the same loop is repeated, so that j =
At n + 1, the pointer j advances to the position of the grid point (0, n) and the position of the grid point (p, n), and the grid point on the line segment connecting (0, j) and the grid point (p, j) When it is determined that all the coordinates (i, j) have been calculated, this routine ends. By executing the above routine, when the vertices of a plurality of small polygons forming the same line (p lines) inside the deformation target are moved according to the parameters of the Bezier curve, after moving other grid points. The process of calculating the coordinates is performed, and as a result, the inside of the transformation target can be transformed into a curve according to the parameters of the Bezier curve, as shown in FIG. 9B.

【0047】なお、上記処理において、曲線の両端の座
標(xb1、yb1)、(xb4、yb4)を変形対象
の変形前の左右の外枠上に設定、つまりxb1=x1、
xb4=x2に設定すれば、外枠の形を変えずに、内部
の小多角形のみを変形することができる。また、上記例
は変形対象の内部に含まれる同一行を形成する格子点を
ベジェ曲線のパラメータに従って移動させた場合の各格
子点の座標を算出するルーチンを説明したものである
が、これに限らず、例えば変形対象の内部に含まれる同
一列を形成する格子点をベジェ曲線のパラメータに従っ
て移動させる場合であっても、同様の処理で各格子点の
移動後の座標を算出することができる。
In the above process, the coordinates (xb1, yb1), (xb4, yb4) at both ends of the curve are set on the left and right outer frames of the deformation target, that is, xb1 = x1,
If xb4 = x2 is set, only the small polygon inside can be deformed without changing the shape of the outer frame. Further, the above example describes a routine for calculating the coordinates of each grid point when the grid points forming the same line included in the transformation target are moved according to the parameters of the Bezier curve, but the present invention is not limited to this. Alternatively, for example, even when the grid points included in the deformation target and forming the same column are moved according to the parameters of the Bezier curve, the coordinates of the moved grid points can be calculated by the same process.

【0048】さらに、本実施例では曲線パラメータとし
てベジェ曲線のパラメータを使用しているが、これに限
るものではなく、例えばBスプライン曲線等の任意の曲
線を用いることも可能である。また、この他に放物線、
双曲線等のように変形対象の内部に含まれる同一行を形
成する格子点を滑らかに配置可能な任意の数式を採用す
ることが可能である。この場合、変形対象の内部に含ま
れる同一行を形成する格子点を移動するには曲線の式だ
けでなく、放物線、双曲線等の変形のさせ方に応じて適
切な数式を用いればよい。このようにすると、その時々
に応じた適切な変形を行わせることができる。
Further, although the Bezier curve parameter is used as the curve parameter in this embodiment, the curve parameter is not limited to this, and it is also possible to use an arbitrary curve such as a B-spline curve. In addition to this, a parabola,
It is possible to employ an arbitrary mathematical expression such as a hyperbola that allows the grid points forming the same row included in the deformation target to be smoothly arranged. In this case, in order to move the lattice points forming the same row included in the deformation target, not only a curved line expression, but also an appropriate mathematical expression depending on how to deform a parabola or a hyperbola. By doing so, it is possible to perform appropriate deformation depending on the occasion.

【0049】このように本実施例では、ビット配列形式
の画像データを有する変形対象を複数の小矩形に分割
し、変形対象全体が滑らかに変形されるように、各小矩
形を座標変換処理に従って異なる小四角形にそれぞれ変
形することが行われる。このとき、小矩形の変形処理で
は、変形対象の内部にある同一行あるい同一列のうちの
少なくとも1つを形成する複数個の小多角形の頂点を、
所定の曲線パラメータに従うとともに、少なくとも変形
後に再び内部に位置するような任意の位置に移動したと
き、変形対象全体が滑らかに変形されるように他の小矩
形の頂点を移動させ、移動した他の小矩形の頂点(座
標:xd(j)、yd(j))を基準となる小矩形の頂
点に基づいて算出し、この算出した頂点に対応して各小
矩形を四角形に変形することが行われる。その後、変形
前の小矩形に含まれるビット配列形式の画像データの配
列が各小四角毎にライン貼り付け法に従って変形後の小
四角形のデータに対応するように順次変形されて変形後
の全体画像が作成される。その結果、本実施例の処理を
適用することにより、例えば図1(a)に示すようなビ
ット配列形式の「目」の画像を図1(b)に示すような
「目」の画像に滑らかに変形させることができる。
As described above, in this embodiment, the transformation target having the image data in the bit array format is divided into a plurality of small rectangles, and each small rectangle is subjected to the coordinate conversion processing so that the entire transformation target is smoothly transformed. It is transformed into different small squares. At this time, in the process of deforming the small rectangle, the vertices of a plurality of small polygons forming at least one of the same row or the same column inside the deformation target are
According to the predetermined curve parameters, at the time of moving to an arbitrary position that is located inside again after deformation, move the vertices of other small rectangles so that the entire deformation target is smoothly deformed, and move the other It is possible to calculate the vertices (coordinates: xd (j), yd (j)) of the small rectangles based on the vertices of the reference small rectangles, and transform each small rectangle into a quadrangle corresponding to the calculated vertices. Be seen. After that, the array of the image data in the bit array format included in the small rectangle before transformation is sequentially transformed for each small square according to the line pasting method so as to correspond to the data of the transformed small square, and the entire image after transformation is transformed. Is created. As a result, by applying the processing of the present embodiment, for example, an image of “eyes” in a bit array format as shown in FIG. 1A is smoothed to an image of “eyes” as shown in FIG. 1B. Can be transformed into

【0050】したがって、変形対象の画像データの配列
に対して各小矩形毎に変形処理が行われるので、従来の
ように全く異なる全体の画像データを予め持つ必要がな
く、少ないメモリ容量で、ビット配列形式のデータを有
する画像を自由に変形することができる。また、変形対
象を複数の小矩形に分割し、各小矩形毎に変形処理が行
われるので、変形に自由度があり、予めメモリに多くの
データを持たなくても、画像を滑らかに変形することが
できる。特に、変形対象の内部にある同一行あるい同一
列のうちの少なくとも1つを形成する複数個の小多角形
の頂点を所定の曲線パラメータに従って移動させる変形
法を使用することにより、曲線パラメータとして数点
(例えば、4点)分の座標だけを持っていればよく、変
形後のすべての小多角形の頂点の位置データ(例えば、
座標)を持っておく必要がない。よって極めて少ない変
形データで非常に滑らかな画像変形を行わせることがで
きる。さらに、この変形法を用いた場合、曲線の両端の
座標を変形対象の外枠上に設定すると、外枠の形を変え
ることなく、内部の小多角形のみを変形することがで
き、画像データの外形(例えば、大きさ)を変えずに、
内部の形のみを変えたい場合に有効である。
Therefore, since the transformation process is performed for each small rectangle on the array of transformation-target image data, it is not necessary to previously have totally different image data as in the conventional case, and a small memory capacity and bit An image having data in array format can be freely transformed. In addition, since the transformation target is divided into a plurality of small rectangles and the transformation process is performed for each small rectangle, there is a degree of freedom in the transformation and the image can be transformed smoothly even if the memory does not have much data in advance. be able to. In particular, by using a deformation method in which the vertices of a plurality of small polygons forming at least one of the same row or the same column inside the deformation target are moved according to a predetermined curve parameter, It is only necessary to have coordinates for several points (for example, 4 points), and the position data of the vertices of all the small polygons after transformation (for example,
You don't have to have the coordinates. Therefore, it is possible to perform a very smooth image transformation with very little transformation data. Furthermore, when this transformation method is used and the coordinates of both ends of the curve are set on the outer frame to be transformed, only the small polygon inside can be transformed without changing the shape of the outer frame. Without changing the outer shape (for example, size) of
This is effective when you want to change only the internal shape.

【0051】その他に、具体的な波及効果としては、本
発明の適用により、例えばアニメーション、ゲーム等の
キャラクター又は背景データ等のようにドットで構成さ
れ、かつ各ドット毎に表示色番号あるいはパレット番号
を持つようなビット配列形式の画像を、自由にかつ滑ら
かに変形することができる。その結果、1つの元画像デ
ータから元画像データの一部又は全部が滑らかに変形し
た複数の画像データを作成することができる。また、ア
ニメーションに適用した場合、従来のように少しずつそ
の形の異なる複数の画像データを予めメモリに持ってお
かなくても、一定時間毎に元画像データを本発明の変形
法を用いて変形すれば、少ないメモリ容量で従来と同等
のアニメーションを行うことができる。
In addition, as a concrete ripple effect, by the application of the present invention, it is composed of dots such as characters of animation, games, etc. or background data, and the display color number or palette number for each dot. It is possible to freely and smoothly transform an image in a bit array format such as. As a result, a plurality of image data in which a part or all of the original image data is smoothly transformed can be created from one original image data. Further, when applied to animation, the original image data is transformed by the transformation method of the present invention at regular time intervals, even if it is not necessary to previously store a plurality of image data of different shapes in the memory as in the conventional case. By doing so, it is possible to perform animation similar to the conventional one with a small memory capacity.

【0052】ゲーム等に複数のキャラクターを登場させ
る場合にも、1つのキャラクターの画像データから全く
別の複数のキャラクターを作ることができる。ゲーム等
に登場するキャラクターの一部分(例えば、目、鼻、
手、足等のパーツ)の形を変える場合にも、元となる1
つの画像データだけを持っていればよいという効果があ
る。ゲーム等の背景等に特殊効果を付加する場合にも、
従来のような拡大、縮小、四角形から四角形への変形等
に比べてはるかに自由かつ滑らかな変形を行うことがで
き、従来にない特殊効果(例えば、背景を歪ませて異次
元の世界を表現する等)を付加することができる。
Even when a plurality of characters appear in a game or the like, a plurality of completely different characters can be created from the image data of one character. Some of the characters that appear in games, such as eyes, nose,
Even if you change the shape of parts such as hands and feet)
The effect is that only one image data needs to be stored. Even when adding special effects to the background of games, etc.,
Compared with the conventional expansion, reduction, and transformation from quadrilateral to quadrilateral, it is possible to perform much more free and smooth transformation, and special effects that have never existed (for example, distorting the background to express a different dimensional world). Etc.) can be added.

【0053】第2実施例 次に、本発明の第2実施例として三角関数を使用して外
枠上の格子点を滑らかに配置する処理について説明す
る。まず、この変形処理の対象となる変形対象の例は図
13(a)に示され、変形後の例は図13(b)に示さ
れる。図13(a)に示すように、変形対象を予め縦m
分割(例えば、4分割)、横n分割(例えば、6分割)
して合計でm×n個(例えば、24個)の小矩形に分割
する。このとき、各小矩形の画像データはドットによっ
て構成され、かつ各ドット毎に表示色番号あるいはパレ
ット番号を持っている。そして、各小矩形毎の画像はそ
のドット全体によって表示される。さて、変形対象の内
部にある同一行を形成する小多角形を選択し、選択した
複数個の小多角形の頂点を、以下の(10)式で示す三
角関数の曲線パラメータに従って移動させたとき、その
他の各小矩形の頂点の座標を算出する処理は前記実施例
と同様のルーチン(図11)で行われる。 y=a・sinπb(x−c)+d……(10) すなわち、変形対象の内部にある同一行(例えば、P
行)を形成する小多角形の頂点を三角関数の曲線パラメ
ータに従って移動させるために変形データとして持って
いるものは、図13(b)に示す曲線パラメータのデー
タで、曲線の両端の座標(例えば、変形前の格子点(x
1、p)、(x2、p))と、曲線の曲がり方を制御す
る(10)式で示す三角関数のデータである。
Second Embodiment Next, as a second embodiment of the present invention, a process of smoothly arranging the grid points on the outer frame by using a trigonometric function will be described. First, an example of a transformation target that is the target of this transformation process is shown in FIG. 13A, and an example after transformation is shown in FIG. 13B. As shown in FIG. 13 (a), the deformation target is previously set to m
Division (for example, 4 divisions), horizontal n division (for example, 6 divisions)
Then, it is divided into m × n (for example, 24) small rectangles in total. At this time, the image data of each small rectangle is composed of dots, and each dot has a display color number or a palette number. Then, the image for each small rectangle is displayed by the entire dots. Now, when small polygons forming the same row inside the transformation target are selected and the vertices of the selected plural small polygons are moved according to the trigonometric curve parameters shown in the following equation (10): The process of calculating the coordinates of the vertices of each of the other small rectangles is performed by the same routine (FIG. 11) as in the above embodiment. y = a · sin πb (x−c) + d (10) That is, the same row (for example, P
What is possessed as deformation data for moving the vertices of a small polygon forming a line in accordance with the curve parameter of the trigonometric function is the curve parameter data shown in FIG. , The grid point before deformation (x
1, p), (x2, p)) and the trigonometric function data shown in the equation (10) for controlling the bending of the curve.

【0054】このとき、記憶装置33には図14に示す
ように、上記(10)式で示す三角関数の情報を格納す
る変形データエリアがある。 三角関数の振幅……a 三角関数の周期……b 三角関数の位相……c y方向のオフセット……d したがって、第2実施例では曲線の両端の座標(x1、
p)、(x2、p)と、曲線の曲がり方を制御する(1
0)式で示す三角関数のデータに基づいて変形対象の内
部にある同一行を形成する小多角形の頂点を滑らかに変
形できるとともに、変形に対応してその他の各小矩形の
頂点の座標を算出することができる。その結果、前記実
施例と同様の効果を得ることができる。特に、三角関数
のパラメータを用いているから、前記実施例とは異なる
態様の画像変形を行わせることができる。
At this time, as shown in FIG. 14, the storage device 33 has a modified data area for storing the information of the trigonometric function represented by the equation (10). Amplitude of trigonometric function ... a Period of trigonometric function ... b Phase of trigonometric function ... c Offset in y direction ... d Therefore, in the second embodiment, coordinates of both ends of the curve (x1,
p), (x2, p) and control how the curve bends (1
Based on the trigonometric function data shown in equation (0), the vertices of the small polygons forming the same row inside the transformation target can be smoothly transformed, and the coordinates of the vertices of the other small rectangles can be determined in correspondence with the transformation. It can be calculated. As a result, the same effect as that of the above-described embodiment can be obtained. In particular, since the parameters of the trigonometric function are used, it is possible to perform image transformation in a mode different from that of the above-described embodiment.

【0055】第3実施例 次に、本発明の第3実施例の変形処理について説明す
る。この実施例では、変形対象の内部にある複数の行
(ここては2行)をそれぞれ形成する複数個の小多角形
の頂点を、ベジェ曲線のパラメータに従って移動させた
ときのその他の各小矩形の頂点の座標を算出する処理を
行うものである。まず、この変形処理の対象となる変形
対象の例は図15(a)に示され、変形後の例は図15
(b)に示される。図15(a)に示すように、変形対
象を予め縦m分割(例えば、4分割)、横n分割(例え
ば、6分割)して合計でm×n個(例えば、24個)の
小矩形に分割する。このとき、各小矩形の画像データは
ドットによって構成され、かつ各ドット毎に表示色番号
あるいはパレット番号を持っている。そして、各小矩形
毎の画像はそのドット全体によって表示される。
Third Embodiment Next, a modification process of the third embodiment of the present invention will be described. In this embodiment, the vertices of a plurality of small polygons forming a plurality of lines (here, two lines) inside the transformation target are moved in accordance with the parameters of the Bezier curve. This is a process for calculating the coordinates of the vertices of. First, an example of a transformation target that is the target of this transformation process is shown in FIG. 15A, and an example after the transformation is shown in FIG.
It is shown in (b). As shown in FIG. 15A, the transformation target is divided into m parts vertically (for example, 4 parts) and n parts horizontally (for example, 6 parts) in advance, and a total of m × n (for example, 24) small rectangles. Split into. At this time, the image data of each small rectangle is composed of dots, and each dot has a display color number or a palette number. Then, the image for each small rectangle is displayed by the entire dots.

【0056】さて、変形対象の内部にある2つの同一行
を形成する複数個のそれぞれの頂点を所定の曲線パラメ
ータに従って移動したときのその他の各小矩形の頂点の
座標を算出する処理について説明する。この例は、あた
かも変形対象の内部の2つの同一行を形成する複数個の
小矩形の頂点を右側に向って一方は下げ、他方は上げる
ような変形を行うケースに相当する。この場合、変形デ
ータとして予め位置が判明しているために、位置データ
の保有が可能なものは、図15(a)に示す変形前にお
ける変形対象の小矩形の頂点であり、これらの外枠の2
つの頂点の位置データは(x1、y1)、(x2、y
2)なる座標で表される。また、変形前における変形対
象の2つの同一行を形成するそれぞれの2つの小多角形
の頂点(x1、p1)、(x2、p1)、(x1、p
2)、(x2、p2)も変形データとして予め位置が判
明している。一方、変形対象の2つの同一行を形成する
それぞれの複数個の小多角形を曲線パラメータに従って
移動させるために変形データとして持っているものは、
図15(b)に示す曲線パラメータのデータである。ま
ず、一方の行に対応する曲線1のパラメータとしては、
曲線1の両端の座標(xb1、yb1)、(xb4、y
b4)と、曲線の曲がり方を制御する座標(xb2、y
b2)、(xb3、yb3)がある。また、選択した他
方の行に対応する曲線2のパラメータとしては、曲線2
の両端の座標(xc1、yc1)、(xc4、yc4)
と、曲線の曲がり方を制御する座標(xc2、yc
2)、(xc3、yc3)がある。
Now, the process of calculating the coordinates of the vertices of other small rectangles when a plurality of vertices forming two identical lines inside the transformation target are moved according to a predetermined curve parameter will be described. . This example corresponds to a case in which the vertices of a plurality of small rectangles forming two same rows inside the deformation target are deformed such that one is lowered toward the right and the other is raised. In this case, since the position is known in advance as the deformation data, the position data can be held are the vertices of the small rectangle to be deformed before the deformation shown in FIG. Of 2
The position data of one vertex is (x1, y1), (x2, y
2) is represented by coordinates. In addition, the vertices (x1, p1), (x2, p1), and (x1, p of the two small polygons forming the same two rows to be deformed before the deformation
The positions of 2) and (x2, p2) are known in advance as deformation data. On the other hand, what is held as deformation data in order to move each of the plurality of small polygons forming two same lines to be deformed according to the curve parameters is:
It is the data of the curve parameters shown in FIG. First, as the parameters of curve 1 corresponding to one row,
Coordinates (xb1, yb1) at both ends of the curve 1 (xb4, y
b4) and the coordinates (xb2, y) that control how the curve bends.
b2) and (xb3, yb3). Further, as the parameter of the curve 2 corresponding to the other selected line, the curve 2
Coordinates of both ends of (xc1, yc1), (xc4, yc4)
And the coordinates (xc2, yc
2) and (xc3, yc3).

【0057】記憶装置33には図16に示すように、上
記各情報を格納する変形データエリアがある。 曲線1のパラメータ1のx座標……xb1 曲線1のパラメータ1のy座標……yb1 曲線1のパラメータ2のx座標……xb2 曲線1のパラメータ2のy座標……yb2 曲線1のパラメータ3のx座標……xb3 曲線1のパラメータ3のy座標……yb3 曲線1のパラメータ4のx座標……xb4 曲線1のパラメータ4のy座標……yb4 曲線2のパラメータ1のx座標……xc1 曲線2のパラメータ1のy座標……yc1 曲線2のパラメータ2のx座標……xc2 曲線2のパラメータ2のy座標……yc2 曲線2のパラメータ3のx座標……xc3 曲線2のパラメータ3のy座標……yc3 曲線2のパラメータ4のx座標……xc4 曲線2のパラメータ4のy座標……yc4
As shown in FIG. 16, the storage device 33 has a modified data area for storing the above information. X-coordinate of parameter 1 of curve 1 ... xb1 y-coordinate of parameter 1 of curve 1 ... yb1 x-coordinate of parameter 2 of curve 1 ... xb2 y-coordinate of parameter 2 of curve 1 ... yb2 of parameter 3 of curve 1 x coordinate ... xb3 y coordinate of parameter 3 of curve 1 ... yb3 x coordinate of parameter 4 of curve 1 ... xb4 y coordinate of parameter 4 of curve 1 ... yb4 x coordinate of parameter 1 of curve 2 ... xc1 curve 2 parameter 1 y coordinate ... yc1 curve 2 parameter 2 x coordinate ... xc2 curve 2 parameter 2 y coordinate ... yc2 curve 2 parameter 3 x coordinate ... xc3 curve 2 parameter 3 y coordinate Coordinates ... yc3 x coordinate of parameter 4 of curve 2 ... xc4 y coordinate of parameter 4 of curve 2 ... yc4

【0058】図17、図18は変形後の格子点座標算出
処理のルーチンを示すフローチャートである。このルー
チンで採用するベジェ曲線の発生方法については、前記
実施例と同様であるので、重複説明を省略する。本ルー
チンでは、上記ベジェ曲線の発生方法に基づいて、変形
対象の2つの同一行を形成するそれぞれの複数個の小多
角形の頂点(格子点)を、それぞれベジェ曲線のパラメ
ータに従って移動させ、このときの他の格子点の移動後
の座標を算出する処理を説明する。まず、変形対象の左
上側の外枠の頂点の座標を(x1、y1)とし、右下側
の外枠の頂点の座標を(x2、y2)とする。最初に上
側にあるp1行を形成する格子点に関する処理から説明
する。
17 and 18 are flowcharts showing the routine of the lattice point coordinate calculation processing after the deformation. The method of generating the Bezier curve used in this routine is the same as that in the above-described embodiment, and thus the duplicated description will be omitted. In this routine, the vertices (lattice points) of a plurality of small polygons forming two identical lines to be deformed are respectively moved according to the Bezier curve parameters based on the above Bezier curve generation method. A process of calculating the coordinate after movement of another grid point at this time will be described. First, the coordinates of the vertices of the outer frame on the upper left side of the transformation target are set to (x1, y1), and the coordinates of the vertices of the outer frame on the lower right side are set to (x2, y2). First, the processing regarding the lattice points forming the p1 row on the upper side will be described.

【0059】A.p1行を形成する格子点の処理 ステップS200でポインタjを[0]にセットする。
ポインタjは格子点をx軸方向に沿って順次指定するも
のである。次いで、ステップS202で変形対象の内部
に含まれる同一行(ここではp1行)を形成する格子点
(p1、j)(ただし、0≦j≦n)の移動後の座標
(xd(j)、yd(j))を、以下に示す(11)式
および(12)式に従って算出する。この格子点(0、
j)は、図15(b)において△印で示される。 xd(j)=(1−j/n)3・xb1+3(j/n)
・(1−j/n)2・xb2+3(j/n)2・(1−j
/n)・xb3+(j/n)3・xb4……(11) yd(j)=(1−j/n)3・yb1+3(j/n)
・(1−j/n)2・yb2+3(j/n)2・(1−j
/n)・yb3+(j/n)3・yb4……(12)
A. Processing of grid points forming row p1 In step S200, the pointer j is set to [0].
The pointer j is for sequentially designating grid points along the x-axis direction. Next, in step S202, the coordinates (xd (j), after movement of the grid points (p1, j) (where 0 ≦ j ≦ n) forming the same row (here, row p1) included in the transformation target, yd (j)) is calculated according to the equations (11) and (12) shown below. This grid point (0,
j) is indicated by a triangle mark in FIG. xd (j) = (1-j / n) 3 xb1 + 3 (j / n)
・ (1-j / n) 2・ xb2 + 3 (j / n) 2・ (1-j
/ N) · xb3 + (j / n) 3 · xb4 ...... (11) yd (j) = (1-j / n) 3 · yb1 + 3 (j / n)
・ (1-j / n) 2・ yb2 + 3 (j / n) 2・ (1-j
/ N) ・ yb3 + (j / n) 3・ yb4 …… (12)

【0060】最初のルーチンではj=0であるから、格
子点(p1、0)の移動後の座標(xd(0)、yd
(0))が(11)式および(12)式に従って算出さ
れる。この格子点(p1、0)の座標位置は、図15
(b)において△印で示される。次いで、ステップS2
04でポインタjをインクリメントし(1だけ進め
る)、続くステップS206でポインタjがnに等しく
なったか(つまり外枠の右側の辺まで到達したか)否か
を判別する。今回はNOであるから、ステップS202
に戻って同様のループを繰り返す。したがって、次回の
ループでは変形対象の内部に含まれる同一行(p1行)
を形成する格子点(p、1)の移動後の座標(xd
(1)、yd(1))が(11)式および(12)式に
従って算出される。そして、同様のループを繰り返すこ
とにより、j=n+1になると、格子点(p1、n)の
位置までポインタjが進んでその移動後の座標(xd
(n)、yd(n))が算出されたと判断してステップ
S208に抜ける。このようにして、変形対象の内部に
含まれる同一行(p1行)を形成する格子点(p1、
j)(ただし、0≦j≦n)の移動後の座標(xd
(j)、yd(j))がすべて順次算出される。その結
果、図15(b)に示すように変形対象の内部に含まれ
る同一行(p1行)を形成する各格子点をベジェ曲線1
のパラメータに従った曲線に変形させることができる。
Since j = 0 in the first routine, the coordinates (xd (0), yd after the movement of the grid point (p1, 0) are moved.
(0)) is calculated according to equations (11) and (12). The coordinate position of this grid point (p1, 0) is shown in FIG.
It is indicated by a triangle mark in (b). Then, step S2
In 04, the pointer j is incremented (advanced by 1), and in the following step S206, it is determined whether or not the pointer j has become equal to n (that is, has reached the right side of the outer frame). This time is NO, so step S202
Return to and repeat the same loop. Therefore, in the next loop, the same line (line p1) included inside the transformation target
Of the grid point (p, 1) forming the
(1) and yd (1) are calculated according to the equations (11) and (12). Then, by repeating the same loop, when j = n + 1, the pointer j advances to the position of the grid point (p1, n), and the coordinate (xd
It is determined that (n), yd (n)) have been calculated, and the process proceeds to step S208. In this way, the lattice points (p1, p1) that form the same row (row p1) included inside the transformation target
j) (where 0 ≦ j ≦ n) after movement (xd
(J) and yd (j)) are all sequentially calculated. As a result, as shown in FIG. 15B, each lattice point forming the same row (row p1) included inside the transformation target is set to the Bezier curve 1
It can be transformed into a curve according to the parameters of.

【0061】次いで、下側にあるp2行を形成する格子
点に関する処理から説明する。B.p2行を形成する格
子点の処理ステップS208で再びポインタjを[0]
にセットする。これにより、再び各格子点をポインタj
により順次x軸方向に沿って順次指定していくことにな
る。次いで、ステップS210で変形対象の内部に含ま
れる同一行(ここではp2行)を形成する格子点(p
2、j)(ただし、0≦j≦n)の移動後の座標(xd
2(j)、yd2(j))を、以下に示す(13)式お
よび(14)式に従って算出する。この格子点(p2、
j)は、図15(b)において▲印で示される。 xd2(j)=(1−j/n)3・xc1+3(j/
n)・(1−j/n)2・xc2+3(j/n)2・(1
−j/n)・xc3+(j/n)3・xc4……(1
3) yd2(j)=(1−j/n)3・yc1+3(j/
n)・(1−j/n)2・yc2+3(j/n)2・(1
−j/n)・yc3+(j/n)3・yc4……(1
4)
Next, the processing for the lattice points forming the p2 row on the lower side will be described. B. In the processing step S208 of the lattice points forming the p2 row, the pointer j is set to [0] again.
Set to. As a result, each grid point is again moved to the pointer j
By this, designation is made sequentially along the x-axis direction. Then, in step S210, grid points (p) that form the same row (here, p2 row) included inside the transformation target
2, j) (where 0 ≦ j ≦ n) after movement (xd
2 (j) and yd2 (j)) are calculated according to the following equations (13) and (14). This grid point (p2,
j) is indicated by a triangle mark in FIG. xd2 (j) = (1-j / n) 3 * xc1 + 3 (j /
n) · (1-j / n) 2 · xc2 + 3 (j / n) 2 · (1
-J / n) * xc3 + (j / n) 3 * xc4 ... (1
3) yd2 (j) = (1-j / n) 3 · yc1 + 3 (j /
n) ・ (1-j / n) 2・ yc2 + 3 (j / n) 2・ (1
-J / n) · yc3 + ( j / n) 3 · yc4 ...... (1
4)

【0062】最初のルーチンではj=0であるから、格
子点(p2、0)の移動後の座標(xd2(0)、yd
2(0))が(13)式および(14)式に従って算出
される。この格子点(p2、0)の座標位置は、図15
(b)において▲印で示される。次いで、ステップS2
12でポインタjをインクリメントし(1だけ進め
る)、続くステップS214でポインタjがn+1に等
しくなったか(つまり外枠の右側の辺まで到達したか)
否かを判別する。今回はNOであるから、ステップS2
10に戻って同様のループを繰り返す。したがって、次
回のループでは変形対象の内部に含まれる同一行(p2
行)を形成する格子点(p2、1)の移動後の座標(x
d2(1)、yd2(1))が(13)式および(1
4)式に従って算出される。そして、同様のループを繰
り返すことにより、j=n+1になると、格子点(p
2、n)の位置までポインタjが進んでその移動後の座
標(xd2(n)、yd2(n))が算出されたと判断
してステップS216に抜ける。このようにして、変形
対象の内部に含まれる同一行(p2行)を形成する格子
点(p2、j)(ただし、0≦j≦n)の移動後の座標
(xd2(j)、yd2(j))がすべて順次算出され
る。その結果、図15(b)に示すように変形対象の内
部に含まれる同一行(p2行)を形成する各格子点をベ
ジェ曲線2のパラメータに従った曲線に変形させること
ができる。
Since j = 0 in the first routine, the coordinates (xd2 (0), yd after the movement of the grid point (p2, 0) are moved.
2 (0)) is calculated according to the equations (13) and (14). The coordinate position of this lattice point (p2, 0) is shown in FIG.
It is indicated by a triangle mark in (b). Then, step S2
The pointer j is incremented by 12 (advance by 1), and the pointer j becomes equal to n + 1 in the subsequent step S214 (that is, whether the right side of the outer frame is reached).
Determine whether or not. This time is NO, so step S2
Return to 10 and repeat the same loop. Therefore, in the next loop, the same line (p2
Coordinates (x) after movement of grid points (p2, 1) forming a row
d2 (1) and yd2 (1) are expressed by equation (13) and (1
It is calculated according to the equation 4). Then, by repeating the same loop, when j = n + 1, the grid point (p
The pointer j is advanced to the position of (2, n) and it is determined that the coordinates (xd2 (n), yd2 (n)) after the movement are calculated, and the process proceeds to step S216. In this manner, the coordinates (xd2 (j), yd2 (, j)) are all calculated sequentially. As a result, as shown in FIG. 15B, each lattice point forming the same row (row p2) included in the transformation target can be transformed into a curve according to the parameters of the Bezier curve 2.

【0063】次いで、ステップS216で再びポインタ
jを[0]にセットする。これにより、ポインタjによ
って格子点をx軸方向に沿って順次指定していくための
準備をする。次いで、ステップS218で以下に示す
(15)式に従って格子点(0、j)、格子点(m、
j)のx座標(xe(j))を算出する。 xe(j)=x1・(n−j)/n+x2・j/n……(15) このとき、格子点(0、j)、格子点(m、j)のy座
標は、それぞれy1、y2となる。次いで、ステップS
220でポインタiを[1]にセットする。ポインタi
は格子点をy軸方向に沿って順次指定するものである。
図18に移り、ステップS222でポインタiの値を判
別する。これは、変形対象の内部に含まれる2つの同一
行(p1行およびp2行)をそれぞれ形成する格子点
(p1、j)、(p2、j)を境として、それらの上下
に存在する格子点(i、j)の座標を算出するために、
ポインタiの位置がp1行、p2行を基準として区分さ
れるどこの領域にあるかを判断するためのものである。
Then, in step S216, the pointer j is set to [0] again. As a result, preparation is made for sequentially specifying the lattice points by the pointer j along the x-axis direction. Next, at step S218, the grid point (0, j) and the grid point (m,
The x coordinate (xe (j)) of j) is calculated. xe (j) = x1 · (n−j) / n + x2 · j / n (15) At this time, the y coordinates of the grid point (0, j) and the grid point (m, j) are y1 and y2, respectively. Becomes Then, step S
At 220, the pointer i is set to [1]. Pointer i
Indicates that grid points are sequentially designated along the y-axis direction.
18, the value of pointer i is determined in step S222. This is because grid points (p1, j) and (p2, j) that form two identical rows (row p1 and row p2) included in the transformation target are the grid points existing above and below those grid points. In order to calculate the coordinates of (i, j),
This is for judging where the position of the pointer i is located on the basis of the p1 and p2 lines.

【0064】C.格子点(j、i)がp1行の上方にあ
る場合 この場合は、0<i<p1となるので、ステップS22
2からステップS224に分岐する。そして、ステップ
S224で格子点(0、j)と格子点(p1、j)を結
ぶ線分上の格子点(i、j)(ただし、0<i<p1)
の座標を、以下に示す(16)式および(17)式に従
って算出する。 x=xe(j)・(p1−i)/p1+xd(j)・i/p1……(16) y=y1・(p1−i)/p1+yd(j)・i/p1……(17) この格子点(i、j)は、図15(b)においてp1行
の上方の領域にある。次いで、ステップS230でポイ
ンタiをインクリメントし(1だけ進める)、続くステ
ップS232でポインタiがmに等しくなったか(つま
り外枠の下辺まで到達したか)否かを判別する。最初の
ルーチンではNOであるから、ステップS222に戻っ
て同様のループを繰り返す。
C. In the case where the grid point (j, i) is above the p1 row In this case, 0 <i <p1 is established, so step S22
It branches from 2 to step S224. Then, in step S224, the grid point (i, j) on the line segment connecting the grid point (0, j) and the grid point (p1, j) (where 0 <i <p1)
The coordinate of is calculated according to the following equations (16) and (17). x = xe (j). (p1-i) / p1 + xd (j) .i / p1 ... (16) y = y1. (p1-i) / p1 + yd (j) .i / p1 .. (17) This The grid point (i, j) is in the upper region of the p1 row in FIG. 15 (b). Next, in step S230, the pointer i is incremented (advanced by 1), and in the following step S232, it is determined whether or not the pointer i has become equal to m (that is, has reached the lower side of the outer frame). Since the answer is NO in the first routine, the process returns to step S222 and the same loop is repeated.

【0065】最初のルーチンでは、格子点(0、j)と
格子点(p1、j)を結ぶ線上にある第1の(つまり、
一番上側にある)格子点(1、j)の座標(x、y)が
算出されることになるので、ポインタiをインクリメン
トすることにより、次回は格子点(1、j)と格子点
(p1、j)を結ぶ線上にある第2の(つまり、2番目
の)格子点(2、j)の座標(x、y)が算出される。
以後、ステップS222〜ステップS232のループを
繰り返すが、途中でi=p1になると、ステップS22
2の判別結果によりステップS230に直接ジャンプす
る。これは、i=p1のときは変形対象の内部に含まれ
る同一行(p1行)を指定することになるからである。
その後、ステップS230、ステップS232を通り、
再びステップS222に戻る。
In the first routine, the first (that is, the following) on the line connecting the grid point (0, j) and the grid point (p1, j):
Since the coordinates (x, y) of the grid point (uppermost) (1, j) are calculated, by incrementing the pointer i, next time the grid point (1, j) and the grid point ( The coordinates (x, y) of the second (that is, the second) lattice point (2, j) on the line connecting p1, j) are calculated.
After that, the loop of steps S222 to S232 is repeated, but when i = p1 is reached midway, step S22
According to the determination result of 2, the process directly jumps to step S230. This is because when i = p1, the same row (row p1) included inside the transformation target is designated.
After that, through steps S230 and S232,
It returns to step S222 again.

【0066】D.格子点(i、j)がp1行とp2行の
間にある場合 この場合は、i=p1の状態を超えてp1<i<p2と
なるので、ステップS222からステップS226に分
岐する。そして、ステップS226で格子点(p1、
j)と格子点(p2、j)を結ぶ線分上の格子点(i、
j)(ただし、p1<i<p2)の座標を、以下に示す
(18)式および(19)式に従って算出する。 x=xd1(j)・(p2−i)/(p2−p1)+x
d2・(i−p1)/(p2−p1)……(18) y=yd1(j)・(p2−i)/(p2−p1)+y
d2・(i−p2)/(p2−p1)……(19)
D. When the grid point (i, j) is between the p1 row and the p2 row In this case, since the state of i = p1 is exceeded and p1 <i <p2, the process branches from step S222 to step S226. Then, in step S226, the grid point (p1,
j) and the grid point (p2, j) on the line segment (i,
j) (However, p1 <i <p2) coordinates are calculated according to the following equations (18) and (19). x = xd1 (j). (p2-i) / (p2-p1) + x
d2 * (i-p1) / (p2-p1) ... (18) y = yd1 (j) * (p2-i) / (p2-p1) + y
d2 ・ (i-p2) / (p2-p1) (19)

【0067】この格子点(i、j)は、図15(b)に
おいてp1行とp2行とによって挟まれる領域にある。
次いで、ステップS230でポインタiをインクリメン
トし(1だけ進める)、続くステップS232でポイン
タiがmに等しくなったか(つまり外枠の下辺まで到達
したか)否かを判別する。ステップS226を通過する
最初のルーチンではNOであるから、ステップS222
に戻って同様のループを繰り返す。このときステップS
226を通過する最初のルーチンでは、格子点(p1、
j)と格子点(p2、j)を結ぶ線分上にある第1の格
子点(1、j)の座標(x、y)が算出されることにな
るので、ポインタiをインクリメントすることにより、
次回は格子点(p1、j)と格子点(p2、j)を結ぶ
線分上にある第2の(つまり、2番目の)格子点(2、
j)の座標(x、y)が算出される。以後、ステップS
222、ステップS226、ステップS230、ステッ
プS232のループを繰り返すことにより、格子点(p
1、j)と格子点(p2、j)を結ぶ線分上にある格子
点(i、j)の座標(x、y)をすべて算出し、ステッ
プS232でi=p2になった時点で、ステップS22
2の判別結果によりステップS230に直接ジャンプす
る。これは、i=p2のときは変形対象の内部に含まれ
る同一行(p2行)を指定することになるからである。
その後、ステップS230、ステップS232を通り、
再びステップS222に戻る。
This lattice point (i, j) is located in the area between the p1 row and the p2 row in FIG. 15 (b).
Next, in step S230, the pointer i is incremented (advanced by 1), and in the following step S232, it is determined whether or not the pointer i has become equal to m (that is, has reached the lower side of the outer frame). Since it is NO in the first routine that passes through step S226, step S222
Return to and repeat the same loop. At this time, step S
In the first routine passing through 226, the grid points (p1,
Since the coordinates (x, y) of the first grid point (1, j) on the line segment connecting j) and the grid point (p2, j) are calculated, by incrementing the pointer i ,
Next time, the second (that is, the second) grid point (2, on the line segment connecting the grid point (p1, j) and the grid point (p2, j))
The coordinates (x, y) of j) are calculated. After that, step S
By repeating the loop of 222, step S226, step S230, and step S232, the grid point (p
1, j) and the grid point (p2, j) on the line segment connecting the grid points (i, j) coordinates (x, y) are all calculated, at the time point i = p2 in step S232, Step S22
According to the determination result of 2, the process directly jumps to step S230. This is because when i = p2, the same row (row p2) included inside the transformation target is designated.
After that, through steps S230 and S232,
It returns to step S222 again.

【0068】E.格子点(i、j)がp2の下側にある
場合 この場合は、p2<i<mとなるので、ステップS22
2からステップS228に分岐する。そして、ステップ
S228で格子点(p2、j)と格子点(m、j)を結
ぶ線分上の格子点(i、j)(ただし、p2<i<m)
の座標を、以下に示す(20)式および(21)式に従
って算出する。 x=xd2(j)・(m−i)/(m−p2)+xe
(j)・(i−p2)/(m−p2)……(20) y=yd2(j)・(m−i)/(m−p2)+y2・
(i−p2)/(m−p2)……(21)
E. When the grid point (i, j) is on the lower side of p2 In this case, p2 <i <m, and therefore step S22.
It branches from 2 to step S228. Then, in step S228, the grid point (i, j) on the line segment connecting the grid point (p2, j) and the grid point (m, j) (where p2 <i <m)
The coordinates of are calculated according to the following equations (20) and (21). x = xd2 (j) · (m−i) / (m−p2) + xe
(J) · (i−p2) / (m−p2) (20) y = yd2 (j) · (m−i) / (m−p2) + y2 ·
(I-p2) / (m-p2) (21)

【0069】この格子点(i、j)は、図15(b)に
おいてp2行の下側にある。次いで、ステップS230
でポインタiをインクリメントし(1だけ進める)、続
くステップS232でポインタiがmに等しくなったか
(つまり外枠の下辺まで到達したか)否かを判別する。
ステップS228を通過する最初のルーチンではNOで
あるから、ステップS222に戻って同様のループを繰
り返す。このときステップS228を通過する最初のル
ーチンでは、格子点(p2、j)と格子点(m、j)を
結ぶ線分上にある第1の格子点(1、j)の座標(x、
y)が算出されることになるので、ポインタiをインク
リメントすることにより、次回は格子点(p2、j)と
格子点(m、j)を結ぶ線分上にある第2の(つまり、
2番目の)格子点(2、j)の座標(x、y)が算出さ
れる。以後、ステップS222〜ステップS232のル
ープを繰り返すことにより、i=mになると、格子点
(p2、j)と格子点(m、j)を結ぶ線分上にある格
子点(i、j)の座標(x、y)がすべて算出されたの
で、ステップS232からYESに分岐してステップS
234に進む。
This lattice point (i, j) is on the lower side of the p2 row in FIG. 15 (b). Then, step S230
The pointer i is incremented by 1 (advance by 1), and it is determined in a succeeding step S232 whether or not the pointer i becomes equal to m (that is, the lower edge of the outer frame is reached).
Since the first routine is NO in step S228, the process returns to step S222 to repeat the same loop. At this time, in the first routine that passes through step S228, the coordinates (x, x) of the first grid point (1, j) on the line segment connecting the grid point (p2, j) and the grid point (m, j) are set.
Since y) is calculated, by incrementing the pointer i, next time, the second (that is, the following) is obtained on the line segment connecting the grid point (p2, j) and the grid point (m, j).
The coordinates (x, y) of the (second) grid point (2, j) are calculated. After that, when i = m by repeating the loop of steps S222 to S232, the grid point (i, j) on the line segment connecting the grid point (p2, j) and the grid point (m, j) Since all coordinates (x, y) have been calculated, the process branches from step S232 to YES and step S232 is performed.
Proceed to 234.

【0070】ステップS234ではポインタjをインク
リメントし(1だけ進める)、続くステップS236で
ポインタjがn+1に等しくなったか(つまり外枠の右
側の辺まで到達したか)否かを判別する。最初のルーチ
ンでは(0、1)と格子点(m、1)を結ぶ線分上の格
子点(i、j)の座標をp1行、p2行を通過して上下
方向ですべて算出したのみであるから、今回はNOであ
り、ステップS222に戻って同様のループを繰り返
す。したがって、次回のループでは(0、2)と格子点
(m、2)を結ぶ線分上の格子点(i、j)の座標を算
出することになる。以下、同様にしてポインタjを順次
インクリメントして同様のループを繰り返すことによ
り、j=n+1になると、格子点(0、n)の位置およ
び格子点(m、n)の位置までポインタjが進んで
(0、j)と格子点(m、j)を結ぶ線分上の格子点
(i、j)の座標がすべて算出された、すなわち、p1
行およびp2行を含むすべてての領域における各格子点
の座標がすべて算出されたと判断して本ルーチンを終了
する。以上のルーチンを実行することにより、変形対象
の内部にある2つの同一行(p1行およびp2行)を形
成する複数個の小多角形の頂点をベジェ曲線1およびベ
ジェ曲線2の各パラメータに従って移動させたとき、他
の格子点の移動後の座標を算出する処理が行われ、その
結果、図15(b)に示すように変形対象の内部をベジ
ェ曲線1およびベジェ曲線2の各パラメータに従った曲
線に変形させることができる。
In step S234, the pointer j is incremented (advanced by 1), and in the following step S236, it is determined whether or not the pointer j has become equal to n + 1 (that is, whether the right side of the outer frame has been reached). In the first routine, the coordinates of the grid point (i, j) on the line segment connecting (0, 1) and the grid point (m, 1) are all calculated in the vertical direction by passing through the rows p1 and p2. Therefore, this time is NO, and the process returns to step S222 to repeat the same loop. Therefore, in the next loop, the coordinates of the grid point (i, j) on the line segment connecting (0, 2) and the grid point (m, 2) will be calculated. Thereafter, similarly, the pointer j is sequentially incremented and the same loop is repeated. When j = n + 1, the pointer j advances to the position of the grid point (0, n) and the position of the grid point (m, n). All coordinates of the grid point (i, j) on the line segment connecting (0, j) and the grid point (m, j) are calculated, that is, p1
It is determined that the coordinates of each grid point in all areas including the row and the p2 row have been calculated, and this routine ends. By executing the above routine, the vertices of a plurality of small polygons forming two identical rows (rows p1 and p2) inside the transformation target are moved according to the parameters of Bezier curve 1 and Bezier curve 2. When this is done, the process of calculating the coordinates after the movement of the other grid points is performed, and as a result, the inside of the deformation target follows the parameters of Bezier curve 1 and Bezier curve 2 as shown in FIG. It can be transformed into a curved line.

【0071】なお、上記処理において、曲線の両端の座
標(xb1、yb1)、(xb4、yb4)、(xc
1、yc1)、(xc4、yc4)を変形対象の変形前
の左右の外枠上にそれぞれ設定、つまりxc1=x1、
xc4=x2およびxc4=x2に設定すれば、外枠の
形を変えずに、内部の小多角形のみを変形することがで
きる。また、上記処理では変形対象の内部にあるp1行
を形成する格子点を第1のベジェ曲線のパラメータに従
って移動させ、p2行を形成する格子点を第2のベジェ
曲線のパラメータに従って移動させた例であるが、曲線
パラメータの配置は任意でよく、例えば変形対象の内部
にある複数の列を形成するそれぞれの格子点をそれぞれ
に対応する曲線パラメータに従って移動させた場合につ
いても、同様の処理によって各格子点の移動後の座標を
算出することができる。
In the above processing, the coordinates (xb1, yb1), (xb4, yb4), (xc) at both ends of the curve are obtained.
1, yc1) and (xc4, yc4) are set on the left and right outer frames of the deformation target before deformation, that is, xc1 = x1,
By setting xc4 = x2 and xc4 = x2, it is possible to deform only the inner small polygon without changing the shape of the outer frame. In the above process, the lattice points forming the p1 row inside the transformation target are moved according to the parameters of the first Bezier curve, and the lattice points forming the p2 row are moved according to the parameters of the second Bezier curve. However, the arrangement of the curve parameters may be arbitrary. For example, when the respective grid points forming a plurality of rows inside the deformation target are moved according to the curve parameters corresponding to the respective grid points, the same processing is performed. The coordinates after the movement of the grid points can be calculated.

【0072】したがって、第3実施例においても、前記
実施例と同様の効果を得ることができる。この場合、特
に複数の行に対してそれぞれ行毎に、あるいは複数の列
に対してそれぞれ列毎に曲線パラメータを割り当てれ
ば、より一層複雑な変形を行うことができる。なお、上
記実施例では第1、第2の曲線パラメータとしてベジェ
曲線のパラメータを使用しているが、これに限るもので
はなく、例えばBスプライン曲線等の任意の曲線を用い
ることも可能である。また、この他に放物線、双曲線、
三角関数等のように変形対象の内部にある複数の行ある
いは列を形成する格子点を滑らかに配置可能な任意の数
式を採用することが可能である。この場合、各格子点を
移動するには曲線の式だけでなく、放物線、双曲線、三
角関数等の変形のさせ方に応じて適切な数式を用いれば
よい。このようにすると、その時々に応じた適切な変形
を行われせることができる。
Therefore, also in the third embodiment, it is possible to obtain the same effect as the above-mentioned embodiment. In this case, in particular, if curve parameters are assigned to each of a plurality of rows or to each of a plurality of columns, a more complicated transformation can be performed. Although the Bezier curve parameters are used as the first and second curve parameters in the above embodiment, the present invention is not limited to this, and it is also possible to use an arbitrary curve such as a B-spline curve. In addition to this, parabola, hyperbola,
It is possible to employ an arbitrary mathematical expression such as a trigonometric function that can smoothly arrange the grid points forming a plurality of rows or columns inside the transformation target. In this case, in order to move each lattice point, not only a curved line expression, but an appropriate mathematical expression may be used according to the way of deforming a parabola, a hyperbola, a trigonometric function, or the like. By doing so, appropriate deformation can be performed depending on the occasion.

【0073】次に、前述したいわゆるライン貼り付け法
の処理内容について、以下に具体的に詳述する。ライン貼り付け処理のサブルーチン 図7に示したステップS34におけるライン貼り付け法
(矩形から任意の四角形への変形方法)の具体的な内容
は以下の通りである。図19はライン貼り付け法の処理
を示すサブルーチンのフローチャートであり、このサブ
ルーチンの処理の対象となる画像データの例は図20
(a)、(b)のように示される。すなわち、図20
(a)は変形前の元画像データを示し、詳しくは変形元
となるビット配列形式の画像データを分割した場合のあ
る1つの小矩形の画像データ(つまり、変形前の小矩形
画像データ)に対応する。ここで説明するライン貼り付
け法は、図20(a)に示すように変形前の小矩形画像
データとして縦(Y)方向が12ピクセル、横(X)方
向が16ピクセルで構成される元画像データ(矩形AB
CDで表される)を、図20(b)に示すような四角形
A’B’C’D’に変形する内容である。その変形処理
では、まず元画像データを12本の水平ライン(ライン
0〜ライン11)に分割する。そして、分割した各ライ
ンを画像変形態様に応じて変形後の四角形に順番に貼り
付けていく処理が行われ、変形画像が得られる。
Next, the processing contents of the so-called line pasting method described above will be described in detail below. Subroutine of line pasting processing The specific contents of the line pasting method (method of transforming a rectangle into an arbitrary rectangle) in step S34 shown in FIG. 7 are as follows. FIG. 19 is a flowchart of a subroutine showing the processing of the line pasting method, and an example of image data to be processed by this subroutine is shown in FIG.
It is shown as (a) and (b). That is, FIG.
(A) shows the original image data before the deformation, and more specifically, into one small rectangular image data (that is, the small rectangular image data before the deformation) obtained by dividing the image data in the bit array format which is the deformation source. Correspond. In the line pasting method described here, as shown in FIG. 20A, an original image composed of 12 pixels in the vertical (Y) direction and 16 pixels in the horizontal (X) direction as small rectangular image data before transformation. Data (rectangle AB
(Represented by CD) is transformed into a quadrangle A'B'C'D 'as shown in FIG. In the transformation process, the original image data is first divided into 12 horizontal lines (line 0 to line 11). Then, the divided lines are sequentially attached to the transformed quadrangle according to the image transformation mode, and a transformed image is obtained.

【0074】サブルーチンのステップを進めながら、上
記処理について説明する。このサブルーチンに移行する
と、まずステップS1100で辺A’B’についてライ
ンの端点処理を行う。これは、変形後の四角形のライン
の端点A’B’を求めるものである。なお、ステップS
1100の処理(辺A’B’の位置を求める方法)につ
いては、後述のサブルーチンで詳述する。すなわち、図
20(a)(b)に示すように、分割した各ラインを画
像変形態様に応じて変形後の四角形に順番に貼り付けて
いく処理では、以下のような状態に着目する必要があ
る。辺AB上にあった各ラインの一方の端点は辺A’
B’上に、また、辺DC上にあった他方の端点は辺D’
C’上に移動する。このとき、辺ABと辺A’B’およ
び辺DCと辺D’C’では、それらの長さが異なるの
で、辺A’B’、辺D’C’上でラインの端点が重なっ
たりすることがある。これは、図20(b)の☆印で示
す部分であり、辺A’B’上のライン5およびライン6
が重なっている。また、同一のラインを2回以上貼り付
けなければならないこともある。これは、図20(b)
の★印で示す2つの部分であり、辺D’C’上のライン
3およびライン8が2回繰り返され、それぞれライン
3、3’およびライン8、8’となっている。
The above process will be described while advancing the steps of the subroutine. In this subroutine, first, in step S1100, line end point processing is performed on the side A'B '. This is to obtain the end points A′B ′ of the transformed rectangular line. Note that step S
The processing of 1100 (method for obtaining the position of the side A′B ′) will be described in detail in a subroutine described later. That is, as shown in FIGS. 20 (a) and 20 (b), it is necessary to pay attention to the following state in the process of sequentially attaching each of the divided lines to the transformed quadrangle according to the image transformation mode. is there. One end of each line on side AB is side A '
The other end point on B ′ and on the side DC is the side D ′.
Move over C '. At this time, since the sides AB and A'B 'and the sides DC and D'C' have different lengths, the end points of the lines may overlap on the sides A'B 'and D'C'. Sometimes. This is a part indicated by a star mark in FIG. 20 (b), and lines 5 and 6 on the side A'B '.
Are overlapping. Also, the same line may have to be attached more than once. This is shown in FIG.
The line 3 and the line 8 on the side D′ C ′ are repeated twice to form the lines 3 and 3 ′ and the lines 8 and 8 ′, respectively.

【0075】図21にラインを2回貼り付ける様子を示
す。図21(a)は変形前の元画像データであり、詳し
くは変形元となるビット配列形式の画像データを分割し
た場合のある1つの小矩形の画像データに対応する。図
21(b)は変形後の1つの四角形の画像データであ
る。変形前の画像データのライン3が、変形後は途中の
ドットから右側6ドットだけライン3、3’として2ラ
イン分貼り付けられる。また、変形前の画像データのラ
イン5とライン6が、変形後は最初のドットから7ドッ
トまで(つまり左側7ドット分)については同じドット
に貼り付けられ、以後の右側7ドットについてはライン
5、ライン6として別個に貼り付けられる。なお、図2
1〜図28はライン貼り付け法を実行する場合の、複数
の実行過程における変形前の小矩形および変形後の四角
形を示すものであり、各過程の具体例は後述のサブルー
チンを説明するときに述べる。
FIG. 21 shows how the lines are attached twice. FIG. 21A shows original image data before transformation, and more specifically, it corresponds to one small rectangular image data obtained by dividing the transformation-source image data in the bit array format. FIG. 21B shows image data of one quadrangle after transformation. After the transformation, the line 3 of the image data before transformation is pasted for two lines as the lines 3 and 3'only 6 dots to the right of the dots in the middle. Lines 5 and 6 of the image data before the deformation are pasted on the same dots from the first dot to the 7th dot (that is, 7 dots on the left side) after the deformation, and line 5 on the 7 dots on the right side thereafter. , Line 6 is attached separately. Note that FIG.
1 to 28 show a small rectangle before deformation and a quadrangle after deformation in a plurality of execution processes when the line pasting method is executed, and specific examples of each process will be described when a subroutine described later is described. Describe.

【0076】次いで、ステップS1102で辺D’C’
についてラインの端点処理を行う。これは、変形後の四
角形のラインの端点D’C’を求めるものである。な
お、ステップS1102の処理(辺D’C’の位置を求
める方法)については、同様に後述のサブルーチンで詳
述する。このようにして、各ラインの端点が移動する辺
A’B’と辺D’C’の位置が求められると、これらの
ラインの端点位置は図30に示すように、CPU31の
内部レジスタ31aにある端点バッファにデータを格納
する。この場合、内部レジスタ31aには辺A’B’上
の端点バッファと、辺D’C’上の端点バッファという
2つの格納エリアがある。そして、これらの各端点バッ
ファではラインの端点の座標と、そのライン番号を対応
付けて格納する。2つの端点バッファは端点の位置を読
み出すときや、ラインの描画位置を決めるときに使用さ
れる。
Next, in step S1102, the side D'C '
The end points of the line are processed. This is to obtain the end point D'C 'of the transformed quadrangular line. The process of step S1102 (method of obtaining the position of the side D'C ') will be described in detail in a subroutine described later. In this way, when the positions of the side A'B 'and the side D'C' where the end points of each line move are obtained, the end point positions of these lines are stored in the internal register 31a of the CPU 31, as shown in FIG. Store the data in an endpoint buffer. In this case, the internal register 31a has two storage areas, an end point buffer on the side A'B 'and an end point buffer on the side D'C'. Then, in each of these end point buffers, the coordinates of the end points of the line and the line number are stored in association with each other. The two end point buffers are used when reading the position of the end point and when determining the drawing position of the line.

【0077】次いで、ステップS1104〜ステップS
1110でラインを描画する処理を行う。まず、ステッ
プS1104では2つの端点バッファからライン番号の
同じデータを読み出す。次いで、ステップS1106で
同じライン番号のラインが複数あるときには描画回数が
最小になるように組み合せる。これは、図31に示すよ
うに、例えば辺A’B’上で同じライン番号のラインが
3本あり、一方、辺D’C’上で同じライン番号のライ
ンが2本ある場合、上側の各端点同士を1本のラインで
引き、辺A’B’上の2つの端点と辺D’C’上の1つ
の端点とを2本のラインで引くような処理を行うもので
ある。次いで、ステップS1108で描画処理(詳細は
サブルーチンで後述)を行う。次いで、ステップS11
10ですべてのラインについて処理したか否かを判別
し、NOのときはステップS1104に戻って同様の処
理を繰り返す。そして、すべてのラインについてステッ
プS1104〜ステップS1108の処理が終了する
と、ステップS1110からYESに抜けてルーチンを
終了する。このようにして、各小矩形が異なる四角形に
それぞれ変形され、変形対象の画像全体が滑らかに変形
することになる。
Next, steps S1104 to S
At 1110, a process of drawing a line is performed. First, in step S1104, the same line number data is read from the two end point buffers. Next, in step S1106, when there are a plurality of lines having the same line number, the lines are combined so that the number of drawing is minimized. As shown in FIG. 31, for example, when there are three lines having the same line number on the side A′B ′ and two lines having the same line number on the side D′ C ′, the upper side The processing is such that each end point is drawn by one line, and two end points on the side A'B 'and one end point on the side D'C' are drawn by two lines. Next, in step S1108, drawing processing (details will be described later in a subroutine) is performed. Then, step S11
In step 10, it is determined whether or not all lines have been processed. If NO, the process returns to step S1104 to repeat the same processing. Then, when the processes of steps S1104 to S1108 have been completed for all the lines, the process exits from step S1110 to YES and ends the routine. In this way, each small rectangle is transformed into a different quadrangle, and the entire image to be transformed is transformed smoothly.

【0078】ライン端点処理のサブルーチン 次に、上記ステップS1100およびステップS110
2におけるラインの端点処理のサブルーチンについて説
明する。図32はラインの端点処理(ステップS111
0の処理)を示すサブルーチンのフローチャートであ
る。まず、貼り付けるラインの一方の端点となる辺A’
B’の位置を求める方法から説明する。なお、貼り付け
るラインの他方の端点となる辺D’C’の位置を求める
方法も同様である。ステップS1200で座標決定用誤
差e1、ライン選択用誤差e2、現在ライン番号をすべ
て[0]に初期設定する。座標決定用誤差e1とは、端
点の位置を決めるとき又はラインの描画位置を決めると
きに用いる座標決定用誤差のことである。ライン選択用
誤差e2とは、端点に割り当てるラインを選択するとき
に用いるライン選択用誤差のことである。これにより、
最初は各誤差が[0]になる。
Subroutine for Line End Point Processing Next, the above steps S1100 and S110.
A subroutine of line end point processing in 2 will be described. FIG. 32 shows line end point processing (step S111).
It is a flowchart of a subroutine showing (process 0). First, side A'which is one end of the line to be pasted
The method of obtaining the position of B'will be described. The method of obtaining the position of the side D'C 'which is the other end point of the sticking line is also the same. In step S1200, the coordinate determination error e1, the line selection error e2, and the current line number are all initialized to [0]. The coordinate determination error e1 is a coordinate determination error used when determining the position of an end point or when determining the drawing position of a line. The line selection error e2 is a line selection error used when selecting a line to be assigned to an end point. This allows
Initially, each error is [0].

【0079】次いで、ステップS1202で処理を開始
する点(A’又はD’)の座標をCPU31の内部レジ
スタ31aにある現在座標というエリアに格納する。例
えば、貼り付けるラインの一方の端点となる辺A’B’
の位置を求める処理では、A’の座標を格納する。一
方、貼り付けるラインの他方の端点となる辺D’C’の
位置を求める処理では、D’の座標を格納する。CPU
31の内部レジスタ31aには図30に示すように、端
点バッファの他に、以下のような格納エリアがある。 座標決定用誤差e1のエリア 座標決定用誤差増分Δe1のエリア 現在座標のエリア ライン選択用誤差e2のエリア ライン選択誤差増分Δe2のエリア 現在ライン番号 また、ドット選択用の格納エリアとしては、以下のよう
なものがある。 ドット選択用誤差e3のエリア ドット選択用誤差増分Δe3のエリア 現在ドット番号のエリア
Next, in step S1202, the coordinates of the point (A 'or D') at which the processing is to be started are stored in an area called current coordinates in the internal register 31a of the CPU 31. For example, side A'B 'that is one end of the line to be pasted
In the process of obtaining the position of, the coordinates of A ′ are stored. On the other hand, in the process of obtaining the position of the side D'C 'which is the other end point of the line to be attached, the coordinates of D'is stored. CPU
As shown in FIG. 30, the internal register 31a of 31 has the following storage areas in addition to the end point buffer. Area for coordinate determination error e1 Area for coordinate determination error increment Δe1 Area for current coordinates Area for line selection error e2 Area for line selection error increment Δe2 Current line number Also, as the storage area for dot selection, There is something like this. Area for dot selection error e3 Area for dot selection error increment Δe3 Area for current dot number

【0080】次いで、ステップS1204でY方向のピ
クセル数がX方向のピクセル数より多いか否かを判別す
る。いま、貼り付けるラインの一方の端点となる辺A’
B’の位置を求める場合の具体例は図22に示される。
図22(a)に示す変形前のラインの一方の端点となる
辺ABを示し、図22(b)は貼り付けるラインの一方
の端点となる辺A’B’の様子を示し、さらに図22
(c)は辺A’B’におけるX方向およびY方向のピク
セル数の変化を示している。この例に対応させて考える
と、辺A’B’はY方向に11ピクセル、X方向に4ピ
クセルに渡って描画されるので、ステップS1204の
判別結果はYESとなり、このケースではステップS1
206に進む。一方、逆のケースではNOに分岐して図
33に示すステップS1238に進む。また、この場
合、図22に示すケースでは点A’から点B’に向って
Y座標を1ずつ変えていったときにX座標の変化する位
置を求めると、そのとき変化した座標が辺A’B’の位
置となる。したがって、無条件に位置の決る始点(点
A’)を除く10個のドットを打つときには、X座標の
変化する位置としてX座標が変化する3箇所を求めるこ
とになる。
Next, in step S1204, it is determined whether the number of pixels in the Y direction is larger than the number of pixels in the X direction. Now, the side A'which is one end of the line to be pasted
A specific example of obtaining the position of B'is shown in FIG.
22A shows a side AB that is one end point of the line before deformation shown in FIG. 22A, FIG. 22B shows a state of a side A′B ′ that is one end point of the line to be attached, and FIG.
(C) shows changes in the number of pixels in the X and Y directions on the side A'B '. Considering this example, since the side A′B ′ is drawn over 11 pixels in the Y direction and 4 pixels in the X direction, the determination result of step S1204 is YES, and in this case, step S1
Proceed to 206. On the other hand, in the opposite case, the process branches to NO and proceeds to step S1238 shown in FIG. Further, in this case, in the case shown in FIG. 22, when the position where the X coordinate changes when the Y coordinate is changed by 1 from the point A ′ to the point B ′, the changed coordinate is the side A. It is in the position of'B '. Therefore, when 10 dots are laid unconditionally except for the starting point (point A ′) whose position is determined, three positions where the X coordinate changes are obtained as positions where the X coordinate changes.

【0081】ステップS1206に進むと、座標決定用
誤差増分Δe1を(Xピクセル数−1)/(Yピクセル
数−1)に初期設定するとともに、ライン選択誤差増分
Δe2を(元ライン数−1)/(Yピクセル数−1)に
初期設定する。ステップS1200〜ステップS120
6の処理により必要な初期設定が完了する。次いで、ス
テップS1208で現在のライン番号と現在座標を端点
バッファ(図39参照)に格納する。次いで、ステップ
S1210で現在座標のY座標を変更する。次いで、ス
テップS1212で座標決定用誤差e1についての判別
を以下のようにして行う。すなわち、選択誤差(初期値
=0)eを決め、選択誤差eに誤差増分Δeを加える
(e=e+Δe)。Δeは(X方向のピクセル数−1)
/(Y方向のピクセル数−1)である。
In step S1206, the coordinate determination error increment Δe1 is initialized to (X pixel number -1) / (Y pixel number -1), and the line selection error increment Δe2 is (original line number -1). The initial setting is / (Y pixel count-1). Step S1200 to Step S120
The necessary initialization is completed by the processing of 6. Next, in step S1208, the current line number and current coordinates are stored in the end point buffer (see FIG. 39). Next, in step S1210, the Y coordinate of the current coordinate is changed. Next, in step S1212, the determination regarding the coordinate determination error e1 is performed as follows. That is, the selection error (initial value = 0) e is determined, and the error increment Δe is added to the selection error e (e = e + Δe). Δe is (number of pixels in X direction-1)
/ (The number of pixels in the Y direction-1).

【0082】なお、ここでは、座標決定用であるからe
をe1とし、ΔeをΔe1として処理をする。そうする
と、e1=e1+Δe1となる。この値が1/2より大
きくなったか否かを判別する。そして、誤差増分Δe1
を加えた結果e1がe1≧(1/2)であれば、ステッ
プS1214に進んで次に打つ点の座標(次の現在座標
に相当)のX座標を変更する。これは、選択誤差に誤差
増分を加え、その結果が1/2より大きいか小さいかに
よって処理を選択するもので、選択誤差が1/2以上の
ときに誤差を補正する。
It should be noted that here, since it is for coordinate determination, e
Is set as e1 and Δe is set as Δe1. Then, e1 = e1 + Δe1. It is determined whether this value is larger than 1/2. Then, the error increment Δe1
If the result of adding e1 is e1 ≧ (1/2), the process advances to step S1214 to change the X coordinate of the coordinate of the next hit point (corresponding to the next current coordinate). In this method, an error increment is added to the selection error, and the process is selected depending on whether the result is larger or smaller than 1/2, and the error is corrected when the selection error is 1/2 or more.

【0083】このようにすると、点A’から点B’に向
ってY座標を1ずつ変えていったときに、少なくとも誤
差増分Δe1が1の半分より大きい場合に、次の座標を
変更するので、X座標の変化する位置が滑らかにつなが
ることになる。なお、この方法はいわゆるBresenhamの
アルゴリズムとして用いられるものである。次いで、ス
テップS1216で誤差補正を行い、e1=e1−1と
する。これは、選択誤差が1/2以上になって次の座標
を変更したので、1を減算することにより、再び次の現
在座標から誤差増分Δeを加えて同様の判別を始めるた
めである。その後、ステップS1218に進む。一方、
誤差増分Δe1を加えた結果e1がe1<(1/2)で
あれば、ステップS1214、ステップS1216をジ
ャンプしてステップS1218に進む。このときは、次
に打つ点のX座標は元のままにする。また、この場合は
選択誤差e1は補正しない。以上のステップS1210
〜ステップS1216を実行することにより、貼り付け
るラインの一方の端点となる辺A’B’の位置が決定さ
れる。
In this way, when the Y coordinate is changed by 1 from the point A ′ to the point B ′, the next coordinate is changed at least when the error increment Δe1 is larger than half of 1. , X-coordinate changing positions are smoothly connected. This method is used as a so-called Bresenham algorithm. Next, in step S1216, error correction is performed to set e1 = e1-1. This is because the selection error becomes 1/2 or more and the next coordinate is changed, so that by subtracting 1 from the next current coordinate, the error increment Δe is added again to start the same determination. Then, it progresses to step S1218. on the other hand,
If the result e1 of adding the error increment Δe1 is e1 <(1/2), the process jumps from step S1214 and step S1216 to step S1218. At this time, the X coordinate of the next hit point remains unchanged. Further, in this case, the selection error e1 is not corrected. Step S1210 above
By executing step S1216, the position of the side A′B ′ which is one end point of the sticking line is determined.

【0084】ここで、図22の場合(貼り付けるライン
の一方の端点となる辺A’B’の位置を決定する場合)
の具体例について説明する。まず、最初の端点A’は無
条件に決まる。この時点で、選択誤差eは[0]に初期
設定されている。また、端点A’から端点B’に対して
はY方向に11ピクセル、X方向に4ピクセルに渡って
描画されるので、誤差増分Δeは Δe=(4−1)/(11−1)=0.30である。次
いで、選択誤差eはe=0に初期設定されているからそ
のままとし、誤差増分ΔeとしてΔe=0.30を加え
ると、e=0+0.30=0.30<(1/2)とな
る。したがって、このときは次に打つ点のX座標は変
更しない(図22(c)参照)。また、選択誤差eは1
/2より小さいので、選択誤差eの補正は行わない。次
いで、ここまでの選択誤差e=0.30に誤差増分Δe
としてΔe=0.30を加えると、e=0.30+0.
30=0.60≧(1/2)となるので、今度は次に打
つ点のX座標を変更する(図22(c)参照)。以上
の処理を繰り返すことにより、点、の位置でX座標
の変更が行われ、最終的に図22(c)に示すように、
端点B’の位置が決定される。
Here, in the case of FIG. 22 (when the position of the side A'B 'which is one end point of the pasting line is determined)
A specific example of will be described. First, the first end point A'is unconditionally determined. At this point, the selection error e is initialized to [0]. Further, from the end point A ′ to the end point B ′, 11 pixels in the Y direction and 4 pixels in the X direction are drawn, and thus the error increment Δe is Δe = (4-1) / (11-1) = It is 0.30. Next, since the selection error e is initially set to e = 0, it is left as it is, and when Δe = 0.30 is added as the error increment Δe, e = 0 + 0.30 = 0.30 <(1/2). Therefore, at this time, the X coordinate of the next hit point is not changed (see FIG. 22 (c)). Also, the selection error e is 1
Since it is less than / 2, the selection error e is not corrected. Next, the error increment Δe is set to the selection error e = 0.30 so far.
.DELTA.e = 0.30 is added, then e = 0.30 + 0.
Since 30 = 0.60 ≧ (1/2), the X coordinate of the next hit point is changed (see FIG. 22C). By repeating the above process, the X coordinate is changed at the positions of and, and finally, as shown in FIG.
The position of the end point B'is determined.

【0085】一方、上記ステップS1204でY方向の
ピクセル数がX方向のピクセル数より小さいときは図3
3のステップS1238に進み、今度はY座標の方を変
更する処理を行う。すなわち、ステップS1238で座
標決定用誤差増分Δe1を(Yピクセル数−1)/(X
ピクセル数−1)に初期設定するとともに、ライン選択
誤差増分Δe2を(元ライン数−1)/(Xピクセル数
−1)に初期設定する。次いで、ステップS1240で
現在のライン番号と現在座標を端点バッファ(図30参
照)に格納する。次いで、ステップS1242で現在座
標のX座標を変更する。次いで、ステップS1244で
座標決定用誤差e1についての判別を以下のようにして
行う。すなわち、選択誤差(初期値=0)eを決め、選
択誤差eに誤差増分Δeを加える(e=e+Δe)。Δ
eは(Y方向のピクセル数−1)/(X方向のピクセル
数−1)である。なお、ここでは、同様に座標決定用で
あるからeをe1とし、ΔeをΔe1として処理をす
る。そうすると、e1=e1+Δe1となる。この値が
1/2より大きくなったか否かを判別する。そして、誤
差増分Δe1を加えた結果e1がe1≧(1/2)であ
れば、ステップS1246に進んで次に打つ点の座標
(次の現在座標に相当)のY座標を変更する。これは、
選択誤差に誤差増分を加え、その結果が1/2より大き
いか小さいかによって処理を選択するもので、選択誤差
が1/2以上のときに誤差を補正する。
On the other hand, if the number of pixels in the Y direction is smaller than the number of pixels in the X direction in step S1204 described above,
In step S1238, the process for changing the Y coordinate is performed. That is, in step S1238, the coordinate determination error increment Δe1 is set to (Y pixel number-1) / (X
Initially, the line selection error increment Δe2 is set to (original line number-1) / (X pixel number-1) as well as the pixel number-1). Next, in step S1240, the current line number and current coordinate are stored in the end point buffer (see FIG. 30). Next, in step S1242, the X coordinate of the current coordinate is changed. Next, in step S1244, the determination regarding the coordinate determination error e1 is performed as follows. That is, the selection error (initial value = 0) e is determined, and the error increment Δe is added to the selection error e (e = e + Δe). Δ
e is (the number of pixels in the Y direction-1) / (the number of pixels in the X direction-1). Note that, here, since the coordinate determination is performed similarly, e is set to e1 and Δe is set to Δe1. Then, e1 = e1 + Δe1. It is determined whether this value is larger than 1/2. If the result e1 obtained by adding the error increment Δe1 is e1 ≧ (1/2), the process advances to step S1246 to change the Y coordinate of the next hitting coordinate (corresponding to the next current coordinate). this is,
An error increment is added to the selection error, and the process is selected depending on whether the result is larger or smaller than 1/2. The error is corrected when the selection error is 1/2 or more.

【0086】このようにすると、点D’から点C’に向
ってX座標を1ずつ変えていったときに、少なくとも誤
差増分Δe1が1の半分より大きい場合に、次の座標を
変更するので、Y座標の変化する位置が滑らかにつなが
ることになる。次いで、ステップS1248で誤差補正
を行い、e1=e1−1とする。これは、選択誤差が1
/2以上になって次の現在座標のY座標を変更したの
で、1を減算することにより、再び次の現在座標から誤
差増分Δeを加えて同様の判別を始めるためである。そ
の後、ステップS1250に進む。一方、誤差増分Δe
1を加えた結果e1がe1<(1/2)であれば、ステ
ップS1246、ステップS1248をジャンプしてス
テップS1250に進む。このときは、次に打つ点のY
座標は元のままにする。また、この場合は選択誤差e1
は補正しない。以上のステップS1242〜ステップS
1248を実行することにより、貼り付けるラインの一
方の端点となる辺D’C’の位置が決定される。
In this way, when the X coordinate is changed by 1 from the point D ′ to the point C ′, the next coordinate is changed at least when the error increment Δe1 is larger than half of 1. , Y-coordinate changing positions are smoothly connected. Next, in step S1248, error correction is performed to set e1 = e1-1. This has a selection error of 1
This is because the Y coordinate of the next current coordinate is changed to / 2 or more, and therefore, 1 is subtracted, and the error increment Δe is added again from the next current coordinate to start the same determination. Then, it progresses to step S1250. On the other hand, the error increment Δe
If the result e1 of adding 1 is e1 <(1/2), the process jumps to steps S1246 and S1248 and proceeds to step S1250. In this case, the next Y to hit
The coordinates remain unchanged. Further, in this case, the selection error e1
Is not corrected. Steps S1242-S above
By executing 1248, the position of the side D′ C ′ that is one end point of the line to be attached is determined.

【0087】ここで、図23の場合(貼り付けるライン
の他方の端点となる辺D’C’の位置を決定する場合)
の具体例について説明する。図23(a)は変形前のラ
インの他方の端点となる辺DCを示し、図23(b)は
貼り付けるラインの他方の端点となる辺D’C’の様子
を示し、さらに図23(c)は辺D’C’におけるX方
向およびY方向のピクセル数の変化を示している。この
例に対応させて考えると、辺D’C’はY方向に14ピ
クセル、X方向に5ピクセルに渡って描画されるので、
点D’から点C’に向ってY座標を1ずつ変えていった
ときにX座標の変化する位置を求めると、そのとき変化
した座標が辺D’C’の位置となる。したがって、無条
件に位置の決る始点(点D’)を除く13個のドットを
打つときには、X座標の変化する位置としてX座標が変
化する4箇所を求めることになる。
Here, in the case of FIG. 23 (when the position of the side D'C ', which is the other end point of the pasting line, is determined)
A specific example of will be described. FIG. 23A shows a side DC which is the other end point of the line before deformation, FIG. 23B shows a state of the side D′ C ′ which is the other end point of the line to be attached, and FIG. c) shows changes in the number of pixels in the X and Y directions on the side D'C '. Considering this example, the side D'C 'is drawn over 14 pixels in the Y direction and 5 pixels in the X direction.
When the position where the X coordinate changes when the Y coordinate is changed by 1 from the point D ′ to the point C ′ is obtained, the changed coordinate becomes the position of the side D′ C ′. Therefore, when the 13 dots except the starting point (point D ′) where the position is unconditionally decided, four positions where the X coordinate changes are obtained as the positions where the X coordinate changes.

【0088】まず、最初の端点D’は無条件に決まる。
この時点で、選択誤差eは[0]に初期設定されてい
る。また、端点D’から端点C’に対してはY方向に1
4ピクセル、X方向に5ピクセルに渡って描画されるの
で、誤差増分Δeは Δe=(5−1)/(14−1) =0.30である。次いで、選択誤差eはe=0に初期
設定されているからそのままとし、誤差増分Δeとして
Δe=0.30を加えると、e=0+0.30=0.3
0<(1/2)となる。したがって、このときは次に打
つ点のX座標は変更しない(図23(c)参照)。ま
た、選択誤差eは1/2より小さいので、選択誤差eの
補正は行わない。次いで、ここまでの選択誤差e=0.
30に誤差増分ΔeとしてΔe=0.30を加えると、
e=0.30+0.30=0.60≧(1/2)となる
ので、今度は次に打つ点のX座標を変更する(図23
c)参照)。以上の処理を繰り返すことにより、点、
、(12)(なお、10以降の○付き数字は表示が困難に
つき、かっこ付きの半角数字で表す)の位置でX座標の
変更が行われ、最終的に図23(c)に示すように、端
点C’の位置が決定される。
First, the first end point D'is unconditionally determined.
At this point, the selection error e is initialized to [0]. Also, 1 from the end point D'to the end point C'in the Y direction.
Since the image is drawn over 4 pixels and 5 pixels in the X direction, the error increment Δe is Δe = (5-1) / (14-1) = 0.30. Next, since the selection error e is initially set to e = 0, it is left as it is, and when Δe = 0.30 is added as the error increment Δe, e = 0 + 0.30 = 0.3
0 <(1/2). Therefore, at this time, the X coordinate of the next hit point is not changed (see FIG. 23 (c)). Since the selection error e is smaller than 1/2, the selection error e is not corrected. Next, the selection error so far e = 0.
If Δe = 0.30 is added as an error increment Δe to 30,
Since e = 0.30 + 0.30 = 0.60 ≧ (1/2), the X coordinate of the next hit point is changed (FIG. 23).
See c)). By repeating the above process,
, (12) (Note that the numbers with a circle from 10 onward are difficult to display, so they are represented by parenthesized half-width numbers), and the X coordinate is changed, and finally as shown in FIG. 23 (c). , The position of the end point C ′ is determined.

【0089】さて、再び図33のフローチャートに戻
り、端点位置の決定が行われると、ステップS1218
に進む。ステップS1218〜ステップS1236およ
びステップS1250〜ステップS1266では、辺
A’B’、辺D’C’に分割された水平ラインのうち、
どのラインの端点を割り当てるかを求める処理を行う。
まず、図24(b)に示す辺A’B’のように図24
(a)に示す元となる辺ABよりも短い辺に、貼り付け
るラインの端点を割り当てる処理内容について説明す
る。元画像データの水平ライン数は12本、辺A’B’
に貼り付けることのできるライン数は11本なので、元
画像データの12本のラインのうち、2本のラインの端
点が辺A’B’上で重なる。重なるラインの選択の処理
は、次のようになる。
Now, returning to the flowchart of FIG. 33 again, when the end point positions are determined, step S1218
Proceed to. In step S1218 to step S1236 and step S1250 to step S1266, of the horizontal lines divided into the side A'B 'and the side D'C',
A process for determining which line end point is to be assigned is performed.
First, as shown by the side A′B ′ in FIG.
The processing contents of allocating the end points of the line to be attached to the side shorter than the original side AB shown in (a) will be described. The number of horizontal lines in the original image data is 12, and the side A'B '
Since the number of lines that can be attached to 11 is 11, the end points of 2 lines among the 12 lines of the original image data overlap on the side A′B ′. The process of selecting overlapping lines is as follows.

【0090】ステップS1218で選択誤差(初期値=
0)eを決め、選択誤差eに誤差増分Δeを加える(e
=e+Δe)。Δeは(元画像のライン数−1)/(辺
A’B’のピクセル数−1)である。なお、ここでは、
ライン選択用であるからeをe2とし、ΔeをΔe2と
して処理をする。そうすると、e2=e2+Δe2とな
る。次いで、この値が1/2より大きくなったか否かを
ステップS1220で判別する。そして、誤差増分Δe
2を加えた結果e2がe2≧(1/2)であれば、ステ
ップS1224に進んで現在のライン番号を[1]だけ
インクリメントする(つまり、次のライン番号に進め
る)。これは、選択誤差に誤差増分を加え、その結果が
1/2より大きいか小さいかによって処理を選択するも
ので、選択誤差が1/2以上のときに誤差を補正する。
現在のライン番号を1進めることにより、辺A’B’上
の次の点には次のラインの端点が割り当てられる。
In step S1218, the selection error (initial value =
0) e, and the error increment Δe is added to the selection error e (e
= E + Δe). Δe is (the number of lines of the original image-1) / (the number of pixels of the side A'B'-1). In addition, here
Since it is for line selection, e is set to e2 and Δe is set to Δe2. Then, e2 = e2 + Δe2. Next, it is determined in step S1220 whether this value has become larger than 1/2. Then, the error increment Δe
If the result e2 of adding 2 is e2 ≧ (1/2), the process advances to step S1224 to increment the current line number by [1] (that is, advances to the next line number). In this method, an error increment is added to the selection error, and the process is selected depending on whether the result is larger or smaller than 1/2, and the error is corrected when the selection error is 1/2 or more.
By advancing the current line number by 1, the next point on side A'B 'is assigned the endpoint of the next line.

【0091】このようにすると、点A’から点B’に向
ってX座標を1ずつ変えていったときに、少なくとも誤
差増分Δe2が1の半分より大きい場合に、次のライン
番号に変更するので、ライン端点の変化する位置が滑ら
かにつながることになる。また、ステップS1220で
e2が1/2未満のときはステップS1236にジャン
プする。ステップS1236ではすべての端点について
処理したか否かを判別し、すべての端点について処理が
終了していなければ、ステップS1208に戻って同様
の処理を繰り返す。したがって、誤差増分Δe2が1の
半分より大きくなった時点でステップS1236へジャ
ンプせず、ステップS1224の方に進むことになる。
In this way, when the X coordinate is changed by 1 from the point A ′ to the point B ′, at least when the error increment Δe2 is larger than half of 1, the line number is changed to the next line number. Therefore, the changing positions of the line end points are smoothly connected. If e2 is less than 1/2 in step S1220, the process jumps to step S1236. In step S1236, it is determined whether or not all the end points have been processed. If the processing has not been completed for all the end points, the process returns to step S1208 and the same processing is repeated. Therefore, when the error increment Δe2 becomes larger than half of 1, it does not jump to step S1236 but proceeds to step S1224.

【0092】ステップS1224を経ると、続くステッ
プS1224で誤差補正を行い、e2=e2−1とす
る。これは、選択誤差が1/2以上になって次のライン
番号に変更したので、1を減算することにより、再び次
のライン番号から誤差増分Δeを加えて同様の判別を始
めるためである。次いで、ステップS1228で再び選
択誤差e2が1/2以上であるか否かを判別する。これ
は、誤差補正を行った結果について、再度選択誤差e2
の大ささを判断するものである。そして、誤差補正を行
った結果、選択誤差e2が依然として1/2以上であれ
ば、ステップS1230に進み、現在のライン番号と現
在座標をCPU31の内部レジスタ31a内の端点バッ
ファに格納する。次いで、ステップS1232でライン
番号を[1]だけインクリメントする(つまり、次のラ
イン番号に進める)。これにより、辺A’B’上の同じ
点に、次のラインの端点も割り当てられる。そして、選
択誤差e2が1/2未満になるまで、同じ点に次のライ
ンの端点が順次割り当てられていく。
After step S1224, error correction is performed in step S1224 to set e2 = e2-1. This is because since the selection error has become 1/2 or more and the line number has been changed to the next line number, by subtracting 1 from the next line number, the error increment Δe is added again and the same determination is started. Next, in step S1228, it is determined again whether the selection error e2 is 1/2 or more. This is because the selection error e2 is again calculated for the result of error correction.
Is to judge the size of. If the selection error e2 is still ½ or more as a result of the error correction, the process advances to step S1230 to store the current line number and the current coordinate in the end point buffer in the internal register 31a of the CPU 31. Next, in step S1232, the line number is incremented by [1] (that is, the line number is advanced to the next line number). Thereby, the end point of the next line is also assigned to the same point on the side A'B '. The end points of the next line are sequentially assigned to the same point until the selection error e2 becomes less than 1/2.

【0093】次いで、ステップS1234で誤差補正を
行い、e2=e2−1とする。これは、上記同様に選択
誤差が1/2以上になって次のライン番号に変更したの
で、1を減算することにより、再び次のライン番号から
誤差増分Δeを加えて同様の判別を始めるためである。
その後、ステップS1228に戻って同様の処理を繰り
返す。したがって、誤差を補正した結果(選択誤差)e
2が未だ1/2より大きければ、ライン番号を更に1進
めて辺A’B’上の同じ点に、次のラインの端点が割り
当てられ、選択誤差e2が1/2未満になるまで、同じ
点に次のラインの端点が割り当てられることになる。
Next, in step S1234, error correction is performed to set e2 = e2-1. This is because the selection error becomes 1/2 or more and the line number is changed to the next line number in the same manner as described above. Therefore, by subtracting 1, the error increment Δe is added again from the next line number to start the same determination. Is.
Then, it returns to step S1228 and repeats the same processing. Therefore, the result of correcting the error (selection error) e
If 2 is still larger than 1/2, the line number is further advanced by 1 and the end point of the next line is assigned to the same point on the side A'B ', and the same is true until the selection error e2 becomes less than 1/2. The point will be assigned the endpoint of the next line.

【0094】一方、ステップS1228で誤差増分Δe
2を加えた結果e2がe2<(1/2)であれば、ステ
ップS1236にジャンプする。このときは、次のライ
ン番号に変更されず、ライン番号は元のままである。ま
た、この場合は選択誤差e2は補正しない。ステップS
1236ではすべての端点について処理したか否かを判
別する。すべての端点について処理が終了していなけれ
ば、ステップS1208に戻って処理を繰り返す。これ
により、点A’から点B’に向ってX座標を1ずつ変え
ていったときに、誤差増分Δe2の大きさに応じて上記
のような処理が繰り返される。誤差増分Δe2が1/2
より大きい場合に、次のライン番号に変更されていく。
以上のステップS1218〜ステップS1236を実行
することにより、辺A’B’のように元となる辺ABよ
りも短い辺に、貼り付けるラインの端点を割り当てる場
合の各ライン端点の位置が決定される。
On the other hand, in step S1228, the error increment Δe
If the result of adding 2 is e2 <(1/2), the process jumps to step S1236. At this time, the line number is not changed to the next line number and remains unchanged. Further, in this case, the selection error e2 is not corrected. Step S
At 1236, it is determined whether or not all the end points have been processed. If the process has not been completed for all the end points, the process returns to step S1208 to repeat the process. As a result, when the X coordinate is changed by 1 from the point A ′ toward the point B ′, the above processing is repeated according to the magnitude of the error increment Δe2. Error increment Δe2 is 1/2
If it is larger, it is changed to the next line number.
By executing the above steps S1218 to S1236, the position of each line end point when the end point of the line to be pasted is assigned to a side shorter than the original side AB such as the side A′B ′ is determined. .

【0095】ここで、図24の場合(辺A’B’のよう
に元となる辺ABよりも短い辺に、ラインの一方の端点
を割り当てる場合)の具体例について説明する。図24
(a)は変形前のラインの一方の端点となる辺ABを示
し、図24(b)は貼り付けるラインの一方の端点とな
る辺A’B’の様子を示し、さらに図24(c)は辺
A’B’におけるX方向およびY方向のピクセル数の変
化を示している。まず、ライン0の端点が頂点A’上に
決まる。この時点でライン番号は0、選択誤差eは
[0]に初期設定されている。また、誤差増分Δeは Δe=(12−1)/(11−1)=1.10である。
次いで、選択誤差eはe=0に初期設定されているから
そのまとし、誤差増分ΔeとしてΔe=1.10を加え
ると、e=0+1.10=1.10≧(1/2)とな
る。これにより、ライン番号を1進める(ライン1にな
る:図24(c)参照)。したがって、辺A’B’上の
点にはライン1の端点が割り当てられる(図24
(b)参照)。このとき、選択誤差eを次のように補正
する。 e=1.10−1=0.10<1/2
Here, a specific example in the case of FIG. 24 (when one end point of the line is assigned to a side shorter than the original side AB such as the side A'B ') will be described. Figure 24
FIG. 24A shows a side AB which is one end point of the line before deformation, FIG. 24B shows a state of a side A′B ′ which is one end point of the line to be attached, and FIG. Indicates a change in the number of pixels in the X direction and the Y direction on the side A′B ′. First, the end point of line 0 is determined on vertex A '. At this point, the line number is initialized to 0 and the selection error e is initialized to [0]. The error increment Δe is Δe = (12-1) / (11-1) = 1.10.
Next, since the selection error e is initially set to e = 0, the error increment Δe is added to Δe = 1.10, so that e = 0 + 1.10 = 1.10 ≧ (1/2). . As a result, the line number is advanced by 1 (becomes line 1: see FIG. 24 (c)). Therefore, the end points of the line 1 are assigned to the points on the side A′B ′ (FIG. 24).
(See (b)). At this time, the selection error e is corrected as follows. e = 1.10-1 = 0.10 <1/2

【0096】ここまでの選択誤差e=0.10に、再び
誤差増分Δe=1.10を加えると、e=0.10+
1.10=1.20≧(1/2)となる。これにより、
ライン番号を1進める(今度はライン2になる:図24
(c)参照)。したがって、辺A’B’上の点にはラ
イン2の端点が割り当てられる(図24(b)参照)。
このとき、選択誤差eを次のように補正する。 e=1.20−1=0.20<1/2 以下、同様の処理を行い、辺A’B’上の点にはライ
ン3の端点が、点にはライン4の端点が、点にはラ
イン5の端点がそれぞれ割り当てられる(図24(b)
参照)。このとき、ライン5を割り当てて選択誤差eを
補正した時点で選択誤差eは0.50になる。選択誤差
eを補正した時点で未だe≧1/2なので、ライン番号
を更に1進めて(ライン6になる)、点にライン6の
端点も割り当てる。次いで、さらに選択誤差eを以下の
ように補正する。 e=0.50−1=−0.50<1/2 以上の処理を繰り返すことにより、辺A’B’に分割さ
れた元の水平ライン内のどのラインの端点を割り当てる
かが決まる。
When the error increment Δe = 1.10 is added again to the selection error e = 0.10 so far, e = 0.10 +
1.10 = 1.20 ≧ (1/2). This allows
Advance line number by 1 (this time becomes line 2: Figure 24)
(See (c)). Therefore, the end points of the line 2 are assigned to the points on the side A′B ′ (see FIG. 24B).
At this time, the selection error e is corrected as follows. e = 1.20-1 = 0.20 <1/2 Hereafter, the same processing is performed, and the point on the side A′B ′ is the end point of the line 3, the point is the end point of the line 4, and the point is the point. Are assigned the endpoints of line 5 (FIG. 24 (b)).
reference). At this time, when the line 5 is allocated and the selection error e is corrected, the selection error e becomes 0.50. Since e ≧ 1/2 when the selection error e is corrected, the line number is further advanced by 1 (to become line 6) and the end point of line 6 is also assigned to the point. Next, the selection error e is further corrected as follows. e = 0.50−1 = −0.50 <1/2 By repeating the above processing, it is determined which end point of the original horizontal line divided into the side A′B ′ is assigned.

【0097】さて、再び図33のフローチャートに戻っ
て説明する。上述の説明は辺A’B’のように元となる
辺ABよりも短い辺に、貼り付けるラインの端点を割り
当てる処理内容であったが、今度は、図25(b)に示
す辺D’C’のように図25(a)に示す元となる辺D
Cよりも長い辺に、貼り付けるラインの端点を割り当て
る処理内容について説明する。この場合には図33に示
すステップS1250以降の処理が実行される。これ
は、先のステップS1204の判別結果がNOである場
合に相当し、この判別結果がNOということは元となる
辺DCよりも長い辺D’C’の処理に進むケースであ
る。ステップS1204の判別結果がNOであるときは
図33のステップS1238に分岐し、端点の位置決定
を行った後、ステップS1250以降の各ステップを実
行する。まず、元画像データの水平ライン数は12本、
辺D’C’に貼り付けることのできるライン数は14本
なので、元画像データの12本のラインのうち、2本の
ラインの端点が辺D’C’上で2回貼り付けられること
になる。貼り付けられるラインの選択の処理は、次のよ
うになる。
Now, returning to the flowchart of FIG. 33 again, description will be made. The above description is the processing content of allocating the end points of the pasting line to a side shorter than the original side AB such as the side A′B ′, but this time, the side D ′ shown in FIG. An edge D as shown in FIG.
The contents of the process of assigning the end points of the line to be attached to the side longer than C will be described. In this case, the processing from step S1250 onward shown in FIG. 33 is executed. This corresponds to the case where the determination result of the previous step S1204 is NO, and when the determination result is NO, this is a case where the process proceeds to the side D'C 'longer than the original side DC. If the decision result in the step S1204 is NO, the process branches to a step S1238 in FIG. 33 to determine the position of the end point, and then execute the steps after the step S1250. First, the number of horizontal lines in the original image data is 12,
Since the number of lines that can be pasted on the side D'C 'is 14, the end points of two lines of the 12 lines of the original image data are pasted twice on the side D'C'. Become. The process of selecting the line to be pasted is as follows.

【0098】ステップS1250で選択誤差(初期値=
0)eを決め、選択誤差eに誤差増分Δeを加える(e
=e+Δe)。Δeは(元画像のライン数−1)/(辺
D’C’のピクセル数−1)である。なお、ここでは、
ライン選択用であるからeをe2とし、ΔeをΔe2と
して処理をする。そうすると、e2=e2+Δe2とな
る。次いで、この値が1/2より大きくなったか否かを
ステップS1252で判別する。そして、誤差増分Δe
2を加えた結果e2がe2≧(1/2)であれば、ステ
ップS1254に進んで現在のライン番号を[1]だけ
インクリメントする(つまり、次のライン番号に進め
る)。これは、選択誤差に誤差増分を加え、その結果が
1/2より大きいか小さいかによって処理を選択するも
ので、選択誤差が1/2以上のときに誤差を補正する。
現在のライン番号を1進めることにより、辺D’C’上
の次の点には次のラインの端点が割り当てられる。
In step S1250, the selection error (initial value =
0) e, and the error increment Δe is added to the selection error e (e
= E + Δe). Δe is (the number of lines of the original image-1) / (the number of pixels of the side D'C'-1). In addition, here
Since it is for line selection, e is set to e2 and Δe is set to Δe2. Then, e2 = e2 + Δe2. Next, it is determined in step S1252 whether or not this value has become larger than 1/2. Then, the error increment Δe
If the result e2 of adding 2 is e2 ≧ (1/2), the flow advances to step S1254 to increment the current line number by [1] (that is, to advance to the next line number). In this method, an error increment is added to the selection error, and the process is selected depending on whether the result is larger or smaller than 1/2, and the error is corrected when the selection error is 1/2 or more.
By advancing the current line number by 1, the next point on the side D'C 'is assigned the endpoint of the next line.

【0099】このようにすると、点D’から点C’に向
ってX座標を1ずつ変えていったときに、少なくとも誤
差増分Δe2が1の半分より大きい場合に、次のライン
番号に変更するので、ライン端点の変化する位置が滑ら
かにつながることになる。また、ステップS252でe
2が1/2未満のときはステップS266にジャンプす
る。ステップS1266ではすべての端点について処理
したか否かを判別し、すべての端点について処理が終了
していなければ、ステップS1240に戻って同様の処
理を繰り返す。したがって、誤差増分Δe2が1の半分
より大きくなった時点でステップS1266へジャンプ
せず、ステップS1254の方に進むことになる。
In this way, when the X coordinate is changed by 1 from the point D ′ to the point C ′, at least when the error increment Δe2 is larger than half of 1, the line number is changed to the next line number. Therefore, the changing positions of the line end points are smoothly connected. In step S252, e
If 2 is less than 1/2, the process jumps to step S266. In step S1266, it is determined whether or not all the end points have been processed. If the processing has not been completed for all the end points, the process returns to step S1240 and the same processing is repeated. Therefore, when the error increment Δe2 becomes larger than half of 1, the process does not jump to step S1266 but proceeds to step S1254.

【0100】ステップS1254を経ると、続くステッ
プS1256で誤差補正を行い、e2=e2−1とす
る。これは、選択誤差が1/2以上になって次のライン
番号に変更したので、1を減算することにより、再び次
のライン番号から誤差増分Δeを加えて同様の判別を始
めるためである。次いで、ステップS1258で再び選
択誤差e2が1/2以上であるか否かを判別する。これ
は、誤差補正を行った結果について、再度選択誤差e2
の大きさを判断するものである。そして、誤差補正を行
った結果、選択誤差e2が依然として1/2以上であれ
ば、ステップS1260に進み、現在のライン番号と現
在座標をCPU31の内部レジスタ31a内の端点バッ
ファに格納する。次いで、ステップS1262でライン
番号を[1]だけインクリメントする(つまり、次のラ
イン番号に進める)。これにより、辺D’C’上の同じ
点に、次のラインの端点も割り当てられる。そして、選
択誤差e2が1/2未満になるまで、同じ点に次のライ
ンの端点が順次割り当てられていく。
After step S1254, error correction is performed in step S1256 to set e2 = e2-1. This is because since the selection error has become 1/2 or more and the line number has been changed to the next line number, by subtracting 1 from the next line number, the error increment Δe is added again and the same determination is started. Then, in step S1258, it is determined again whether the selection error e2 is 1/2 or more. This is because the selection error e2 is again calculated for the result of error correction.
Is to determine the size of. If the selection error e2 is still ½ or more as a result of the error correction, the process advances to step S1260 to store the current line number and the current coordinate in the end point buffer in the internal register 31a of the CPU 31. Next, in step S1262, the line number is incremented by [1] (that is, the line number is advanced to the next line number). Thereby, the end point of the next line is also assigned to the same point on the side D'C '. The end points of the next line are sequentially assigned to the same point until the selection error e2 becomes less than 1/2.

【0101】次いで、ステップS1264で誤差補正を
行い、e2=e2−1とする。これは、上記同様に選択
誤差が1/2以上になって次のライン番号に変更したの
で、1を減算することにより、再び次のライン番号から
誤差増分Δeを加えて同様の判別を始めるためである。
その後、再びステップS1258に戻って同様の処理を
繰り返す。したがって、誤差を補正した結果(選択誤
差)e2が未だ1/2より大きければ、ライン番号を更
に1進めて辺D’C’上の同じ点に、次のラインの端点
が割り当てられることになる。そして、選択誤差e2が
1/2未満になるまで、同じ点に次のラインの端点が割
り当てられていく。
Then, in step S1264, error correction is performed to set e2 = e2-1. This is because the selection error becomes 1/2 or more and the line number is changed to the next line number in the same manner as described above. Therefore, by subtracting 1, the error increment Δe is added again from the next line number to start the same determination. Is.
Then, the process returns to step S1258 and the same process is repeated. Therefore, if the error correction result (selection error) e2 is still larger than 1/2, the line number is further advanced by 1 and the end point of the next line is assigned to the same point on the side D'C '. . Then, the end points of the next line are assigned to the same point until the selection error e2 becomes less than 1/2.

【0102】一方、ステップS258で誤差増分Δe2
を加えた結果e2がe2<(1/2)であれば、ステッ
プS1266にジャンプする。このときは、次のライン
番号に変更されず、ライン番号は元のままである。ま
た、この場合は選択誤差e2は補正しない。ステップS
1266ではすべての端点について処理したか否かを判
別する。すべての端点について処理が終了していなけれ
ば、ステップS1240に戻って処理を繰り返す。これ
により、点D’から点C’に向ってX座標を1ずつ変え
ていったときに、誤差増分Δe2の大きさに応じて上記
のような処理が繰り返される。誤差増分Δe2が1/2
より大きい場合に、次のライン番号に変更されていく。
以上のステップS1250〜ステップS1266を実行
することにより、辺D’C’のように元となる辺DCよ
りも長い辺に、貼り付けるラインの端点を割り当てる場
合の各ライン端点の位置が決定される。
On the other hand, in step S258, the error increment Δe2
If the result of adding e2 is e2 <(1/2), the process jumps to step S1266. At this time, the line number is not changed to the next line number and remains unchanged. Further, in this case, the selection error e2 is not corrected. Step S
At 1266, it is determined whether or not all the end points have been processed. If the processing has not been completed for all the end points, the processing returns to step S1240 and is repeated. As a result, when the X coordinate is changed by 1 from the point D ′ to the point C ′, the above processing is repeated according to the magnitude of the error increment Δe2. Error increment Δe2 is 1/2
If it is larger, it is changed to the next line number.
By executing the above steps S1250 to S1266, the position of each line end point when the end point of the line to be pasted is assigned to a side longer than the original side DC such as the side D'C 'is determined. .

【0103】ここで、図25の場合(辺D’C’のよう
に元となる辺ABよりも長い辺に、ラインの一方の端点
を割り当てる場合)の具体例について説明する。図25
(a)は変形前のラインの一方の端点となる辺DCを示
し、図25(b)は貼り付けるラインの一方の端点とな
る辺D’C’の様子を示し、さらに図25(c)は辺
D’C’におけるX方向およびY方向のピクセル数の変
化を示している。まず、ライン0の端点が頂点てD’上
に決まる。この時点でライン番号は0、選択誤差eは
[0]に初期設定されている。また、誤差増分Δeは Δe=(12−1)/(14−1)=0.84である。
次いで、選択誤差eはe=0に初期設定されているから
そのままとし、誤差増分ΔeとしてΔe=0.84を加
えると、e=0+0.84=0.84≧(1/2)とな
る。これにより、ライン番号を1進める(ライン1にな
る:図25(c)参照)。したがって、辺D’C’上の
点にはライン1の端点が割り当てられる(図25
(b)参照)。このとき、選択誤差eを次のように補正
する。 e=0.84−1=−0.16<1/2
Here, a specific example of the case of FIG. 25 (when one end point of the line is assigned to a side longer than the original side AB such as the side D'C ') will be described. Figure 25
25A shows a side DC that is one end point of the line before deformation, FIG. 25B shows a state of a side D′ C ′ that is one end point of the line to be attached, and FIG. Indicates changes in the number of pixels in the X direction and the Y direction on the side D′ C ′. First, the end point of line 0 is apex and is determined on D '. At this point, the line number is initialized to 0 and the selection error e is initialized to [0]. The error increment Δe is Δe = (12-1) / (14-1) = 0.84.
Next, since the selection error e is initially set to e = 0, it is left as it is, and when Δe = 0.84 is added as the error increment Δe, e = 0 + 0.84 = 0.84 ≧ (1/2). This advances the line number by 1 (becomes line 1: see FIG. 25 (c)). Therefore, the end points of the line 1 are assigned to the points on the side D'C '(FIG. 25).
(See (b)). At this time, the selection error e is corrected as follows. e = 0.84-1 = -0.16 <1/2

【0104】同様に、辺D’C’上の点にはライン2
の端点が、点にはライン3の端点が割り当てられる
(図25(b)参照)。ライン3を割り当てて選択誤差
eを補正して時点で、選択誤差eは−0.48になって
いる。ここまでの選択誤差e=−0.48に再び誤差増
分Δe=0.84を加えると、e=−0.48+0.8
4=0.36<(1/2)になるので、ライン3を点
にもう一度貼り付ける(図25(c)参照)。このと
き、選択誤差eは補正しない。以上の処理を繰り返すこ
とにより、辺D’C’に分割された元の水平ライン内の
どのラインの端点を割り当てるかが決まる。ライン端点
処理が終わった時点における端点バッファへの格納デー
タは図36に示すようになる。図36では、辺A’B’
上のライン0〜ライン11の12個の端点位置が座標に
よって端点バッファに記憶される。また、辺D’C’上
のライン0〜ライン11(そのうちライン3とライン8
は2つある)の14個の端点位置が座標によって端点バ
ッファに記憶される。
Similarly, the line 2 is located at a point on the side D'C '.
, And the end point of line 3 is assigned to the point (see FIG. 25B). At the time when the line 3 is allocated and the selection error e is corrected, the selection error e is -0.48. If the error increment Δe = 0.84 is added again to the selection error e = −0.48 so far, e = −0.48 + 0.8
Since 4 = 0.36 <(1/2), line 3 is pasted again at a point (see FIG. 25 (c)). At this time, the selection error e is not corrected. By repeating the above processing, it is determined which end point of the original horizontal line divided into the side D'C 'is assigned. The data stored in the end point buffer at the time when the line end point processing is completed is as shown in FIG. In FIG. 36, side A'B '
The 12 end point positions of the upper line 0 to line 11 are stored in the end point buffer by coordinates. Line 0 to line 11 on the side D'C '(of which line 3 and line 8
14 end point positions are stored in the end point buffer by coordinates.

【0105】ライン描画処理のサブルーチン さて、その後はこのようにして求めた辺A’B’上に一
方のラインの端点を持ち、辺D’C’上に他方の端点を
持つような複数のラインに元画像データ(矩形ABC
D)の対応するラインを順番に貼り付けていけば画像変
形が行える。ただし、このとき転送先と転送元ではライ
ンの長さ(ピクセル数)が異なるので、ライン毎に拡大
あるいは縮小をしながら貼り付けていくことになる。そ
こで、続いて前述の図19に示したステップS1108
のラインの描画処理のサブルーチンについて説明する。
図34はラインの描画処理を示すサブルーチンのフロー
チャートである。まず、貼り付けるラインの位置を求め
る処理から説明する。具体例としては、後にライン0の
貼り付け位置を求める方法を説明をする。他のラインの
貼り付け位置についても同様である。まず、ステップS
1300で座標決定用誤差e1、ドット選択用誤差e
3、現在ドット番号をすべて[0]に初期設定する。座
標決定用誤差e1とは、ここではラインの描画位置を決
めるときに用いる座標決定用誤差のことである。ドット
選択用誤差e3とは、ラインに割り当てるドットを選択
するときに用いるドット選択用誤差のことである。これ
により、最初は各誤差が[0]になる。
Subroutine for Line Drawing Process Then, after that, a plurality of lines having an end point of one line on the side A'B 'thus obtained and another end point on the side D'C' Original image data (rectangle ABC
If the corresponding lines of D) are attached in order, the image can be transformed. However, at this time, since the line length (the number of pixels) is different between the transfer destination and the transfer source, the lines are attached while expanding or reducing each line. Therefore, subsequently, step S1108 shown in FIG.
The subroutine of the line drawing process will be described.
FIG. 34 is a flowchart of a subroutine showing line drawing processing. First, the process of obtaining the position of the line to be attached will be described. As a specific example, a method of obtaining the sticking position of line 0 will be described later. The same applies to the attachment positions of other lines. First, step S
In 1300, the coordinate determination error e1 and the dot selection error e
3. Initialize all current dot numbers to [0]. The coordinate determination error e1 is a coordinate determination error used when determining the line drawing position. The dot selection error e3 is a dot selection error used when selecting a dot to be assigned to a line. As a result, each error initially becomes [0].

【0106】次いで、ステップS1302で辺A’B’
上の端点の座標をCPU31の内部レジスタ31aにあ
る現在座標というエリアに格納する(図30参照)。な
お、ドット選択処理の過程で使用される関連の格納エリ
アとしては、ドット選択用誤差e3のエリア、ドット選
択用誤差増分Δe3のエリア、現在ドット番号のエリア
が用いられる。次いで、ステップS1304でY方向の
ピクセル数がX方向のピクセル数より多いか否かを判別
する。いま、ライン0を貼り付けるため各ドットの位置
を求める場合の具体例は図26に示される。図26
(a)は変形前のラインADを示し、図26(b)は変
形後のライン辺A’D’の様子を示し、さらに図26
(c)は辺A’D’におけるX方向およびY方向のピク
セル数の変化を示している。この例に対応させて考える
と、辺A’D’はY方向に10ピクセル、X方向に2ピ
クセルに渡って描画されるので、ステップS1304の
判別結果はYESとなり、このケースではステップS1
306に進む。一方、逆のケースではNOに分岐して図
25に示すステップS1328に進む。また、この場
合、図26に示すケースでは点A’から点D’に向って
X座標を1ずつ変えていったときにY座標の変化する位
置を求めると、そのとき変化した座標がラインA’D’
を貼り付けする位置となる。したがって、無条件に位置
の決る始点(点A’)を除く9個のドットを打つときに
は、X座標の変化する位置としてX座標が変化する1箇
所を求めることになる。
Next, in step S1302, the side A'B '
The coordinates of the upper end point are stored in an area called current coordinates in the internal register 31a of the CPU 31 (see FIG. 30). As related storage areas used in the process of the dot selection processing, the area of the dot selection error e3, the area of the dot selection error increment Δe3, and the area of the current dot number are used. Next, in step S1304, it is determined whether the number of pixels in the Y direction is larger than the number of pixels in the X direction. FIG. 26 shows a specific example in which the position of each dot is obtained in order to paste the line 0. FIG. 26
26A shows the line AD before the deformation, FIG. 26B shows the state of the line side A′D ′ after the deformation, and FIG.
(C) shows a change in the number of pixels in the X direction and the Y direction on the side A′D ′. Considering this example, since the side A′D ′ is drawn over 10 pixels in the Y direction and 2 pixels in the X direction, the determination result of step S1304 is YES, and in this case, step S1
Proceed to 306. On the other hand, in the opposite case, the process branches to NO and proceeds to step S1328 shown in FIG. Further, in this case, in the case shown in FIG. 26, when the position where the Y coordinate changes when the X coordinate is changed by 1 from the point A ′ to the point D ′, the changed coordinate is the line A. "D"
Is the position to paste. Therefore, when 9 dots except the starting point (point A ′) where the position is unconditionally decided, one position where the X coordinate changes is obtained as the position where the X coordinate changes.

【0107】ステップS1306に進むと、座標決定用
誤差増分Δe1を(Xピクセル数−1)/(Yピクセル
数−1)に初期設定するとともに、ドット選択誤差増分
Δe3を(転送元ドット数−1)/(転送先ドット数−
1)に初期設定する。ステップS1300〜ステップS
1306の処理により必要な初期設定が完了する。次い
で、ステップS1308で現在座標に描画されていなけ
れば、現在ドット番号のドットを描画する。これによ
り、該当するラインの最初の点がドットで描画され
る。次いで、ステップS1310で現在座標のY座標を
変更する。次いで、ステップS1312で座標決定用誤
差e1についての判別を以下のようにして行う。すなわ
ち、選択誤差(初期値=0)eを決め、選択誤差eに誤
差増分Δeを加える(e=e+Δe)。Δeは(Y方向
のピクセル数−1)/(X方向のピクセル数−1)であ
る。なお、ここでは、座標決定用であるからeをe1と
し、ΔeをΔe1として処理をする。そうすると、e1
=e1+Δe1となる。この値が1/2より大きくなっ
たか否かを判別する。そして、誤差増分Δe1を加えた
結果e1がe1≧(1/2)であれば、ステップS13
14に進んで次に打つ点の座標(次の現在座標に相当)
のX座標を変更する。これは、選択誤差に誤差増分を加
え、その結果が1/2より大きいか小さいかによって処
理を選択するもので、選択誤差が1/2以上のときに誤
差を補正する。
In step S1306, the coordinate determination error increment Δe1 is initialized to (X pixel number -1) / (Y pixel number -1), and the dot selection error increment Δe3 is set to (source dot number -1). ) / (Number of transfer destination dots −
Initialize to 1). Step S1300 to Step S
The necessary initial settings are completed by the processing of 1306. Next, in step S1308, if it is not drawn at the current coordinates, the dot of the current dot number is drawn. As a result, the first point of the corresponding line is drawn as a dot. Next, in step S1310, the Y coordinate of the current coordinate is changed. Next, in step S1312, the determination regarding the coordinate determination error e1 is performed as follows. That is, the selection error (initial value = 0) e is determined, and the error increment Δe is added to the selection error e (e = e + Δe). Δe is (the number of pixels in the Y direction-1) / (the number of pixels in the X direction-1). Note that, here, since it is for determining the coordinates, e is set to e1 and Δe is set to Δe1. Then, e1
= E1 + Δe1. It is determined whether this value is larger than 1/2. If the result e1 of adding the error increment Δe1 is e1 ≧ (1/2), step S13
Go to step 14 and set the coordinates of the next hit point (corresponding to the next current coordinates)
Change the X coordinate of. In this method, an error increment is added to the selection error, and the process is selected depending on whether the result is larger or smaller than 1/2, and the error is corrected when the selection error is 1/2 or more.

【0108】このようにすると、点A’から点D’に向
ってX座標を1ずつ変えていったときに、少なくとも誤
差増分Δe1が1の半分より大きい場合に、次の座標を
変更するので、Y座標の変化する位置が滑らかにつなが
ることになる。次いで、ステップS1316で誤差補正
を行い、e1=e1−1とする。これは、選択誤差が1
/2以上になって次の座標を変更したので、1を減算す
ることにより、再び次の現在座標から誤差増分Δeを加
えて同様の判別を始めるためである。その後、ステップ
S1318に進む。また、誤差増分Δe1を加えた結果
e1がe1<(1/2)であれば、ステップS131
4、ステップS1316をジャンプしてステップS13
18に進む。このときは、次に打つ点のX座標は元のま
まにする。また、この場合は選択誤差e1は補正しな
い。以上のステップS1310〜ステップS1316を
実行することにより、Y方向のピクセル数がX方向のピ
クセル数より多い場合における該当するラインの貼り付
け位置が決定される。
In this way, when the X coordinate is changed by 1 from the point A ′ to the point D ′, the next coordinate is changed at least when the error increment Δe1 is larger than half of 1. , Y-coordinate changing positions are smoothly connected. Next, in step S1316, error correction is performed to set e1 = e1-1. This has a selection error of 1
This is because since the next coordinate has been changed to / 2 or more, 1 is subtracted, and the error increment Δe is added again from the next current coordinate to start the same determination. Then, it progresses to step S1318. If the result e1 of adding the error increment Δe1 is e1 <(1/2), step S131
4, jump from step S1316 to step S13
Proceed to 18. At this time, the X coordinate of the next hit point remains unchanged. Further, in this case, the selection error e1 is not corrected. By executing the above steps S1310 to S1316, the paste position of the corresponding line when the number of pixels in the Y direction is larger than the number of pixels in the X direction is determined.

【0109】一方、上記ステップS1304でY方向の
ピクセル数がX方向のピクセル数より小さいときは図3
5のステップS1328に進み、今度はX座標の方を変
更する処理を行う。すなわち、ステップS1328で座
標決定用誤差増分Δe1を(Yピクセル数−1)/(X
ピクセル数−1)に初期設定するとともに、ドット選択
誤差増分Δe3を(転送元ドット数−1)/(転送先ド
ット数−1)に初期設定する。次いで、ステップS13
30で現在座標に描画されていなければ、現在ドット番
号のドットを描画する。これにより、該当するラインの
最初の点がドットで描画される。次いで、ステップS
1332で現在座標のX座標を変更する。次いで、ステ
ップS1334で座標決定用誤差e1についての判別を
以下のようにして行う。
On the other hand, if the number of pixels in the Y direction is smaller than the number of pixels in the X direction in step S1304, then the process shown in FIG.
In step S1328 of step 5, processing for changing the X coordinate is performed. That is, in step S1328, the coordinate determination error increment Δe1 is set to (Y pixel number-1) / (X
Initially, the number of pixels-1) and the dot selection error increment Δe3 are initialized to (the number of transfer source dots-1) / (the number of transfer destination dots-1). Then, step S13
If it is not drawn at the current coordinates at 30, the dot of the current dot number is drawn. As a result, the first point of the corresponding line is drawn as a dot. Then, step S
At 1332, the X coordinate of the current coordinate is changed. Next, in step S1334, the determination regarding the coordinate determination error e1 is performed as follows.

【0110】すなわち、選択誤差(初期値=0)eを決
め、選択誤差eに誤差増分Δeを加える(e=e+Δ
e)。Δeは(Y方向のピクセル数−1)/(X方向の
ピクセル数−1)である。なお、ここでは、座標決定用
であるからeをe1とし、ΔeをΔe1として処理をす
る。そうすると、e1=e1+Δe1となる。この値が
1/2より大きくなったか否かを判別する。そして、誤
差増分Δe1を加えた結果e1がe1≧(1/2)であ
れば、ステップS1336に進んで次に打つ点の座標
(次の現在座標に相当)のY座標を変更する。これは、
選択誤差に誤差増分を加え、その結果が1/2より大き
いか小さいかによって処理を選択するもので、選択誤差
が1/2以上のときに誤差を補正する。
That is, the selection error (initial value = 0) e is determined, and the error increment Δe is added to the selection error e (e = e + Δ
e). Δe is (the number of pixels in the Y direction-1) / (the number of pixels in the X direction-1). Note that, here, since it is for determining the coordinates, e is set to e1 and Δe is set to Δe1. Then, e1 = e1 + Δe1. It is determined whether this value is larger than 1/2. If the result e1 obtained by adding the error increment Δe1 is e1 ≧ (1/2), the process advances to step S1336 to change the Y coordinate of the coordinate of the next hit point (corresponding to the next current coordinate). this is,
An error increment is added to the selection error, and the process is selected depending on whether the result is larger or smaller than 1/2. The error is corrected when the selection error is 1/2 or more.

【0111】このようにすると、点A’から点D’に向
ってX座標を1ずつ変えていったときに、少なくとも誤
差増分Δe1が1の半分より大きい場合に、次の座標を
変更するので、Y座標の変化する位置が滑らかにつなが
ることになる。次いで、ステップS1340で誤差補正
を行い、e1=e1−1とする。これは、選択誤差が1
/2以上になって次の座標を変更したので、1を減算す
ることにより、再び次の現在座標から誤差増分Δeを加
えて同様の判別を始めるためである。その後、ステップ
S1342に進む。また、誤差増分Δe1を加えた結果
e1がe1<(1/2)であれば、ステップS133
8、ステップS1340をジャンプしてステップS13
42に進む。このときは、次に打つ点のX座標は元のま
まにする。また、この場合は選択誤差e1は補正しな
い。以上のステップS1332〜ステップS1340を
実行することにより、Y方向のピクセル数がX方向のピ
クセル数より小さい場合における該当するラインの貼り
付け位置が決定される。
In this way, when the X coordinate is changed by 1 from the point A ′ to the point D ′, the next coordinate is changed at least when the error increment Δe1 is larger than half of 1. , Y-coordinate changing positions are smoothly connected. Next, in step S1340, error correction is performed to set e1 = e1-1. This has a selection error of 1
This is because since the next coordinate has been changed to / 2 or more, 1 is subtracted, and the error increment Δe is added again from the next current coordinate to start the same determination. Then, it progresses to step S1342. If the result e1 of adding the error increment Δe1 is e1 <(1/2), step S133.
8. Jump from step S1340 to step S13
Proceed to 42. At this time, the X coordinate of the next hit point remains unchanged. Further, in this case, the selection error e1 is not corrected. By executing the above steps S1332 to S1340, the paste position of the corresponding line when the number of pixels in the Y direction is smaller than the number of pixels in the X direction is determined.

【0112】なお、上記処理は前述した図32に示すス
テップS1210〜ステップS1216と同様の処理内
容であるが、図32のルーチンに比べてXとYが逆にな
っている部分がある。これは、X方向とY方向のピクセ
ル数の多い方を基準として考えているからである。図3
2のルーチンではピクセル数の多いY座標を基準として
考え、Y座標を1つずつ変えていったときに、X座標が
どう変化するかを決定したのに対して、図34のルーチ
ンではピクセル数の多いX座標を基準として考え、X座
標を1つずつ変えていったときに、Y座標がどう変化す
るかを決定している。他のラインの貼り付け位置につい
ても、同様の方法で求める処理が行われる。
The above-mentioned processing has the same processing contents as those in steps S1210 to S1216 shown in FIG. 32, but there is a portion in which X and Y are reversed as compared with the routine in FIG. This is because the consideration is based on the one having a larger number of pixels in the X direction and the Y direction. Figure 3
In the routine of No. 2, the Y coordinate having a large number of pixels is used as a reference, and it is determined how the X coordinate changes when the Y coordinate is changed one by one, whereas in the routine of FIG. 34, the number of pixels is changed. Considering the X coordinate, which has a lot of values, as a reference, it is determined how the Y coordinate changes when the X coordinate is changed one by one. With respect to the pasting positions of other lines, the processing for obtaining by the same method is performed.

【0113】以上で、各ラインの貼り付け位置が求まっ
たので、次に、元となる水平ドットラインのドット内の
うち、どのドットを割り当てる(つまり、ドットを選択
する)かを求める処理内容を説明する。まず、ドット選
択の処理として示されるステップS1318以降の処理
で、転送先ラインのピクセル数が転送元ラインのピクセ
ル数より少ないとき、つまりラインを縮小する方法を説
明する。この方法は、ドット選択の処理であるステップ
S1318〜ステップS1326で示される。転送元ラ
インの最初のドット(ドット0)を無条件に選択するも
のとすると、その他のドットの選択の方法は以下のよう
になる。すなわち、まずステップS1318で選択誤差
(初期値=0)eを決め、選択誤差eに誤差増分Δeを
加える(e=e+Δe)。Δeは(転送元のドット数−
1)/(転送先のドット数−1)である。なお、ここで
は、ドット選択用であるからeをe3とし、ΔeをΔe
3として処理をする。そうすると、e3=e3+Δe3
となる。
Since the pasting position of each line has been obtained as described above, next, the processing content for obtaining which dot in the dots of the original horizontal dot line is to be assigned (that is, the dot is selected) is described. explain. First, a method of reducing the line when the number of pixels of the transfer destination line is smaller than the number of pixels of the transfer source line in the processes from step S1318 shown as the dot selection process will be described. This method is shown in steps S1318 to S1326, which are dot selection processes. Assuming that the first dot (dot 0) on the transfer source line is unconditionally selected, the method for selecting other dots is as follows. That is, first, in step S1318, a selection error (initial value = 0) e is determined, and an error increment Δe is added to the selection error e (e = e + Δe). Δe is (the number of transfer source dots −
1) / (dot number of transfer destination-1). Here, since it is for dot selection, e is set to e3 and Δe is set to Δe.
Process as 3. Then, e3 = e3 + Δe3
Becomes

【0114】次いで、この値が1/2より大きくなった
か否かをステップS1320で判別する。そして、誤差
増分Δe3を加えた結果e3がe3≧(1/2)であれ
ば、ステップS1322に進んで現在ドット番号(転送
元ラインのドット番号)を[1]だけインクリメントす
る(つまり、次のドット番号に進める)。これは、選択
誤差に誤差増分を加え、その結果が1/2より大きいか
小さいかによって処理を選択するもので、選択誤差が1
/2以上のときに誤差を補正する。転送元ラインのドッ
ト番号を1進めることにより、辺AD上で次に選択すべ
き転送元ラインのドット番号が割り当てられる。
Then, it is determined in step S1320 whether this value has become larger than 1/2. If the result e3 obtained by adding the error increment Δe3 is e3 ≧ (1/2), the flow advances to step S1322 to increment the current dot number (dot number of the transfer source line) by [1] (that is, Go to the dot number). This is to add an error increment to the selection error and select processing depending on whether the result is larger or smaller than 1/2.
The error is corrected when / 2 or more. By advancing the dot number of the transfer source line by 1, the dot number of the transfer source line to be selected next on the side AD is assigned.

【0115】このようにすると、点Aから点Dに向って
X座標を1ずつ変えていったときに、少なくとも誤差増
分Δe3が1の半分より大きい場合に、次のドット番号
に変更するので、ドットの変化する位置が滑らかにつな
がることになる。次いで、ステップS1324で誤差補
正を行い、e3=e3−1とする。これは、選択誤差が
1/2以上になって次のドット番号を変更したので、1
を減算することにより、再び次の現在ドット番号から誤
差増分Δeを加えて同様の判別を始めるためである。そ
の後、ステップS1344に戻ってステップS1344
〜ステップS1348のループを繰り返す。そして、ス
テップS1320でe3が1/2未満になると、ステッ
プS1350に分岐する。
In this way, when the X coordinate is changed by 1 from the point A to the point D, the dot number is changed to the next dot number at least when the error increment Δe3 is larger than half of 1. The changing positions of the dots are connected smoothly. Next, in step S1324, error correction is performed to set e3 = e3-1. This is because the selection error became 1/2 or more and the next dot number was changed.
This is because subtracting is added again to the error increment Δe from the next current dot number, and the same determination is started. Then, it returns to step S1344 and step S1344.
-The loop of step S1348 is repeated. Then, when e3 becomes less than 1/2 in step S1320, the process branches to step S1350.

【0116】一方、ステップS1320でe3が当初か
ら1/2未満のときはステップS1326にジャンプす
る。ステップS1326ではすべてのドットについて処
理したか否かを判別し、すべてのドットについて処理が
終了していなければ、ステップS1330に戻って同様
の処理を繰り返す。したがって、誤差増分Δe3が1の
半分より大きくなった時点ではステップS1350へジ
ャンプせず、ステップS1346の方へ進むことにな
る。このように、誤差増分Δe3を加えた結果(選択誤
差)e3がe3<(1/2)であれば、転送先ラインの
次のドットには1つ前のドットと同じデータが再び転送
される。このとき、水平ドット番号と選択誤差e3の変
更は行われない。
On the other hand, if e3 is less than 1/2 from the beginning in step S1320, the process jumps to step S1326. In step S1326, it is determined whether or not all dots have been processed. If the processing has not been completed for all dots, the process returns to step S1330 and the same processing is repeated. Therefore, when the error increment Δe3 becomes larger than half of 1, it does not jump to step S1350 but proceeds to step S1346. In this way, if the result (selection error) e3 obtained by adding the error increment Δe3 is e3 <(1/2), the same data as the previous dot is transferred again to the next dot on the transfer destination line. . At this time, the horizontal dot number and the selection error e3 are not changed.

【0117】ここで、ドット選択の具体例について図2
8を参照して説明する。図28(a)は変形前の転送元
ラインのドットの様子を示し、図28(b)は変形後の
転送先ラインのドットの様子を示し、さらに図28
(c)は転送ラインにおけるX方向およびY方向のピク
セル数の変化を示している。この例は、転送先ラインの
ピクセル数が転送元ラインのピクセル数より多いとき、
つまりラインを拡大する処理に相当するものである。こ
の例に対応させて考えると、転送元ラインのドット数は
16個、転送先ラインのドット数は17個なので、転送
先の17個のドットのうち1個は1つ前のドットと同じ
データを転送することになる。転送元ラインの最初のド
ット(ドット0)を無条件に転送するものとすると、そ
の他のドットの転送の処理は次のようにして行われる。
Here, a specific example of dot selection is shown in FIG.
This will be described with reference to FIG. FIG. 28 (a) shows the dots on the transfer source line before the deformation, FIG. 28 (b) shows the dots on the transfer destination line after the deformation, and FIG.
(C) shows changes in the number of pixels in the X and Y directions in the transfer line. In this example, when the number of pixels of the transfer destination line is larger than the number of pixels of the transfer source line,
That is, this corresponds to the process of enlarging the line. Considering this example, since the number of dots on the transfer source line is 16 and the number of dots on the transfer destination line is 17, one of the 17 dots at the transfer destination has the same data as the previous dot. Will be transferred. Assuming that the first dot (dot 0) of the transfer source line is transferred unconditionally, the process of transferring the other dots is performed as follows.

【0118】まず、最初にドット0を転送する。この時
点で、選択誤差eは[0]に初期設定され、ドット番号
は0になっている。また、転送元ラインのドット数は1
6個、転送先ラインのドット数は17個であるから、誤
差増分Δeは Δe=(16−1)/(17−1)=0.93である。
次いで、選択誤差eはe=0に初期設定されているから
そのままとし、誤差増分ΔeとしてΔe=0.93を加
えると、e=0+0.93=0.93≧(1/2)とな
る。したがって、このときはドット番号を1進める(ド
ット1になる)。同時に、選択誤差eを以下のように補
正する。 e=0.93−1=−0.07<(1/2) この時点で選択誤差eが1/2より小さくなるので、点
にはドット1が転送される(図28(b)、図28
(c)参照)。
First, dot 0 is transferred first. At this point, the selection error e is initially set to [0] and the dot number is 0. The number of dots on the transfer source line is 1
Since there are 6 dots and the number of dots on the transfer destination line is 17, the error increment Δe is Δe = (16-1) / (17-1) = 0.93.
Next, since the selection error e is initially set to e = 0, it is left as it is, and when Δe = 0.93 is added as the error increment Δe, e = 0 + 0.93 = 0.93 ≧ (1/2). Therefore, at this time, the dot number is advanced by 1 (to become dot 1). At the same time, the selection error e is corrected as follows. e = 0.93-1 = -0.07 <(1/2) Since the selection error e becomes smaller than 1/2 at this point, dot 1 is transferred to the point (FIG. 28 (b), FIG. 28
(See (c)).

【0119】次いで、同様にここまでの選択誤差e=−
0.07に誤差増分ΔeとしてΔe=0.93を加える
と、e=−0.07+0.93=0.86≧(1/2)
になるので、ドット番号を1進める(ドット2になる)
とともに、選択誤差eを以下のように補正する。 e=0.86−1=−0.14<(1/2) この時点で選択誤差eが1/2より小さくなり、点に
表示すべきドットとして、ドット2が転送される(図2
8(b)、図28(c)参照)。
Then, similarly, the selection errors e up to this point e =-
If Δe = 0.93 is added as an error increment Δe to 0.07, e = −0.07 + 0.93 = 0.86 ≧ (1/2)
Therefore, the dot number is incremented by 1 (it becomes dot 2)
At the same time, the selection error e is corrected as follows. e = 0.86−1 = −0.14 <(1/2) At this point, the selection error e becomes smaller than 1/2, and the dot 2 is transferred as the dot to be displayed at the point (FIG. 2).
8 (b) and FIG. 28 (c)).

【0120】以後、同様の処理を行うと、点にはドッ
ト3が、点にはドット4が、点にはドット5が、点
にはドット6が、点にはドット7がそれぞれ割り当
てられる。ドット7を割り当てた時点で選択誤差eは−
0.49になる。ここまでの選択誤差e=−0.49に
誤差増分Δe=0.93を加えると、e=−0.49+
0.93=0.44<(1/2)になるので、今度はド
ット番号は7のままで、選択誤差eも変更しない。した
がって、点にはドット7が再び転送される(図28
(b)、図28(c)参照)。以上の処理を繰り返すこ
とにより、転送先ラインの16個のドットから1個のド
ット(ドット7)が2回転送されて、転送先ラインの1
7個のドットが決定される。このようにして、転送先ラ
インのピクセル数が転送元ラインのピクセル数より多い
場合に、ラインを拡大する処理が行われる。
Thereafter, when the same processing is performed, dot 3 is assigned to point, dot 4 is assigned to point, dot 5 is assigned to point, dot 6 is assigned to point, and dot 7 is assigned to point. When the dot 7 is assigned, the selection error e is −
It becomes 0.49. If the error increment Δe = 0.93 is added to the selection error e = −0.49 so far, e = −0.49 +
Since 0.93 = 0.44 <(1/2), the dot number remains 7, and the selection error e is not changed. Therefore, dot 7 is transferred again to the point (FIG. 28).
(B) and FIG. 28 (c)). By repeating the above process, one dot (dot 7) from the 16 dots of the transfer destination line is transferred twice, and 1 dot of the transfer destination line is transferred.
7 dots are determined. In this way, when the number of pixels of the transfer destination line is larger than the number of pixels of the transfer source line, the process of enlarging the line is performed.

【0121】上述した各プログラムを実行することによ
り、変形前の画像データのラインを変形後の画像データ
として貼り付ける処理が行われるが、このときラインの
貼り付けは辺A’B’と辺D’C’のうち、長い方の辺
が有するピクセル数分だけ行われる。例えば、図24の
例では辺A’B’と辺D’C’の各ピクセル数を比較す
ると、辺A’B’のピクセル数が11、辺D’C’のピ
クセル数が14であるから、辺D’C’のピクセル数分
(=14)だけ行われる。具体的には、図24(b)に
示すように辺D’C’のピクセル数に対応して、ライン
0、ライン0、ライン1、ライン2、ライン3、ライン
3’、ライン4、ライン5、ライン6、ライン7、ライ
ン8、ライン8’、ライン9、ライン10、ライン11
の14回ラインの貼り付けるが行われる。そして、各ラ
インを貼り付けた最終的な状態は図29(b)のように
示される。なお、図29(a)は変形前の画像データの
ラインである。なお、図21(a)、(b)に示すよう
に貼り付けた2つのラインが重なる部分が生じるが、本
実施例では先に書かれたものを優先するようにしてい
る。また、この他に、後に書かれたものを優先する方
法、あるいは重なった部分では2つのドットデータの色
コードを合成する毎に、その値を加えて1/2する等の
処理方法もある。ドットデータの色コードを合成する場
合には、例えばR(赤成分)、G(緑成分)、B(青成
分)というように色コードを分ける。
By executing the above-mentioned programs, the process of pasting the lines of the image data before the transformation as the image data after the transformation is performed. At this time, the lines are pasted on the sides A'B 'and D'. The number of pixels of the longer side of'C 'is performed. For example, in the example of FIG. 24, comparing the numbers of pixels on sides A'B 'and D'C', the number of pixels on side A'B 'is 11, and the number of pixels on side D'C' is 14, , D′ C ′ pixels (= 14). Specifically, as shown in FIG. 24B, line 0, line 0, line 1, line 2, line 3, line 3 ′, line 4, line corresponding to the number of pixels on side D′ C ′. 5, line 6, line 7, line 8, line 8 ', line 9, line 10, line 11
The line is pasted 14 times. The final state in which each line is attached is shown in FIG. 29 (b). Note that FIG. 29A is a line of image data before transformation. As shown in FIGS. 21 (a) and 21 (b), there is a portion where the two pasted lines overlap, but in the present embodiment, the one written earlier is given priority. In addition to this, there is also a method of giving priority to a later written one, or a processing method of adding the value every time the color codes of two dot data are combined in the overlapping portion and halving the value. When synthesizing color codes of dot data, the color codes are divided into R (red component), G (green component), and B (blue component), for example.

【0122】なお、上記各実施例ではビット配列形式の
画像データを有する変形対象を小矩形に分割し、任意な
四角形に変形しているが、これに限らず、例えば変形対
象を複数の小六角形に分割し、各六角形を例えば所定の
変形処理手順に従って異なる小六角形にそれぞれ変形す
ることにより、変形後の画像データを作成するようにし
てもよい。また、ビット配列形式の画像データを有する
変形対象を分割する形状は上記の2種類に限るものでは
なく、本発明の目的の範囲内が各種の変形が可能であ
る。さらに、本発明の適用はアニメーション、ゲーム等
のキャラクター又は背景データ等に限るものではなく、
他の分野、他の画像データにも適用できる。
In each of the above embodiments, the transformation target having the image data in the bit array format is divided into small rectangles and transformed into arbitrary quadrilaterals. The image data after deformation may be created by dividing the hexagon into different small hexagons, for example, according to a predetermined deformation processing procedure. Further, the shape for dividing the transformation target having the image data in the bit array format is not limited to the above two types, and various transformations are possible within the scope of the object of the present invention. Furthermore, the application of the present invention is not limited to animation, characters such as games, background data, etc.
It can be applied to other fields and other image data.

【0123】[0123]

【発明の効果】本発明によれば、変形対象を複数の小多
角形に分割し、各小多角形を所定の変形処理に従って異
なる小多角形にそれぞれ変形し、このとき小多角形の変
形処理では、変形対象の内部にある同一行あるい同一列
のうちの少なくとも1つを形成する複数個の小多角形の
頂点を、所定の曲線パラメータに従うとともに、少なく
とも変形後に再び内部に位置するような任意の位置に移
動したとき、前記複数個の小多角形の移動に応じて他の
小多角形の頂点を移動させ、移動した他の小多角形の頂
点を前記任意の小多角形の移動後の頂点に基づいて算出
し、この算出した頂点に対応して各小多角形を変形し、
さらに変形前の小多角形に含まれるビット配列形式の画
像データの配列を、各小多角形毎に、所定のデータ変換
処理に従って変形後の小多角形のデータに対応するよう
に順次変更して変更後の全体画像を作成しているので、
以下の効果を得ることができる。 変形対象の有する画像データの配列は、各小多角形毎
に変更処理が行われるので、従来のように全く異なる全
体の画像データを予め持つ必要がなく、少ないメモリ容
量で、ビット配列形式の画像を自由に変形することがで
きる。 変形対象を複数の小多角形に分割し、各小多角形毎に
変形処理が行われるので、変形に自由度があり、予めメ
モリに多くのデータを持たなくても、画像を滑らかに変
形することができる。 特に、変形対象の内部にある同一行あるい同一列のう
ちの少なくとも1つを形成する複数個の小多角形の頂点
を所定の曲線パラメータに従って移動させる変形法を使
用することにより、曲線パラメータとして数点(例え
ば、4点)分の座標だけを持っていればよく、変形後の
すべての小多角形の頂点の位置データ(例えば、座標)
を持っておく必要がない。よって極めて少ない変形デー
タで、複雑かつ非常に滑らかな画像変形を行わせること
ができる。 この変形法を用いると、変形対象の外枠の形を変える
ことなく、内部の小多角形のみを変形することができ、
画像データの外形(例えば、大きさ)を変えずに、内部
の形のみを変えたい場合に有効である。
According to the present invention, a transformation target is divided into a plurality of small polygons, and each small polygon is transformed into different small polygons according to a predetermined transformation process. At this time, the transformation process of the small polygons is performed. Then, the vertices of a plurality of small polygons forming at least one of the same row or the same column inside the object to be deformed are subjected to predetermined curve parameters, and at least after being deformed, they are positioned inside again. When moved to an arbitrary position, the vertices of the other small polygons are moved according to the movement of the plurality of small polygons, and the vertices of the other moved small polygons are moved after the movement of the arbitrary small polygons. Calculate based on the vertices of, and transform each small polygon corresponding to the calculated vertices,
Further, the array of the bit array format image data included in the small polygon before transformation is sequentially changed for each small polygon so as to correspond to the data of the transformed small polygon according to a predetermined data conversion process. Since the whole image after the change is created,
The following effects can be obtained. The image data array of the transformation target is changed for each small polygon, so there is no need to have completely different image data in advance as in the conventional case, and a small memory capacity and bit array format image Can be freely transformed. Since the transformation target is divided into multiple small polygons and the transformation process is performed for each small polygon, there is a degree of freedom in transformation, and the image can be transformed smoothly even if there is not much data in memory beforehand. be able to. In particular, by using a deformation method in which the vertices of a plurality of small polygons forming at least one of the same row or the same column inside the deformation target are moved according to a predetermined curve parameter, It is only necessary to have coordinates for several points (for example, 4 points), and the position data (for example, coordinates) of the vertices of all the small polygons after transformation.
You don't have to have one. Therefore, it is possible to perform complex and very smooth image transformation with very little transformation data. Using this transformation method, it is possible to transform only the small polygon inside without changing the shape of the outer frame to be transformed,
This is effective when it is desired to change only the internal shape without changing the outer shape (for example, size) of the image data.

【0124】また、他の請求項記載の発明によれば、小
多角形の変形処理において、変形対象の内部にある複数
の行あるい複数の列のうちの少なくとも1つを形成する
複数個の小多角形の群の各小多角形の頂点を、所定の曲
線パラメータに従って移動させる変形法を使用している
ので、同様に変形後のすべての小多角形の頂点の位置デ
ータ(例えば、座標)を持っておく必要がなく、少ない
変形データで滑らかな画像変形を行わせることができ
る。さらに、上記変形法で、曲線の両端の座標を変形対
象の外枠上に設定すると、外枠の形を変えることなく、
内部の小多角形のみを変形することができ、画像データ
の外形(例えば、大きさ)を変えずに、内部の形のみを
変えたい場合に有効である。また、複数の行毎に、ある
いは複数の列に対して列毎に曲線のパラメータを割り当
てれば、さらに複雑な変形を行うことができる。
According to another aspect of the present invention, in the small polygon deforming process, a plurality of rows forming at least one of a plurality of rows or a plurality of columns inside the object to be deformed is formed. Since the transformation method of moving the vertices of each small polygon of the group of small polygons according to the predetermined curve parameters is used, the position data (for example, the coordinates) of the vertices of all the small polygons after transformation are also used. It is not necessary to hold the image, and it is possible to perform smooth image transformation with a small amount of transformation data. Furthermore, in the above modification method, if the coordinates of both ends of the curve are set on the outer frame to be deformed, without changing the shape of the outer frame,
Only the inner small polygon can be transformed, which is effective when it is desired to change only the inner shape without changing the outer shape (for example, size) of the image data. Further, if a curve parameter is assigned to each of a plurality of rows or a plurality of columns, a more complicated transformation can be performed.

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

【図1】本発明による多角形分割変形方法の原理を説明
する図である。
FIG. 1 is a diagram illustrating the principle of a polygon division transformation method according to the present invention.

【図2】本発明による多角形分割変形方法の小矩形から
任意の四角形への変形例を示す図である。
FIG. 2 is a diagram showing a modification example of a polygonal division modification method according to the present invention from a small rectangle to an arbitrary quadrangle.

【図3】本発明に係る画像変形装置の第1実施例の構成
図である。
FIG. 3 is a configuration diagram of a first embodiment of an image transformation apparatus according to the present invention.

【図4】同実施例の変形対象となる画像データを多数の
小矩形に分割する例を示す図である。
FIG. 4 is a diagram showing an example in which the image data to be transformed in the embodiment is divided into a large number of small rectangles.

【図5】同実施例のCPUの内部レジスタへのデータの
格納例を示す図である。
FIG. 5 is a diagram showing an example of storing data in an internal register of the CPU of the embodiment.

【図6】同実施例の画像変形処理のメインプログラムを
示すフローチャートである。
FIG. 6 is a flowchart showing a main program of image transformation processing of the embodiment.

【図7】同実施例の小矩形変形処理のサブルーチンを示
すフローチャートである。
FIG. 7 is a flowchart showing a subroutine of small rectangle transformation processing of the embodiment.

【図8】同実施例のライン貼り付け法を説明する図であ
る。
FIG. 8 is a diagram illustrating a line pasting method of the example.

【図9】同実施例の変形対象の変形処理を説明する図で
ある。
FIG. 9 is a diagram illustrating a modification process of a modification target of the embodiment.

【図10】同実施例のデータの格納例を示す図である。FIG. 10 is a diagram showing a storage example of data according to the embodiment.

【図11】同実施例の格子点座標算出処理のルーチンを
示すフローチャートである。
FIG. 11 is a flowchart showing a routine of a grid point coordinate calculation process of the embodiment.

【図12】同実施例のベジェ曲線発生方法を説明する図
である。
FIG. 12 is a diagram illustrating a Bezier curve generation method according to the same embodiment.

【図13】本発明の第2実施例の変形対象の変形処理を
説明する図である。
FIG. 13 is a diagram illustrating a modification process of a modification target according to the second embodiment of the present invention.

【図14】同実施例のデータの格納例を示す図である。FIG. 14 is a diagram showing a storage example of data according to the embodiment.

【図15】本発明の第3実施例の変形対象の変形処理を
説明する図である。
FIG. 15 is a diagram illustrating a modification process of a modification target according to the third embodiment of this invention.

【図16】同実施例のデータの格納例を示す図である。FIG. 16 is a diagram showing a storage example of data according to the embodiment.

【図17】同実施例の格子点座標算出処理のルーチンを
示すフローチャートである。
FIG. 17 is a flowchart showing a routine of a grid point coordinate calculation process of the embodiment.

【図18】同実施例の格子点座標算出処理のルーチンを
示すフローチャートである。
FIG. 18 is a flowchart showing a routine of a grid point coordinate calculation process of the embodiment.

【図19】上記各実施例のライン貼り付け処理のサブル
ーチンを示すフローチャートである。
FIG. 19 is a flowchart showing a subroutine of a line pasting process of each of the above embodiments.

【図20】上記各実施例の画像データの変形例を示す図
である。
FIG. 20 is a diagram showing a modified example of the image data of each of the embodiments.

【図21】上記各実施例の画像データの変形例を示す図
である。
FIG. 21 is a diagram showing a modified example of the image data of each of the above embodiments.

【図22】上記各実施例の画像データの変形例を示す図
である。
FIG. 22 is a diagram showing a modified example of the image data of each of the above embodiments.

【図23】上記各実施例の画像データの変形例を示す図
である。
FIG. 23 is a diagram showing a modified example of the image data of each of the embodiments.

【図24】上記各実施例の画像データの変形例を示す図
である。
FIG. 24 is a diagram showing a modified example of the image data of each of the embodiments.

【図25】上記各画像データの変形例を示す図である。FIG. 25 is a diagram showing a modified example of each of the image data.

【図26】上記各実施例の画像データの変形例を示す図
である。
FIG. 26 is a diagram showing a modified example of the image data of each of the embodiments.

【図27】上記各実施例の画像データの変形例を示す図
である。
FIG. 27 is a diagram showing a modified example of the image data of each of the embodiments.

【図28】上記各実施例の画像データの変形例を示す図
である。
FIG. 28 is a diagram showing a modified example of the image data of each of the embodiments.

【図29】上記各実施例の画像データの変形例を示す図
である。
FIG. 29 is a diagram showing a modified example of the image data of each of the embodiments.

【図30】上記各実施例のCPUの内部レジスタへのデ
ータの格納例を示す図である。
FIG. 30 is a diagram showing an example of storing data in an internal register of the CPU of each of the above embodiments.

【図31】上記各実施例のライン描画の一例を説明する
図である。
FIG. 31 is a diagram illustrating an example of line drawing in each of the embodiments.

【図32】上記各実施例のライン端点処理のサブルーチ
ンの一部を示すフローチャートである。
FIG. 32 is a flowchart showing a part of a subroutine of line end point processing in each of the embodiments.

【図33】上記各実施例のライン端点処理のサブルーチ
ンの一部を示すフローチャートである。
FIG. 33 is a flowchart showing a part of a subroutine of line end point processing in each of the above embodiments.

【図34】上記各実施例のライン描画処理のサブルーチ
ンの一部を示すフローチャートである。
FIG. 34 is a flowchart showing a part of a subroutine of the line drawing process of each of the embodiments.

【図35】上記各実施例のライン描画処理のサブルーチ
ンの一部を示すフローチャートである。
FIG. 35 is a flowchart showing a part of a subroutine of the line drawing process of each of the embodiments.

【図36】上記各実施例の端点バッファへのデータの格
納例を示す図である。
FIG. 36 is a diagram showing an example of storing data in the end point buffer of each of the embodiments.

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

31 CPU(分割手段、変形手段、画像データ作成手
段、座標変換手段、データ変換手段、画像変形制御手
段) 32 入力操作子(変形態様指定手段) 33 記憶装置(記憶手段) 34 VDP 35 VRAM 36 TVディスプレイ(表示手段) 41 ビット配列形式の画像データ 42 変形前の格子点座標 43、44 変形後の格子点座標 51 第1の変形スイッチ 52 第2の変形スイッチ
31 CPU (dividing means, transforming means, image data creating means, coordinate transforming means, data transforming means, image transforming control means) 32 Input operator (transformation mode designating means) 33 Storage device (storage means) 34 VDP 35 VRAM 36 TV Display (display means) 41 Image data in bit array format 42 Lattice point coordinates before deformation 43, 44 Lattice point coordinates after deformation 51 First transformation switch 52 Second transformation switch

フロントページの続き (51)Int.Cl.6 識別記号 庁内整理番号 FI 技術表示箇所 G09G 5/36 520 D 9471−5G H04N 5/262 9365−5L G06F 15/72 350 Continuation of front page (51) Int.Cl. 6 Identification number Office reference number FI Technical display location G09G 5/36 520 D 9471-5G H04N 5/262 9365-5L G06F 15/72 350

Claims (20)

【特許請求の範囲】[Claims] 【請求項1】 ビット配列形式の画像データを有する変
形対象を、複数の小多角形に分割し、 この各小多角形を所定の変形処理に従って異なる小多角
形に変形し、 変形前の小多角形に含まれるビット配列形式の画像デー
タの配列を、各小多角形毎に、所定のデータ変換処理に
従って、変形後の小多角形のデータに対応するように順
次変更して変更後の全体画像データを作成するととも
に、 前記小多角形の変形処理では、変形対象の内部にある同
一行あるい同一列のうちの少なくとも1つを形成する複
数個の小多角形の頂点を、所定の曲線パラメータに従
い、少なくとも変形後に再び内部に位置するような任意
の位置に移動したとき、前記複数個の小多角形の移動に
応じて他の小多角形の頂点を移動させ、移動した他の小
多角形の頂点を前記複数個の小多角形の移動後の頂点に
基づいて算出し、この算出した頂点に対応して各小多角
形を変形することを特徴とする画像変形方法。
1. An object to be deformed having image data in a bit array format is divided into a plurality of small polygons, and each small polygon is deformed into different small polygons according to a predetermined deformation process. The array of the image data in the bit array format included in the polygon is sequentially changed for each small polygon according to the predetermined data conversion process so as to correspond to the deformed small polygon data, and the whole image after the change In addition to creating data, in the processing for transforming the small polygon, the vertices of the plurality of small polygons forming at least one of the same row or the same column inside the transformation target are set to predetermined curve parameters. According to the above, at least after being deformed, when moved to an arbitrary position that is located inside again, the vertices of the other small polygons are moved in accordance with the movement of the plurality of small polygons, and the other small polygons are moved. The top of An image transforming method, characterized in that calculation is performed based on the vertices of several small polygons after movement, and each small polygon is transformed corresponding to the calculated vertices.
【請求項2】 前記小多角形の変形処理では、変形対象
の内部にある複数の行あるい複数の列のうちの少なくと
も1つを形成する複数個の小多角形の群の各小多角形の
頂点を、所定の曲線パラメータに従い、少なくとも変形
後に再び内部に位置するような任意の位置に移動したと
き、前記複数個の小多角形のの移動に応じて他の小多角
形の頂点を移動させ、移動した他の小多角形の頂点を前
記複数個の小多角形の移動後の頂点に基づいて算出し、
この算出した頂点に対応して各小多角形を変形すること
を特徴とする請求項1記載の画像変形方法。
2. The small polygon deforming process, wherein each small polygon of a group of a plurality of small polygons forming at least one of a plurality of rows or a plurality of columns inside the object to be deformed. When the vertices of the plurality of small polygons are moved to an arbitrary position such that they are located again inside at least after the deformation according to the predetermined curve parameters, the vertices of the other small polygons are moved according to the movement of the plurality of small polygons. Then, the vertices of the other moved small polygons are calculated based on the moved vertices of the plurality of small polygons,
The image transforming method according to claim 1, wherein each small polygon is transformed corresponding to the calculated vertex.
【請求項3】 前記変形処理における複数個の小多角形
の頂点を移動配置する所定の曲線パラメータは、ベジェ
曲線あるいは三角関数の少なくとも一方によって規定さ
れる任意のパラメータであることを特徴とする請求項1
又は2記載の画像変形方法。
3. The predetermined curve parameter for moving and arranging the vertices of a plurality of small polygons in the transforming process is an arbitrary parameter defined by at least one of a Bezier curve and a trigonometric function. Item 1
Alternatively, the image transformation method described in 2.
【請求項4】 前記所定の変形処理は、座標変換処理で
あり、 この座標変換処理では、分割された各小多角形の頂点の
座標を求め、次いで、変形後の各小多角形の頂点の座標
を算出し、この算出した座標に基づいて変形後の異なる
小多角形の形状を決定することにより、分割された各小
多角形を異なる小多角形に変形することを特徴とする請
求項1又は2記載の画像変形方法。
4. The predetermined transforming process is a coordinate transforming process. In this coordinate transforming process, the coordinates of the vertices of each of the divided small polygons are obtained, and then the vertexes of the transformed small polygons are calculated. The divided small polygons are transformed into different small polygons by calculating coordinates and determining the shape of different small polygons after transformation based on the calculated coordinates. Alternatively, the image transformation method described in 2.
【請求項5】 前記所定のデータ変換処理は、 変形対象となる各小多角形に含まれるビット配列形式の
画像データを複数のラインに分割する処理と、 この分割された各ラインの変形後の小多角形上での端点
を算出する処理と、 前記分割された各ラインを、変形後の小多角形の対応す
るラインの大きさに合せて拡大又は縮小する処理と、 この拡大又は縮小されたラインを変形後の小多角形の対
応するライン上の端点を起点として順次転送して配置す
る処理と、を有することを特徴とする請求項1又は2記
載の画像変形方法。
5. The predetermined data conversion process is a process of dividing image data of a bit array format included in each small polygon to be deformed into a plurality of lines, and a process of deforming each of the divided lines. The process of calculating the end points on the small polygon, the process of enlarging or reducing each of the divided lines according to the size of the corresponding line of the deformed small polygon, and the process of enlarging or reducing 3. The image transformation method according to claim 1 or 2, further comprising: a process of sequentially transferring and arranging a line starting from an end point on a line corresponding to the transformed small polygon.
【請求項6】 前記端点を算出する処理は、 変形前および変形後のラインの端点の位置に基づいて、
変形前の各ラインの端点の位置を変化させずに順次変形
後の小多角形の対応するラインの端点の位置とした場合
の誤差を順次累算する処理と、 この誤差が所定値を超えるときにのみ、ラインの端点の
位置を変更するとともに、前記累算された誤差から一定
値を減算する処理と、を有することを特徴とする請求項
5記載の画像変形方法。
6. The process of calculating the end points is based on the positions of the end points of the lines before and after the deformation,
The process of sequentially accumulating the error when the position of the end point of each line before deformation is not changed and the position of the end point of the corresponding line of the small polygon after deformation is sequentially accumulated, and when this error exceeds a predetermined value 6. The image transformation method according to claim 5, further comprising: changing the position of the end point of the line and subtracting a constant value from the accumulated error.
【請求項7】 前記拡大又は縮小する処理は、 変形前および変形後のラインに含まれるビット配列形式
の画像データおよび変形後のラインに含まれるビット配
列形式の画像データの数に基づいて、変形前の各ライン
に含まれるビット配列形式の各画像データを変形後のラ
インに順次指定して配列したときの誤差を累算する処理
と、 この誤差が所定値を超えるときには、現在指定されてい
る画像データを変形後のラインに転送配置して次の画像
データを指定するとともに、前記累算された誤差から一
定値を減算する動作を前記誤差が所定値以下になるまで
繰り返す処理と、 前記誤差が所定値以下のときに、前記指定された画像デ
ータを変形後のラインに転送して配置する処理と、を有
することを特徴とする請求項5記載の画像変形方法。
7. The process of enlarging or reducing is modified based on the number of bit array format image data included in the lines before and after the modification and the bit array format image data included in the lines after the modification. The process of accumulating the error when the image data in the bit array format included in each previous line is sequentially specified and arranged in the modified line, and when this error exceeds a predetermined value, it is currently specified. A process of transferring and arranging the image data to the transformed line to specify the next image data, and repeating the operation of subtracting a constant value from the accumulated error until the error becomes a predetermined value or less; 6. The image transformation method according to claim 5, further comprising: a process of transferring the designated image data to a transformed line and arranging the designated image data when is less than or equal to a predetermined value.
【請求項8】 前記転送する処理は、 変形前および変形後のラインの数に基づいて、変形前の
各ラインを指定して変形後の小多角形の対応するライン
の位置に順次配列したときの誤差を累算する処理と、 この誤差が所定値を超えるときには、現在指定されてい
るラインを変形後の小多角形のラインとして転送配置し
て次のラインを指定するとともに、前記累算された誤差
から一定値を減算する動作を前記誤差が所定値以下にな
るまで繰り返す処理と、 前記誤差が所定値以下のときに、前記指定されたライン
を変形後のラインとして転送配置する処理と、を有する
ことを特徴とする請求項5記載の画像変形方法。
8. The process of transferring, when each line before deformation is designated based on the number of lines before and after deformation and sequentially arranged at the position of the corresponding line of the small polygon after deformation. When the error exceeds a predetermined value, the currently specified line is transferred and arranged as a modified small polygon line to specify the next line, and the above-mentioned accumulation is performed. A process of repeating the operation of subtracting a constant value from the error until the error becomes a predetermined value or less; a process of transferring and arranging the designated line as a modified line when the error is a predetermined value or less; The image transformation method according to claim 5, further comprising:
【請求項9】 ビット配列形式の画像データを有する変
形対象を、複数の小多角形に分割する分割手段と、 変形対象の内部にある同一行あるい同一列のうちの少な
くとも1つを形成する複数個の小多角形の頂点を、所定
の曲線パラメータに従い、少なくとも変形後に再び内部
に位置するような任意の位置に移動したとき、前記複数
個の小多角形の移動に応じて他の小多角形の頂点を移動
させ、移動した他の小多角形の頂点を前記複数個の小多
角形の移動後の頂点に基づいて算出し、この算出した頂
点に対応して分割手段によって分割した各小多角形を異
なる小多角形に変形する変形手段と、 変形前の小多角形に含まれるビット配列形式の画像デー
タの配列を、各小多角形毎に、所定のデータ変換処理に
従って、変形後の小多角形のデータに対応するように順
次変更して変更後の全体画像データを作成する画像デー
タ作成手段と、を備えたことを特徴とする画像変形装
置。
9. A dividing means for dividing a transformation target having bit array image data into a plurality of small polygons, and at least one of the same row or the same column inside the transformation target. When the vertices of the plurality of small polygons are moved to arbitrary positions that are located inside again after the deformation at least according to the predetermined curve parameters, the other small polygons are moved according to the movement of the plurality of small polygons. The vertices of the polygon are moved, the vertices of the other moved small polygons are calculated based on the moved vertices of the plurality of small polygons, and each small polygon divided by the dividing means corresponds to the calculated vertices. Deformation means for transforming a polygon into different small polygons, and an array of image data in the bit array format included in the pre-deformation small polygon are processed for each small polygon according to a predetermined data conversion process. For small polygon data Image transformation apparatus, wherein the image data generating means, further comprising a creating entire image data after the change are sequentially changed to.
【請求項10】 前記変形手段は、変形対象の内部にあ
る複数の行あるい複数の列のうちの少なくとも1つを形
成する複数個の小多角形の群の各小多角形の頂点を、所
定の曲線パラメータに従い、少なくとも変形後に再び内
部に位置するような任意の位置に移動させるような変形
処理を行うことを特徴とする請求項9記載の画像変形装
置。
10. The deforming means defines a vertex of each small polygon of a group of a plurality of small polygons forming at least one of a plurality of rows or a plurality of columns inside the object to be deformed, The image transforming apparatus according to claim 9, wherein the transforming process is performed according to a predetermined curve parameter such that the transforming process is performed such that the transforming process is moved to an arbitrary position that is located inside again after the transforming.
【請求項11】 前記変形手段における複数個の小多角
形の頂点を移動配置する所定の曲線パラメータは、ベジ
ェ曲線あるいは三角関数の少なくとも一方によって規定
される任意のパラメータであることを特徴とする請求項
9又は10記載の画像変形装置。
11. The predetermined curve parameter for moving and arranging the vertices of a plurality of small polygons in the deforming means is an arbitrary parameter defined by at least one of a Bezier curve and a trigonometric function. Item 9. The image transformation device according to item 9 or 10.
【請求項12】 前記変形手段は、分割手段によって分
割した各小多角形を異なる小多角形に変形する所定の変
形処理を実行可能な座標変換手段を備え、 この座標変換手段は、分割された各小多角形の頂点の座
標を求めるとともに、変形後の各小多角形の頂点の座標
を算出し、この算出した座標に基づいて変形後の異なる
小多角形の形状を決定することにより、分割された各小
多角形を異なる小多角形に変形することを特徴とする請
求項9又は10記載の画像変形装置。
12. The transforming means comprises coordinate transforming means capable of executing a predetermined transforming process for transforming each small polygon divided by the dividing means into different small polygons, and the coordinate transforming means is divided. By calculating the coordinates of the vertices of each small polygon, calculating the coordinates of the vertices of each small polygon after transformation, and determining the shape of the different small polygons after transformation based on these calculated coordinates. The image transforming device according to claim 9 or 10, wherein each of the formed small polygons is transformed into a different small polygon.
【請求項13】 前記画像データ作成手段は、前記所定
のデータ変換処理を実行可能なデータ変換手段を備え、 このデータ変換手段は、変形対象となる各小多角形に含
まれるビット配列形式の画像データを複数のラインに分
割する手段と、 この分割された各ラインの変形後の小多角形上での端点
を算出する手段と、 前記分割された各ラインを、変形後の小多角形の対応す
るラインの大きさに合せて拡大又は縮小する手段と、 この拡大又は縮小されたラインを変形後の小多角形の対
応するライン上の端点を起点として順次転送して配置す
る手段と、を有することを特徴とする請求項9又は10
記載の画像変形装置。
13. The image data creating means includes a data converting means capable of executing the predetermined data converting process, and the data converting means includes an image in a bit array format included in each small polygon to be transformed. A means for dividing the data into a plurality of lines, a means for calculating the end points of each of the divided lines on the deformed small polygon, and a correspondence between each of the divided lines of the deformed small polygon. And a means for enlarging or reducing according to the size of the line to be formed, and a means for sequentially transferring and arranging the enlarged or reduced line starting from an end point on the corresponding line of the deformed small polygon. 11. The method according to claim 9 or 10, wherein
The image transformation device described.
【請求項14】 前記端点を算出する手段は、 変形前および変形後のラインの端点の位置に基づいて、
変形前の各ラインの端点の位置を変化させずに順次変形
後の小多角形の対応するラインの端点の位置とした場合
の誤差を順次累算する手段と、 この誤差が所定値を超えるときにのみ、ラインの端点の
位置を変更するとともに、前記累算された誤差から一定
値を減算する手段と、を有することを特徴とする請求項
13記載の画像変形装置。
14. The means for calculating the end points, based on the positions of the end points of the line before and after the deformation,
A means for sequentially accumulating errors when the positions of the end points of the lines before deformation are not changed and the positions of the end points of the corresponding lines of the small polygon after deformation are sequentially accumulated, and when this error exceeds a predetermined value. 14. The image transformation apparatus according to claim 13, further comprising means for changing the position of the end point of the line and subtracting a constant value from the accumulated error.
【請求項15】 前記拡大又は縮小する手段は、 変形前および変形後のラインに含まれるビット配列形式
の画像データおよび変形後のラインに含まれるビット配
列形式の画像データの数に基づいて、変形前の各ライン
に含まれるビット配列形式の各画像データを変形後のラ
インに順次指定して配列したときの誤差を累算する手段
と、 この誤差が所定値を超えるときには、現在指定されてい
る画像データを変形後のラインに転送配置して次の画像
データを指定するとともに、前記累算された誤差から一
定値を減算する動作を前記誤差が所定値以下になるまで
繰り返す手段と、 前記誤差が所定値以下のときに、前記指定された画像デ
ータを変形後のラインに転送して配置する手段と、を有
することを特徴とする請求項13記載の画像変形装置。
15. The means for enlarging or reducing is modified based on the number of bit array format image data included in the lines before and after modification and the bit array format image data included in the lines after modification. A means for accumulating an error when the image data in the bit array format included in each previous line is sequentially specified and arranged in the modified line, and when this error exceeds a predetermined value, it is currently specified. A means for transferring and arranging the image data to the transformed line to specify the next image data, and repeating the operation of subtracting a constant value from the accumulated error until the error becomes a predetermined value or less; 14. The image transformation apparatus according to claim 13, further comprising means for transferring the designated image data to a transformed line and arranging the designated image data when the is less than or equal to a predetermined value.
【請求項16】 前記転送する手段は、 変形前および変形後のラインの数に基づいて、変形前の
各ラインを指定して変形後の小多角形の対応するライン
の位置に順次配列したときの誤差を累算する手段と、 この誤差が所定値を超えるときには、現在指定されてい
るラインを変形後の小多角形のラインとして転送配置し
て次のラインを指定するとともに、前記累算された誤差
から一定値を減算する動作を前記誤差が所定値以下にな
るまで繰り返す手段と、 前記誤差が所定値以下のときに、前記指定されたライン
を変形後のラインとして転送配置する手段と、を有する
ことを特徴とする請求項13記載の画像変形装置。
16. The transfer means specifies each line before deformation based on the number of lines before and after deformation and sequentially arranges the lines before the deformation at corresponding line positions of the small polygon after deformation. Means for accumulating the error, and when this error exceeds a predetermined value, the currently specified line is transferred and arranged as a deformed small polygon line to specify the next line, and the accumulated line is accumulated. Means for repeating the operation of subtracting a constant value from the error until the error becomes less than or equal to a predetermined value, and means for transferring and arranging the designated line as a modified line when the error is less than or equal to a predetermined value, The image transformation device according to claim 13, further comprising:
【請求項17】 前記画像データ作成手段によって作成
された変形後の画像データを表示する表示手段を、さら
に有することを特徴とする請求項9記載の画像変形装
置。
17. The image transformation apparatus according to claim 9, further comprising display means for displaying the transformed image data created by said image data creation means.
【請求項18】 変形対象を変形する場合の変形態様を
指定する変形態様指定手段を有し、 前記変形手段は、この変形態様指定手段の出力に基づい
て前記各小多角形を異なる小多角形にそれぞれ変形処理
することを特徴とする請求項9記載の画像変形装置。
18. A small polygon different from each of the small polygons based on an output of the deforming means, wherein the deforming means has a deforming manner designating means for designating a deforming manner when deforming an object to be deformed. The image transforming apparatus according to claim 9, wherein the transforming process is performed on each of the images.
【請求項19】 前記変形態様指定手段は、変形対象を
第1の変形態様に指定する第1の変形スイッチと、 変形対象を第2の変形態様に指定する第2の変形スイッ
チとを有することを特徴とする請求項18記載の画像変
形装置。
19. The deformation mode designating means includes a first modification switch for designating a modification target as a first modification mode and a second modification switch for designating a deformation target as a second modification mode. The image transformation apparatus according to claim 18, characterized in that.
【請求項20】 変形対象のビット配列形式の画像デー
タと、変形対象をどのように分割するかを示す分割デー
タと、分割した各小多角形をどのように変形するかを示
す変形データとを記憶する記憶手段と、 前記変形態様指定手段により変形態様が指定されたと
き、記憶手段に記憶された各データを読み出し画像変形
の制御を行う画像変形制御手段と、を備えたことを特徴
とする請求項9又は10記載の画像変形装置。
20. Deformation target bit array format image data, division data indicating how to divide the transformation target, and deformation data indicating how to transform each of the divided small polygons. Storage means for storing, and image deformation control means for controlling the image deformation by reading out each data stored in the storage means when the deformation mode is specified by the deformation mode designating means. The image transformation device according to claim 9.
JP5347814A 1993-12-24 1993-12-24 Image deforming method and device therefor Abandoned JPH07192122A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5347814A JPH07192122A (en) 1993-12-24 1993-12-24 Image deforming method and device therefor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5347814A JPH07192122A (en) 1993-12-24 1993-12-24 Image deforming method and device therefor

Publications (1)

Publication Number Publication Date
JPH07192122A true JPH07192122A (en) 1995-07-28

Family

ID=18392773

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5347814A Abandoned JPH07192122A (en) 1993-12-24 1993-12-24 Image deforming method and device therefor

Country Status (1)

Country Link
JP (1) JPH07192122A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6035075A (en) * 1997-04-10 2000-03-07 Nec Corporation Image deforming method and apparatus

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6035075A (en) * 1997-04-10 2000-03-07 Nec Corporation Image deforming method and apparatus

Similar Documents

Publication Publication Date Title
JP2919428B2 (en) Image transformation device
JP2008257752A (en) Perspective editing tool to two-dimensional image
US6124859A (en) Picture conversion method and medium used therefor
JPH0325792B2 (en)
EP2038848B1 (en) Facilitating image-editing operations across multiple perspective planes
JPH07192122A (en) Image deforming method and device therefor
JP3463125B2 (en) Image transformation method and apparatus
JPH07200800A (en) Image deforming method and device therefor
JPH0561954A (en) Image processor
US7734118B2 (en) Automatic image feature embedding
JPH07182499A (en) Method and device for deforming image
JP4056118B2 (en) Image processing device
JPH07192121A (en) Image deforming method and device therefor
JPH07182497A (en) Method and device for deforming image
JP2002006391A (en) Method for adjusting plane of projection of projector and recording medium
JP3591876B2 (en) Graphic processing apparatus and method
JPH07182501A (en) Method and device for deforming image
JPH07182500A (en) Method and device for deforming image
JP3463124B2 (en) Image transformation method and apparatus
JP3533472B2 (en) Image deformation method and apparatus
JP4514943B2 (en) Image creating method and apparatus
JPH0350686A (en) Graphic processing system
JP3517982B2 (en) Drawing device
JP2642374B2 (en) Figure clipping method
JPH07320077A (en) Area specifying device

Legal Events

Date Code Title Description
A762 Written abandonment of application

Free format text: JAPANESE INTERMEDIATE CODE: A762

Effective date: 20040625