Lumino
ln::Texture2D Class Reference

2D テクスチャのクラスです。 More...

#include <Texture.hpp>

Inheritance diagram for ln::Texture2D:
ln::Texture ln::AssetObject ln::IGraphicsResource

Public Member Functions

void setMipmapEnabled (bool value)
 Mipmap の有無を設定します。(default: false)
 
Bitmap2D * map (MapMode mode)
 テクスチャが保持するビットマップデータにアクセスします。
 
void setResourceUsage (GraphicsResourceUsage usage)
 リソースの使用方法を変更します。(default: Static)
 
void setResourcePool (GraphicsResourcePool pool)
 リソースの管理方法を変更します。(default: Managed)
 
void clear (const Color &color)
 指定した色でテクスチャ全体をクリアします。
 
void setPixel (int x, int y, const Color &color)
 指定した色でテクスチャ全体をクリアします。
 
void blit (int x, int y, Texture2D *srcTexture, int sx, int sy, int sw, int sh)
 別のテクスチャからこのテクスチャへ、ビットマップ転送を行います。
 
- Public Member Functions inherited from ln::Texture
int width () const
 テクスチャの幅を取得します。(ピクセル単位)
 
int height () const
 テクスチャの高さを取得します。 (ピクセル単位)
 
TextureFormat format () const
 テクスチャのピフォーマットを取得します。
 
bool mipmap () const
 ミップマップの有無を取得します。
 
SamplerStatesamplerState () const
 このテクスチャに関連付けられている SamplerState を取得します。
 
void setSamplerState (SamplerState *value)
 このテクスチャに関連付ける SamplerState を設定します。
 

Static Public Member Functions

static Ref< Texture2Dcreate (int width, int height)
 テクスチャを作成します。ピクセルフォーマットは RGBA8 です。 More...
 
static Ref< Texture2Dcreate (int width, int height, TextureFormat format)
 テクスチャを作成します。 More...
 
static Ref< Texture2Dload (const StringRef &filePath)
 ローカルのファイルを読み込み、テクスチャを作成します。 More...
 
static Ref< Texture2DloadEmoji (StringRef code)
 loadEmoji More...
 

Protected Member Functions

void init (int width, int height)
 テクスチャを作成します。ピクセルフォーマットは RGBA8 です。 More...
 
void init (int width, int height, TextureFormat format)
 テクスチャを作成します。 More...
 

Detailed Description

2D テクスチャのクラスです。

Member Function Documentation

◆ create() [1/2]

static Ref<Texture2D> ln::Texture2D::create ( int  width,
int  height 
)
static

テクスチャを作成します。ピクセルフォーマットは RGBA8 です。

Parameters
[in]width: 幅 (px 単位)
[in]height: 高さ (px 単位)
Returns
作成されたテクスチャ

◆ create() [2/2]

static Ref<Texture2D> ln::Texture2D::create ( int  width,
int  height,
TextureFormat  format 
)
static

テクスチャを作成します。

Parameters
[in]width: 幅 (px 単位)
[in]height: 高さ (px 単位)
[in]format: ピクセルフォーマット

◆ init() [1/2]

void ln::Texture2D::init ( int  width,
int  height 
)
protected

テクスチャを作成します。ピクセルフォーマットは RGBA8 です。

Parameters
[in]width: 幅 (px 単位)
[in]height: 高さ (px 単位)
Returns
作成されたテクスチャ

◆ init() [2/2]

void ln::Texture2D::init ( int  width,
int  height,
TextureFormat  format 
)
protected

テクスチャを作成します。

Parameters
[in]width: 幅 (px 単位)
[in]height: 高さ (px 単位)
[in]format: ピクセルフォーマット

◆ load()

static Ref<Texture2D> ln::Texture2D::load ( const StringRef filePath)
static

ローカルのファイルを読み込み、テクスチャを作成します。

Parameters
[in]filePath: 読み込むファイルのパス
[in]format: ピクセルフォーマット

このメソッドは TextureImporter のユーティリティです。 アセットからテクスチャを読み込みます。

Parameters
[in]filePath: 読み込むファイルのパス

サポートしているフォーマットは次の通りです。 PNG(.png), JPG(.jpg), TGA(.tga), BMP(.bmp), GIF(.gif)

◆ loadEmoji()

static Ref<Texture2D> ln::Texture2D::loadEmoji ( StringRef  code)
static

loadEmoji

Parameters
[in]code: xxxx

The documentation for this class was generated from the following file: