JPH07200800A - Image deforming method and device therefor - Google Patents

Image deforming method and device therefor

Info

Publication number
JPH07200800A
JPH07200800A JP5348802A JP34880293A JPH07200800A JP H07200800 A JPH07200800 A JP H07200800A JP 5348802 A JP5348802 A JP 5348802A JP 34880293 A JP34880293 A JP 34880293A JP H07200800 A JPH07200800 A JP H07200800A
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
JP5348802A
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 JP5348802A priority Critical patent/JPH07200800A/en
Publication of JPH07200800A publication Critical patent/JPH07200800A/en
Abandoned legal-status Critical Current

Links

Abstract

PURPOSE:To freely and smoothly deform the image of a bit array form with a small memory capacity. CONSTITUTION:When the vertexes of plural small polygons at the external frame of a deforming object are according to each parameter of a Bezier curve and the vertex (lattice point (p, q)) of one internal small polygon is moved, the vertexes of small other polygons are moved so that the whole of the deforming object may be smoothly deformed and the vertexes of the small other moved polygons are calculated based on the vertexes of the small polygon to be a reference after the moving. At this time, by using the both ends coordinates of the curve (xb1, yb1), (xb4, yb4), (xc1, yc1) and (xc4, yc4) and coordinates controlling the bending way of the curve (xb2, yb2), (xb3, yb3), (xc2, yc2) and (xc3, yc3) as the parameters of the curve and using the coordinate (xa, ya) after the lattic point is moved, the shape after a deformation corresponding to each calculated vertex is determined and an original image is deformed so as to correspond to the data of small polygon after the deformation.

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記載の発明による画像変形方法は、ビット配列形
式の画像データを有する変形対象を、複数の小多角形に
分割し、この各小多角形を所定の変形処理に従って異な
る小多角形に変形し、変形前の小多角形に含まれるビッ
ト配列形式の画像データの配列を、各小多角形毎に、所
定のデータ変換処理に従って、変形後の小多角形のデー
タに対応するように順次変更して変更後の全体画像デー
タを作成するとともに、前記小多角形の変形処理では、
変形対象の外枠上にある任意の小多角形の頂点および変
形対象の内部にある任意の小多角形の頂点を、少なくと
も変形後に再び外枠を構成するような任意の位置および
少なくとも再び内部に位置するような任意の位置にそれ
ぞれ移動したとき、前記任意の小多角形の移動に応じて
他の小多角形の頂点を移動させ、移動した他の小多角形
の頂点を前記複数個の小多角形の移動後の頂点に基づい
て算出し、この算出した頂点に対応して各小多角形を変
形することを特徴とする。請求項2記載の発明による画
像変形方法は、変形対象の外枠を構成する向い合う複数
の辺を選択し、選択したそれぞれの辺上にある複数個の
小多角形の頂点を、それぞれの辺に対応する所定の曲線
パラメータに従い、少なくとも変形後に再び向い合う複
数の辺を構成するような任意の位置に移動するととも
に、変形対象の内部にある任意の小多角形の頂点を、少
なくとも変形後に再び内部に位置するような任意の位置
に移動したとき、前記任意の小多角形の移動に応じて他
の小多角形の頂点を移動させ、移動した他の小多角形の
頂点を前記複数個の小多角形の移動後の頂点に基づいて
算出し、この算出した頂点に対応して各小多角形を変形
することを特徴とする。
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,
The vertices of any small polygon on the outer frame to be deformed and the vertices of any small polygon on the inside of the deformable object are placed at least at any position where the outer frame is reconstructed after the deformation and at least again inside. When each of the small polygons is moved to an arbitrary position, the vertices of the other small polygons are moved according to the movement of the arbitrary small polygon, and the vertices of the other small polygons moved are moved to the plurality of small polygons. It is characterized in that it is calculated based on the vertices of the polygon after the movement, and each small polygon is deformed corresponding to the calculated vertices. In the image transforming method according to the second aspect of the present invention, a plurality of facing sides forming the outer frame to be transformed are selected, and a plurality of small polygon vertices on each of the selected sides are set to the respective sides. According to a predetermined curve parameter corresponding to, at least after the deformation, move to an arbitrary position that constitutes a plurality of opposite sides, and at the same time, at least after the deformation, revert the vertices of any small polygon inside the deformation target. When moved to an arbitrary position that is located inside, the vertices of other small polygons are moved according to the movement of the arbitrary small polygons, and the vertices of the other small polygons that have been moved are set to the plurality of It is characterized in that the small polygons are calculated based on the moved vertices, and each small polygon is deformed corresponding to the calculated vertices.

【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記載の画像変形装置は、ビット配
列形式の画像データを有する変形対象を、複数の小多角
形に分割する分割手段と、変形対象の外枠上にある任意
の小多角形の頂点および変形対象の内部にある任意の小
多角形の頂点を、少なくとも変形後に再び外枠を構成す
るような任意の位置および少なくとも再び内部に位置す
るような任意の位置にそれぞれ移動したとき、前記任意
の小多角形の移動に応じて他の小多角形の頂点を移動さ
せ、移動した他の小多角形の頂点を前記任意の小多角形
の移動後の頂点に基づいて算出し、この算出した頂点に
対応して分割手段によって分割した各小多角形を異なる
小多角形に変形する変形手段と、変形前の小多角形に含
まれるビット配列形式の画像データの配列を、各小多角
形毎に、所定のデータ変換処理に従って、変形後の小多
角形のデータに対応するように順次変更して変更後の全
体画像データを作成する画像データ作成手段と、を備え
たことを特徴とする。
According to a ninth aspect of the present invention, there is provided an image transformation apparatus which divides a transformation target having image data in a bit array format into a plurality of small polygons, and an arbitrary small polygon on an outer frame of the transformation target. When the vertices of and the vertices of any small polygon inside the deformation target are moved to at least any positions that again form the outer frame after deformation and at least any positions that are inside again, The vertices of the other small polygons are moved according to the movement of the arbitrary small polygon, and the vertices of the moved small polygons are calculated based on the moved vertices of the small polygons. Deformation means for transforming each small polygon divided by the dividing means into different small polygons corresponding to the calculated vertices, and an array of image data in the bit array format included in the small polygon before transformation are provided for each small polygon. For each polygon, According to another 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 deformation.

【0010】請求項10記載の画像変形装置は、前記変
形手段は、変形対象の外枠を構成する向い合う複数の辺
を選択し、選択したそれぞれの辺上にある複数個の小多
角形の頂点を、それぞれの辺に対応する所定の曲線パラ
メータに従い、少なくとも変形後に再び向い合う複数の
辺を構成するような任意の位置に移動するとともに、変
形対象の内部にある任意の小多角形の頂点を、少なくと
も変形後に再び内部に位置するような任意の位置に移動
させるような変形処理を行うことを特徴とする。また、
好ましい態様として、例えば請求項11記載のように、
前記変形手段における複数個の小多角形の頂点を移動配
置する所定の曲線パラメータは、ベジェ曲線あるいは三
角関数の少なくとも一方によって規定される任意のパラ
メータであるようにしてもよい。例えば請求項12記載
のように、前記変形手段は、分割手段によって分割した
各小多角形を異なる小多角形に変形する所定の変形処理
を実行可能な座標変換手段を備え、この座標変換手段
は、分割された各小多角形の頂点の座標を求めるととも
に、変形後の各小多角形の頂点の座標を算出し、この算
出した座標に基づいて変形後の異なる小多角形の形状を
決定することにより、分割された各小多角形を異なる小
多角形に変形するようにしてもよい。
According to a tenth aspect of the present invention, in the image transforming apparatus, the transforming means selects a plurality of facing sides forming an outer frame to be transformed, and selects a plurality of small polygons on each of the selected sides. According to the predetermined curve parameters corresponding to each side, the apex is moved to an arbitrary position that forms at least a plurality of sides that face again after deformation, and the apex of any small polygon inside the deformation target. Is deformed at least after the deformation to an arbitrary position that is located inside again. Also,
As a preferred embodiment, for example, as described in claim 11,
The predetermined curve parameter for moving and arranging the vertices of the plurality of small polygons in the deforming means may be an arbitrary parameter defined by at least one of Bezier curve and trigonometric function. 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]

【作用】本発明では、まずビット配列形式の画像データ
を有する変形対象を複数の小多角形に分割し、各小多角
形を所定の変形処理(例えば、座標変換処理)に従って
異なる小多角形にそれぞれ変形する。このとき、小多角
形の変形処理では、変形対象の外枠上にある任意の小多
角形の頂点および変形対象の内部にある任意の小多角形
の頂点を、少なくとも変形後に再び外枠を構成するよう
な任意の位置および少なくとも再び内部に位置するよう
な任意の位置にそれぞれ移動したとき、前記任意の小多
角形の移動に応じて他の小多角形の頂点を移動させ(例
えば、変形対象全体が滑らかに変形されるように他の小
多角形の頂点を移動させ)、移動した他の小多角形の頂
点を前記任意の小多角形の移動後の頂点に基づいて算出
し、この算出した頂点に対応して各小多角形を変形する
ことが行われる。次いで、変形前の小多角形に含まれる
ビット配列形式の画像データの配列を、各小多角形毎
に、所定のデータ変換処理に従って変形後の小多角形の
データに対応するように順次変更して変更後の全体画像
データが作成される。
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 deforming process, the vertices of any small polygon on the outer frame to be deformed and the vertices of any small polygon inside the target to be deformed are reconfigured to form the outer frame at least after the deformation. When moving to an arbitrary position such as that described above and at least to an arbitrary position that is located inside again, the vertices of other small polygons are moved according to the movement of the arbitrary small polygon (for example, the deformation target). The vertices of the other small polygons are moved so that the whole is smoothly deformed), and the vertices of the other small polygons that have been moved are calculated based on the vertices after the movement of the arbitrary small polygon. Each small polygon is deformed corresponding to the vertex. 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】したがって、変形対象の画像は各小多角形
毎に変形処理が行われるから、従来のように全く異なる
全体の画像データを予め持つ必要がなくなり、少ないメ
モリ容量で、ビット配列形式の画像データの配列を自由
に変更できる。また、変形対象を複数の小多角形に分割
し、各小多角形毎に変形処理が行われるので、変形に自
由度があり、予めメモリに多くのデータを持たなくて
も、画像を滑らかに変形できる。特に、変形対象の外枠
上にある任意の小多角形の頂点および変形対象の内部に
ある任意の小多角形の頂点を、少なくとも変形後に再び
外枠を構成するような任意の位置および少なくとも再び
内部に位置するような任意の位置にそれぞれ移動させる
変形法を使用することにより、変形後のすべての小多角
形の頂点の位置データ(例えば、座標)を持っておく必
要がない。よって少ない変形データで滑らかな画像変形
を行わせることができる。
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, the vertices of any small polygon on the outer frame to be deformed and the vertices of any small polygon on the inside of the deformable object are at least repositioned at least at any position such that the outer frame is formed again after the deformation. It is not necessary to have the position data (for example, the coordinates) of the vertices of all the small polygons after the deformation by using the deformation method in which each is moved to an arbitrary position such that it is located inside. Therefore, it is possible to perform smooth image deformation with a small amount of deformation data.

【0016】また、他の請求項記載の発明では、変形対
象の外枠を構成する向い合う複数の辺を選択し、選択し
たそれぞれの辺上にある複数個の小多角形の頂点を、そ
れぞれの辺に対応する所定の曲線パラメータに従い、少
なくとも変形後に再び向い合う複数の辺を構成するよう
な任意の位置に移動するとともに、変形対象の内部にあ
る任意の小多角形の頂点を、少なくとも変形後に再び内
部に位置するような任意の位置に移動させる変形法を使
用することにより、曲線パラメータとして数点(例え
ば、4点)分の座標だけを持っていればよく、変形後の
すべての小多角形の頂点の位置データ(例えば、座標)
を持っておく必要がない。よって少ない変形データで滑
らかな画像変形を行わせることができる。さらに、この
変形法を用いると、変形対象の外枠の形を変えるととも
に、内部の小多角形も任意の形に変形できるので、画像
データの外形(例えば、大きさ)を変え、さらに内部の
形も変えたい場合に有効である。
According to another aspect of the invention, a plurality of facing sides forming the outer frame to be deformed are selected, and a plurality of small polygon vertices on each selected side are respectively selected. According to a predetermined curve parameter corresponding to the side of, at least after the deformation, move to an arbitrary position that forms a plurality of opposite sides, and at least deform the vertex of any small polygon inside the deformation target. By using a modification method that moves to an arbitrary position so that it will be located inside again later, it is sufficient to have only a few points (for example, 4 points) of coordinates as the curve parameter, and all the small values after the modification can be used. Position data (eg, coordinates) of polygon vertices
You don't have to have one. Therefore, it is possible to perform smooth image deformation with a small amount of deformation data. Furthermore, when this transformation method is used, the shape of the outer frame to be transformed can be changed, and the small polygon inside can be transformed into an arbitrary shape, so the outer shape (for example, size) of the image data can be changed, and This is effective when you want to change the shape.

【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. An image (picture) B of “” is obtained. In this case, each small rectangle (1), (2), for the array of image data to be transformed,
(3) The transformation processing is performed for each (24), so there is no need to have completely different image data in advance as in the past, and a bit array image can be freely created with a small memory capacity. It can be transformed. In addition, the transformation target is a plurality of small rectangles (1),
It is divided into (2), (3), ... (24), and each small rectangle (1),
(2), (3), ... Since the deformation process is performed for each (24), there is a degree of freedom in the deformation, and the image can be smoothly deformed even if there is not much data in memory beforehand. It will be possible.

