OpenSiv3D  v0.6.5
C++20 framework for creative coding
s3d::TextureAsset Class Reference

#include <TextureAsset.hpp>

Inherits s3d::Texture.

Public Member Functions

SIV3D_NODISCARD_CXX20 TextureAsset (AssetNameView name)
 
- Public Member Functions inherited from s3d::Texture
SIV3D_NODISCARD_CXX20 Texture ()
 
SIV3D_NODISCARD_CXX20 Texture (const Image &image, TextureDesc desc=TextureDesc::Unmipped)
 
SIV3D_NODISCARD_CXX20 Texture (const Image &image, const Array< Image > &mipmaps, TextureDesc desc=TextureDesc::Mipped)
 
SIV3D_NODISCARD_CXX20 Texture (FilePathView path, TextureDesc desc=TextureDesc::Unmipped)
 画像ファイルからテクスチャを作成します。 More...
 
SIV3D_NODISCARD_CXX20 Texture (IReader &&reader, TextureDesc desc=TextureDesc::Unmipped)
 
SIV3D_NODISCARD_CXX20 Texture (FilePathView rgb, FilePathView alpha, TextureDesc desc=TextureDesc::Unmipped)
 
SIV3D_NODISCARD_CXX20 Texture (const Color &rgb, FilePathView alpha, TextureDesc desc=TextureDesc::Unmipped)
 
SIV3D_NODISCARD_CXX20 Texture (const Emoji &emoji, TextureDesc desc=TextureDesc::Mipped)
 絵文字からテクスチャを作成します。 More...
 
SIV3D_NODISCARD_CXX20 Texture (const Icon &icon, int32 size, TextureDesc desc=TextureDesc::Mipped)
 アイコンからテクスチャを作成します。 More...
 
virtual ~Texture ()
 
int32 width () const
 テクスチャの幅(ピクセル)を返します。 More...
 
int32 height () const
 テクスチャの高さ(ピクセル)を返します。 More...
 
Size size () const
 テクスチャの幅と高さ(ピクセル)を返します。 More...
 
template<class Type = double>
Type horizontalAspectRatio () const noexcept
 
TextureDesc getDesc () const
 テクスチャの設定を返します。 More...
 
TextureFormat getFormat () const
 テクスチャのフォーマットを返します。 More...
 
bool isMipped () const
 ミップマッピングが有効化されているかを返します。 More...
 
bool srgbSampling () const
 
bool isSDF () const
 
bool hasDepth () const
 デプスバッファを持っているかを返します。 More...
 
Rect region (int32 x, int32 y) const
 
Rect region (Point pos=Point{ 0, 0 }) const
 
RectF region (double x, double y) const
 
RectF region (Vec2 pos) const
 
RectF regionAt (double x, double y) const
 
RectF regionAt (Vec2 pos) const
 
RectF draw (const ColorF &diffuse=Palette::White) const
 
RectF draw (const ColorF &color0, const ColorF &color1, const ColorF &color2, const ColorF &color3) const
 
RectF draw (Arg::top_< ColorF > topColor, Arg::bottom_< ColorF > bottomColor) const
 
RectF draw (Arg::left_< ColorF > leftColor, Arg::right_< ColorF > rightColor) const
 
RectF draw (double x, double y, const ColorF &diffuse=Palette::White) const
 左上位置を指定してテクスチャを描画します。 More...
 
RectF draw (double x, double y, const ColorF &color0, const ColorF &color1, const ColorF &color2, const ColorF &color3) const
 
RectF draw (double x, double y, Arg::top_< ColorF > topColor, Arg::bottom_< ColorF > bottomColor) const
 
RectF draw (double x, double y, Arg::left_< ColorF > leftColor, Arg::right_< ColorF > rightColor) const
 
RectF draw (const Vec2 &pos, const ColorF &diffuse=Palette::White) const
 
RectF draw (const Vec2 &pos, const ColorF &color0, const ColorF &color1, const ColorF &color2, const ColorF &color3) const
 
RectF draw (const Vec2 &pos, Arg::top_< ColorF > topColor, Arg::bottom_< ColorF > bottomColor) const
 
RectF draw (const Vec2 &pos, Arg::left_< ColorF > leftColor, Arg::right_< ColorF > rightColor) const
 
RectF draw (Arg::topLeft_< Vec2 > topLeft, const ColorF &diffuse=Palette::White) const
 
RectF draw (Arg::topRight_< Vec2 > topRight, const ColorF &diffuse=Palette::White) const
 
RectF draw (Arg::bottomLeft_< Vec2 > bottomLeft, const ColorF &diffuse=Palette::White) const
 
RectF draw (Arg::bottomRight_< Vec2 > bottomRight, const ColorF &diffuse=Palette::White) const
 
