JP2011186930A - Drawing control device, drawing control method, computer program of the same, and recording medium with the program recorded thereon - Google Patents
Drawing control device, drawing control method, computer program of the same, and recording medium with the program recorded thereon Download PDFInfo
- Publication number
- JP2011186930A JP2011186930A JP2010053434A JP2010053434A JP2011186930A JP 2011186930 A JP2011186930 A JP 2011186930A JP 2010053434 A JP2010053434 A JP 2010053434A JP 2010053434 A JP2010053434 A JP 2010053434A JP 2011186930 A JP2011186930 A JP 2011186930A
- Authority
- JP
- Japan
- Prior art keywords
- dimensional
- area
- coordinates
- rectangular
- dimensional image
- 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.)
- Withdrawn
Links
Images
Landscapes
- Image Generation (AREA)
Abstract
Description
本発明は、図形や文字などを描画する描画処理技術に関し、特に、グラフィックス機能として搭載された2D(2次元)エンジンを用いて、3D(3次元)空間でイメージデータを回転させた場合のイメージを擬似的に生成する描画制御装置、描画制御方法、そのコンピュータ・プログラムおよびそのプログラムを記録した記録媒体に関する。 The present invention relates to a drawing processing technique for drawing a figure, a character, and the like, and in particular, when image data is rotated in a 3D (3D) space using a 2D (2D) engine installed as a graphics function. The present invention relates to a drawing control apparatus that artificially generates an image, a drawing control method, a computer program thereof, and a recording medium on which the program is recorded.
近年、パーソナルコンピュータ、携帯端末などの情報処理装置の高機能化、多機能化が進んでおり、表示画面における描画処理にも高い処理能力が要求されるようになってきている。このような情報処理装置において、描画処理速度を向上させるために、2Dエンジンや3Dエンジンを搭載することが多い。 In recent years, information processing apparatuses such as personal computers and portable terminals have become highly functional and multi-functional, and high processing capability is required for drawing processing on a display screen. In such an information processing apparatus, a 2D engine or a 3D engine is often mounted in order to improve the drawing processing speed.
情報処理装置に3Dアクセラレータを搭載している場合、BMP(ビットマップ)などの2次元イメージデータを3次元的に回転表示させるには、テクスチャマッピングを用いてこれを行なうことが可能である。また、3Dアクセラレータを搭載していない場合には、3次元処理を全てソフトウェアで実現するソフトウェア・レンダリングを用いるのが一般的である。 When a 3D accelerator is installed in the information processing apparatus, it is possible to perform two-dimensional image data such as BMP (bitmap) by using texture mapping in order to rotate and display it three-dimensionally. When a 3D accelerator is not installed, software rendering that realizes all three-dimensional processing with software is generally used.
これに関連する技術として、下記の特許文献1〜4に開示された発明がある。
特許文献1は、1次元アクセスの通常の小型のメモリ回路と単純な変換回路およびプログラムだけで、ほぼ同等の処理速度で、2値画像のアフィン変換を実行できる方法および装置を提供することを目的とする。画像のアフィン変換処理方法は、直交座標系で記憶されている画像データに対し、それぞれx軸方向へずれた平行四辺形に変換(斜交軸変換)する第1のステップと、y軸方向への拡大または縮小を実行する第2のステップと、90度回転する第3のステップとを交互に所定回数実行するものである。
As technologies related to this, there are inventions disclosed in the following
特許文献2は、ガマットマッピングにより得られたある表色系における色立体を、他の表色系に簡易な操作で変換して表示する手段を提供することを目的とする。階層ツリーウィンドウには、表示されている第1の表色系に対応するウィンドウ、第2の表色系に対応するウィンドウそれぞれに対応するノードと、それぞれのウィンドウ内に表示されている、ガマットマッピングにより得られた各表色系の色立体に対応するノードがツリー構造で表示される。操作者が、色立体に相当するオブジェクトを選択してドラッグし、いずれかのウィンドウに相当するオブジェクト上にドロップすると、移動された色立体は、ドロップされたウィンドウの表色系に座標変換されて、そのウィンドウに色立体として表示される。 Patent Document 2 aims to provide means for converting and displaying a color solid in one color system obtained by gamut mapping into another color system by a simple operation. The hierarchical tree window includes a window corresponding to the displayed first color system, a node corresponding to each of the windows corresponding to the second color system, and a gamut mapping displayed in each window. Nodes corresponding to the color solids of the respective color systems obtained by the above are displayed in a tree structure. When the operator selects and drags an object corresponding to a color solid and drops it on an object corresponding to one of the windows, the moved color solid is coordinate-converted to the color system of the dropped window. , Displayed as a color solid in the window.
特許文献3は、ビットブリット処理過程で、αブレンディングなどの画像処理を行うことが可能な画像処理装置を提供することを目的とする。第1のセレクタが、プリミティブデータ、ホスト・ローカル転送用の画像データおよびディスティネーションデータの中から一つを選択してαブレンド回路に出力する。αブレンド回路は、制御信号に基づいて、入力した画像データのαブレンディング処理をオン/オフする。第2のセレクタは、2つの画像データのうち一方を選択して、DRAMに書き込む。 Patent Document 3 aims to provide an image processing apparatus capable of performing image processing such as α blending in the bit blitting process. The first selector selects one of primitive data, image data for host / local transfer, and destination data and outputs the selected data to the α blend circuit. The α blend circuit turns on / off α blending processing of the input image data based on the control signal. The second selector selects one of the two image data and writes it to the DRAM.
特許文献4は、変化する領域でのみレンダリングが実行されるグラフィック画像のレンダリング方法を開示する。好ましい形態において、その画像は、複数のオブジェクトを含む。そのレンダリング方法は、各々のオブジェクトが、次のフレームにおいて異なって表示される必要があるように変化したかどうかを判断する第1の判断ステップと、次のフレームにおいて、各々の変化したオブジェクトの境界域を判断する第2の判断ステップと、次のフレームの前のフレームにおいて変化した各々のオブジェクトの境界域を判断する第3の判断ステップと、境界域を結合して、集合領域を形成し、画像を集合領域内でのみレンダリングするレンダリングステップとを備える。 Patent Document 4 discloses a graphic image rendering method in which rendering is performed only in a changing region. In a preferred form, the image includes a plurality of objects. The rendering method includes a first determination step for determining whether each object has changed so that it needs to be displayed differently in the next frame, and a boundary of each changed object in the next frame. A second determination step of determining a region, a third determination step of determining a boundary region of each object changed in a frame before the next frame, and combining the boundary regions to form a collection region; A rendering step for rendering the image only within the collection region.
テレビ画面やカメラのディスプレイなどのような、3Dアクセラレータを搭載しない組み込み環境において、2次元イメージデータの3次元的回転表示の要求がある。しかしながら、ソフトウェア・レンダリング処理となってしまうため処理性能が低下するといった問題があった。 There is a need for three-dimensional rotation display of two-dimensional image data in an embedded environment such as a television screen or a camera display that does not include a 3D accelerator. However, there has been a problem that the processing performance deteriorates due to software rendering processing.
本発明は、上記問題点を解決するためになされたものであり、その目的は、2次元イメージデータの3次元的回転表示を高速に行なうことが可能な描画制御装置、描画制御方法、そのコンピュータ・プログラムおよびそのプログラムを記録した記録媒体を提供することである。 The present invention has been made to solve the above-described problems, and an object of the present invention is to provide a drawing control apparatus, a drawing control method, and a computer capable of performing high-speed three-dimensional rotation display of two-dimensional image data. -To provide a program and a recording medium on which the program is recorded.
本発明の一実施例によれば、2次元イメージを3次元空間で回転させた擬似3次元イメージを生成して描画する描画制御装置が提供される。座標変換部は、2次元イメージの座標を3次元座標に変換する。透視変換部は、座標変換部によって3次元座標に変換された3次元形状を2次元座標に透視変換する。領域算出部は、透視変換部によって透視変換された後の2次元形状を分割した複数の矩形領域それぞれを転送先領域とし、それに対応する2次元イメージの矩形領域を転送元領域として算出する。そして、BitBlt処理部は、領域算出部によって算出された転送元領域と転送先領域とに基づいてビットブロック転送を順次行なうことにより、擬似3次元イメージを描画する。 According to an embodiment of the present invention, there is provided a drawing control apparatus that generates and draws a pseudo 3D image obtained by rotating a 2D image in a 3D space. The coordinate conversion unit converts the coordinates of the two-dimensional image into three-dimensional coordinates. The perspective conversion unit perspectively converts the three-dimensional shape converted into the three-dimensional coordinate by the coordinate conversion unit into the two-dimensional coordinate. The region calculation unit calculates each of a plurality of rectangular regions obtained by dividing the two-dimensional shape after the perspective conversion by the perspective conversion unit as a transfer destination region, and calculates a corresponding two-dimensional rectangular region as a transfer source region. Then, the BitBlt processing unit draws a pseudo three-dimensional image by sequentially performing bit block transfer based on the transfer source region and the transfer destination region calculated by the region calculation unit.
この実施例によれば、BitBlt処理部が、領域算出部によって算出された転送元領域と転送先領域とに基づいてビットブロック転送を順次行なうことにより、擬似3次元イメージを描画するので、3Dアクセラレータを搭載しない組み込み環境においても、2次元イメージデータの3次元的回転表示を高速に行なうことが可能となる。 According to this embodiment, the BitBlt processing unit draws a pseudo three-dimensional image by sequentially performing bit block transfer based on the transfer source region and the transfer destination region calculated by the region calculation unit. Even in an embedded environment that does not include the two-dimensional image data, three-dimensional rotation display of two-dimensional image data can be performed at high speed.
(第1の実施の形態)
図1は、本発明の第1の実施の形態における描画制御装置の構成例を示すブロック図である。この描画制御装置は、演算プロセッサ11と、システムメモリ12と、2D描画プロセッサ13と、描画メモリ14とを含み、これらがシステムバス15を介して接続されている。
(First embodiment)
FIG. 1 is a block diagram showing a configuration example of a drawing control apparatus according to the first embodiment of the present invention. The drawing control apparatus includes an
演算プロセッサ11はCPU(Central Processing Unit)などによって構成され、システムメモリ12に記憶される命令コード(プログラム)やデータを用いて演算処理を行なう。また、演算プロセッサ11は内部メモリ16を有しており、システムメモリ12などに記憶される描画プログラムなどのアプリケーションプログラムや擬似3Dパラメータ生成プログラムを内部メモリ16にロードして実行する。
The
演算プロセッサ11が擬似3Dパラメータ生成プログラムを実行することによって、後述の擬似3Dパラメータ生成器の機能が実現され、描画プログラムによって指定された描画モードに応じて、2D描画プロセッサ13を制御するための擬似3Dパラメータを生成する。なお、擬似3Dパラメータ生成器は、ハードウェアによって実現されてもよく、またソフトウェアとハードウェアとの組み合わせによって実現されてもよい。
When the
2D描画プロセッサ13は、アクセラレータ、グラフィックスエンジン、GPU(Graphic Processing Unit)などと呼ばれる画像データ処理に特化した集積回路であり、描画メモリ14を用いて文字や図形を描画する機能の他に、BitBlt(Bit Block Transfer)機能も有している。なお、擬似3Dパラメータ生成器は、2D描画プロセッサ13内にハードウェアとして実装されてもよい。
The
図2は、擬似3Dパラメータ生成器の機能的構成を示すブロック図である。上述のように、演算プロセッサ11が内部メモリ16に記憶される擬似3Dパラメータ生成プログラムを実行することによってこの機能が実現されてもよいし、ハードウェアによって実現されてもよい。
FIG. 2 is a block diagram showing a functional configuration of the pseudo 3D parameter generator. As described above, this function may be realized by the
擬似3Dパラメータ生成器は、パラメータ設定部21と、座標変換部22と、クリップ処理部23と、透視変換部24と、補間データ作成部25と、領域算出部26と、BitBlt処理部27とを含む。第1の実施の形態において、擬似3Dパラメータ生成器は、2DイメージデータをY軸と平行な回転軸を中心として回転する場合の擬似3Dパラメータを生成するものである。
The pseudo 3D parameter generator includes a
パラメータ設定部21は、2Dイメージデータの回転パラメータとして、回転軸、回転角が0度の場合の画像の位置、回転角度、奥行き、透視具合を取得して座標変換部22に設定する。パラメータ設定部は、描画プログラムからの指示によってこれらの回転パラメータを設定するようにしてもよいし、予めシステムメモリ12や内部メモリ16に格納されているものを取得して設定するようにしてもよい。
The
座標変換部22は、パラメータ設定部21によって設定されたパラメータに基づいて3次元座標変換を行ない、2Dイメージデータを回転したときの座標を3次元座標に変換してクリップ処理部23に出力する。
The coordinate
クリップ処理部23は、座標変換部22によって回転された後の3次元形状に対して、奥行き(Z軸)方向のクリップ処理を行なう。
The
透視変換部24は、クリップ処理部23によってクリップ処理された後の形状の3次元座標を2次元座標に透視変換する。
The
補間データ作成部25は、透視変換部24によって透視変換された後の2次元形状の上端エッジおよび下端エッジのY座標を計算するのに必要となる補間データと、奥行き情報としてZ値を計算するのに必要となる補間データとを生成する。
The interpolation
補間データ作成部25は、上端エッジのY座標の補間データとして、上端エッジの左側からX軸方向に1ドットずつ移動した場合の上端エッジのY座標の補間値を計算する。同様に、補間データ作成部25は、下端エッジのY座標の補間データとして、下端エッジの左側からX軸方向に1ドットずつ移動した場合の下端エッジのY座標の補間値を計算する。
The interpolation
また、補間データ作成部25は、奥行き情報としてZ値をX軸の左側から右側に移動する場合の補間値を計算する。さらに、補間データ作成部25は、転送先形状の補間間隔に対応する転送元形状のX方向の補間値を計算する。
Further, the interpolation
領域算出部26は、転送先形状のX軸方向の1ピクセルを幅とし、Y軸方向における上端エッジと下端エッジとの間を高さとした領域を設定する。そして、その領域に対応する転送元形状の矩形領域を算出する。
The
BitBlt処理部27は、領域算出部26によって決定された転送元形状の矩形領域を、転送先形状の矩形領域として転送するBitBlt処理を2D描画プロセッサ13に実行させる。
The
図3は、本発明の第1の実施の形態における描画制御装置の処理手順を説明するためのフローチャートである。図4〜図8を適宜参照しながら、本実施の形態における描画制御装置の処理手順を説明する。 FIG. 3 is a flowchart for explaining the processing procedure of the drawing control apparatus according to the first embodiment of the present invention. The processing procedure of the drawing control apparatus in the present embodiment will be described with reference to FIGS. 4 to 8 as appropriate.
図4は、本発明の第1の実施の形態における描画制御装置が2次元矩形イメージから擬似3次元イメージを生成するときの概要を説明するための図である。図4(a)は、転送元形状の一例として2次元矩形イメージ(格子模様)の場合を示している。この2次元矩形イメージは、幅がImageWであり、高さがImageHである。 FIG. 4 is a diagram for explaining an outline when the drawing control apparatus according to the first embodiment of the present invention generates a pseudo 3D image from a 2D rectangular image. FIG. 4A shows a case of a two-dimensional rectangular image (lattice pattern) as an example of the transfer source shape. The two-dimensional rectangular image has a width of ImageW and a height of ImageH.
図4(b)は、図4(a)に示す2次元矩形イメージを3次元空間に配置したところを示している。図4(b)において、2次元矩形イメージを回転するときの回転軸(Xrot)と、水平軸(Yv)とが設定される。なお、2次元矩形イメージの左上座標を(0x,0y)とする。 FIG. 4B shows the two-dimensional rectangular image shown in FIG. 4A arranged in a three-dimensional space. In FIG. 4B, a rotation axis (Xrot) and a horizontal axis (Yv) for rotating a two-dimensional rectangular image are set. It is assumed that the upper left coordinates of the two-dimensional rectangular image are (0x, 0y).
図4(c)は、図4(b)に示す2次元矩形イメージを3次元空間で回転軸を中心にθxだけ回転させたところを示している。図4(d)は、図4(c)に示す3次元空間で2次元矩形イメージを回転させた回転形状を2次元に投影したところを示している。 FIG. 4C shows a state where the two-dimensional rectangular image shown in FIG. 4B is rotated by θx around the rotation axis in a three-dimensional space. FIG. 4D shows a two-dimensional projection of a rotated shape obtained by rotating a two-dimensional rectangular image in the three-dimensional space shown in FIG.
本実施の形態における描画制御装置は、図4(a)に示す2次元ソースイメージを転送元イメージとし、図4(d)に示す回転した座標変換後の2次元イメージ(擬似3次元イメージ)を転送先イメージとして2D描画プロセッサ13にBitBlt処理を行なわせるものである。
The drawing control apparatus according to the present embodiment uses the two-dimensional source image shown in FIG. 4A as the transfer source image, and the rotated two-dimensional image (pseudo three-dimensional image) after coordinate conversion shown in FIG. As a transfer destination image, the
まず、パラメータ設定部21は、図4に示す転送元の2次元矩形イメージのパラメータを設定する(S11)。このパラメータとして、2次元矩形イメージの幅(ImageW=w)、2次元矩形イメージの高さ(ImageH=h)、転送元の2次元矩形イメージの回転角度0°における左上座標(0x,0y)、回転軸のX座標(Xrot)、回転角度(θx)、水平軸のY座標(Yver)、奥行きオフセット(pers)などが設定される。
First, the
次に、座標変換部22は、パラメータ設定部21によって設定されたパラメータに基づいて、3次元座標変換を行なう(S12)。
Next, the coordinate
図5は、3次元座標変換の一例を示す図である。図5(a)は、転送元の2次元矩形イメージを示しており、回転軸と矩形の左端との間の距離をxl、回転軸と矩形の右端との間の距離をxr、水平軸と矩形の上端との間の距離をyt、水平軸と下端との間の距離をybとしている。 FIG. 5 is a diagram illustrating an example of three-dimensional coordinate conversion. FIG. 5A shows a two-dimensional rectangular image of the transfer source, where the distance between the rotation axis and the left end of the rectangle is xl, the distance between the rotation axis and the right end of the rectangle is xr, and the horizontal axis The distance between the upper end of the rectangle is yt, and the distance between the horizontal axis and the lower end is yb.
図5(b)は、図5(a)に示す矩形イメージを3次元的に回転させてY軸方向から見たところを示している。図5(b)においては、奥行き方向のオフセット(pers)分だけ奥行きにシフトし、回転軸を中心にθxだけ回転させた場合を示している。座標変換部22は、回転後の矩形の形状を示す座標xl’、zl’、xr’、zr’を次式によって計算する。
FIG. 5B shows a three-dimensional rotation of the rectangular image shown in FIG. 5A and viewed from the Y-axis direction. FIG. 5B shows a case where the depth is shifted by an offset (pers) in the depth direction and rotated by θx about the rotation axis. The coordinate
xl’=xl×cos(θx) ・・・(1)
zl’=xl×sin(θx)+pers ・・・(2)
xr’=xr×cos(θx) ・・・(3)
zr’=xr×sin(θx)+pers ・・・(4)
また、奥行きZ軸方向にクリップが必要な場合、クリップ処理部23は、クリップ後の座標xl’、zl’、xr’、zr’を計算する(S13)。
xl ′ = xl × cos (θx) (1)
zl ′ = xl × sin (θx) + pers (2)
xr ′ = xr × cos (θx) (3)
zr ′ = xr × sin (θx) + pers (4)
If clipping is necessary in the depth Z-axis direction, the
図6は、クリップが必要な場合の回転後の矩形イメージの座標を説明するための図である。図6においては、奥行きfarClipでクリップしたところを示しており、クリップ処理部23は、zr’をfarClipとし、それに対応するxr’を計算する。なお、図6は、奥の図形をクリップする場合であるが、手前側をクリップする場合にはその奥行きnearClipをzl’とし、それに対応するxl’が計算される。
FIG. 6 is a diagram for explaining the coordinates of a rotated rectangular image when a clip is necessary. FIG. 6 shows a clipped position with a depth farClip, and the
次に、透視変換部24は、3次元座標変換された後の形状を2次元に透視投影変換を行なう(S14)。
Next, the
図7は、透視変換後の2次元形状の座標を説明するための図である。図7に示すように、左端エッジのX座標がxl”、右端エッジのX座標がxr”として表され、上端エッジの左端のY座標がytl、上端エッジの右端のY座標がytr、下端エッジの左端のY座標がybl、下端エッジの右端のY座標がybrとして表される。 FIG. 7 is a diagram for explaining coordinates of a two-dimensional shape after perspective transformation. As shown in FIG. 7, the X coordinate of the left edge is represented as xl ″, the X coordinate of the right edge is represented as xr ″, the Y coordinate of the left edge of the upper edge is ytl, the Y coordinate of the right edge of the upper edge is ytr, and the lower edge Is represented as ybl, and the Y coordinate of the right end of the lower edge is represented as ybr.
透視変換部24は、xl”、xr”、ytl、ytr、ybl、ybrを次式によって計算する。
The
xl”=xl’/zl’ ・・・(5)
xr”=xr’/zl’ ・・・(6)
ytl=yt/zl’ ・・・(7)
ytr=yt/zr’ ・・・(8)
ybl=yb/zl’ ・・・(9)
ybr=yb/zr’ ・・・(10)
次に、補間データ作成部25は、透視変換部24によって2次元に投影された形状のY軸方向における上端エッジおよび下端エッジの補間データdytおよびdybを作成し、奥行きZ値の補間データdzを作成する(S15)。上端エッジのY座標の補間データdytは、上端エッジの左端から右端に向かって1ピクセルずつ移動するときのY座標の補間データである。下端エッジのY軸方向の補間データdybは、下端エッジの左端から右端に向かって1ピクセルずつ移動するときのY座標の補間データである。補間データ作成部25は、補間データdyt、dyb、dzを次式によって算出する。
xl ″ = xl ′ / zl ′ (5)
xr ″ = xr ′ / zl ′ (6)
ytl = yt / zl ′ (7)
ytr = yt / zr '(8)
ybl = yb / zl ′ (9)
ybr = yb / zr ′ (10)
Next, the interpolation
dyt=(ytr−ytl)/(xr”−xl”) ・・・(11)
dyb=(ybr−ybl)/(xr”−xl”) ・・・(12)
dz =(zr’−zl’)/(xr”−xl”) ・・・(13)
また、補間データ作成部25は、転送先形状の補間間隔に対応する転送元形状のX方向の補間データduを次式によって作成する(S16)。なお、この補間データduは、3次元グラフィックスのテクスチャマッピングで用いられる透視補正を実施するために、転送元形状のX方向の座標値を対応するZ座標で除算しておく。
dyt = (ytr−ytl) / (xr ″ −xl ″) (11)
dyb = (ybr−ybl) / (xr ″ −xl ″) (12)
dz = (zr′−zl ′) / (xr ″ −xl ″) (13)
Further, the interpolation
du=(w×zr’−0×zl’)/(xr”−xl”) ・・・(14)
次に、領域算出部26は、転送先形状となる座標変換後の形状を、左端から右方向に向かってX方向に1ピクセル単位とする短冊状の矩形を作成し、それに対応する転送元の矩形領域(X方向幅)を算出する(S17)。転送先形状の左端からnピクセル目の矩形の左上の座標(xdst,ydst)、幅wdst、高さhdstは、次式によって算出される。
du = (w × zr′−0 × zl ′) / (xr ″ −xl ″) (14)
Next, the
xdst=xl”+n ・・・(15)
ydst=ytl+dyt×n ・・・(16)
wdst=1 ・・・(17)
hdst=(ytl+dyt×n)−(ybl+dyb×n) ・・・(18)
また、転送元形状の矩形の左上の座標(xsrc,ysrc)、幅wsrc、高さhsrcは、次式によって算出される。
xdst = xl ″ + n (15)
ydst = ytl + dyt × n (16)
wdst = 1 (17)
hdst = (ytl + dyt × n) − (ybl + dyb × n) (18)
Further, the upper left coordinates (xsrc, ysrc), width wsrc, and height hsrc of the rectangle of the transfer source shape are calculated by the following equations.
xsrc=(du×n)/(zl”+dz×n) ・・・(19)
ysrc=0y ・・・(20)
wsrc=(du×(n+1))/(zl”+dz×(n+1))−(xsrc)
・・・(21)
hsrc=h ・・・(22)
図8は、転送元形状および転送先形状に設定された短冊状の矩形領域を説明するための図である。図8(a)は、転送元形状の短冊状の矩形領域を示しており、図8(b)に示す転送先形状の1ピクセル幅の短冊状の矩形領域に対応している。図8(b)に示す矩形領域を右方向に1ピクセルずつずらしながら、対応する転送元形状の短冊状の矩形領域が算出される。
xsrc = (du × n) / (zl ″ + dz × n) (19)
ysrc = 0y (20)
wsrc = (du × (n + 1)) / (zl ″ + dz × (n + 1)) − (xsrc)
... (21)
hsrc = h (22)
FIG. 8 is a diagram for explaining strip-shaped rectangular areas set in the transfer source shape and the transfer destination shape. FIG. 8A shows a rectangular rectangular area having a transfer source shape, and corresponds to the rectangular rectangular area having a 1-pixel width having a transfer destination shape shown in FIG. 8B. While the rectangular area shown in FIG. 8B is shifted by one pixel to the right, the corresponding rectangular shape of the transfer source shape is calculated.
次に、BitBlt処理部27は、領域算出部26によって算出された矩形データを2D描画プロセッサ13に設定し、2D描画プロセッサ13にBitBltを用いた描画を行なわせる(S18)。
Next, the
最後に、矩形領域のBitBlt処理が右端エッジに達したか否かが判定される(S19)。右端エッジに達していなければ(S19,No)、ステップS17に戻って以降の処理が繰り返される。また、右端エッジに達した場合には(S19,Yes)、処理を終了する。 Finally, it is determined whether or not the BitBlt process of the rectangular area has reached the right edge (S19). If the right edge has not been reached (No at S19), the process returns to step S17 and the subsequent processing is repeated. If the right edge has been reached (S19, Yes), the process is terminated.
なお、以上の説明においては、左端エッジから右端エッジに向かって矩形データを補間する場合について説明したが、右端エッジから左端エッジに向かって矩形データを補間するようにしてもよい。 In the above description, the case where the rectangular data is interpolated from the left end edge to the right end edge has been described. However, the rectangular data may be interpolated from the right end edge to the left end edge.
以上説明したように、本実施の形態における描画制御装置によれば、転送先形状のX方向における1ピクセル単位の短冊状の矩形領域を作成し、それに対応する転送元形状の短冊状の矩形領域を算出して順次BitBlt処理を行なうようにしたので、2Dエンジンのみを搭載し、3Dエンジンを搭載していない環境下においても、擬似的に3D空間でイメージデータを回転させた場合のイメージを高速に描画することが可能となった。 As described above, according to the drawing control apparatus of the present embodiment, a rectangular rectangular area in units of one pixel in the X direction of the transfer destination shape is created, and a rectangular rectangular area of the transfer source shape corresponding thereto is created. Since the BitBlt processing is performed sequentially, only the 2D engine is installed, and even when the 3D engine is not installed, the image when the image data is rotated in the 3D space in a pseudo manner is high speed. It became possible to draw on.
(第2の実施の形態)
本発明の第2の実施の形態における描画制御装置の構成は、図1に示す第1の実施の形態における描画制御装置の構成と同様である。したがって、重複する構成および機能の詳細な説明は繰り返さない。
(Second Embodiment)
The configuration of the drawing control apparatus in the second embodiment of the present invention is the same as the configuration of the drawing control apparatus in the first embodiment shown in FIG. Therefore, detailed description of overlapping configurations and functions will not be repeated.
なお、本発明の第2の実施の形態における擬似3Dパラメータ生成器の機能的構成は、図2に示す第1の実施の形態における擬似3Dパラメータ生成器の機能的構成と同様である。したがって、図2を用いて第2の実施の形態における擬似3Dパラメータ生成器の説明を行なうことにする。第2の実施の形態において、擬似3Dパラメータ生成器は、2DイメージデータをX軸と平行な回転軸を中心として回転する場合の擬似3Dパラメータを生成するものである。 The functional configuration of the pseudo 3D parameter generator in the second embodiment of the present invention is the same as the functional configuration of the pseudo 3D parameter generator in the first embodiment shown in FIG. Therefore, the pseudo 3D parameter generator in the second embodiment will be described with reference to FIG. In the second embodiment, the pseudo 3D parameter generator generates a pseudo 3D parameter when rotating 2D image data around a rotation axis parallel to the X axis.
パラメータ設定部21は、2Dイメージデータの回転パラメータとして、回転軸、回転角が0度の場合の画像の位置、回転角度、奥行き、透視具合を取得して座標変換部22に設定する。パラメータ設定部は、描画プログラムからの指示によってこれらの回転パラメータを設定するようにしてもよいし、予めシステムメモリ12や内部メモリ16に格納されているものを取得して設定するようにしてもよい。
The
座標変換部22は、パラメータ設定部21によって設定されたパラメータに基づいて3次元座標変換を行ない、2Dイメージデータを回転したときの座標を3次元座標に変換してクリップ処理部23に出力する。
The coordinate
クリップ処理部23は、座標変換部22によって回転された後の3次元形状に対して、奥行き(Z軸)方向のクリップ処理を行なう。
The
透視変換部24は、クリップ処理部23によってクリップ処理された後の形状の3次元座標を2次元座標に透視変換する。
The
補間データ作成部25は、透視変換部24によって透視変換された後の2次元形状の左端エッジおよび右端エッジのX座標を計算するのに必要となる補間データと、奥行き情報としてZ値を計算するのに必要となる補間データとを生成する。
The interpolation
補間データ作成部25は、左端エッジのX座標の補間データとして、左端エッジの上側からY軸方向に1ドットずつ移動した場合の左端エッジのX座標の補間値を計算する。同様に、補間データ作成部25は、右端エッジのX座標の補間データとして、右端エッジの上側からY軸方向に1ドットずつ移動した場合の右端エッジのX座標の補間値を計算する。
The interpolation
また、補間データ作成部25は、奥行き情報としてZ値をY軸の上側から下側に移動する場合の補間値を計算する。さらに、補間データ作成部25は、転送先形状の補間間隔に対応する転送元形状のY方向の補間値を計算する。
Further, the interpolation
領域算出部26は、転送先形状のY軸方向の1ピクセルを高さとし、X軸方向における左端エッジと右端エッジとの間を幅とした領域を設定する。そして、その領域に対応する転送元形状の矩形領域を算出する。
The
BitBlt処理部27は、領域算出部26によって決定された転送元形状の矩形領域を、転送先形状の矩形領域として転送するBitBlt処理を2D描画プロセッサ13に実行させる。
The
図9は、本発明の第2の実施の形態における描画制御装置の処理手順を説明するためのフローチャートである。図10〜図14を適宜参照しながら、本実施の形態における描画制御装置の処理手順を説明する。 FIG. 9 is a flowchart for explaining the processing procedure of the drawing control apparatus according to the second embodiment of the present invention. The processing procedure of the drawing control apparatus in the present embodiment will be described with reference to FIGS.
図10は、本発明の第2の実施の形態における描画制御装置が2次元矩形イメージから擬似3次元イメージを生成するときの概要を説明するための図である。図10(a)は、転送元形状の一例として2次元矩形イメージ(格子模様)の場合を示している。この2次元矩形イメージは、幅がImageWであり、高さがImageHである。 FIG. 10 is a diagram for explaining an outline when the drawing control apparatus according to the second embodiment of the present invention generates a pseudo 3D image from a 2D rectangular image. FIG. 10A shows the case of a two-dimensional rectangular image (lattice pattern) as an example of the transfer source shape. The two-dimensional rectangular image has a width of ImageW and a height of ImageH.
図10(b)は、図10(a)に示す2次元矩形イメージを3次元空間に配置したところを示している。図10(b)において、2次元矩形イメージを回転するときの回転軸(Yrot)と、垂直軸(Xh)とが設定される。なお、2次元矩形イメージの左上座標を(0x,0y)とする。 FIG. 10B shows the two-dimensional rectangular image shown in FIG. 10A arranged in a three-dimensional space. In FIG. 10B, a rotation axis (Yrot) and a vertical axis (Xh) for rotating a two-dimensional rectangular image are set. It is assumed that the upper left coordinates of the two-dimensional rectangular image are (0x, 0y).
図10(c)は、図10(b)に示す2次元矩形イメージを3次元空間で回転軸を中心にθyだけ回転させたところを示している。図10(d)は、図10(c)に示す3次元空間で2次元矩形イメージを回転させた回転形状を2次元に投影したところを示している。 FIG. 10C shows a state where the two-dimensional rectangular image shown in FIG. 10B is rotated by θy around the rotation axis in a three-dimensional space. FIG. 10D shows a two-dimensional projection of a rotated shape obtained by rotating a two-dimensional rectangular image in the three-dimensional space shown in FIG.
本実施の形態における描画制御装置は、図10(a)に示す2次元ソースイメージを転送元イメージとし、図10(d)に示す回転した座標変換後の2次元イメージ(擬似3次元イメージ)を転送先イメージとして2D描画プロセッサ13にBitBlt処理を行なわせるものである。
The drawing control apparatus according to the present embodiment uses the two-dimensional source image shown in FIG. 10A as a transfer source image, and the rotated two-dimensional image (pseudo three-dimensional image) after coordinate conversion shown in FIG. As a transfer destination image, the
まず、パラメータ設定部21は、図10に示す転送元の2次元矩形イメージのパラメータを設定する(S21)。このパラメータとして、2次元矩形イメージの幅(ImageW=w)、2次元矩形イメージの高さ(ImageH=h)、転送元の2次元矩形イメージの回転角度0°における左上座標(0x,0y)、回転軸のY座標(Yrot)、回転角度(θy)、垂直軸のX座標(Xh)、奥行きオフセット(pers)などが設定される。
First, the
次に、座標変換部22は、パラメータ設定部21によって設定されたパラメータに基づいて、3次元座標変換を行なう(S22)。
Next, the coordinate
図11は、3次元座標変換の一例を示す図である。図11(a)は、転送元の2次元矩形イメージを示しており、回転軸と矩形の上端との間の距離をyr、回転軸と矩形の下端との間の距離をyl、垂直軸と矩形の左端との間の距離をxt、垂直軸と右端との間の距離をxbとしている。 FIG. 11 is a diagram illustrating an example of three-dimensional coordinate conversion. FIG. 11A shows a two-dimensional rectangular image as a transfer source. The distance between the rotation axis and the upper end of the rectangle is yr, the distance between the rotation axis and the lower end of the rectangle is yl, and the vertical axis is The distance between the left end of the rectangle is xt, and the distance between the vertical axis and the right end is xb.
図11(b)は、図11(a)に示す矩形イメージを3次元的に回転させてX軸方向から見たところを示している。図11(b)においては、奥行き方向のオフセット(pers)分だけ奥行きにシフトし、回転軸を中心にθyだけ回転させた場合を示している。座標変換部22は、回転後の矩形の形状を示す座標yl’、zl’、yr’、zr’を次式によって計算する。
FIG. 11B shows a three-dimensional rotation of the rectangular image shown in FIG. 11A viewed from the X-axis direction. FIG. 11B shows a case where the depth is shifted by an offset (pers) in the depth direction and rotated by θy about the rotation axis. The coordinate
yl’=yl×cos(θy) ・・・(23)
zl’=yl×sin(θy)+pers ・・・(24)
yr’=yr×cos(θy) ・・・(25)
zr’=yr×sin(θy)+pers ・・・(26)
また、奥行きZ軸方向にクリップが必要な場合、クリップ処理部23は、クリップ後の座標yl’、zl’、yr’、zr’を計算する(S23)。
yl ′ = yl × cos (θy) (23)
zl ′ = yl × sin (θy) + pers (24)
yr ′ = yr × cos (θy) (25)
zr ′ = yr × sin (θy) + pers (26)
If clipping is required in the depth Z-axis direction, the
図12は、クリップが必要な場合の回転後の矩形イメージの座標を説明するための図である。図12においては、奥行きfarClipでクリップしたところを示しており、クリップ処理部23は、zl’をfarClipとし、それに対応するyl’を計算する。なお、図12は、奥の図形をクリップする場合であるが、手前側をクリップする場合にはその奥行きnearClipをzr’とし、それに対応するyr’が計算される。
FIG. 12 is a diagram for explaining the coordinates of the rotated rectangular image when a clip is necessary. FIG. 12 shows that the clip has been clipped with the depth farClip, and the
次に、透視変換部24は、3次元座標変換された後の形状を2次元に透視投影変換を行なう(S24)。
Next, the
図13は、透視変換後の2次元形状の座標を説明するための図である。図13に示すように、上端エッジのY座標がyl”、下端エッジのY座標がyr”として表され、左端エッジの上端のX座標がxtl、左端エッジの下端のX座標がxtr、右端エッジの上端のX座標がxbl、右端エッジの下端のX座標がxbrとして表される。 FIG. 13 is a diagram for explaining coordinates of a two-dimensional shape after perspective transformation. As shown in FIG. 13, the Y coordinate of the upper edge is represented as yl ″, the Y coordinate of the lower edge is represented as yr ″, the X coordinate of the upper edge of the left edge is xtl, the X coordinate of the lower edge of the left edge is xtr, and the right edge. Is represented as xbl, and the X coordinate of the lower end of the right edge is represented as xbr.
透視変換部24は、yl”、yr”、xtl、xtr、xbl、xbrを次式によって計算する。
The
yl”=yl’/zl’ ・・・(27)
yr”=yr’/zl’ ・・・(28)
xtl=xt/zl’ ・・・(29)
xtr=xt/zr’ ・・・(30)
xbl=xb/zl’ ・・・(31)
xbr=xb/zr’ ・・・(32)
次に、補間データ作成部25は、透視変換部24によって2次元に投影された形状のX軸方向における左端エッジおよび右端エッジの補間データdxtおよびdxbを作成し、奥行きZ値の補間データdzを作成する(S25)。左端エッジのX座標の補間データdxtは、左端エッジの上端から下端に向かって1ピクセルずつ移動するときのX座標の補間データである。右端エッジのX軸方向の補間データdxbは、右端エッジの上端から下端に向かって1ピクセルずつ移動するときのX座標の補間データである。補間データ作成部25は、補間データdxt、dxb、dzを次式によって算出する。
yl ″ = yl ′ / zl ′ (27)
yr ″ = yr ′ / zl ′ (28)
xtl = xt / zl ′ (29)
xtr = xt / zr ′ (30)
xbl = xb / zl ′ (31)
xbr = xb / zr ′ (32)
Next, the interpolation
dxt=(xtr−xtl)/(yr”−yl”) ・・・(33)
dxb=(xbr−xbl)/(yr”−yl”) ・・・(34)
dz =(zr’−zl’)/(yr”−yl”) ・・・(35)
また、補間データ作成部25は、転送先形状の補間間隔に対応する転送元形状のY方向の補間データduを次式によって作成する(S26)。なお、この補間データduは、3次元グラフィックスのテクスチャマッピングで用いられる透視補正を実施するために、転送元形状のY方向の座標値を対応するZ座標で除算しておく。
dxt = (xtr−xtl) / (yr ″ −yl ″) (33)
dxb = (xbr−xbl) / (yr ″ −yl ″) (34)
dz = (zr'-zl ') / (yr "-yl") (35)
Further, the interpolation
du=(w×zr’−0×zl’)/(xr”−xl”) ・・・(36)
次に、領域算出部26は、転送先形状となる座標変換後の形状を、上端から下方向に向かってY方向に1ピクセル単位とする短冊状の矩形を作成し、それに対応する転送元の矩形領域(Y方向幅)を算出する(S27)。転送先形状の上端からnピクセル目の矩形の左上の座標(xdst,ydst)、幅wdst、高さhdstは、次式によって算出される。
du = (w × zr′−0 × zl ′) / (xr ″ −xl ″) (36)
Next, the
xdst=xtl+dxt×n ・・・(37)
ydst=yl”+n ・・・(38)
wdst=(xtl+dxt×n)−(xbl+dxb×n) ・・・(39)
hdst=1 ・・・(40)
また、転送元形状の矩形の左上の座標(xsrc,ysrc)、幅wsrc、高さhsrcは、次式によって算出される。
xdst = xtl + dxt × n (37)
ydst = yl ″ + n (38)
wdst = (xtl + dxt × n) − (xbl + dxb × n) (39)
hdst = 1 (40)
Further, the upper left coordinates (xsrc, ysrc), width wsrc, and height hsrc of the rectangle of the transfer source shape are calculated by the following equations.
xsrc=0x ・・・(41)
ysrc=(du×n)/(zl”+dz×n) ・・・(42)
wsrc=w ・・・(43)
hsrc=(du×(n+1))/(zl”+dz×(n+1))−(ysrc)
・・・(44)
図14は、転送元形状および転送先形状に設定された短冊状の矩形領域を説明するための図である。図14(a)は、転送元形状の短冊状の矩形領域を示しており、図14(b)に示す転送先形状の1ピクセル幅の短冊状の矩形領域に対応している。図14(b)に示す矩形領域を下方向に1ピクセルずつずらしながら、対応する転送元形状の短冊状の矩形領域が算出される。
xsrc = 0x (41)
ysrc = (du × n) / (zl ″ + dz × n) (42)
wsrc = w (43)
hsrc = (du × (n + 1)) / (zl ″ + dz × (n + 1)) − (ysrc)
... (44)
FIG. 14 is a diagram for explaining strip-shaped rectangular areas set in the transfer source shape and the transfer destination shape. FIG. 14A shows a rectangular rectangular area having a transfer source shape, and corresponds to the rectangular rectangular area having a 1-pixel width having a transfer destination shape shown in FIG. While the rectangular area shown in FIG. 14B is shifted downward by one pixel at a time, the corresponding rectangular shape of the transfer source shape is calculated.
次に、BitBlt処理部27は、領域算出部26によって算出された矩形データを2D描画プロセッサ13に設定し、2D描画プロセッサ13にBitBltを用いた描画を行なわせる(S28)。
Next, the
最後に、矩形領域のBitBlt処理が下端エッジに達したか否かが判定される(S29)。下端エッジに達していなければ(S29,No)、ステップS27に戻って以降の処理が繰り返される。また、下端エッジに達した場合には(S29,Yes)、処理を終了する。 Finally, it is determined whether or not the BitBlt process of the rectangular area has reached the lower edge (S29). If the lower edge has not been reached (S29, No), the process returns to step S27 and the subsequent processing is repeated. If the lower edge is reached (S29, Yes), the process is terminated.
なお、以上の説明においては、上端エッジから下端エッジに向かって矩形データを補間する場合について説明したが、下端エッジから上端エッジに向かって矩形データを補間するようにしてもよい。 In the above description, the case where the rectangular data is interpolated from the upper end edge toward the lower end edge has been described. However, the rectangular data may be interpolated from the lower end edge toward the upper end edge.
以上説明したように、本実施の形態における描画制御装置によれば、転送先形状のY方向における1ピクセル単位の短冊状の矩形領域を作成し、それに対応する転送元形状の短冊状の矩形領域を算出して順次BitBlt処理を行なうようにしたので、2Dエンジンのみを搭載し、3Dエンジンを搭載していない環境下においても、擬似的に3D空間でイメージデータを回転させた場合のイメージを高速に描画することが可能となった。 As described above, according to the drawing control apparatus of the present embodiment, a rectangular rectangular area in units of one pixel in the Y direction of the transfer destination shape is created, and a rectangular rectangular area of the transfer source shape corresponding thereto is created. Since the BitBlt processing is performed sequentially, only the 2D engine is installed, and even when the 3D engine is not installed, the image when the image data is rotated in the 3D space in a pseudo manner is high speed. It became possible to draw on.
(第3の実施の形態)
本発明の第3の実施の形態における描画制御装置の構成は、図1に示す第1の実施の形態における描画制御装置の構成と同様である。したがって、重複する構成および機能の詳細な説明は繰り返さない。
(Third embodiment)
The configuration of the drawing control apparatus in the third embodiment of the present invention is the same as the configuration of the drawing control apparatus in the first embodiment shown in FIG. Therefore, detailed description of overlapping configurations and functions will not be repeated.
なお、本発明の第3の実施の形態における擬似3Dパラメータ生成器の機能的構成は、図2に示す第1の実施の形態における擬似3Dパラメータ生成器の機能的構成と同様である。第3の実施の形態において、擬似3Dパラメータ生成器は、第1の実施の形態と同様に、2DイメージデータをY軸と平行な回転軸を中心として回転する場合の擬似3Dパラメータを生成するものであるが、さらに転送先形状に矩形クリップ領域が設定された場合の処理に関するものである。 The functional configuration of the pseudo 3D parameter generator according to the third embodiment of the present invention is the same as the functional configuration of the pseudo 3D parameter generator according to the first embodiment shown in FIG. In the third embodiment, the pseudo 3D parameter generator generates a pseudo 3D parameter when rotating 2D image data around a rotation axis parallel to the Y axis, as in the first embodiment. However, the present invention relates to processing when a rectangular clip area is set as the transfer destination shape.
図15は、本発明の第3の実施の形態における描画制御装置の処理手順を説明するためのフローチャートである。図16を適宜参照しながら、本実施の形態における描画制御装置の処理手順を説明する。 FIG. 15 is a flowchart for explaining the processing procedure of the drawing control apparatus according to the third embodiment of the present invention. The processing procedure of the drawing control apparatus in the present embodiment will be described with reference to FIG. 16 as appropriate.
ステップS11〜S14において、第1の実施の形態において説明した処理と同様の処理が行なわれる。そして、クリップ処理部23は、X軸方向のクリップ処理を行なう(S31)。
In steps S11 to S14, processing similar to that described in the first embodiment is performed. Then, the
図16は、転送先形状にクリップ領域が設定された場合の転送元形状および転送先形状に設定された短冊状の矩形領域を説明するための図である。図16(a)は、転送元形状の短冊状の矩形領域を示しており、図16(b)に示す転送先形状の1ピクセル幅の短冊状の矩形領域に対応している。図16(b)に示す矩形領域を右方向に1ピクセルずつずらしながら、対応する転送元形状の短冊状の矩形領域が算出される。 FIG. 16 is a diagram for explaining a transfer source shape and a strip-shaped rectangular region set in the transfer destination shape when a clip region is set in the transfer destination shape. FIG. 16A shows a rectangular rectangular area of the transfer source shape, and corresponds to the rectangular rectangular area of 1 pixel width having the transfer destination shape shown in FIG. While the rectangular area shown in FIG. 16B is shifted by one pixel to the right, the corresponding rectangular shape of the transfer source shape is calculated.
図16(b)に示すように、矩形クリップ領域を表す情報として、Xmax、Xmin、Ymax、Yminが指定される。2次元に投影された形状は、必ず左端と右端とがY軸と平行となっており、左端をXminの位置に、右端をXmaxの位置に変更することによってX軸方向のクリップ処理が行なえる。 As shown in FIG. 16B, Xmax, Xmin, Ymax, and Ymin are designated as information representing the rectangular clip area. The shape projected in two dimensions always has a left end and a right end parallel to the Y axis. By changing the left end to the Xmin position and the right end to the Xmax position, clip processing in the X axis direction can be performed. .
また、上端と下端とはX軸と平行ではないため、クリップ領域内に入る部分と入らない部分とが存在する。そのため、クリップ領域内に入らない場合には、転送先形状の上端エッジ部分をYmaxに、下端エッジ部分をYminに変更することによってY軸方向のクリップ処理が行なわれる。そして、YmaxおよびYminに対応する転送元形状のYmax’およびYmin’が算出される。 In addition, since the upper end and the lower end are not parallel to the X axis, there are a portion that enters the clip region and a portion that does not. Therefore, when it does not fall within the clip area, the clip processing in the Y-axis direction is performed by changing the upper edge portion of the transfer destination shape to Ymax and the lower edge portion to Ymin. Then, Ymax ′ and Ymin ′ of the transfer source shape corresponding to Ymax and Ymin are calculated.
ステップS31において、クリップ処理部23は、透視変換部24によって2次元に投影された形状のX軸方向のクリップ処理を行なう。上述のように、転送先形状の左端をXminの位置に、右端をXmaxの位置に変更する。そして、第1の実施の形態において説明したステップS15〜S17の処理が行なわれる。
In step S <b> 31, the
ステップS32において、クリップ処理部23は、領域算出部26によって算出された転送先形状の短冊状の矩形領域が矩形クリップ領域に入らない場合には、上端エッジ部分をYmaxに、下端エッジ部分をYminに変更する。そして、クリップ処理部23は、これに対応する転送元形状の上端エッジ部分をYmax’に、下端エッジ部分をYmin’に変更する。そして、ステップS18以降の処理が行なわれる。
In step S32, the
なお、矩形クリップ領域内に全ての転送先形状が入る場合には、クリップ処理が実質的には行なわれない。また、矩形クリップ領域内に転送先形状が全く入らない場合には、ステップS31またはS32において処理が終了する。 Note that when all the transfer destination shapes are included in the rectangular clip area, the clip processing is not substantially performed. If no transfer destination shape enters the rectangular clip area, the process ends in step S31 or S32.
以上説明したように、本実施の形態における描画制御装置によれば、転送先形状に対して矩形クリップ領域を設定し、それに対応する転送元形状のX軸座標およびY軸座標を変更してBitBlt処理を行なうようにしたので、矩形クリップ領域が指定された擬似3Dイメージに対する処理を高速に行なうことが可能となった。 As described above, according to the drawing control apparatus of this embodiment, a rectangular clip area is set for the transfer destination shape, and the X-axis coordinate and the Y-axis coordinate of the transfer-source shape corresponding to the rectangular clip region are changed to BitBlt. Since the processing is performed, it is possible to perform the processing on the pseudo 3D image in which the rectangular clip area is designated at high speed.
(第4の実施の形態)
本発明の第4の実施の形態における描画制御装置の構成は、図1に示す第1の実施の形態における描画制御装置の構成と同様である。したがって、重複する構成および機能の詳細な説明は繰り返さない。
(Fourth embodiment)
The configuration of the drawing control apparatus in the fourth embodiment of the present invention is the same as the configuration of the drawing control apparatus in the first embodiment shown in FIG. Therefore, detailed description of overlapping configurations and functions will not be repeated.
なお、本発明の第4の実施の形態における擬似3Dパラメータ生成器の機能的構成は、図2に示す第1の実施の形態における擬似3Dパラメータ生成器の機能的構成と同様である。第4の実施の形態において、擬似3Dパラメータ生成器は、第2の実施の形態と同様に、2DイメージデータをX軸と平行な回転軸を中心として回転する場合の擬似3Dパラメータを生成するものであるが、さらに転送先形状に矩形クリップ領域が設定された場合の処理に関するものである。 The functional configuration of the pseudo 3D parameter generator in the fourth embodiment of the present invention is the same as the functional configuration of the pseudo 3D parameter generator in the first embodiment shown in FIG. In the fourth embodiment, the pseudo 3D parameter generator generates a pseudo 3D parameter when rotating 2D image data around a rotation axis parallel to the X axis, as in the second embodiment. However, the present invention relates to processing when a rectangular clip area is set as the transfer destination shape.
図17は、本発明の第4の実施の形態における描画制御装置の処理手順を説明するためのフローチャートである。図18を適宜参照しながら、本実施の形態における描画制御装置の処理手順を説明する。 FIG. 17 is a flowchart for explaining the processing procedure of the drawing control apparatus according to the fourth embodiment of the present invention. The processing procedure of the drawing control apparatus in the present embodiment will be described with reference to FIG. 18 as appropriate.
ステップS21〜S24において、第2の実施の形態において説明した処理と同様の処理が行なわれる。そして、クリップ処理部23は、Y軸方向のクリップ処理を行なう(S41)。
In steps S21 to S24, processing similar to that described in the second embodiment is performed. Then, the
図18は、転送先形状にクリップ領域が設定された場合の転送元形状および転送先形状に設定された短冊状の矩形領域を説明するための図である。図18(a)は、転送元形状の短冊状の矩形領域を示しており、図18(b)に示す転送先形状の1ピクセル幅の短冊状の矩形領域に対応している。図18(b)に示す矩形領域を下方向に1ピクセルずつずらしながら、対応する転送元形状の短冊状の矩形領域が算出される。 FIG. 18 is a diagram for describing a transfer source shape and a strip-shaped rectangular region set in the transfer destination shape when a clip region is set in the transfer destination shape. FIG. 18A shows a rectangular rectangular area having a transfer source shape, and corresponds to the rectangular rectangular area having a 1-pixel width having a transfer destination shape shown in FIG. While the rectangular area shown in FIG. 18B is shifted downward by one pixel at a time, the corresponding rectangular shape of the transfer source shape is calculated.
図18(b)に示すように、矩形クリップ領域を表す情報として、Xmax、Xmin、Ymax、Yminが指定される。2次元に投影された形状は、必ず上端と下端とがX軸と平行となっており、上端をYmaxの位置に、下端をYminの位置に変更することによってY軸方向のクリップ処理が行なえる。 As shown in FIG. 18B, Xmax, Xmin, Ymax, and Ymin are designated as information representing the rectangular clip area. The shape projected in two dimensions always has an upper end and a lower end that are parallel to the X axis, and can be clipped in the Y axis direction by changing the upper end to the Ymax position and the lower end to the Ymin position. .
また、左端と右端とはY軸と平行ではないため、クリップ領域内に入る部分と入らない部分とが存在する。そのため、クリップ領域内に入らない場合には、転送先形状の左端エッジ部分をXminに、右端エッジ部分をXmaxに変更することによってX軸方向のクリップ処理が行なわれる。そして、XminおよびXmaxに対応する転送元形状のXmin’およびXmax’が算出される。 Further, since the left end and the right end are not parallel to the Y axis, there are a portion that enters the clip region and a portion that does not enter. Therefore, when it does not fall within the clip area, the clip processing in the X-axis direction is performed by changing the left end edge portion of the transfer destination shape to Xmin and the right end edge portion to Xmax. Then, Xmin ′ and Xmax ′ of the transfer source shape corresponding to Xmin and Xmax are calculated.
ステップS41において、クリップ処理部23は、透視変換部24によって2次元に投影された形状のY軸方向のクリップ処理を行なう。上述のように、転送先形状の上端をYmaxの位置に、下端をYminの位置に変更する。そして、第2の実施の形態において説明したステップS25〜S27の処理が行なわれる。
In step S <b> 41, the
ステップS42において、クリップ処理部23は、領域算出部26によって算出された転送先形状の短冊状の矩形領域が矩形クリップ領域に入らない場合には、左端エッジ部分をXminに、右端エッジ部分をXmaxに変更する。そして、クリップ処理部23は、これに対応する転送元形状の左端エッジ部分をXmin’に、右端エッジ部分をXmax’に変更する。そして、ステップS28以降の処理が行なわれる。
In step S42, the
なお、矩形クリップ領域内に全ての転送先形状が入る場合には、クリップ処理が実質的には行なわれない。また、矩形クリップ領域内に転送先形状が全く入らない場合には、ステップS41またはS42において処理が終了する。 Note that when all the transfer destination shapes are included in the rectangular clip area, the clip processing is not substantially performed. If no transfer destination shape enters the rectangular clip area, the process ends in step S41 or S42.
以上説明したように、本実施の形態における描画制御装置によれば、転送先形状に対して矩形クリップ領域を設定し、それに対応する転送元形状のX軸座標およびY軸座標を変更してBitBlt処理を行なうようにしたので、矩形クリップ領域が指定された擬似3Dイメージに対する処理を高速に行なうことが可能となった。 As described above, according to the drawing control apparatus of this embodiment, a rectangular clip area is set for the transfer destination shape, and the X-axis coordinate and the Y-axis coordinate of the transfer-source shape corresponding to the rectangular clip region are changed to BitBlt. Since the processing is performed, it is possible to perform the processing on the pseudo 3D image in which the rectangular clip area is designated at high speed.
今回開示された実施の形態は、すべての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は上記した説明ではなくて特許請求の範囲によって示され、特許請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。 The embodiment disclosed this time should be considered as illustrative in all points and not restrictive. The scope of the present invention is defined by the terms of the claims, rather than the description above, and is intended to include any modifications within the scope and meaning equivalent to the terms of the claims.
11 演算プロセッサ、12 システムメモリ、13 2D描画プロセッサ、14 描画メモリ、15 システムバス、16 内部メモリ、21 パラメータ設定部、22 座標変換部、23 クリップ処理部、24 透視変換部、25 補間データ作成部、26 領域算出部、27 BitBlt処理部。
DESCRIPTION OF
Claims (9)
前記2次元イメージの座標を3次元座標に変換する座標変換手段と、
前記座標変換手段によって3次元座標に変換された3次元形状を2次元座標に透視変換する透視変換手段と、
前記透視変換手段によって透視変換された後の2次元形状を分割した複数の矩形領域それぞれを転送先領域とし、それに対応する前記2次元イメージの矩形領域を転送元領域として算出する領域算出手段と、
前記領域算出手段によって算出された転送元領域と転送先領域とに基づいてビットブロック転送を順次行なうことにより、前記擬似3次元イメージを描画する描画手段とを含む、描画制御装置。 A drawing control apparatus for generating and drawing a pseudo 3D image obtained by rotating a 2D image in a 3D space,
Coordinate conversion means for converting the coordinates of the two-dimensional image into three-dimensional coordinates;
Perspective conversion means for perspective-converting the three-dimensional shape converted into the three-dimensional coordinates by the coordinate conversion means into two-dimensional coordinates;
A plurality of rectangular areas obtained by dividing the two-dimensional shape after the perspective transformation by the perspective transformation means as transfer destination areas, and a corresponding area calculation means for calculating the corresponding rectangular area of the two-dimensional image as a transfer source area;
A drawing control apparatus comprising: drawing means for drawing the pseudo three-dimensional image by sequentially performing bit block transfer based on the transfer source area and the transfer destination area calculated by the area calculation means.
前記領域算出手段は、前記透視変換手段によって透視変換された後の2次元形状をX軸方向に順次シフトしながらX方向の1ピクセルを単位とする矩形領域を算出して前記転送先領域とし、それに対応する前記2次元イメージの矩形領域を算出して前記転送元領域とする、請求項1または2記載の描画制御装置。 The coordinate conversion means generates three-dimensional coordinates when the two-dimensional image is rotated around a rotation axis parallel to the Y axis,
The area calculation means calculates a rectangular area in units of one pixel in the X direction while sequentially shifting the two-dimensional shape after being perspective-transformed by the perspective transformation means in the X-axis direction as the transfer destination area. The drawing control apparatus according to claim 1, wherein a rectangular area of the two-dimensional image corresponding thereto is calculated as the transfer source area.
前記領域算出手段は、前記補間データ作成手段によって作成された補間データに基づいて、前記転送元領域と前記転送先領域とを算出する、請求項3記載の描画制御装置。 The drawing control apparatus further calculates interpolation data necessary for calculating the Y coordinates of the upper and lower edges of the two-dimensional shape after being perspective-transformed by the perspective transformation means, and a Z value as depth information. Including interpolation data creation means for creating the interpolation data required for
The drawing control apparatus according to claim 3, wherein the area calculation unit calculates the transfer source area and the transfer destination area based on the interpolation data created by the interpolation data creation means.
前記領域算出手段は、前記透視変換手段によって透視変換された後の2次元形状をY軸方向に順次シフトしながらY方向の1ピクセルを単位とする矩形領域を算出して前記転送先領域とし、それに対応する前記2次元イメージの矩形領域を算出して前記転送元領域とする、請求項1または2記載の描画制御装置。 The coordinate conversion means generates coordinates when the two-dimensional image is rotated around a rotation axis parallel to the X axis,
The area calculation means calculates a rectangular area in units of one pixel in the Y direction while sequentially shifting the two-dimensional shape after the perspective conversion by the perspective conversion means in the Y-axis direction, and serves as the transfer destination area. The drawing control apparatus according to claim 1, wherein a rectangular area of the two-dimensional image corresponding thereto is calculated as the transfer source area.
前記領域算出手段は、前記補間データ作成手段によって作成された補間データに基づいて、前記転送元領域と前記転送先領域とを算出する、請求項5記載の描画制御装置。 The drawing control apparatus further calculates interpolation data necessary for calculating the X coordinate of the left end edge and the right end edge of the two-dimensional shape after the perspective conversion by the perspective conversion means, and a Z value as depth information. Including interpolation data creation means for creating the interpolation data required for
The drawing control apparatus according to claim 5, wherein the area calculation unit calculates the transfer source area and the transfer destination area based on the interpolation data created by the interpolation data creation means.
前記演算手段に、前記2次元イメージの座標を3次元座標に変換させるステップと、
前記3次元座標に変換された3次元形状を2次元座標に透視変換させるステップと、
前記透視変換された後の2次元形状を分割した複数の矩形領域それぞれを転送先領域とし、それに対応する前記2次元イメージの矩形領域を転送元領域として算出させるステップと、
前記算出された転送元領域と転送先領域とに基づいてビットブロック転送を順次行なうことにより、前記擬似3次元イメージを描画させるステップとを含む、描画制御方法。 A drawing control method for generating and drawing a pseudo three-dimensional image obtained by rotating a two-dimensional image in a three-dimensional space by executing a program stored in a storage unit by an arithmetic unit,
Causing the computing means to convert the coordinates of the two-dimensional image into three-dimensional coordinates;
Perspectively transforming the three-dimensional shape converted into the three-dimensional coordinates into two-dimensional coordinates;
A plurality of rectangular regions obtained by dividing the two-dimensional shape after the perspective transformation are set as transfer destination regions, and the corresponding rectangular regions of the two-dimensional image are calculated as transfer source regions;
And a step of drawing the pseudo three-dimensional image by sequentially performing bit block transfer based on the calculated transfer source area and transfer destination area.
前記演算手段に、前記2次元イメージの座標を3次元座標に変換させるステップと、
前記3次元座標に変換された3次元形状を2次元座標に透視変換させるステップと、
前記透視変換された後の2次元形状を分割した複数の矩形領域それぞれを転送先領域とし、それに対応する前記2次元イメージの矩形領域を転送元領域として算出させるステップと、
前記算出された転送元領域と転送先領域とに基づいてビットブロック転送を順次行なうことにより、前記擬似3次元イメージを描画させるステップとを含む、コンピュータ・プログラム。 A computer program for generating and drawing a pseudo three-dimensional image obtained by rotating a two-dimensional image in a three-dimensional space by executing a program stored in a storage unit by an arithmetic unit,
Causing the computing means to convert the coordinates of the two-dimensional image into three-dimensional coordinates;
Perspectively transforming the three-dimensional shape converted into the three-dimensional coordinates into two-dimensional coordinates;
A plurality of rectangular regions obtained by dividing the two-dimensional shape after the perspective transformation are set as transfer destination regions, and the corresponding rectangular regions of the two-dimensional image are calculated as transfer source regions;
And a step of drawing the pseudo three-dimensional image by sequentially performing bit block transfer based on the calculated transfer source area and transfer destination area.
前記演算手段に、前記2次元イメージの座標を3次元座標に変換させるステップと、
前記3次元座標に変換された3次元形状を2次元座標に透視変換させるステップと、
前記透視変換された後の2次元形状を分割した複数の矩形領域それぞれを転送先領域とし、それに対応する前記2次元イメージの矩形領域を転送元領域として算出させるステップと、
前記算出された転送元領域と転送先領域とに基づいてビットブロック転送を順次行なうことにより、前記擬似3次元イメージを描画させるステップとを含む、コンピュータで読取可能な記録媒体。 A computer-readable recording medium storing the program for generating and rendering a pseudo three-dimensional image obtained by rotating a two-dimensional image in a three-dimensional space by executing a program stored in the storage unit by the arithmetic unit. There,
Causing the computing means to convert the coordinates of the two-dimensional image into three-dimensional coordinates;
Perspectively transforming the three-dimensional shape converted into the three-dimensional coordinates into two-dimensional coordinates;
A plurality of rectangular regions obtained by dividing the two-dimensional shape after the perspective transformation are set as transfer destination regions, and the corresponding rectangular regions of the two-dimensional image are calculated as transfer source regions;
A computer-readable recording medium including a step of rendering the pseudo three-dimensional image by sequentially performing bit block transfer based on the calculated transfer source area and transfer destination area.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2010053434A JP2011186930A (en) | 2010-03-10 | 2010-03-10 | Drawing control device, drawing control method, computer program of the same, and recording medium with the program recorded thereon |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2010053434A JP2011186930A (en) | 2010-03-10 | 2010-03-10 | Drawing control device, drawing control method, computer program of the same, and recording medium with the program recorded thereon |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2011186930A true JP2011186930A (en) | 2011-09-22 |
Family
ID=44793090
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2010053434A Withdrawn JP2011186930A (en) | 2010-03-10 | 2010-03-10 | Drawing control device, drawing control method, computer program of the same, and recording medium with the program recorded thereon |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2011186930A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2019223523A1 (en) * | 2018-05-23 | 2019-11-28 | 苏州新光维医疗科技有限公司 | Method and device for image processing, and three-dimensional imaging system |
-
2010
- 2010-03-10 JP JP2010053434A patent/JP2011186930A/en not_active Withdrawn
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2019223523A1 (en) * | 2018-05-23 | 2019-11-28 | 苏州新光维医疗科技有限公司 | Method and device for image processing, and three-dimensional imaging system |
US11317080B2 (en) | 2018-05-23 | 2022-04-26 | Scivita Medical Technology Co., Ltd. | Image processing method and device, and three-dimensional imaging system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10438312B2 (en) | Method for efficient re-rendering objects to vary viewports and under varying rendering and rasterization parameters | |
KR102275712B1 (en) | Rendering method and apparatus, and electronic apparatus | |
KR101145260B1 (en) | Apparatus and method for mapping textures to object model | |
KR101911906B1 (en) | Apparatus for 3D object creation and thereof Method | |
US9330466B2 (en) | Methods and apparatus for 3D camera positioning using a 2D vanishing point grid | |
JP3892016B2 (en) | Image processing apparatus and image processing method | |
WO2012114387A1 (en) | Map rendering device | |
JPH11161819A (en) | Image processor, its method and recording medium recording image processing program | |
JP6223916B2 (en) | Information processing apparatus, method, and program | |
JP4827659B2 (en) | Image processing apparatus, image processing method, and computer program | |
JP3756888B2 (en) | Graphics processor, graphics card and graphics processing system | |
JP6297169B2 (en) | Drawing apparatus and drawing method | |
JP2011186930A (en) | Drawing control device, drawing control method, computer program of the same, and recording medium with the program recorded thereon | |
KR101227155B1 (en) | Graphic image processing apparatus and method for realtime transforming low resolution image into high resolution image | |
JP2013080466A (en) | Method and device for processing document image | |
CN110335335A (en) | Uniform density cube for spherical projection renders | |
JP2002140063A (en) | Graphics drawing device | |
CN110827411B (en) | Method, device, equipment and storage medium for displaying augmented reality model of self-adaptive environment | |
CN111028357B (en) | Soft shadow processing method and device of augmented reality equipment | |
KR100914915B1 (en) | A low cost view-volume clipping method and an apparatus therefor | |
JP2012098951A (en) | Graphic drawing processing apparatus, graphic drawing processing method and computer program | |
KR20160010780A (en) | 3D image providing system and providing method thereof | |
US6870536B2 (en) | Image processing apparatus and image processing program | |
JP2010152702A (en) | Semiconductor integrated circuit for graphics | |
JP5306060B2 (en) | Image processing apparatus and image processing method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A300 | Withdrawal of application because of no request for examination |
Free format text: JAPANESE INTERMEDIATE CODE: A300 Effective date: 20130604 |