【0019】特に、変形対象の外枠を構成する向い合う
任意の辺(向い合う複数の辺でもよい)を選択し、選択
したそれぞれの辺上にある複数個の小多角形の頂点を、
それぞれの辺に対応する曲線パラメータに従って移動さ
せるとともに、変形対象の内部にある任意の小多角形の
頂点を、少なくとも変形後に再び内部に位置するような
任意の位置に移動させる変形法を使用すれば、変形後の
すべての四角形(1)’、(2)’、(3)’、・・・・・(2
4)’の位置データ(例えば、座標)を持っておく必要が
なく、少ない変形データで滑らかな画像変形を行わせる
ことができる。さらに、この変形法を用いると、変形対
象の外枠の形を変えるとともに、内部の小多角形も任意
の形に変形できるので、画像データの外形(例えば、大
きさ)を変え、さらに内部の形も変えることができる。
In particular, an arbitrary facing side (may be a plurality of facing sides) forming the outer frame to be deformed is selected, and the vertices of a plurality of small polygons on each selected side are
If you use the deformation method that moves according to the curve parameters corresponding to each side, and moves the vertices of any small polygon inside the deformation target to at least any position that is inside again after deformation , All the transformed rectangles (1) ', (2)', (3) ', ... (2
It is not necessary to have the position data (for example, coordinates) of 4) ′, and it is possible to perform smooth image deformation with a small amount of deformation data. Furthermore, when this transformation method is used, the shape of the outer frame to be transformed can be changed, and the small polygon inside can be transformed into an arbitrary shape, so the outer shape (for example, size) of the image data can be changed, and The shape can be changed.

【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. Lattice points (0,
0) X coordinate ... 90 (lattice point coordinate of deformation data 1, the same applies below) Y coordinate of lattice point (0, 0) ... 100 X coordinate of lattice point (0, 1) ... 105 Lattice point (0 1) Y coordinate ... 95 ... X coordinate of lattice point (m, n) ... 140 Y coordinate of lattice 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でいわゆるライン
貼り付け法(データ変換処理に相当)により各小矩形内
の画像データの配列を変形する処理を行う。ライン貼り
付け法とは、変形元である分割した各小多角形のビット
配列形式の画像データの配列を複数のラインに分割し、
分割した各ラインを変形先の各多角形の対応する位置に
順次転送するとともに、転送に際して転送先の大きさに
合うように拡大又は縮小させながらそれぞれラインとし
て貼り付けていくことにより、変形後の各小多角形の画
像データの配列を作成することをいう。なお、いわゆる
ライン貼り付け法の処理内容は、実施例を説明した後に
まとめて詳述する(図13〜図30参照)。ライン貼り
付け法は、具体的には図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. Note that the processing contents of the so-called line pasting method will be collectively described in detail after describing the embodiment (see FIGS. 13 to 30). 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 the Present Embodiment Next, the transformation processing which is the characteristic part of the present embodiment (that is, when any one lattice point inside the transformation target is moved, the transformation target is smoothly transformed. Process of moving each other grid point as shown in the figure and calculating the coordinates of each grid point after the movement)
Will be described. First, FIG. 9A shows an example of a transformation target that is the target of this transformation processing, and FIG.
It is shown in (b). 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))の頂
点を、少なくとも変形後に再び内部に位置するような任
意の位置に移動したときのその他の各小矩形の頂点の座
標を算出する処理について説明する。この例は、あたか
も変形対象の外枠にある複数の小矩形の頂点を外方に緩
やかに膨らませ、かつ内部の1つの各小矩形の頂点
(p、q)を下方移動するような変形を行うケースに相
当する。ここで、本実施例では格子点の表し方と、格子
点の座標とについて、次のような取り決めにしている。
後述の実施例においても同様である。例えば、格子点
(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, a plurality of facing sides forming the outer frame to be deformed are selected, and the vertices of a plurality of small polygons on each of the selected sides are defined by predetermined curve parameters corresponding to the respective sides. According to the above, each vertex of one small polygon (lattice point (p, q)) inside the deformation target is moved to an arbitrary position that is inside again at least after the deformation. The process of calculating the coordinates of the vertices of a small rectangle will be described. In this example, the vertices of a plurality of small rectangles in the outer frame to be deformed are gently swollen outward, and the vertices (p, q) of one small rectangle inside are moved downward. Corresponds to the case. 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, in the case of a grid point (p, 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, grid 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)なる座標で表される。ま
た、変形前における変形対象の内部にある1つの小矩形
の頂点(p、q)も変形データとして予め位置が判明し
ている。なお、この内部にある小矩形の頂点は、移動の
基準となるものであり、以下、移動基準格子点という。
そして、その位置を座標で表すと、図9(a)に示す格
子点(p、q)となる。変形後における移動基準格子点
としての小矩形の頂点は、変形移動格子点といい、その
位置を座標で表すと、図9(b)に示すように格子点
(xa、ya)となる。また、変形後における図9
(b)に示す外枠の下辺の小矩形の頂点も予め位置が判
明しており、その位置データは(x1、y2)、(x
2、y2)なる座標で表される。なお、各小矩形の頂点
を、適宜、格子点という。さらに、図面の説明上、横方
向を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). In addition, the position of one small rectangular vertex (p, q) inside the transformation target before transformation is known as transformation data in advance. In addition, the vertices of the small rectangle in the inside serve as a reference for movement, and are hereinafter referred to as movement reference grid points.
Then, when the position is expressed by coordinates, it becomes a grid point (p, q) shown in FIG. The vertices of the small rectangles as the movement reference lattice points after the deformation are referred to as the deformed movement lattice points, and when the position is represented by coordinates, they become lattice points (xa, ya) as shown in FIG. 9B. In addition, FIG.
The positions of the vertices of the small rectangle on the lower side of the outer frame shown in (b) are known in advance, and their position data are (x1, y2), (x
2, y2). The vertices of each small rectangle are referred to as grid points as appropriate. Further, in the description of the drawings, it is assumed that the horizontal direction is x-coordinate and the vertical direction is y-coordinate, and the x-coordinate increases from left to right and the y-coordinate increases from top to bottom in the drawing.

【0038】一方、変形対象の外枠を曲線パラメータに
従って移動させるために変形データとして持っているも
のは、図9(b)に示すように、外枠上の格子点を移動
するために必要な選択した一方の辺に対応する曲線1の
パラメータと、外枠上の格子点を移動するために必要な
選択した他方の辺に対応する曲線2のパラメータと、内
部の格子点を移動するために必要な移動を行う内部の移
動基準格子点(p、q)と、移動基準格子点の移動後の
座標(xa、ya)についての各データである。この場
合、曲線1のパラメータは曲線の両端の座標(xb1、
yb1)、(xb4、yb4)と、曲線の曲がり方を制
御する座標(xb2、yb2)、(xb3、yb3)と
いうデータからなる。また、曲線2のパラメータは曲線
の両端の座標(xc1、yc1)、(xc4、yc4)
と、曲線の曲がり方を制御する座標(xc2、yc
2)、(xc3、yc3)というデータからなる。
On the other hand, what is possessed as deformation data for moving the outer frame to be deformed in accordance with the curve parameters is necessary for moving the grid points on the outer frame as shown in FIG. 9B. In order to move the parameter of the curve 1 corresponding to the selected one side, the parameter of the curve 2 corresponding to the selected other side required to move the grid point on the outer frame, and the internal grid point It is each data about the internal movement reference lattice point (p, q) that performs the necessary movement and the coordinate (xa, ya) after the movement of the movement reference lattice point. In this case, the parameters of the curve 1 are the coordinates (xb1,
yb1), (xb4, yb4) and coordinates (xb2, yb2), (xb3, yb3) that control how the curve bends. The parameters of the curve 2 are the coordinates (xc1, yc1), (xc4, yc4) of both ends of the curve.
And the coordinates (xc2, yc
2) and (xc3, yc3).

【0039】記憶装置33には図10に示すように、上
記各情報を格納する変形データエリアがある。 曲線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 移動を行う内部の格子点……格子点(p、q) 移動基準格子点の移動後のx座標……xa 移動基準格子点の移動後のy座標……ya
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 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 Internal grid point to move ... lattice point (p, q) move y coordinate ...... ya after the movement of the x-coordinate ...... xa moving reference lattice points after the movement of the quasi-lattice points

【0040】図11は変形後の格子点座標算出処理のル
ーチンを示すフローチャートである。このルーチンは、
変形対象の外枠を構成する向い合う複数の辺(ここでは
上辺および下辺)を選択し、選択したそれぞれの辺上に
ある複数個の小多角形の頂点を、それぞれの辺に対応す
る所定の曲線パラメータに従って移動させるとともに、
変形対象の内部にある1つの小多角形(格子点(p、
q))の頂点を、少なくとも変形後に再び内部に位置す
るような任意の位置に移動した、変形対象全体が滑らか
に変形されるように他の小多角形の頂点を移動させ、移
動した他の小多角形の頂点を任意の小多角形の移動後の
頂点(適宜、変形移動格子点という)に基づいて算出す
るものである。そして、その後、算出した各頂点に対応
して変形後の各小多角形の形状が決定され、変形後の小
多角形に対応するように元画像が順次変形処理されて変
形後の全体画像が作成されることになる。
FIG. 11 is a flow chart showing the routine of the lattice point coordinate calculation processing after the transformation. This routine
Select a plurality of facing sides (here, the upper side and the lower side) that make up the outer frame to be deformed, and set the vertices of the small polygons on each of the selected sides to a predetermined value corresponding to each side. While moving according to the curve parameters,
One small polygon (lattice point (p, p,
q)) is moved to an arbitrary position so that it is located inside again at least after the deformation, and the vertices of other small polygons are moved so that the whole deformation target is smoothly deformed, and the other moved The vertices of the small polygon are calculated based on the vertices of the arbitrary small polygon after the movement (appropriately referred to as deformed moving grid 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.

【0041】最初に、ベジェ曲線の発生方法について説
明する。図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.

【0042】本ルーチンでは、上記ベジェ曲線の発生方
法に基づいて、変形対象の上側の外枠上にある格子点
を、ベジェ曲線1のパラメータに従って移動させるとと
もに、変形対象の下側の外枠上にある格子点を、ベジェ
曲線2のパラメータに従って移動させ、かつ変形対象の
内部にある格子点(p、q)を座標(xa、ya)で表
される位置に移動したときの他の格子点の移動後の座標
を算出する処理を説明する。まず、変形対象の左上側の
外枠の頂点の座標を(x1、y1)とし、右下側の外枠
の頂点の座標を(x2、y2)とする。ステップS10
0で変形後の外枠の縦方向の格子点(0、0)〜(m、
0)および(0、n)〜(m、n)の座標を求める。こ
れは、外枠の頂点の座標(x1、y1)、(x2、y
2)により比例演算により求められる。そして、ステッ
プS110でポインタjを[0]にセットする。ポイン
タjは格子点をx軸方向に沿って順次指定するものであ
る。次いで、ステップS112で変形対象の上辺にあっ
た格子点(0、j)(ただし、0<j<n)の移動後の
座標(xd(j)、yd(j))を、以下に示す(3)
式および(4)式に従って算出する。この格子点(0、
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 grid points on the upper outer frame to be deformed are moved according to the parameters of the Bezier curve 1 on the basis of the generation method of the Bezier curve, and on the lower outer frame to be deformed. Other grid point when the grid point in is moved according to the parameter of the Bezier curve 2 and the grid point (p, q) inside the deformation target is moved to the position represented by the coordinates (xa, ya). The process of calculating the coordinates after the movement of 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). Step S10
The grid points (0, 0) to (m,
0) and coordinates (0, n) to (m, n) are obtained. This is the coordinates (x1, y1), (x2, y) of the vertices of the outer frame.
It is calculated by proportional calculation according to 2). 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. Next, the coordinates (xd (j), yd (j)) after movement of the grid point (0, j) (where 0 <j <n) on the upper side of the deformation target in step S112 are shown below ( 3)
It is calculated according to the formula and the formula (4). 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 · xb 4 (3) yd (j) = (1-j / n) 3 · yb 1 + 3 (j / n) · (1-j / n) 2 · yb 2 + 3 (j / n) 2 · ( 1-j / n) · yb3 + (j / n) 3 · yb4 ...... (4)