RectF draw (Arg::topCenter_< Vec2 > topCenter, const ColorF &diffuse=Palette::White) const
 
RectF draw (Arg::bottomCenter_< Vec2 > bottomCenter, const ColorF &diffuse=Palette::White) const
 
RectF draw (Arg::leftCenter_< Vec2 > leftCenter, const ColorF &diffuse=Palette::White) const
 
RectF draw (Arg::rightCenter_< Vec2 >rightCenter, const ColorF &diffuse=Palette::White) const
 
RectF draw (Arg::center_< Vec2 > center, const ColorF &diffuse=Palette::White) const
 
RectF drawAt (double x, double y, const ColorF &diffuse=Palette::White) const
 
RectF drawAt (double x, double y, const ColorF &color0, const ColorF &color1, const ColorF &color2, const ColorF &color3) const
 
RectF drawAt (const Vec2 &pos, const ColorF &diffuse=Palette::White) const
 
RectF drawAt (const Vec2 &pos, const ColorF &color0, const ColorF &color1, const ColorF &color2, const ColorF &color3) const
 
RectF drawClipped (double x, double y, const RectF &clipRect, const ColorF &diffuse=Palette::White) const
 
RectF drawClipped (const Vec2 &pos, const RectF &clipRect, const ColorF &diffuse=Palette::White) const
 
RectF drawAtClipped (double x, double y, const RectF &clipRect, const ColorF &diffuse=Palette::White) const
 
RectF drawAtClipped (const Vec2 &pos, const RectF &clipRect, const ColorF &diffuse=Palette::White) const
 
TextureRegion operator() (double x, double y, double w, double h) const
 
TextureRegion operator() (const Vec2 &xy, double w, double h) const
 
TextureRegion operator() (double x, double y, double size) const
 
TextureRegion operator() (double x, double y, const Vec2 &size) const
 
TextureRegion operator() (const Vec2 &xy, const Vec2 &size) const
 
TextureRegion operator() (const RectF &rect) const
 
TextureRegion uv (double u, double v, double w, double h) const
 
TextureRegion uv (const RectF &rect) const
 
TextureRegion mirrored () const
 
TextureRegion mirrored (bool doMirror) const
 
TextureRegion flipped () const
 
TextureRegion flipped (bool doFlip) const
 
TextureRegion scaled (double s) const
 
TextureRegion scaled (double xs, double ys) const
 
TextureRegion scaled (Vec2 s) const
 
TextureRegion resized (double size) const
 長辺が指定したサイズになるようリサイズした TextureRegion を返します。 More...
 
TextureRegion resized (double width, double height) const
 
TextureRegion resized (Vec2 size) const
 
TextureRegion repeated (double xRepeat, double yRepeat) const
 
TextureRegion repeated (Vec2 _repeat) const
 
TextureRegion mapped (double width, double height) const
 
TextureRegion mapped (Vec2 size) const
 
TextureRegion fitted (double width, double height, AllowScaleUp allowScaleUp=AllowScaleUp::Yes) const
 
TextureRegion fitted (const Vec2 &size, AllowScaleUp allowScaleUp=AllowScaleUp::Yes) const
 
TexturedQuad rotated (double angle) const
 
TexturedQuad rotatedAt (double x, double y, double angle) const
 
TexturedQuad rotatedAt (const Vec2 &pos, double angle) const
 
TexturedRoundRect rounded (double r) const
 
TexturedRoundRect rounded (double x, double y, double w, double h, double r) const
 
void swap (Texture &other) noexcept
 
- Public Member Functions inherited from s3d::AssetHandle< Texture >
SIV3D_NODISCARD_CXX20 AssetHandle ()
 
SIV3D_NODISCARD_CXX20 AssetHandle (std::shared_ptr< AssetIDWrapperType > &&id)
 
IDType id () const noexcept
 アセットの内部管理 ID を返します。 More...
 
bool isEmpty () const noexcept
 アセットが空であるかを返します。 More...
 
 operator bool () const noexcept
 アセットが空でないかを返します。 More...
 
bool operator== (const AssetHandle &other) const noexcept
 2 つのアセットが同じオブジェクトであるかを返します。 More...
 
bool operator!= (const AssetHandle &other) const noexcept
 2 つのアセットが異なるオブジェクトであるかを返します。 More...
 
void release ()
 このハンドルが管理するアセットを解放します。 More...
 

Static Public Member Functions

static bool Register (AssetNameView name, FilePathView path, TextureDesc desc=TextureDesc::Unmipped)
 テクスチャアセットを登録します。 More...
 
static bool Register (AssetNameView name, FilePathView rgb, FilePathView alpha, TextureDesc desc=TextureDesc::Unmipped)
 
