SFBTransform
ITransform インターフェイスのラッパークラスです。
#include <SFBTransform.hpp>
class SFBTransform : public SFBQuery;
typedef SFBTransform& SFBTransformRef;
typedef SFBTransform* SFBTransformPtr;
typedef SFBTransform** SFBTransformHandle;
typedef const SFBTransform ConstSFBTransform;
typedef const SFBTransform& ConstSFBTransformRef;
typedef const SFBTransform* ConstSFBTransformPtr;
typedef const SFBTransform** ConstSFBTransformHandle;
継承図
メンバ
| パブリック関数 |
public
|
AddRef
(SFBBase から継承)
|
インターフェイスの参照カウントをインクリメントします。
|
public static
|
Instance |
ITransform インターフェイスのインスタンスを取得します。
|
public
|
QueryInterface
(SFBQuery から継承)
|
このオブジェクトからの別の API を問い合わせます。 |
public
|
Release
(SFBBase から継承)
|
インターフェイスの参照カウントをデクリメントします。
|
public
|
Self
(SFBQuery から継承)
|
オブジェクトを単一インタフェースで実装する際に使用します。 |
public
|
TransformBltComplex |
複雑なブリット操作を行います。
|
public
|
TransformBltSimple |
1 つのビットマップを、単純な定義済みの変形を適用しながら、
別のビットマップにブリットします。
|
SFBTransform::Instance
ITransform インターフェイスのインスタンスを取得します。
解説
引数に指定した IBitmap インターフェイスから
ITransoform インターフェイスを問い合わせて返します。
SFBTransform::TransformBltComplex
複雑なブリット操作を行います。
使用例
SFUGraphicsPtr graphic = SFUGraphics::Instance();
SFUBrewPtr<SFBShell> shell = SFBShell::Instance();
SFUBrewPtr<SFBBitmap> bmp;
SFUBrewPtr<SFBBitmap> dst;
SFUBrewPtr<SFBBitmap> tmp;
AEEBitmapInfo bmpInfo = {0};
SFURect bmpRect;
SFUBrewPtr<SFBTransform> trans;
SFUPoint point;
AEETransformMatrix matrix = {0};
// リソース ファイルからビットマップを取得します。
bmp = shell->LoadResBitmap(SAMPLE_RES_FILE, IDR_TILE_BMP);
if (bmp != NULL) {
// ビットマップのサイズを取得します。
bmp->GetInfo(&bmpInfo);
// 転送元ビットマップの長方形領域を設定します。
bmpRect.Set(0, 0, (UInt16)bmpInfo.cx, (UInt16)bmpInfo.cy);
// 作業用のビットマップを作成します。
// (転送先のビットマップと互換性のあるビットマップを作成します。)
dst = graphic->GetDestination();
tmp = dst->CreateCompatibleBitmap(SFUSize((UInt16)bmpInfo.cx, (UInt16)bmpInfo.cy));
// 作業用のビットマップに画像を描画します。
tmp->BltIn(bmpRect, bmp, SFUPoint(0, 0));
// SFBTransform のインスタンスを生成します。
trans = SFBTransform::Instance(dst);
// 変形マトリックスを設定します。
// 1.5 倍に拡大します。
matrix.A = 384;
matrix.B = 0;
matrix.C = 0;
matrix.D = 384;
// 転送元のビットマップを 1.5 倍に拡大して描画します。
point.Set((UInt16)(bmpInfo.cx / 2), (UInt16)(bmpInfo.cy / 2));
trans->TransformBltComplex(point, // 転送先の座標
tmp, // 転送元のビットマップ
bmpRect, // 転送元の長方形領域
matrix // 1.5 倍に拡大します。
);
}
SFBTransform::TransformBltSimple
1 つのビットマップを、単純な定義済みの変形を適用しながら、
別のビットマップにブリットします。
使用例
SFUGraphicsPtr graphic = SFUGraphics::Instance();
SFUBrewPtr<SFBShell> shell = SFBShell::Instance();
SFUBrewPtr<SFBBitmap> bmp;
SFUBrewPtr<SFBBitmap> dst;
SFUBrewPtr<SFBBitmap> tmp;
AEEBitmapInfo bmpInfo = {0};
SFURect bmpRect;
SFUBrewPtr<SFBTransform> trans;
// リソース ファイルからビットマップを取得します。
bmp = shell->LoadResBitmap(SAMPLE_RES_FILE, IDR_TILE_BMP);
if (bmp != NULL) {
// ビットマップのサイズを取得します。
bmp->GetInfo(&bmpInfo);
// 転送元ビットマップの長方形領域を設定します。
bmpRect.Set(0, 0, (UInt16)bmpInfo.cx, (UInt16)bmpInfo.cy);
// 作業用のビットマップを作成します。
// (転送先のビットマップと互換性のあるビットマップを作成します。)
dst = graphic->GetDestination();
tmp = dst->CreateCompatibleBitmap(SFUSize((UInt16)bmpInfo.cx, (UInt16)bmpInfo.cy));
// 作業用のビットマップに画像を描画します。
tmp->BltIn(bmpRect, bmp, SFUPoint(0, 0));
// SFBTransform のインスタンスを生成します。
trans = SFBTransform::Instance(dst);
// 転送元のビットマップを 2 倍に拡大して描画します。
point.Set((UInt16)(bmpInfo.cx / 2), (UInt16)(bmpInfo.cy / 2));
trans->TransformBltSimple(point, // 転送先の座標
tmp, // 転送元のビットマップ
bmpRect, // 転送元の長方形領域
TRANSFORM_SCALE_2 // 2 倍に拡大します。
);
}