【0043】最初のルーチンではj=1であるから、格
子点(0、1)の移動後の座標(xd(1)、yd
(0))が(3)式および(4)式に従って算出され
る。この格子点(0、1)の座標位置は、図9(b)に
おいて△印で示される。次いで、ステップS114で変
形対象の下辺にあった格子点(m、j)(ただし、0<
j<n)の移動後の座標(xe(j)、ye(j))
を、以下に示す(5)式および(6)式に従って算出す
る。この格子点(m、j)は、図9(b)において▲印
で示される。 xe(j)=(1−j/n)3・xc1+3(j/n)・(1−j/n)2 ・xbc2+3(j/n)2・(1−j/n)・xc3 +(j/n)3・xc4……(5) ye(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……(6)
Since j = 1 in the first routine, the coordinates (xd (1), yd after movement of the grid point (0, 1) are moved.
(0)) is calculated according to equations (3) and (4). The coordinate position of this grid point (0, 1) is indicated by a mark in FIG. 9 (b). Next, in step S114, the grid point (m, j) on the lower side of the transformation target (where 0 <
Coordinates after movement of j <n) (xe (j), ye (j))
Is calculated according to the following equations (5) and (6). This lattice point (m, j) is indicated by a triangle mark in FIG. 9 (b). xe (j) = (1-j / n) 3 * xc1 + 3 (j / n) * (1-j / n) 2 * xbc2 + 3 (j / n) 2 * (1-j / n) * xc3 + (j / N) 3 · xc4 (5) ye (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 ...... (6)

【0044】最初のルーチンではj=0であるから、格
子点(m、0)の移動後の座標(xe(0)、ye
(m))が(5)式および(6)式に従って算出され
る。この格子点(m、0)の座標位置は、図9(b)に
おいて▲印で示される。次いで、ステップS116でポ
インタjをインクリメントし(1だけ進める)、続くス
テップS118でポインタjがnに等しくなったか(つ
まり外枠の右側の辺まで到達したか)否かを判別する。
今回はNOであるから、ステップS112に戻って同様
のループを繰り返す。したがって、次回のループでは変
形対象の上辺にあった格子点(0、1)の移動後の座標
(xd(1)、yd(0))が(3)式および(4)式
に従って算出されるとともに、変形対象の下辺にあった
格子点(m、1)の移動後の座標(xe(1)、ye
(m))が(5)式および(6)式に従って算出され
る。そして、同様のループを繰り返すことにより、j=
nになると、格子点(0、n)の位置および格子点
(m、n)の位置までポインタjが進んでその移動後の
座標(xd(n)、yd(0))および(xe(n)、
ye(m))がそれぞれ算出されたと判断してステップ
S120に抜ける。このようにして、変形対象の上辺に
あった格子点(0、j)(ただし、0<j<n)の移動
後の座標(xd(j)、yd(0))および変形対象の
下辺にあった格子点(m、j)(ただし、0<j<n)
の移動後の座標(xe(1)、ye(m))がすべて順
次算出される。その結果、図9(b)に示すように変形
対象の外枠上辺をベジェ曲線1のパラメータに従った曲
線に変形させることができるとともに、変形対象の外枠
下辺をベジェ曲線2のパラメータに従った曲線に変形さ
せることができる。
Since j = 0 in the first routine, the coordinates (xe (0), ye) after the movement of the grid point (m, 0)
(M)) is calculated according to the equations (5) and (6). The coordinate position of this lattice point (m, 0) is indicated by a triangle mark in FIG. 9 (b). Next, in step S116, the pointer j is incremented (advanced by 1), and in the following step S118, it is determined whether or not the pointer j has become equal to n (that is, whether the right side of the outer frame has been reached).
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 (0)) after the movement of the grid point (0, 1) on the upper side of the deformation target are calculated according to the equations (3) and (4). At the same time, the coordinate (xe (1), ye) after movement of the grid point (m, 1) on the lower side of the deformation target is moved.
(M)) is calculated according to the equations (5) and (6). Then, by repeating the same loop, j =
When it becomes n, the pointer j advances to the position of the grid point (0, n) and the position of the grid point (m, n), and the coordinates (xd (n), yd (0)) and (xe (n ),
When it is determined that each of ye (m)) has been calculated, the process proceeds to step S120. In this way, the coordinates (xd (j), yd (0)) after movement of the grid point (0, j) (where 0 <j <n) on the upper side of the deformation target and the lower side of the deformation target Existing grid point (m, j) (where 0 <j <n)
The coordinates (xe (1), ye (m)) after the movement of are all sequentially calculated. As a result, as shown in FIG. 9B, the outer frame upper side of the deformation target can be transformed into a curve according to the parameter of the Bezier curve 1, and the outer frame lower side of the deformation target can be transformed according to the parameter of the Bezier curve 2. It can be transformed into a curved line.

【0045】次いで、変形対象の内部にあって移動の基
準となる格子点(移動基準格子点)(p、q)と同じ行
にある格子点(p、0)の座標(xp1、yp1)を算
出する処理に移る。ステップS120で内部の移動基準
格子点(p、q)と同じ行にある格子点(p、0)の座
標(xp1、yp1)を、以下に示す(7)式および
(8)式に従って算出する。 xp1=xb1・(m−p)/m+xc1・p/m……(7) yp1=yb1・(m−p)/m+yc1・p/m……(8) 同様に、変形対象の内部にあって移動の基準となる格子
点(移動基準格子点)(p、q)と同じ行にある格子点
(p、m)の座標(xp2、yp2)を算出する処理を
行う。すなわち、ステップS122で内部の移動基準格
子点(p、q)と同じ行にある格子点(p、m)の座標
(xp2、yp2)を、以下に示す(9)式および(1
0)式に従って算出する。 xp2=xb4・(m−p)/m+xc4・p/m……(9) yp2=yb4・(m−p)/m+yc4・p/m……(10) 算出した格子点(p、0)の座標(xp1、yp1)お
よび各格子点(p、m)座標(xp2、yp21)は図
9(b)のように示される。
Next, the coordinates (xp1, yp1) of the grid point (p, 0) in the same row as the grid point (movement reference grid point) (p, q) that is inside the deformation target and serves as a reference for movement are set. Move on to the calculation process. In step S120, the coordinates (xp1, yp1) of the grid point (p, 0) in the same row as the internal movement reference grid point (p, q) are calculated according to the following expressions (7) and (8). . xp1 = xb1 · (m−p) / m + xc1 · p / m (7) yp1 = yb1 · (m−p) / m + yc1 · p / m (8) Similarly, inside the deformation target A process of calculating the coordinates (xp2, yp2) of the grid point (p, m) in the same row as the grid point (movement reference grid point) (p, q) that is the reference of movement is performed. That is, in step S122, the coordinates (xp2, yp2) of the grid point (p, m) in the same row as the internal movement reference grid point (p, q) are expressed by the following equations (9) and (1).
It is calculated according to the formula 0). xp2 = xb4 · (m−p) / m + xc4 · p / m (9) yp2 = yb4 · (m−p) / m + yc4 · p / m (10) Calculated grid points (p, 0) The coordinates (xp1, yp1) and the respective grid point (p, m) coordinates (xp2, yp21) are shown in FIG. 9 (b).

【0046】次いで、ステップS124でポインタjを
[1]にセットする。これにより、今度は外枠左辺から
右辺まで各格子点をポインタjにより順次x軸方向に沿
って順次指定していく。次いで、ステップS126で内
部の移動基準格子点(p、q)(図9(b)で◆で表さ
れる)の移動により、この格子点(p、q)の左側にあ
った格子点(p、j)(ただし、0<j<q)の座標
(xf1、yfj)を、以下に示す(11)式および
(12)式に従って算出する。この格子点(p、j)
は、図9(b)において○印で示される。 xf(j)=xp1・(q−j)/q+x2・j/q……(11) yf(j)=yp1・(q−j)/q+y2・j/q……(12)
Next, in step S124, the pointer j is set to [1]. As a result, this time, the respective grid points from the left side to the right side of the outer frame are sequentially designated by the pointer j along the x-axis direction. Next, in step S126, by moving the internal movement reference grid point (p, q) (represented by ♦ in FIG. 9B), the grid point (p that was on the left side of this grid point (p, q) , J) (where 0 <j <q) coordinates (xf1, yfj) are calculated according to the following equations (11) and (12). This grid point (p, j)
Is indicated by a circle in FIG. xf (j) = xp1 * (q-j) / q + x2 * j / q ... (11) yf (j) = yp1 * (q-j) / q + y2 * j / q ... (12)

【0047】次いで、ステップS128でポインタjを
インクリメントし(1だけ進める)、続くステップS1
30でポインタjがqに等しくなったか(つまり移動基
準格子点(p、q)の位置まで到達したか)否かを判別
する。今回はNOであるから、ステップS126に戻っ
て同様のループを繰り返す。最初のルーチンでは、変形
対象の左辺にある格子点(p、0)と移動基準格子点
(p、q)とを結ぶ線上の格子点(p、1)の座標(x
f1、yfp)が算出されたので、ポインタjをインク
リメントすることにより、次回は変形対象の左辺にある
格子点(p、0)と移動基準格子点(p、q)とを結ぶ
線上の各格子点(p、j)の座標(xfj、yfj)が
算出される。以後、ステップS126〜ステップS13
0のループを繰り返すことにより、最終的にj=qにな
ると、変形対象の左辺にある格子点(p、0)と移動基
準格子点(p、q)とを結ぶ線上の格子点(p、j)の
座標(xfj、yfj)(図9(b)において○印で示
す)がすべて算出されたので、ステップS130からY
ESに抜けてステップS132に進む。
Then, in step S128, the pointer j is incremented (advanced by 1), and the subsequent step S1.
At 30, it is determined whether or not the pointer j has become equal to q (that is, has reached the position of the movement reference grid point (p, q)). Since this time is NO, the process returns to step S126 and the same loop is repeated. In the first routine, the coordinates (x) of the grid point (p, 1) on the line connecting the grid point (p, 0) on the left side of the transformation target and the movement reference grid point (p, q)
Since f1 and yfp) have been calculated, by incrementing the pointer j, next time, each grid on the line connecting the grid point (p, 0) on the left side of the transformation target and the movement reference grid point (p, q) The coordinates (xfj, yfj) of the point (p, j) are calculated. After that, steps S126 to S13
When j = q is finally obtained by repeating the loop of 0, grid points (p, p) on the line connecting the grid point (p, 0) on the left side of the transformation target and the movement reference grid point (p, q) Since all the coordinates (xfj, yfj) of j) (indicated by a circle in FIG. 9B) are calculated, Y is calculated from step S130.
Exit ES and proceed to step S132.

【0048】次いで、格子点(p、q)の右側にあった
格子点(p、j)(ただし、q<j<n)の座標を算出
する処理を行う。すなわち、ステップS132でポイン
タjをq+1にセットする。これにより、今度は移動基
準格子点(p、q)から外枠右辺まで各格子点をポイン
タjにより順次x軸方向に沿って順次指定していく。次
いで、ステップS134で内部の移動基準格子点(p、
q)(図9(b)で◆で表される)の移動により、この
格子点(p、q)の右側にあった格子点(p、j)(た
だし、q<j<n)の座標(xf1、yfj)を、以下
に示す(13)式および(14)式に従って算出する。
この格子点(p、j)は、図9(b)において●印で示
される。 xf(j)=xa・(n−j)/(n−q) +xp2・(j−q)/(n−q)……(13) yf(j)=ya・(n−j)/(n−q) +yp2・(j−q)/(n−q)……(14)
Next, a process of calculating the coordinates of the grid point (p, j) (where q <j <n) on the right side of the grid point (p, q) is performed. That is, the pointer j is set to q + 1 in step S132. As a result, this time, each grid point from the movement reference grid point (p, q) to the right side of the outer frame is sequentially designated by the pointer j along the x-axis direction. Then, in step S134, the internal movement reference grid point (p,
q) (represented by ♦ in FIG. 9B), the coordinates of the grid point (p, j) (where q <j <n) on the right side of this grid point (p, q) (Xf1, yfj) is calculated according to the following equations (13) and (14).
This lattice point (p, j) is indicated by a ● mark in FIG. xf (j) = xa · (n−j) / (n−q) + xp2 · (j−q) / (n−q) (13) yf (j) = ya · (n−j) / ( n−q) + yp2 · (j−q) / (n−q) (14)

【0049】次いで、ステップS136でポインタjを
インクリメントし(1だけ進める)、続くステップS1
38でポインタjがnに等しくなったか(つまり外枠の
右側辺まで到達したか)否かを判別する。今回はNOで
あるから、ステップS134に戻って同様のループを繰
り返す。最初のルーチンでは、移動基準格子点(p、
q)と変形対象の右辺にある格子点(p、n)とを結ぶ
線上の格子点(p、q+1)の座標(xf1、yfp)
が算出されたので、ポインタjをインクリメントするこ
とにより、次回は移動基準格子点(p、q)と変形対象
の右辺にある格子点(p、n)とを結ぶ線上の各格子点
(p、j)の座標(xfj、yfj)が算出される。以
後、ステップS134〜ステップS138のループを繰
り返すことにより、最終的にj=nになると、移動基準
格子点(p、q)と変形対象の右辺にある格子点(p、
n)とを結ぶ線上の格子点(p、j)の座標(xfj、
yfj)(図9(b)において●印で示す)がすべて算
出されたので、ステップS138からYESに抜けてス
テップS140に進む。
Then, in step S136, the pointer j is incremented (advanced by 1), and the subsequent step S1.
At 38, 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). Since this time is NO, the process returns to step S134 and the same loop is repeated. In the first routine, the moving reference grid points (p,
q) and the coordinates (xf1, yfp) of the lattice point (p, q + 1) on the line connecting the transformation target lattice point (p, n) on the right side.
Then, by incrementing the pointer j, next time, each grid point (p, p, n) on the line connecting the movement reference grid point (p, q) and the grid point (p, n) on the right side of the deformation target The coordinate (xfj, yfj) of j) is calculated. After that, by repeating the loop of steps S134 to S138, when finally j = n, the movement reference grid point (p, q) and the grid point (p,
n), the coordinates (xfj, of the grid point (p, j) on the line connecting
Since all yfj) (indicated by a black circle in FIG. 9B) have been calculated, the process exits YES from step S138 and proceeds to step S140.