static bool Register (AssetNameView name, const Color &rgb, FilePathView alpha, TextureDesc desc=TextureDesc::Unmipped)
 
static bool Register (AssetNameView name, const Emoji &emoji, TextureDesc desc=TextureDesc::Mipped)
 
static bool Register (AssetNameView name, const Icon &icon, int32 size, TextureDesc desc=TextureDesc::Unmipped)
 
static bool Register (AssetNameView name, std::unique_ptr< TextureAssetData > &&data)
 
static bool Register (const AssetNameAndTags &nameAndTags, FilePathView path, TextureDesc desc=TextureDesc::Unmipped)
 
static bool Register (const AssetNameAndTags &nameAndTags, FilePathView rgb, FilePathView alpha, TextureDesc desc=TextureDesc::Unmipped)
 
static bool Register (const AssetNameAndTags &nameAndTags, const Color &rgb, FilePathView alpha, TextureDesc desc=TextureDesc::Unmipped)
 
static bool Register (const AssetNameAndTags &nameAndTags, const Emoji &emoji, TextureDesc desc=TextureDesc::Mipped)
 
static bool Register (const AssetNameAndTags &nameAndTags, const Icon &icon, int32 size, TextureDesc desc=TextureDesc::Unmipped)
 
static bool IsRegistered (AssetNameView name)
 指定したテクスチャアセットが登録されているかを返します。 More...
 
static bool Load (AssetNameView name)
 指定したテクスチャアセットを直ちにロードします。 More...
 
static void LoadAsync (AssetNameView name)
 指定したテクスチャアセットの非同期ロードを開始します。 More...
 
static void Wait (AssetNameView name)
 指定したテクスチャアセットのロードが完了するまで待機します。 More...
 
static bool IsReady (AssetNameView name)
 指定したテクスチャアセットのロード処理が(成否にかかわらず)完了しているかを返します。 More...
 
static void Release (AssetNameView name)
 指定したテクスチャアセットについて、ロードしたデータをメモリ上から削除します。登録状態は維持されます。 More...
 
static void ReleaseAll ()
 すべてのテクスチャアセットについて、ロードしたデータをメモリ上から削除します。登録状態は維持されます。 More...
 
static void Unregister (AssetNameView name)
 指定したテクスチャアセットについて、ロードしたデータをメモリ上から削除し、登録も解除します。 More...
 
static void UnregisterAll ()
 すべてのテクスチャアセットについて、ロードしたデータをメモリ上から削除し、登録も解除します。 More...
 
static HashTable< AssetName, AssetInfoEnumerate ()
 登録されているテクスチャアセットの情報一覧を取得します。 More...
 

Additional Inherited Members

- Public Types inherited from s3d::AssetHandle< Texture >
using AssetIDWrapperType = AssetIDWrapper< AssetHandle >
 アセット ID ラッパー型 More...
 
using IDType = typename AssetIDWrapperType::IDType
 アセット ID 型 More...
 
- Protected Member Functions inherited from s3d::Texture
SIV3D_NODISCARD_CXX20 Texture (Dynamic, const Size &size, const void *pData, uint32 stride, const TextureFormat &format, TextureDesc desc)
 
SIV3D_NODISCARD_CXX20 Texture (Dynamic, const Size &size, const ColorF &color, const TextureFormat &format, TextureDesc desc)
 
SIV3D_NODISCARD_CXX20 Texture (Render, const Size &size, const TextureFormat &format, HasDepth hasDepth)
 
SIV3D_NODISCARD_CXX20 Texture (Render, const Image &image, HasDepth hasDepth)
 
SIV3D_NODISCARD_CXX20 Texture (Render, const Grid< float > &image, HasDepth hasDepth)
 
SIV3D_NODISCARD_CXX20 Texture (Render, const Grid< Float2 > &image, HasDepth hasDepth)
 
SIV3D_NODISCARD_CXX20 Texture (Render, const Grid< Float4 > &image, HasDepth hasDepth)
 
SIV3D_NODISCARD_CXX20 Texture (MSRender, const Size &size, const TextureFormat &format, HasDepth hasDepth)
 
- Protected Attributes inherited from s3d::AssetHandle< Texture >
std::shared_ptr< AssetIDWrapperTypem_handle
 

Constructor & Destructor Documentation

◆ TextureAsset()

SIV3D_NODISCARD_CXX20 s3d::TextureAsset::TextureAsset ( AssetNameView  name)
explicit

Member Function Documentation

◆ Enumerate()

static HashTable<AssetName, AssetInfo> s3d::TextureAsset::Enumerate ( )
static

登録されているテクスチャアセットの情報一覧を取得します。

Returns
登録されているテクスチャアセットの情報一覧

◆ IsReady()