【0050】次に、格子点(0、j)と格子点(p、
j)を結ぶ線上(つまり、外枠上辺と移動基準格子点と
同じ行にある格子点とを結ぶ線上)にある各格子点
(i、j)(ただし、0<i<p、0≦j≦n)の座標
(x、y)を算出する処理を行う。まず、ステップS1
40でポインタjを[0]にセットする。これにより、
ポインタjによって格子点をx軸方向に沿って順次指定
していくことになる。次いで、ステップS142で変形
対象の上辺にあった格子点(0、j)の座標(xd
(j)、yd(j))および移動基準格子点(p、q)
と同じ行にある格子点(p、j)の座標(xf1、yf
1)を共に読み出す。次いで、ステップS144でポイ
ンタiを[1]にセットする。ポインタiは格子点をy
軸方向に沿って順次指定するものである。次いで、ステ
ップS146で以下に示す(15)式および(16)式
に従って格子点(0、j)と移動基準格子点(p、q)
と同じ行にある格子点(p、j)を結ぶ線上にある格子
点(i、j)の座標を算出する。 x=xd(j)・(p−i)/p+xf(j)・i/p……(15) y=yd(j)・(p−i)/p+yf(j)・i/p……(16)
Next, the grid point (0, j) and the grid point (p,
j) on each line (that is, on the line connecting the outer frame upper side and the grid point on the same row as the movement reference grid point) (i, j) (where 0 <i <p, 0 ≦ j A process of calculating coordinates (x, y) of ≦ n) is performed. First, step S1
At 40, the pointer j is set to [0]. This allows
The lattice points are sequentially designated by the pointer j along the x-axis direction. Then, in step S142, the coordinates (xd
(J), yd (j)) and the movement reference grid point (p, q)
Coordinates (xf1, yf) of the grid point (p, j) in the same row as
Read 1) together. Next, in step S144, the pointer i is set to [1]. The pointer i is the grid point y
It is specified sequentially along the axial direction. Then, in step S146, the grid point (0, j) and the movement reference grid point (p, q) are calculated according to the following expressions (15) and (16).
The coordinates of the grid point (i, j) on the line connecting the grid points (p, j) in the same row as are calculated. x = xd (j) · (p−i) / p + xf (j) · i / p …… (15) y = yd (j) · (p−i) / p + yf (j) · i / p …… ( 16)

【0051】次いで、ステップS148でポインタiを
インクリメントし(1だけ進める)、続くステップS1
50でポインタiがpに等しくなったか(つまり移動基
準格子点(p、q)まで到達したか)否かを判別する。
今回はNOであるから、ステップS146に戻って同様
のループを繰り返す。最初のルーチンでは、格子点
(0、j)と移動基準格子点(p、q)と同じ行にある
格子点(p、j)を結ぶ線上にある第1の(つまり、一
番上側にある)格子点(1、j)の座標(x、y)が算
出されることになるので、ポインタiをインクリメント
することにより、次回は格子点(0、j)と移動基準格
子点(p、q)と同じ行にある格子点(p、j)を結ぶ
線上にある第2の(つまり、2番目の)格子点(1、
j)の座標(x、y)が算出される。以後、ステップS
146〜ステップS150のループを繰り返すことによ
り、最終的にi=pになると、格子点(0、j)と移動
基準格子点(p、q)と同じ行にある格子点(p、j)
を結ぶ線分上にある格子点(i、j)の座標(x、y)
がすべて算出されたので、ステップS150からYES
に抜けてステップS152に進む。
Then, in step S148, the pointer i is incremented (advanced by 1), and the subsequent step S1.
At 50, it is determined whether or not the pointer i has become equal to p (that is, has reached the movement reference grid point (p, q)).
Since this time is NO, the process returns to step S146 and the same loop is repeated. In the first routine, the first point (that is, the uppermost point) on the line connecting the grid point (0, j) and the grid point (p, j) in the same row as the movement reference grid point (p, q) ) Since the coordinates (x, y) of the grid point (1, j) are calculated, by incrementing the pointer i, next time, the grid point (0, j) and the movement reference grid point (p, q) are calculated. )) On the line connecting the grid points (p, j) in the same row as the second (that is, the second) grid point (1,
The coordinates (x, y) of j) are calculated. After that, step S
When i = p is finally obtained by repeating the loop of 146 to step S150, the grid point (p, j) in the same row as the grid point (0, j) and the movement reference grid point (p, q).
Coordinates (x, y) of the grid point (i, j) on the line segment connecting
Since all have been calculated, YES from step S150
To go to step S152.

【0052】次いで、ステップS152でポインタjを
インクリメントし(1だけ進める)、続くステップS1
54でポインタjがn+1に等しくなったか(つまり右
側の外枠辺まで到達したか)否かを判別する。今回はN
Oであるから、ステップS142に戻って同様のループ
を繰り返す。最初のルーチンでは、格子点(0、1)と
移動基準格子点(p、q)と同じ行にある格子点(p、
1)を結ぶ線分について、その線分上にある格子点
(1、j)の座標(x、y)が算出されたので、ポイン
タjをインクリメントすることにより、次回はその右側
に1だけずれた格子点(0、2)と移動基準格子点
(p、q)と同じ行にある格子点(p、2)を結ぶ線分
について、その線分上にある格子点(2、j)の座標
(x、y)が算出される。以後、ステップS142〜ス
テップS154のループを繰り返すことにより、最終的
にj=n+1になると、格子点(0、j)と移動基準格
子点(p、q)と同じ行にある格子点(p、j)を結ぶ
線分上の格子点(p、j)の座標(x、y)(図9
(b)において▽印で示す格子点を含む)がすべて算出
されたので、ステップS154からYESに抜けてステ
ップS156に進む。
Then, in step S152, the pointer j is incremented (advanced by 1), and the subsequent step S1.
At 54, it is determined whether or not the pointer j has become equal to n + 1 (that is, has reached the right outer frame side). This time N
Since it is O, the process returns to step S142 and the same loop is repeated. In the first routine, the grid point (0, 1) and the grid point (p, q) in the same row as the moving reference grid point (p, q)
For the line segment connecting 1), the coordinates (x, y) of the grid point (1, j) on the line segment have been calculated, so by incrementing the pointer j, the next time it is shifted to the right by 1 The line segment connecting the grid point (0, 2) and the grid point (p, 2) in the same row as the movement reference grid point (p, q), the grid point (2, j) on the line segment The coordinates (x, y) are calculated. After that, when j = n + 1 is finally obtained by repeating the loop of steps S142 to S154, the grid point (0, j) and the grid point (p, q) in the same row as the grid point (p, q) of the movement reference The coordinates (x, y) of the grid point (p, j) on the line segment connecting j) (FIG. 9).
Since all the grid points indicated by ∇ in (b) have been calculated, the process exits from step S154 to YES and proceeds to step S156.

【0053】次に、格子点(p、j)と格子点(m、
j)とを結ぶ線上(つまり、移動基準格子点と同じ行に
ある格子点と外枠下辺とを結ぶ線上)にある各格子点
(i、j)(ただし、p<i<m、0≦j≦n)の座標
(x、y)を算出する処理を行う。まず、ステップS1
56でポインタjを[0]にセットする。これにより、
ポインタjによって格子点をx軸方向に沿って順次指定
していくことになる。次いで、ステップS158で移動
基準格子点(p、q)と同じ行にある格子点(p、j)
の座標(xf1、yf1)および変形対象の下辺にあっ
た格子点(m、j)の座標(xc(j)、yc(j))
を共に読み出す。次いで、ステップS160でポインタ
iをp+1にセットする。これにより、移動基準格子点
(p、q)と同じ行から外枠下辺に向ってポインタiに
より格子点を順次y軸方向に沿って順次指定していくこ
とが可能になる。次いで、ステップS162で以下に示
す(17)式および(18)式に従って移動基準格子点
(p、q)と同じ行にある格子点(p、j)と格子点
(m、j)とを結ぶ線上にある格子点(i、j)の座標
を算出する。 x=xf(j)・(m−i)/(m−p) +xe(j)・(i−p)/(m−p)……(17) y=yf(j)・(m−i)/(m−p) +ye(j)・(i−p)/(m−p)……(18)
Next, the grid point (p, j) and the grid point (m,
j)) on each line (that is, on each line connecting the grid points in the same row as the movement reference grid point and the lower edge of the outer frame) (i, j) (where p <i <m, 0 ≦ The process of calculating the coordinates (x, y) of j ≦ n) is performed. First, step S1
At 56, the pointer j is set to [0]. This allows
The lattice points are sequentially designated by the pointer j along the x-axis direction. Next, in step S158, the grid point (p, j) in the same row as the movement reference grid point (p, q)
Coordinates (xf1, yf1) and coordinates (xc (j), yc (j)) of the grid point (m, j) on the lower side of the deformation target
Are read together. Next, in step S160, the pointer i is set to p + 1. As a result, it becomes possible to sequentially designate lattice points from the same line as the movement reference lattice point (p, q) toward the lower side of the outer frame by the pointer i along the y-axis direction. Then, in step S162, the grid point (p, j) and the grid point (m, j) in the same row as the movement reference grid point (p, q) are connected according to the following expressions (17) and (18). The coordinates of the grid point (i, j) on the line are calculated. x = xf (j) · (m−i) / (m−p) + xe (j) · (i−p) / (m−p) (17) y = yf (j) · (m−i) ) / (Mp) + ye (j) · (ip) / (mp) ... (18)

【0054】次いで、ステップS164でポインタiを
インクリメントし(1だけ進める)、続くステップS1
66でポインタiがmに等しくなったか(つまり外枠下
辺まで到達したか)否かを判別する。今回はNOである
から、ステップS62に戻って同様のループを繰り返
す。最初のルーチンでは、移動基準格子点(p、q)と
同じ行にある格子点(p、j)と格子点(m、j)とを
結ぶ線上にある第1の格子点(p+1、j)1の座標
(x、y)が算出されることになるので、ポインタiを
インクリメントすることにより、次回は移動基準格子点
(p、q)と同じ行にある格子点(p、j)と格子点
(m、j)とを結ぶ線上にある第2の(つまり、2番目
の)格子点(2、j)の座標(x、y)が算出される。
以後、ステップS162〜ステップS166のループを
繰り返すことにより、最終的にi=mになると、移動基
準格子点(p、q)と同じ行にある格子点(p、j)と
格子点(m、j)とを結ぶ線分上にある格子点(i、
j)の座標(x、y)がすべて算出されたので、ステッ
プS166からYESに抜けてステップS168に進
む。
Next, in step S164, the pointer i is incremented (advanced by 1), and the subsequent step S1
At 66, it is determined whether or not the pointer i has become equal to m (that is, has reached the lower edge of the outer frame). Since this time is NO, the process returns to step S62 and the same loop is repeated. In the first routine, the first grid point (p + 1, j) on the line connecting the grid point (p, j) and the grid point (m, j) in the same row as the movement reference grid point (p, q) Since the coordinate (x, y) of 1 is calculated, by incrementing the pointer i, the grid point (p, j) and the grid in the same row as the movement reference grid point (p, q) will be displayed next time. The coordinates (x, y) of the second (that is, the second) lattice point (2, j) on the line connecting the point (m, j) are calculated.
After that, by repeating the loop of steps S162 to S166, when i = m finally, the grid points (p, j) and the grid points (m, m, in the same row as the movement reference grid point (p, q) j) and the grid point (i,
Since all the coordinates (x, y) of j) have been calculated, the process exits from step S166 to YES and proceeds to step S168.

【0055】次いで、ステップS168でポインタjを
インクリメントし(1だけ進める)、続くステップS1
70でポインタjがn+1に等しくなったか(つまり右
側の外枠辺まで到達したか)否かを判別する。今回はN
Oであるから、ステップS58に戻って同様のループを
繰り返す。最初のルーチンでは、移動基準格子点(p、
q)と同じ行にある格子点(p、1)と格子点(m、
1)とを結ぶ線分について、その線分上にある格子点
(1、j)の座標(x、y)が算出されたので、ポイン
タjをインクリメントすることにより、次回はその右側
に1だけずれた移動基準格子点(p、q)と同じ行にあ
る格子点(p、2)と格子点(m、2)とを結ぶ線分に
ついて、その線分上にある格子点(2、j)の座標
(x、y)が算出される。以後、ステップS158〜ス
テップS170のループを繰り返すことにより、最終的
にj=n+1になると、移動基準格子点(p、q)と同
じ行にある格子点(p、1)と格子点(m、1)を結ぶ
線分上の格子点(p、j)の座標(x、y)(図9
(b)において▼印で示す格子点を含む)がすべて算出
されたので、ステップS170からYESに抜けて本ル
ーチンを終了する。
Next, in step S168, the pointer j is incremented (advanced by 1), and the subsequent step S1
At 70, it is determined whether or not the pointer j has become equal to n + 1 (that is, has reached the right outer frame side). This time N
Since it is O, the process returns to step S58 and the same loop is repeated. In the first routine, the moving reference grid points (p,
grid point (p, 1) and grid point (m,
For the line segment connecting (1) and (1), the coordinates (x, y) of the grid point (1, j) on the line segment have been calculated. Regarding a line segment connecting the grid point (p, 2) and the grid point (m, 2) in the same row as the shifted reference grid point (p, q), the grid point (2, j) on the line segment ) Coordinates (x, y) are calculated. After that, by repeating the loop of steps S158 to S170, when finally j = n + 1, the grid point (p, 1) and the grid point (m, The coordinates (x, y) of the grid point (p, j) on the line segment connecting 1) (Fig. 9).
Since all of the grid points indicated by ▼ in (b) have been calculated, the process exits from step S170 to YES, and this routine ends.

【0056】以上のルーチンを実行することにより、変
形対象の上側の外枠上にある格子点をベジェ曲線1のパ
ラメータに従って移動させるとともに、下側の外枠上に
ある格子点をベジェ曲線2のパラメータに従って移動さ
せ、かつ変形対象の内部にある1つの小多角形の頂点を
移動させたとき、他の格子点の移動後の座標を算出する
処理が行われる。なお、上記処理では変形対象の上側の
外枠上にある格子点をベジェ曲線1のパラメータに従っ
て移動させ、下側の外枠上にある格子点をベジェ曲線2
のパラメータに従って移動させた場合の各格子点座標の
算出方法を述べたものであるが、上側や下側の外枠上に
ある格子点に限らず、例えば左側、右側の外枠上にある
格子点をベジェ曲線のパラメータに従って移動させる場
合であっても、同様の処理で各格子点の移動後の座標を
算出することができる。
By executing the above routine, the grid points on the upper outer frame to be deformed are moved according to the parameters of the Bezier curve 1, and the grid points on the lower outer frame are moved to the Bezier curve 2. When the vertices of one small polygon inside the transformation target are moved according to the parameters and the vertices of the other small polygonal points are moved, a process of calculating the moved coordinates of the other grid points is performed. In the above process, the grid points on the outer frame on the upper side of the transformation target are moved according to the parameters of the Bezier curve 1, and the grid points on the outer frame on the lower side are moved by the Bezier curve 2.
Although the calculation method of each grid point coordinate when moving according to the parameters of is not limited to the grid points on the upper and lower outer frames, for example, the grid on the left and right outer frames can be used. Even when the point is moved according to the parameter of the Bezier curve, the coordinate after the movement of each grid point can be calculated by the same process.

【0057】次に、前述したいわゆるライン貼り付け法
の処理内容について、以下に具体的に詳述する。ライン貼り付け処理のサブルーチン 図7に示したステップS34におけるライン貼り付け法
(矩形から任意の四角形への変形方法)の具体的な内容
は以下の通りである。図13はライン貼り付け法の処理
を示すサブルーチンのフローチャートであり、このサブ
ルーチンの処理の対象となる画像データの例は図14
(a)、(b)のように示される。すなわち、図14
(a)は変形前の元画像データを示し、詳しくは変形元
となるビット配列形式の画像データを分割した場合のあ
る1つの小矩形の画像データ(つまり、変形前の小矩形
画像データ)に対応する。ここで説明するライン貼り付
け法は、図14(a)に示すように変形前の小矩形画像
データとして縦(Y)方向が12ピクセル、横(X)方
向が16ピクセルで構成される元画像データ(矩形AB
CDで表される)を、図14(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. 13 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. 14A, 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. 14 (b). 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.

【0058】サブルーチンのステップを進めながら、上
記処理について説明する。このサブルーチンに移行する
と、まずステップS1100で辺A’B’についてライ
ンの端点処理を行う。これは、変形後の四角形のライン
の端点A’B’を求めるものである。なお、ステップS
1100の処理(辺A’B’の位置を求める方法)につ
いては、後述のサブルーチンで詳述する。すなわち、図
14(a)(b)に示すように、分割した各ラインを画
像変形態様に応じて変形後の四角形に順番に貼り付けて
いく処理では、以下のような状態に着目する必要があ
る。辺AB上にあった各ラインの一方の端点は辺A’
B’上に、また、辺DC上にあった他方の端点は辺D’
C’上に移動する。このとき、辺ABと辺A’B’およ
び辺DCと辺D’C’では、それらの長さが異なるの
で、辺A’B’、辺D’C’上でラインの端点が重なっ
たりすることがある。これは、図14(b)の☆印で示
す部分であり、辺A’B’上のライン5およびライン6
が重なっている。また、同一のラインを2回以上貼り付
けなければならないこともある。これは、図14(b)
の★印で示す2つの部分であり、辺D’C’上のライン
3およびライン8が2回繰り返され、それぞれライン
3、3’およびライン8、8’となっている。
The above processing 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. 14A and 14B, it is necessary to pay attention to the following state in the process of sequentially attaching the divided lines to the modified quadrangle according to the image modification 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 portion indicated by a star mark in FIG. 14B, and the 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. 14 (b).
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.

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

【0060】次いで、ステップS1102で辺D’C’
についてラインの端点処理を行う。これは、変形後の四
角形のラインの端点D’C’を求めるものである。な
お、ステップS1102の処理(辺D’C’の位置を求
める方法)については、同様に後述のサブルーチンで詳
述する。このようにして、各ラインの端点が移動する辺
A’B’と辺D’C’の位置が求められると、これらの
ラインの端点位置は図30に示すように、CPU31の
内部レジスタ31aにある端点バッファにデータを格納
する。この場合、内部レジスタ31aには辺A’B’上
の端点バッファと、辺D’C’上の端点バッファという
2つの格納エリアがある。そして、これらの各端点バッ
ファではラインの端点の座標と、そのライン番号を対応
付けて格納する。2つの端点バッファは端点の位置を読
み出すときや、ラインの描画位置を決めるときに使用さ
れる。
Then, 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.

【0061】次いで、ステップS1104〜ステップS
1110でラインを描画する処理を行う。まず、ステッ
プS1104では2つの端点バッファからライン番号の
同じデータを読み出す。次いで、ステップS1106で
同じライン番号のラインが複数あるときには描画回数が
最小になるように組み合せる。これは、図25に示すよ
うに、例えば辺A’B’上で同じライン番号のラインが
3本あり、一方、辺D’C’上で同じライン番号のライ
ンが2本ある場合、上側の各端点同士を1本のラインで
引き、辺A’B’上の2つの端点と辺D’C’上の1つ
の端点とを2本のラインで引くような処理を行うもので
ある。次いで、ステップS1108で描画処理(詳細は
サブルーチンで後述)を行う。次いで、ステップS11
10ですべてのラインについて処理したか否かを判別
し、NOのときはステップS1104に戻って同様の処
理を繰り返す。そして、すべてのラインについてステッ
プS1104〜ステップS1108の処理が終了する
と、ステップS1110からYESに抜けてルーチンを
終了する。このようにして、各小矩形が異なる四角形に
それぞれ変形され、変形対象の画像全体が滑らかに変形
することになる。
Then, 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. For example, as shown in FIG. 25, 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.

【0062】ライン端点処理のサブルーチン 次に、上記ステップS1100およびステップS110
2におけるラインの端点処理のサブルーチンについて説
明する。図26はラインの端点処理(ステップ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. 26 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].

【0063】次いで、ステップS1202で処理を開始
する点(A’又はD’)の座標をCPU31の内部レジ
スタ31aにある現在座標というエリアに格納する。例
えば、貼り付けるラインの一方の端点となる辺A’B’
の位置を求める処理では、A’の座標を格納する。一
方、貼り付けるラインの他方の端点となる辺D’C’の
位置を求める処理では、D’の座標を格納する。CPU
31の内部レジスタ31aには図24に示すように、端
点バッファの他に、以下のような格納エリアがある。 座標決定用誤差e1のエリア 座標決定用誤差増分Δe1のエリア 現在座標のエリア ライン選択用誤差e2のエリア ライン選択誤差増分Δe2のエリア 現在ライン番号 また、ドット選択用の格納エリアとしては、以下のよう
なものがある。 ドット選択用誤差e3のエリア ドット選択用誤差増分Δe3のエリア 現在ドット番号のエリア
Next, in step S1202, the coordinates of the point (A 'or D') at which the processing is started are stored in an area called the 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. 24, 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

【0064】次いで、ステップS1204でY方向のピ
クセル数がX方向のピクセル数より多いか否かを判別す
る。いま、貼り付けるラインの一方の端点となる辺A’
B’の位置を求める場合の具体例は図16に示される。
図16(a)に示す変形前のラインの一方の端点となる
辺ABを示し、図16(b)は貼り付けるラインの一方
の端点となる辺A’B’の様子を示し、さらに図16
(c)は辺A’B’におけるX方向およびY方向のピク
セル数の変化を示している。この例に対応させて考える
と、辺A’B’はY方向に11ピクセル、X方向に4ピ
クセルに渡って描画されるので、ステップS1204の
判別結果はYESとなり、このケースではステップS1
206に進む。一方、逆のケースではNOに分岐して図
27に示すステップS1238に進む。また、この場
合、図16に示すケースでは点A’から点B’に向って
Y座標を1ずつ変えていったときにX座標の変化する位
置を求めると、そのとき変化した座標が辺A’B’の位
置となる。したがって、無条件に位置の決る始点(点
A’)を除く10個のドットを打つときには、X座標の
変化する位置としてX座標が変化する3箇所を求めるこ
とになる。
Then, 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.
16A shows a side AB which is one end point of the line before deformation shown in FIG. 16A, FIG. 16B shows a state of a side A′B ′ which 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. 16, 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.

【0065】ステップ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).

【0066】なお、ここでは、座標決定用であるからe
をe1とし、ΔeをΔe1として処理をする。そうする
と、e1=e1+Δe1となる。この値が1/2より大
きくなったか否かを判別する。そして、誤差増分Δe1
を加えた結果e1がe1≧(1/2)であれば、ステッ
プS1214に進んで次に打つ点の座標(次の現在座標
に相当)のX座標を変更する。これは、選択誤差に誤差
増分を加え、その結果が1/2より大きいか小さいかに
よって処理を選択するもので、選択誤差が1/2以上の
ときに誤差を補正する。
In this case, since it is for determining coordinates, 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.

【0067】このようにすると、点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’の位置が決定さ
れる。
By doing so, 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.

【0068】ここで、図16の場合(貼り付けるライン
の一方の端点となる辺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座標は変更しない(図16
(c)参照)。また、選択誤差eは1/2より小さいの
で、選択誤差eの補正は行わない。次いで、ここまでの
選択誤差e=0.30に誤差増分ΔeとしてΔe=0.
30を加えると、e=0.30+0.30=0.60≧
(1/2)となるので、今度は次に打つ点のX座標を
変更する(図16(c)参照)。以上の処理を繰り返す
ことにより、点、の位置でX座標の変更が行われ、
最終的に図16(c)に示すように、端点B’の位置が
決定される。
Here, in the case of FIG. 16 (when the position of the side A'B 'which is one end point of the sticking 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, so the error increment Δe is Δe = (4-1) /
(11-1) = 0.30. Next, since the selection error e is initially set to e = 0, it is left as it is. 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. 16).
(See (c)). Since the selection error e is smaller than 1/2, the selection error e is not corrected. Next, Δe = 0.30 as the error increment Δe for the selection error e = 0.30 so far.
If 30 is added, e = 0.30 + 0.30 = 0.60 ≧
Since this is (1/2), the X coordinate of the next hit point is changed (see FIG. 16C). By repeating the above process, the X coordinate is changed at the position of
Finally, as shown in FIG. 16C, the position of the end point B ′ is determined.

【0069】一方、上記ステップS1204でY方向の
ピクセル数がX方向のピクセル数より小さいときは図2
7のステップS1238に進み、今度はY座標の方を変
更する処理を行う。すなわち、ステップS1238で座
標決定用誤差増分Δe1を(Yピクセル数−1)/(X
ピクセル数−1)に初期設定するとともに、ライン選択
誤差増分Δe2を(元ライン数−1)/(Xピクセル数
−1)に初期設定する。次いで、ステップS1240で
現在のライン番号と現在座標を端点バッファ(図24参
照)に格納する。次いで、ステップ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,
7, the process proceeds to step S1238 to change the Y coordinate. 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 coordinates are stored in the end point buffer (see FIG. 24). 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.

【0070】このようにすると、点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.

【0071】ここで、図17の場合(貼り付けるライン
の他方の端点となる辺D’C’の位置を決定する場合)
の具体例について説明する。図17(a)は変形前のラ
インの他方の端点となる辺DCを示し、図17(b)は
貼り付けるラインの他方の端点となる辺D’C’の様子
を示し、さらに図17(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. 17 (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. 17A shows a side DC which is the other end point of the line before deformation, FIG. 17B 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.

【0072】まず、最初の端点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.30
<(1/2)となる。したがって、このときは次に打つ
点のX座標は変更しない(図17(c)参照)。ま
た、選択誤差eは1/2より小さいので、選択誤差eの
補正は行わない。次いで、ここまでの選択誤差e=0.
30に誤差増分ΔeとしてΔe=0.30を加えると、
e=0.30+0.30=0.60≧(1/2)となる
ので、今度は次に打つ点のX座標を変更する(図17
c)参照)。以上の処理を繰り返すことにより、点、
、(12)(なお、10以降の○付き数字は表示が困難に
つき、かっこ付きの半角数字で表す)の位置でX座標の
変更が行われ、最終的に図17(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 it is drawn over 4 pixels and 5 pixels in the X direction, the error increment Δe is Δe = (5-1) / (14-1) =
It is 0.30. Next, since the selection error e is initially set to e = 0, the error is left as it is, and Δ is set as the error increment Δe.
Adding e = 0.30, 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. 17C). 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. 17).
See c)). By repeating the above process,
, (12) (Note that the numbers with a circle after 10 are difficult to display, so they are represented by parenthesized half-width numbers), the X coordinate is changed, and finally as shown in FIG. , The position of the end point C ′ is determined.