static bool s3d::TextureAsset::IsReady ( AssetNameView  name)
static

指定したテクスチャアセットのロード処理が(成否にかかわらず)完了しているかを返します。

Parameters
nameテクスチャアセット名
Returns
ロード処理が(成否にかかわらず)完了している場合 true, それ以外の場合は false

◆ IsRegistered()

static bool s3d::TextureAsset::IsRegistered ( AssetNameView  name)
static

指定したテクスチャアセットが登録されているかを返します。

Parameters
nameテクスチャアセット名
Returns
登録されている場合 true, それ以外の場合は false

◆ Load()

static bool s3d::TextureAsset::Load ( AssetNameView  name)
static

指定したテクスチャアセットを直ちにロードします。

Parameters
nameテクスチャアセット名
Remarks
この関数はロード処理が終了するまで制御を返しません。
Returns
ロードに成功した場合 true, それ以外の場合は false

◆ LoadAsync()

static void s3d::TextureAsset::LoadAsync ( AssetNameView  name)
static

指定したテクスチャアセットの非同期ロードを開始します。

Parameters
nameテクスチャアセット名

◆ Register() [1/11]

static bool s3d::TextureAsset::Register ( AssetNameView  name,
const Color rgb,
FilePathView  alpha,
TextureDesc  desc = TextureDesc::Unmipped 
)
static

◆ Register() [2/11]

static bool s3d::TextureAsset::Register ( AssetNameView  name,
const Emoji emoji,
TextureDesc  desc = TextureDesc::Mipped 
)
static

◆ Register() [3/11]

static bool s3d::TextureAsset::Register ( AssetNameView  name,
const Icon icon,
int32  size,
TextureDesc  desc = TextureDesc::Unmipped 
)
static

◆ Register() [4/11]

static bool s3d::TextureAsset::Register ( AssetNameView  name,
FilePathView  path,
TextureDesc  desc = TextureDesc::Unmipped 
)
static

テクスチャアセットを登録します。

Parameters
nameテクスチャアセットの登録名
path登録するテクスチャのファイルパス
descテクスチャの設定

◆ Register() [5/11]

static bool s3d::TextureAsset::Register ( AssetNameView  name,
FilePathView  rgb,
FilePathView  alpha,
TextureDesc  desc = TextureDesc::Unmipped 
)
static

◆ Register() [6/11]

static bool s3d::TextureAsset::Register ( AssetNameView  name,
std::unique_ptr< TextureAssetData > &&  data 
)
static

◆ Register() [7/11]

static bool s3d::TextureAsset::Register ( const AssetNameAndTags nameAndTags,
const Color rgb,
FilePathView  alpha,
TextureDesc  desc = TextureDesc::Unmipped 
)
static

◆ Register() [8/11]

static bool s3d::TextureAsset::Register ( const AssetNameAndTags nameAndTags,
const Emoji emoji,
TextureDesc  desc = TextureDesc::Mipped 
)
static

◆ Register() [9/11]

static bool s3d::TextureAsset::Register ( const AssetNameAndTags nameAndTags,
const Icon icon,
int32  size,
TextureDesc  desc = TextureDesc::Unmipped 
)
static

◆ Register() [10/11]

static bool s3d::TextureAsset::Register ( const AssetNameAndTags nameAndTags,
FilePathView  path,
TextureDesc  desc = TextureDesc::Unmipped 
)
static

◆ Register() [11/11]

static bool s3d::TextureAsset::Register ( const AssetNameAndTags nameAndTags,
FilePathView  rgb,
FilePathView  alpha,
TextureDesc  desc = TextureDesc::Unmipped 
)
static

◆ Release()

static void s3d::TextureAsset::Release ( AssetNameView  name)
static

指定したテクスチャアセットについて、ロードしたデータをメモリ上から削除します。登録状態は維持されます。

Parameters
nameテクスチャアセット名

◆ ReleaseAll()

static void s3d::TextureAsset::ReleaseAll ( )
static

すべてのテクスチャアセットについて、ロードしたデータをメモリ上から削除します。登録状態は維持されます。

◆ Unregister()

static void s3d::TextureAsset::Unregister ( AssetNameView  name)
static

指定したテクスチャアセットについて、ロードしたデータをメモリ上から削除し、登録も解除します。

Parameters
nameテクスチャアセット名

◆ UnregisterAll()

static void s3d::TextureAsset::UnregisterAll ( )
static

すべてのテクスチャアセットについて、ロードしたデータをメモリ上から削除し、登録も解除します。

◆ Wait()

static void s3d::TextureAsset::Wait ( AssetNameView  name)
static

指定したテクスチャアセットのロードが完了するまで待機します。

Parameters
nameテクスチャアセット名

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