【0073】さて、再び図27のフローチャートに戻
り、端点位置の決定が行われると、ステップS1218
に進む。ステップS1218〜ステップS1236およ
びステップS1250〜ステップS1266では、辺
A’B’、辺D’C’に分割された水平ラインのうち、
どのラインの端点を割り当てるかを求める処理を行う。
まず、図18(b)に示す辺A’B’のように図18
(a)に示す元となる辺ABよりも短い辺に、貼り付け
るラインの端点を割り当てる処理内容について説明す
る。元画像データの水平ライン数は12本、辺A’B’
に貼り付けることのできるライン数は11本なので、元
画像データの12本のラインのうち、2本のラインの端
点が辺A’B’上で重なる。重なるラインの選択の処理
は、次のようになる。
Now, returning to the flowchart of FIG. 27 again, when the end point positions are determined, step S1218 is performed.
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.

【0074】ステップ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.

【0075】このようにすると、点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.

【0076】ステップ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.

【0077】次いで、ステップS1234で誤差補正を
行い、e2=e2−1とする。これは、上記同様に選択
誤差が1/2以上になって次のライン番号に変更したの
で、1を減算することにより、再び次のライン番号から
誤差増分Δeを加えて同様の判別を始めるためである。
その後、ステップS1228に戻って同様の処理を繰り
返す。したがって、誤差を補正した結果(選択誤差)e
2が未だ1/2より大きければ、ライン番号を更に1進
めて辺A’B’上の同じ点に、次のラインの端点が割り
当てられ、選択誤差e2が1/2未満になるまで、同じ
点に次のラインの端点が割り当てられることになる。
Then, 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.

【0078】一方、ステップ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. .

【0079】ここで、図18の場合(辺A’B’のよう
に元となる辺ABよりも短い辺に、ラインの一方の端点
を割り当てる場合)の具体例について説明する。図18
(a)は変形前のラインの一方の端点となる辺ABを示
し、図18(b)は貼り付けるラインの一方の端点とな
る辺A’B’の様子を示し、さらに図18(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になる:
図18(c)参照)。したがって、辺A’B’上の点
にはライン1の端点が割り当てられる(図18(b)参
照)。このとき、選択誤差eを次のように補正する。 e=1.10−1=0.10<1/2
A specific example in the case of FIG. 18 (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. FIG.
18A shows a side AB which is one end point of the line before deformation, FIG. 18B 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). .
This advances the line number by 1 (becomes line 1:
See FIG. 18C). Therefore, the end points of the line 1 are assigned to the points on the side A′B ′ (see FIG. 18B). At this time, the selection error e is corrected as follows. e = 1.10-1 = 0.10 <1/2

【0080】ここまでの選択誤差e=0.10に、再び
誤差増分Δe=1.10を加えると、e=0.10+
1.10=1.20≧(1/2)となる。これにより、
ライン番号を1進める(今度はライン2になる:図18
(c)参照)。したがって、辺A’B’上の点にはラ
イン2の端点が割り当てられる(図18(b)参照)。
このとき、選択誤差eを次のように補正する。 e=1.20−1=0.20<1/2 以下、同様の処理を行い、辺A’B’上の点にはライ
ン3の端点が、点にはライン4の端点が、点にはラ
イン5の端点がそれぞれ割り当てられる(図18(b)
参照)。このとき、ライン5を割り当てて選択誤差eを
補正した時点で選択誤差eは0.50になる。選択誤差
eを補正した時点で未だe≧1/2なので、ライン番号
を更に1進めて(ライン6になる)、点にライン6の
端点も割り当てる。次いで、さらに選択誤差eを以下の
ように補正する。 e=0.50−1=−0.50<1/2 以上の処理を繰り返すことにより、辺A’B’に分割さ
れた元の水平ライン内のどのラインの端点を割り当てる
かが決まる。
If 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 18
(See (c)). Therefore, the end points of the line 2 are assigned to the points on the side A′B ′ (see FIG. 18B).
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 end points of line 5 (FIG. 18B).
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.

【0081】さて、再び図27のフローチャートに戻っ
て説明する。上述の説明は辺A’B’のように元となる
辺ABよりも短い辺に、貼り付けるラインの端点を割り
当てる処理内容であったが、今度は、図19(b)に示
す辺D’C’のように図19(a)に示す元となる辺D
Cよりも長い辺に、貼り付けるラインの端点を割り当て
る処理内容について説明する。この場合には図27に示
すステップS1250以降の処理が実行される。これ
は、先のステップS1204の判別結果がNOである場
合に相当し、この判別結果がNOということは元となる
辺DCよりも長い辺D’C’の処理に進むケースであ
る。ステップS1204の判別結果がNOであるときは
図27のステップS1238に分岐し、端点の位置決定
を行った後、ステップS1250以降の各ステップを実
行する。まず、元画像データの水平ライン数は12本、
辺D’C’に貼り付けることのできるライン数は14本
なので、元画像データの12本のラインのうち、2本の
ラインの端点が辺D’C’上で2回貼り付けられること
になる。貼り付けられるラインの選択の処理は、次のよ
うになる。
Now, returning to the flowchart of FIG. 27 again, description will be made. The above description is the processing content of allocating the end point of the line to be attached to the side shorter than the original side AB such as the side A'B ', but this time, the side D'shown in FIG. 19B. An original side D shown in FIG. 19A as in C ′
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 shown in FIG. 27 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. 27 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.

【0082】ステップ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.

【0083】このようにすると、点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.

【0084】ステップ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, the error is corrected in the following 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.

【0085】次いで、ステップ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.

【0086】一方、ステップ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. .

【0087】ここで、図19の場合(辺D’C’のよう
に元となる辺ABよりも長い辺に、ラインの一方の端点
を割り当てる場合)の具体例について説明する。図34
(a)は変形前のラインの一方の端点となる辺DCを示
し、図19(b)は貼り付けるラインの一方の端点とな
る辺D’C’の様子を示し、さらに図19(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にな
る:図19(c)参照)。したがって、辺D’C’上の
点にはライン1の端点が割り当てられる(図19
(b)参照)。このとき、選択誤差eを次のように補正
する。 e=0.84−1=−0.16<1/2
Here, a specific example of the case of FIG. 19 (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. FIG. 34
19A shows a side DC which is one end point of the line before deformation, FIG. 19B shows a state of a side D′ C ′ which is one end point of the line to be attached, and further, FIG. 19C. 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. 19C). Therefore, the end points of the line 1 are assigned to the points on the side D'C '(FIG. 19).
(See (b)). At this time, the selection error e is corrected as follows. e = 0.84-1 = -0.16 <1/2

【0088】同様に、辺D’C’上の点にはライン2
の端点が、点にはライン3の端点が割り当てられる
(図19(b)参照)。ライン3を割り当てて選択誤差
eを補正して時点で、選択誤差eは−0.48になって
いる。ここまでの選択誤差e=−0.48に再び誤差増
分Δe=0.84を加えると、e=−0.48+0.8
4=0.36<(1/2)になるので、ライン3を点
にもう一度貼り付ける(図19(c)参照)。このと
き、選択誤差eは補正しない。以上の処理を繰り返すこ
とにより、辺D’C’に分割された元の水平ライン内の
どのラインの端点を割り当てるかが決まる。ライン端点
処理が終わった時点における端点バッファへの格納デー
タは図30に示すようになる。図30では、辺A’B’
上のライン0〜ライン11の12個の端点位置が座標に
よって端点バッファに記憶される。また、辺D’C’上
のライン0〜ライン11(そのうちライン3とライン8
は2つある)の14個の端点位置が座標によって端点バ
ッファに記憶される。
Similarly, a line 2 is attached to a point on the side D'C '.
Of the line 3 is assigned to the point (see FIG. 19B). 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 the point (see FIG. 19 (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. 30, 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.

【0089】ライン描画処理のサブルーチン さて、その後はこのようにして求めた辺A’B’上に一
方のラインの端点を持ち、辺D’C’上に他方の端点を
持つような複数のラインに元画像データ(矩形ABC
D)の対応するラインを順番に貼り付けていけば画像変
形が行える。ただし、このとき転送先と転送元ではライ
ンの長さ(ピクセル数)が異なるので、ライン毎に拡大
あるいは縮小をしながら貼り付けていくことになる。そ
こで、続いて前述の図13に示したステップS1108
のラインの描画処理のサブルーチンについて説明する。
図28はラインの描画処理を示すサブルーチンのフロー
チャートである。まず、貼り付けるラインの位置を求め
る処理から説明する。具体例としては、後にライン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. 28 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].

【0090】次いで、ステップS1302で辺A’B’
上の端点の座標をCPU31の内部レジスタ31aにあ
る現在座標というエリアに格納する(図24参照)。な
お、ドット選択処理の過程で使用される関連の格納エリ
アとしては、ドット選択用誤差e3のエリア、ドット選
択用誤差増分Δe3のエリア、現在ドット番号のエリア
が用いられる。次いで、ステップS1304でY方向の
ピクセル数がX方向のピクセル数より多いか否かを判別
する。いま、ライン0を貼り付けるため各ドットの位置
を求める場合の具体例は図35に示される。図20
(a)は変形前のラインADを示し、図20(b)は変
形後のライン辺A’D’の様子を示し、さらに図20
(c)は辺A’D’におけるX方向およびY方向のピク
セル数の変化を示している。この例に対応させて考える
と、辺A’D’はY方向に10ピクセル、X方向に2ピ
クセルに渡って描画されるので、ステップS1304の
判別結果はYESとなり、このケースではステップS1
306に進む。一方、逆のケースではNOに分岐して図
29に示すステップS1338に進む。また、この場
合、図20に示すケースでは点A’から点D’に向って
X座標を1ずつ変えていったときにY座標の変化する位
置を求めると、そのとき変化した座標がラインA’D’
を貼り付けする位置となる。したがって、無条件に位置
の決る始点(点A’)を除く9個のドットを打つときに
は、X座標の変化する位置としてX座標が変化する1箇
所を求めることになる。
Then, 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. 24). 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. Now, a specific example of the case where the position of each dot is obtained in order to paste the line 0 is shown in FIG. Figure 20
20A shows the line AD before deformation, FIG. 20B shows the state of the line side A′D ′ after 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 S1338 shown in FIG. In this case, in the case shown in FIG. 20, 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.

【0091】ステップ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.

【0092】このようにすると、点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方向のピ
クセル数より多い場合における該当するラインの貼り付
け位置が決定される。
By doing so, 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.

【0093】一方、上記ステップS1304でY方向の
ピクセル数がX方向のピクセル数より小さいときは図4
4のステップ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, the process shown in FIG.
Then, the processing proceeds to step S1328 of 4, and the 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.

【0094】すなわち、選択誤差(初期値=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.

【0095】このようにすると、点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.

【0096】なお、上記処理は前述した図26に示すス
テップS1210〜ステップS1216と同様の処理内
容であるが、図26のルーチンに比べてXとYが逆にな
っている部分がある。これは、X方向とY方向のピクセ
ル数の多い方を基準として考えているからである。図2
6のルーチンではピクセル数の多いY座標を基準として
考え、Y座標を1つずつ変えていったときに、X座標が
どう変化するかを決定したのに対して、図28のルーチ
ンではピクセル数の多いX座標を基準として考え、X座
標を1つずつ変えていったときに、Y座標がどう変化す
るかを決定している。他のラインの貼り付け位置につい
ても、同様の方法で求める処理が行われる。
The above-mentioned processing has the same processing contents as those in steps S1210 to S1216 shown in FIG. 26, 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 2
In the routine of FIG. 6, 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. 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.

【0097】以上で、各ラインの貼り付け位置が求まっ
たので、次に、元となる水平ドットラインのドット内の
うち、どのドットを割り当てる(つまり、ドットを選択
する)かを求める処理内容を説明する。まず、ドット選
択の処理として示されるステップ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, next, the processing contents for obtaining which dot is to be assigned (that is, to select a dot) among the dots of the original horizontal dot line will be 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

【0098】次いで、この値が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.

【0099】このようにすると、点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, if at least the error increment Δe3 is larger than half of 1, the dot number is changed to the next dot number. 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.

【0100】一方、ステップ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.

【0101】ここで、ドット選択の具体例について図2
2を参照して説明する。図22(a)は変形前の転送元
ラインのドットの様子を示し、図22(b)は変形後の
転送先ラインのドットの様子を示し、さらに図22
(c)は転送ラインにおけるX方向およびY方向のピク
セル数の変化を示している。この例は、転送先ラインの
ピクセル数が転送元ラインのピクセル数より多いとき、
つまりラインを拡大する処理に相当するものである。こ
の例に対応させて考えると、転送元ラインのドット数は
16個、転送先ラインのドット数は17個なので、転送
先の17個のドットのうち1個は1つ前のドットと同じ
データを転送することになる。転送元ラインの最初のド
ット(ドット0)を無条件に転送するものとすると、そ
の他のドットの転送の処理は次のようにして行われる。
Here, a specific example of dot selection is shown in FIG.
2 will be described. 22A shows a state of dots on the transfer source line before the deformation, FIG. 22B shows a state of 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.

【0102】まず、最初にドット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が転送される(図22(b)、図22
(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 the number of dots in the transfer destination line is 6, and the number of dots in 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 Δe =
Adding 0.93, 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. 22B, FIG. 22
(See (c)).

【0103】次いで、同様にここまでの選択誤差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
2(b)、図22(c)参照)。
Similarly, the selection error so far 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).
2 (b) and FIG. 22 (c)).

【0104】以後、同様の処理を行うと、点にはドッ
ト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が再び転送される(図22
(b)、図22(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. 22).
(B) and FIG.22 (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.

【0105】上述した各プログラムを実行することによ
り、変形前の画像データのラインを変形後の画像データ
として貼り付ける処理が行われるが、このときラインの
貼り付けは辺A’B’と辺D’C’のうち、長い方の辺
が有するピクセル数分だけ行われる。例えば、図14の
例では辺A’B’と辺D’C’の各ピクセル数を比較す
ると、辺A’B’のピクセル数が11、辺D’C’のピ
クセル数が14であるから、辺D’C’のピクセル数分
(=14)だけ行われる。具体的には、図14(b)に
示すように辺D’C’のピクセル数に対応して、ライン
0、ライン0、ライン1、ライン2、ライン3、ライン
3’、ライン4、ライン5、ライン6、ライン7、ライ
ン8、ライン8’、ライン9、ライン10、ライン11
の14回ラインの貼り付けるが行われる。そして、各ラ
インを貼り付けた最終的な状態は図23(b)のように
示される。なお、図23(a)は変形前の画像データの
ラインである。なお、図15(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. 14, comparing the numbers of pixels on the sides A′B ′ and D′ C ′, the number of pixels on the side A′B ′ is 11, and the number of pixels on the side D′ C ′ is 14, , D′ C ′ pixels (= 14). Specifically, as shown in FIG. 14B, 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. 23 (b). Note that FIG. 23A is a line of image data before transformation. As shown in FIGS. 15 (a) and 15 (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.

【0106】このように本実施例では、ビット配列形式
の画像データを有する変形対象を複数の小矩形に分割
し、変形対象全体が滑らかに変形されるように、各小矩
形を座標変換処理に従って異なる小四角形にそれぞれ変
形することが行われる。このとき、小矩形の変形処理で
は、変形対象の外枠を構成する向い合う上辺および下辺
を選択し、選択したそれぞれの辺上にある複数個の小多
角形の頂点を、それぞれの辺に対応する曲線1のパラメ
ータおよび曲線1のパラメータにそれぞれ従って移動す
るとともに、変形対象の内部にある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 transforming a small rectangle, the facing upper and lower sides that form the outer frame to be transformed are selected, and the vertices of a plurality of small polygons on each selected side are associated with each side. When the vertex of one small polygon inside the deformation target is moved to at least an arbitrary position that is located inside after the deformation, the deformation is performed according to the parameters of the curve 1 and the parameters of the curve 1 The vertices of the other small rectangles are moved so that the entire object is smoothly deformed, and the vertices of the other small rectangles (coordinates: xd (j), yd (j)) that have been moved become the reference small rectangle vertices. Based on the calculated vertices, each small rectangle is transformed into a quadrangle. 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 this embodiment, for example, FIG.
The "eye" image in the bit array format as shown in (a) can be smoothly transformed into the "eye" image as shown in FIG. 1 (b).

【0107】したがって、変形対象の画像データの配列
に対して各小矩形毎に変形処理が行われるので、従来の
ように全く異なる全体の画像データを予め持つ必要がな
く、少ないメモリ容量で、ビット配列形式のデータを有
する画像を自由に変形することができる。また、変形対
象を複数の小矩形に分割し、各小矩形毎に変形処理が行
われるので、変形に自由度があり、予めメモリに多くの
データを持たなくても、画像を滑らかに変形することが
できる。特に、変形対象の外枠を構成する任意の辺にあ
る任意の小多角形の頂点を曲線パラメータに従って移動
させるとともに、変形対象の内部にある任意の小多角形
の頂点を、少なくとも変形後に再び内部に位置するよう
な任意の位置に移動させる変形法を使用することによ
り、曲線パラメータとしてそれぞれ4点分の座標および
内部の格子点を移動するために必要なデータだけを持っ
ていればよく、変形後のすべての小多角形の頂点の位置
データ(例えば、座標)を持っておく必要がない。よっ
て極めて少ない変形データで複雑かつ非常に滑らかな画
像変形を行わせることができる。さらに、この変形法を
用いると、変形対象の外枠の形を変えるとともに、内部
の小多角形も任意の形に変形できるので、画像データの
外形(例えば、大きさ)を変え、さらに内部の形も変え
ることができる。
Therefore, since the transformation process is performed for each small rectangle with respect to the array of transformation-target image data, it is not necessary to previously have completely different whole image data as in the prior art, 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, the vertices of any small polygon on any side that constitutes the outer frame of the deformation target are moved according to the curve parameters, and the vertices of any small polygon inside the deformation target are re-integrated at least after the deformation. By using the transformation method that moves to an arbitrary position such as that located at, it suffices to have only the coordinates for four points and the data necessary to move the internal grid points as the curve parameters. It is not necessary to have position data (for example, coordinates) of the vertices of all the subsequent small polygons. Therefore, it is possible to perform complex and very smooth image transformation with extremely little transformation data. Furthermore, when this transformation method is used, the shape of the outer frame to be transformed can be changed, and the small polygon inside can be transformed into an arbitrary shape, so the outer shape (for example, size) of the image data can be changed, and The shape can be changed.

【0108】その他に、具体的な波及効果としては、本
発明の適用により、例えばアニメーション、ゲーム等の
キャラクター又は背景データ等のようにドットで構成さ
れ、かつ各ドット毎に表示色番号あるいはパレット番号
を持つようなビット配列形式の画像を、自由にかつ滑ら
かに変形することができる。その結果、1つの元画像デ
ータから元画像データの一部又は全部が滑らかに変形し
た複数の画像データを作成することができる。また、ア
ニメーションに適用した場合、従来のように少しずつそ
の形の異なる複数の画像データを予めメモリに持ってお
かなくても、一定時間毎に元画像データを本発明の変形
法を用いて変形すれば、少ないメモリ容量で従来と同等
のアニメーションを行うことができる。ゲーム等に複数
のキャラクターを登場させる場合にも、1つのキャラク
ターの画像データから全く別の複数のキャラクターを作
ることができる。ゲーム等に登場するキャラクターの一
部分(例えば、目、鼻、手、足等のパーツ)の形を変え
る場合にも、元となる1つの画像データだけを持ってい
ればよいという効果がある。ゲーム等の背景等に特殊効
果を付加する場合にも、従来のような拡大、縮小、四角
形から四角形への変形等に比べてはるかに自由かつ滑ら
かな変形を行うことができ、従来にない特殊効果(例え
ば、背景を歪ませて異次元の世界を表現する等)を付加
することができる。
In addition, as a concrete ripple effect, by the application of the present invention, for example, a character such as an animation, a game, or background data is composed of dots, and a display color number or a palette number is set 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. 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. Even when changing the shape of a part of a character appearing in a game or the like (for example, parts such as eyes, nose, hands, and feet), there is an effect that only one original image data is required. Even when adding special effects to the background of games, etc., it is possible to perform far more flexible and smooth transformations than the conventional enlargement, reduction, transformation from square to square, etc. Effects (for example, distorting the background to represent a different dimension world) can be added.

【0109】なお、上記実施例では曲線パラメータとし
てベジェ曲線のパラメータを使用しているが、これに限
るものではなく、例えばBスプライン曲線等の任意の曲
線を用いることも可能である。また、この他に放物線、
双曲線、三角関数等のように外枠上の格子点を滑らかに
配置可能な任意の数式を採用することが可能である。こ
の場合、外枠上の格子点を移動するには曲線の式だけで
なく、放物線、双曲線、三角関数等の変形のさせ方に応
じて適切な数式を用いればよい。このようにすると、そ
の時々に応じた適切な変形を行われせることができる。
また、内部にある移動基準格子点も1つの例に限らず、
例えば複数の内部の移動基準格子点を移動させることも
可能である。さらに、内部にある移動基準格子点を単純
に移動させる場合に限らず、例えば曲線等の数式のパラ
メータに従って移動させる例、内部にある小多角形自体
を移動する例についても、必要に応じて本発明の方法を
適用できる。
In the above embodiment, the Bezier curve parameter is used as the curve parameter, but the curve parameter is not limited to this, and an arbitrary curve such as a B-spline curve may be used. In addition to this, a parabola,
It is possible to employ an arbitrary mathematical expression such as a hyperbola, a trigonometric function or the like that allows the grid points on the outer frame to be arranged smoothly. In this case, in order to move the grid points on the outer frame, not only the equation of the curve but also an appropriate equation may be used according to the way of transforming the parabola, the hyperbola, the trigonometric function and the like. By doing so, appropriate deformation can be performed depending on the occasion.
Also, the movement reference grid points inside are not limited to one example,
For example, it is possible to move a plurality of internal movement reference grid points. Furthermore, not only when simply moving the moving reference grid points inside, but also when moving according to the parameters of mathematical expressions such as curves, and when moving the small polygon itself inside, The method of the invention can be applied.

【0110】なお、上記各実施例ではビット配列形式の
画像データを有する変形対象を小矩形に分割し、任意な
四角形に変形しているが、これに限らず、例えば変形対
象を複数の小六角形に分割し、各六角形を例えば所定の
変形処理手順に従って異なる小六角形にそれぞれ変形す
ることにより、変形後の画像データを作成するようにし
てもよい。また、ビット配列形式の画像データを有する
変形対象を分割する形状は上記の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 rectangles. However, the present invention is not limited to this. 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.

【0111】[0111]

【発明の効果】本発明によれば、変形対象を複数の小多
角形に分割し、各小多角形を所定の変形処理に従って異
なる小多角形にそれぞれ変形し、このとき小多角形の変
形処理では、変形対象の外枠上にある任意の小多角形の
頂点および変形対象の内部にある任意の小多角形の頂点
を、少なくとも変形後に再び外枠を構成するような任意
の位置および少なくとも再び内部に位置するような任意
の位置にそれぞれ移動したとき、前記任意の小多角形の
移動に応じて他の小多角形の頂点を移動させ、移動した
他の小多角形の頂点を前記任意の小多角形の移動後の頂
点に基づいて算出し、この算出した頂点に対応して各小
多角形を変形し、さらに変形前の小多角形に含まれるビ
ット配列形式の画像データの配列を、各小多角形毎に、
所定のデータ変換処理に従って変形後の小多角形のデー
タに対応するように順次変更して変更後の全体画像を作
成しているので、以下の効果を得ることができる。 変形対象の有する画像データの配列は、各小多角形毎
に変更処理が行われるので、従来のように全く異なる全
体の画像データを予め持つ必要がなく、少ないメモリ容
量で、ビット配列形式の画像を自由に変形することがで
きる。 変形対象を複数の小多角形に分割し、各小多角形毎に
変形処理が行われるので、変形に自由度があり、予めメ
モリに多くのデータを持たなくても、画像を滑らかに変
形することができる。 特に、変形対象の外枠上にある任意の小多角形の頂点
および変形対象の内部にある任意の小多角形の頂点を、
少なくとも変形後に再び外枠を構成するような任意の位
置および少なくとも再び内部に位置するような任意の位
置にそれぞれ移動させる変形法を使用することにより、
変形後のすべての小多角形の頂点の位置データ(例え
ば、座標)を持っておく必要がない。よって少ない変形
データで複雑かつ非常に滑らかな画像変形を行わせるこ
とができる。 この変形法を用いると、変形対象の外枠の形を変える
とともに、内部の小多角形も任意の形に変形できるの
で、画像データの外形(例えば、大きさ)を変え、さら
に内部の形も変えることができる。
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 any small polygon on the outer frame to be deformed and the vertices of any small polygon on the inside of the deformable object are at least repositioned at any position such that the outer frame is formed again after the deformation. When each of the small polygons is moved to an arbitrary position inside, the vertices of the other small polygons are moved according to the movement of the arbitrary small polygon, and the vertices of the other small polygons moved are moved to the arbitrary position. Calculated based on the vertices after the movement of the small polygon, deform each small polygon corresponding to the calculated vertices, and further, the array of the image data in the bit array format included in the small polygon before the transformation, For each small polygon,
Since the whole image after the change is created by sequentially changing the data so as to correspond to the deformed small polygon data according to a predetermined data conversion process, 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, the vertices of any small polygon on the outer frame of the deformation target and the vertices of any small polygon inside the deformation target are
By using a deformation method of moving to an arbitrary position such that the outer frame is formed again after at least deformation and at least an arbitrary position that is located inside again, respectively,
It is not necessary to have position data (for example, coordinates) of the vertices of all the small polygons after transformation. Therefore, complex and very smooth image transformation can be performed with a small amount of transformation data. By using this transformation method, the shape of the outer frame to be transformed can be changed, and the small polygon inside can be transformed to any shape. Therefore, the outer shape (for example, size) of the image data can be changed, and the inner shape can also be changed. Can be changed.

【0112】また、他の請求項記載の発明によれば、小
多角形の変形処理において、変形対象の外枠を構成する
向い合う複数の辺を選択し、選択したそれぞれの辺上に
ある複数個の小多角形の頂点を、それぞれの辺に対応す
る所定の曲線パラメータに従い、少なくとも変形後に再
び向い合う複数の辺を構成するような任意の位置に移動
するとともに、変形対象の内部にある任意の小多角形の
頂点を、少なくとも変形後に再び内部に位置するような
任意の位置に移動させる変形法を使用しているので、曲
線パラメータとして数点(例えば、4点)分の座標およ
び内部の格子点のデータだけを持っていればよく、変形
後のすべての小多角形の頂点の位置データ(例えば、座
標)を持っておく必要がなく、少ない変形データで滑ら
かな画像変形を行わせることができる。また、この変形
法を用いると、変形対象の外枠の形を変えるとともに、
内部の小多角形も任意の形に変形できるので、画像デー
タの外形(例えば、大きさ)を変え、さらに内部の形も
変えることができる。
According to another aspect of the present invention, in the small polygon deformation process, a plurality of facing sides forming the outer frame to be deformed are selected, and a plurality of sides on each selected side are selected. The vertices of the small polygons are moved to arbitrary positions at least so as to form a plurality of sides facing each other again after the deformation, according to the predetermined curve parameters corresponding to the respective sides, and at the same time, in an arbitrary position inside the deformation target. Since the transformation method of moving the vertices of the small polygon of at least to an arbitrary position that is located inside again after the transformation, the coordinates of several points (for example, 4 points) and the internal It is only necessary to have the data of the grid points, it is not necessary to have the position data (for example, coordinates) of the vertices of all the small polygons after the transformation, and smooth image transformation can be performed with a small amount of transformation data. It can be. Also, by using this transformation method, while changing the shape of the outer frame to be transformed,
Since the internal small polygon can be transformed into an arbitrary shape, it is possible to change the outer shape (for example, size) of the image data and further change the inner shape.

【図面の簡単な説明】[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】上記実施例のライン貼り付け処理のサブルー
チンを示すフローチャートである。
FIG. 13 is a flowchart showing a subroutine of line pasting processing of the above embodiment.

【図14】上記実施例の画像データの変形例を示す図で
ある。
FIG. 14 is a diagram showing a modification of the image data of the above embodiment.

【図15】上記実施例の画像データの変形例を示す図で
ある。
FIG. 15 is a diagram showing a modification of the image data of the above embodiment.

【図16】上記実施例の画像データの変形例を示す図で
ある。
FIG. 16 is a diagram showing a modification of the image data of the above embodiment.

【図17】上記実施例の画像データの変形例を示す図で
ある。
FIG. 17 is a diagram showing a modification of the image data of the above embodiment.

【図18】上記実施例の画像データの変形例を示す図で
ある。
FIG. 18 is a diagram showing a modification of the image data of the above embodiment.

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

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

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

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

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

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

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

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

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

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

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

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

【符号の説明】[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. 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 whole image after the change is performed by sequentially changing the array of the image data in the bit array format included in the polygon to each small polygon according to the predetermined data conversion processing so as to correspond to the data of the deformed small polygon. In addition to creating the data, in the small polygon deformation process, the vertices of any small polygon on the outer frame of the deformation target and the vertices of any small polygon inside the deformation target are reconstructed at least after the deformation. When each is moved to an arbitrary position that constitutes the outer frame and at least to an arbitrary position that is again positioned inside, the vertex of another small polygon is moved according to the movement of the arbitrary small polygon, Other moved The method for transforming an image, characterized in that the vertices of the small polygon are calculated based on the vertices of the plurality of small polygons after the movement, and each small polygon is deformed corresponding to the calculated vertices.
【請求項2】 前記小多角形の変形処理では、変形対象
の外枠を構成する向い合う複数の辺を選択し、選択した
それぞれの辺上にある複数個の小多角形の頂点を、それ
ぞれの辺に対応する所定の曲線パラメータに従い、少な
くとも変形後に再び向い合う複数の辺を構成するような
任意の位置に移動するとともに、変形対象の内部にある
任意の小多角形の頂点を、少なくとも変形後に再び内部
に位置するような任意の位置に移動したとき、前記任意
の小多角形の移動に応じて他の小多角形の頂点を移動さ
せ、移動した他の小多角形の頂点を前記複数個の小多角
形の移動後の頂点に基づいて算出し、この算出した頂点
に対応して各小多角形を変形することを特徴とする請求
項1記載の画像変形方法。
2. In the small polygon deforming process, a plurality of facing sides constituting an outer frame to be deformed are selected, and a plurality of small polygon vertices on each selected side are respectively selected. According to a predetermined curve parameter corresponding to the side of, at least after the deformation, move to an arbitrary position that constitutes a plurality of opposite sides, and at least deform the vertex of any small polygon inside the deformation target. Later, when the small polygon is moved to an arbitrary position again inside, the vertices of the other small polygons are moved according to the movement of the small polygon, and the vertices of the other small polygons are moved to the plural positions. The image transforming method according to claim 1, wherein the calculation is performed based on the vertices of the respective small polygons after the movement, and each of the small polygons is transformed according to the calculated vertices.
【請求項3】 前記変形処理における複数個の小多角形
の頂点を移動配置する所定の曲線パラメータは、ベジェ
曲線あるいは三角関数の少なくとも一方によって規定さ
れる任意のパラメータであることを特徴とする請求項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 2
The described image transformation method.
【請求項4】 前記所定の変形処理は、座標変換処理で
あり、 この座標変換処理では、分割された各小多角形の頂点の
座標を求め、次いで、変形後の各小多角形の頂点の座標
を算出し、この算出した座標に基づいて変形後の異なる
小多角形の形状を決定することにより、分割された各小
多角形を異なる小多角形に変形することを特徴とする請
求項1記載の画像変形方法。
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. The described image transformation method.
【請求項5】 前記所定のデータ変換処理は、 変形対象となる各小多角形に含まれるビット配列形式の
画像データを複数のラインに分割する処理と、 この分割された各ラインの変形後の小多角形上での端点
を算出する処理と、 前記分割された各ラインを、変形後の小多角形の対応す
るラインの大きさに合せて拡大又は縮小する処理と、 この拡大又は縮小されたラインを変形後の小多角形の対
応するライン上の端点を起点として順次転送して配置す
る処理と、を有することを特徴とする請求項1記載の画
像変形方法。
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 2. The image transforming method according to claim 1, further comprising: a process of sequentially transferring and arranging the line starting from an end point on a line corresponding to the deformed 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】 ビット配列形式の画像データを有する変
形対象を、複数の小多角形に分割する分割手段と、 変形対象の外枠上にある任意の小多角形の頂点および変
形対象の内部にある任意の小多角形の頂点を、少なくと
も変形後に再び外枠を構成するような任意の位置および
少なくとも再び内部に位置するような任意の位置にそれ
ぞれ移動したとき、前記任意の小多角形の移動に応じて
他の小多角形の頂点を移動させ、移動した他の小多角形
の頂点を前記任意の小多角形の移動後の頂点に基づいて
算出し、この算出した頂点に対応して分割手段によって
分割した各小多角形を異なる小多角形に変形する変形手
段と、 変形前の小多角形に含まれるビット配列形式の画像デー
タの配列を、各小多角形毎に、所定のデータ変換処理に
従って、変形後の小多角形のデータに対応するように順
次変更して変更後の全体画像データを作成する画像デー
タ作成手段と、を備えたことを特徴とする画像変形装
置。
9. A dividing means for dividing a deformation target having image data in a bit array format into a plurality of small polygons, and a vertex of an arbitrary small polygon on an outer frame of the deformation target and inside the deformation target. When the vertices of an arbitrary small polygon are respectively moved to at least an arbitrary position that again forms the outer frame after deformation and an arbitrary position that is at least inside again, the movement of the arbitrary small polygon According to the above, the vertices of the other small polygons are moved, the vertices of the moved other small polygons are calculated based on the moved vertices of the arbitrary small polygon, and the vertices of the calculated small vertices are divided. Deformation means for transforming each small polygon divided by the means into different small polygons, and the array of the bit array format image data included in the small polygons before the transformation is converted into predetermined data for each small polygon. After transformation, according to processing Image transformation apparatus characterized by comprising: the image data generation means for generating an entire image data after the change are sequentially changed to correspond to the data of the small polygons, the.
【請求項10】 前記変形手段は、変形対象の外枠を構
成する向い合う複数の辺を選択し、選択したそれぞれの
辺上にある複数個の小多角形の頂点を、それぞれの辺に
対応する所定の曲線パラメータに従い、少なくとも変形
後に再び向い合う複数の辺を構成するような任意の位置
に移動するとともに、変形対象の内部にある任意の小多
角形の頂点を、少なくとも変形後に再び内部に位置する
ような任意の位置に移動させるような変形処理を行うこ
とを特徴とする請求項9記載の画像変形装置。
10. The deforming means selects a plurality of facing sides forming an outer frame to be deformed, and associates a plurality of small polygon vertices on each selected side with each side. According to a predetermined curve parameter to be moved to at least an arbitrary position that forms a plurality of sides facing each other again after the deformation, at the same time, at least after the deformation, the vertex of any small polygon inside the deformation target The image transforming device according to claim 9, wherein the transforming process is performed so as to move the image to an arbitrary position where the image is located.
【請求項11】 前記変形手段における複数個の小多角
形の頂点を移動配置する所定の曲線パラメータは、ベジ
ェ曲線あるいは三角関数の少なくとも一方によって規定
される任意のパラメータであることを特徴とする請求項
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 10. The image transformation device according to item 10.
【請求項12】 前記変形手段は、分割手段によって分
割した各小多角形を異なる小多角形に変形する所定の変
形処理を実行可能な座標変換手段を備え、 この座標変換手段は、分割された各小多角形の頂点の座
標を求めるとともに、変形後の各小多角形の頂点の座標
を算出し、この算出した座標に基づいて変形後の異なる
小多角形の形状を決定することにより、分割された各小
多角形を異なる小多角形に変形することを特徴とする請
求項9記載の画像変形装置。
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 transformation apparatus according to claim 9, wherein each of the formed small polygons is transformed into a different small polygon.
【請求項13】 前記画像データ作成手段は、前記所定
のデータ変換処理を実行可能なデータ変換手段を備え、 このデータ変換手段は、変形対象となる各小多角形に含
まれるビット配列形式の画像データを複数のラインに分
割する手段と、 この分割された各ラインの変形後の小多角形上での端点
を算出する手段と、 前記分割された各ラインを、変形後の小多角形の対応す
るラインの大きさに合せて拡大又は縮小する手段と、 この拡大又は縮小されたラインを変形後の小多角形の対
応するライン上の端点を起点として順次転送して配置す
る手段と、を有することを特徴とする請求項9記載の画
像変形装置。
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. The image transformation device according to claim 9, wherein
【請求項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記載の画像変形装置。
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 reading out each data stored in the storage means and controlling the image deformation when the deformation mode is specified by the deformation mode designating means. The image transformation device according to claim 9.
JP5348802A 1993-12-27 1993-12-27 Image deforming method and device therefor Abandoned JPH07200800A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5348802A JPH07200800A (en) 1993-12-27 1993-12-27 Image deforming method and device therefor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5348802A JPH07200800A (en) 1993-12-27 1993-12-27 Image deforming method and device therefor

Publications (1)

Publication Number Publication Date
JPH07200800A true JPH07200800A (en) 1995-08-04

Family

ID=18399469

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5348802A Abandoned JPH07200800A (en) 1993-12-27 1993-12-27 Image deforming method and device therefor

Country Status (1)

Country Link
JP (1) JPH07200800A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008081588A1 (en) * 2007-01-04 2008-07-10 Ssd Company Limited Image processing apparatus, image processing system, and image processing method
JP2013077988A (en) * 2011-09-30 2013-04-25 Seiko Epson Corp Projector and control method of the same
US9285662B2 (en) 2011-09-30 2016-03-15 Seiko Epson Corporation Projector and method for controlling projector

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008081588A1 (en) * 2007-01-04 2008-07-10 Ssd Company Limited Image processing apparatus, image processing system, and image processing method
JP2013077988A (en) * 2011-09-30 2013-04-25 Seiko Epson Corp Projector and control method of the same
US9285662B2 (en) 2011-09-30 2016-03-15 Seiko Epson Corporation Projector and method for controlling projector
US9841662B2 (en) 2011-09-30 2017-12-12 Seiko Epson Corporation Projector and method for controlling projector

Similar Documents

Publication Publication Date Title
JP2919428B2 (en) Image transformation device
US5428721A (en) Data processing apparatus for editing image by using image conversion
JP2006338692A (en) Image processor and method
JP2001022953A (en) Method and device for rendering, game device and computer-readable recording medium with program for calculating data about shadow of object in virtual space stored therein
JPH0325792B2 (en)
EP2038848B1 (en) Facilitating image-editing operations across multiple perspective planes
JPH07200800A (en) Image deforming method and device therefor
JP3463125B2 (en) Image transformation method and apparatus
JPH07192122A (en) Image deforming method and device therefor
JPH07182499A (en) Method and device for deforming image
JP3548867B2 (en) Image deformation method and apparatus
JP3591876B2 (en) Graphic processing apparatus and method
JP2999019B2 (en) Character and graphic transformation processor
JPH07182497A (en) Method and device for deforming image
JPH11195134A (en) Picture processor
JP3191739B2 (en) Polygon drawing method and apparatus
JPH07182501A (en) Method and device for deforming image
JP2722148B2 (en) Image brushing method
JP3268667B2 (en) Interactive polygon selection device
JPH07182500A (en) Method and device for deforming image
JP3463124B2 (en) Image transformation method and apparatus
JPH0350686A (en) Graphic processing system
JPS6079475A (en) Graphic processing device
JPS62285188A (en) Display method for segment
JP2895884B2 (en) Layouter for flyers and catalogs

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20031218

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040106

A762 Written abandonment of application

Free format text: JAPANESE INTERMEDIATE CODE: A762

Effective date: 20040216