docs: update resources API docs
This commit is contained in:
25
docs/api/resources/textureimportsettings/clone.md
Normal file
25
docs/api/resources/textureimportsettings/clone.md
Normal file
@@ -0,0 +1,25 @@
|
||||
# TextureImportSettings::Clone
|
||||
|
||||
```cpp
|
||||
Core::UniqueRef<ImportSettings> Clone() const override;
|
||||
```
|
||||
|
||||
创建并返回一份当前设置的深拷贝。
|
||||
|
||||
**返回:** `Core::UniqueRef<ImportSettings>` - 新的 `TextureImportSettings` 克隆
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
TextureImportSettings settings;
|
||||
settings.SetTextureType(TextureType::Texture2D);
|
||||
|
||||
auto cloned = settings.Clone();
|
||||
// cloned 是独立的副本,修改不影响原对象
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [TextureImportSettings 总览](textureimportsettings.md) - 返回类总览
|
||||
@@ -0,0 +1,3 @@
|
||||
# TextureImportSettings::GetBorderColor
|
||||
|
||||
参见 [`SetBorderColor`](setbordercolor.md)
|
||||
@@ -0,0 +1,3 @@
|
||||
# TextureImportSettings::GetCompressionQuality
|
||||
|
||||
参见 [`SetCompressionQuality`](setcompressionquality.md)
|
||||
@@ -0,0 +1,3 @@
|
||||
# TextureImportSettings::GetFlipHorizontal
|
||||
|
||||
参见 [`SetFlipHorizontal`](setfliphhorizontal.md)
|
||||
@@ -0,0 +1,3 @@
|
||||
# TextureImportSettings::GetFlipVertical
|
||||
|
||||
参见 [`SetFlipVertical`](setflipvertical.md)
|
||||
@@ -0,0 +1,3 @@
|
||||
# TextureImportSettings::GetGenerateMipmaps
|
||||
|
||||
参见 [`SetGenerateMipmaps`](setgeneratemipmaps.md)
|
||||
@@ -0,0 +1,3 @@
|
||||
# TextureImportSettings::GetGenerateNormalMap
|
||||
|
||||
参见 [`SetGenerateNormalMap`](setgeneratenormalmap.md)
|
||||
@@ -0,0 +1,3 @@
|
||||
# TextureImportSettings::GetMaxAnisotropy
|
||||
|
||||
参见 [`SetMaxAnisotropy`](setmaxanisotropy.md)
|
||||
3
docs/api/resources/textureimportsettings/getmaxsize.md
Normal file
3
docs/api/resources/textureimportsettings/getmaxsize.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# TextureImportSettings::GetMaxSize
|
||||
|
||||
参见 [`SetMaxSize`](setmaxsize.md)
|
||||
@@ -0,0 +1,3 @@
|
||||
# TextureImportSettings::GetMipmapFilter
|
||||
|
||||
参见 [`SetMipmapFilter`](setmipmapfilter.md)
|
||||
@@ -0,0 +1,3 @@
|
||||
# TextureImportSettings::GetNormalMapStrength
|
||||
|
||||
参见 [`SetNormalMapStrength`](setnormalmapstrength.md)
|
||||
3
docs/api/resources/textureimportsettings/getsrgb.md
Normal file
3
docs/api/resources/textureimportsettings/getsrgb.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# TextureImportSettings::GetSRGB
|
||||
|
||||
参见 [`SetSRGB`](setsrgb.md)
|
||||
@@ -0,0 +1,3 @@
|
||||
# TextureImportSettings::GetTargetFormat
|
||||
|
||||
参见 [`SetTargetFormat`](settargetformat.md)
|
||||
@@ -0,0 +1,3 @@
|
||||
# TextureImportSettings::GetTextureType
|
||||
|
||||
参见 [`SetTextureType`](settexturetype.md)
|
||||
@@ -0,0 +1,3 @@
|
||||
# TextureImportSettings::GetUseHardwareCompression
|
||||
|
||||
参见 [`SetUseHardwareCompression`](setusehardwarecompression.md)
|
||||
28
docs/api/resources/textureimportsettings/loadfromjson.md
Normal file
28
docs/api/resources/textureimportsettings/loadfromjson.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# TextureImportSettings::LoadFromJSON
|
||||
|
||||
```cpp
|
||||
bool LoadFromJSON(const Containers::String& json) override;
|
||||
```
|
||||
|
||||
从 JSON 字符串加载导入设置。
|
||||
|
||||
**参数:**
|
||||
- `json` - JSON 格式的设置字符串
|
||||
|
||||
**返回:** `bool` - 加载是否成功
|
||||
|
||||
**注意:** 当前为 stub 实现,始终返回 `false`。
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
TextureImportSettings settings;
|
||||
bool success = settings.LoadFromJSON(R"({"textureType":1,"sRGB":true})");
|
||||
// 当前实现返回 false
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [TextureImportSettings 总览](textureimportsettings.md) - 返回类总览
|
||||
26
docs/api/resources/textureimportsettings/savetojson.md
Normal file
26
docs/api/resources/textureimportsettings/savetojson.md
Normal file
@@ -0,0 +1,26 @@
|
||||
# TextureImportSettings::SaveToJSON
|
||||
|
||||
```cpp
|
||||
Containers::String SaveToJSON() const override;
|
||||
```
|
||||
|
||||
将当前设置序列化为 JSON 字符串。
|
||||
|
||||
**返回:** `Containers::String` - JSON 格式的设置字符串
|
||||
|
||||
**注意:** 当前为 stub 实现,始终返回空字符串。
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
TextureImportSettings settings;
|
||||
settings.SetSRGB(true);
|
||||
Containers::String json = settings.SaveToJSON();
|
||||
// 当前实现返回空字符串
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [TextureImportSettings 总览](textureimportsettings.md) - 返回类总览
|
||||
27
docs/api/resources/textureimportsettings/setbordercolor.md
Normal file
27
docs/api/resources/textureimportsettings/setbordercolor.md
Normal file
@@ -0,0 +1,27 @@
|
||||
# TextureImportSettings::SetBorderColor / GetBorderColor
|
||||
|
||||
```cpp
|
||||
void SetBorderColor(const Math::Vector3& color);
|
||||
const Math::Vector3& GetBorderColor() const;
|
||||
```
|
||||
|
||||
设置或获取纹理边框颜色。
|
||||
|
||||
**参数:**
|
||||
- `color` - 边框颜色(RGB)
|
||||
|
||||
**返回:** `const Math::Vector3&` / `void`
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
TextureImportSettings settings;
|
||||
settings.SetBorderColor(Math::Vector3(1.0f, 0.0f, 0.0f)); // 红色边框
|
||||
const Math::Vector3& color = settings.GetBorderColor();
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [TextureImportSettings 总览](textureimportsettings.md) - 返回类总览
|
||||
@@ -0,0 +1,27 @@
|
||||
# TextureImportSettings::SetCompressionQuality / GetCompressionQuality
|
||||
|
||||
```cpp
|
||||
void SetCompressionQuality(CompressionQuality quality);
|
||||
CompressionQuality GetCompressionQuality() const;
|
||||
```
|
||||
|
||||
设置或获取纹理压缩质量级别。
|
||||
|
||||
**参数:**
|
||||
- `quality` - 压缩质量(`Low`、`Medium`、`High`、`Ultra`)
|
||||
|
||||
**返回:** `CompressionQuality` / `void`
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
TextureImportSettings settings;
|
||||
settings.SetCompressionQuality(CompressionQuality::High);
|
||||
CompressionQuality quality = settings.GetCompressionQuality(); // CompressionQuality::High
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [TextureImportSettings 总览](textureimportsettings.md) - 返回类总览
|
||||
@@ -0,0 +1,27 @@
|
||||
# TextureImportSettings::SetFlipHorizontal / GetFlipHorizontal
|
||||
|
||||
```cpp
|
||||
void SetFlipHorizontal(bool flip);
|
||||
bool GetFlipHorizontal() const;
|
||||
```
|
||||
|
||||
设置或获取是否在导入时水平翻转纹理。
|
||||
|
||||
**参数:**
|
||||
- `flip` - 是否水平翻转
|
||||
|
||||
**返回:** `bool` / `void`
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
TextureImportSettings settings;
|
||||
settings.SetFlipHorizontal(true);
|
||||
bool flip = settings.GetFlipHorizontal(); // true
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [TextureImportSettings 总览](textureimportsettings.md) - 返回类总览
|
||||
27
docs/api/resources/textureimportsettings/setflipvertical.md
Normal file
27
docs/api/resources/textureimportsettings/setflipvertical.md
Normal file
@@ -0,0 +1,27 @@
|
||||
# TextureImportSettings::SetFlipVertical / GetFlipVertical
|
||||
|
||||
```cpp
|
||||
void SetFlipVertical(bool flip);
|
||||
bool GetFlipVertical() const;
|
||||
```
|
||||
|
||||
设置或获取是否在导入时垂直翻转纹理。
|
||||
|
||||
**参数:**
|
||||
- `flip` - 是否垂直翻转
|
||||
|
||||
**返回:** `bool` / `void`
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
TextureImportSettings settings;
|
||||
settings.SetFlipVertical(true);
|
||||
bool flip = settings.GetFlipVertical(); // true
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [TextureImportSettings 总览](textureimportsettings.md) - 返回类总览
|
||||
@@ -0,0 +1,27 @@
|
||||
# TextureImportSettings::SetGenerateMipmaps / GetGenerateMipmaps
|
||||
|
||||
```cpp
|
||||
void SetGenerateMipmaps(bool generate);
|
||||
bool GetGenerateMipmaps() const;
|
||||
```
|
||||
|
||||
设置或获取是否生成 Mipmap。
|
||||
|
||||
**参数:**
|
||||
- `generate` - 是否生成 Mipmap
|
||||
|
||||
**返回:** `bool` / `void`
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
TextureImportSettings settings;
|
||||
settings.SetGenerateMipmaps(true);
|
||||
bool generate = settings.GetGenerateMipmaps(); // true
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [TextureImportSettings 总览](textureimportsettings.md) - 返回类总览
|
||||
@@ -0,0 +1,27 @@
|
||||
# TextureImportSettings::SetGenerateNormalMap / GetGenerateNormalMap
|
||||
|
||||
```cpp
|
||||
void SetGenerateNormalMap(bool generate);
|
||||
bool GetGenerateNormalMap() const;
|
||||
```
|
||||
|
||||
设置或获取是否在导入时生成法线贴图。
|
||||
|
||||
**参数:**
|
||||
- `generate` - 是否生成法线贴图
|
||||
|
||||
**返回:** `bool` / `void`
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
TextureImportSettings settings;
|
||||
settings.SetGenerateNormalMap(true);
|
||||
bool generate = settings.GetGenerateNormalMap(); // true
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [TextureImportSettings 总览](textureimportsettings.md) - 返回类总览
|
||||
27
docs/api/resources/textureimportsettings/setmaxanisotropy.md
Normal file
27
docs/api/resources/textureimportsettings/setmaxanisotropy.md
Normal file
@@ -0,0 +1,27 @@
|
||||
# TextureImportSettings::SetMaxAnisotropy / GetMaxAnisotropy
|
||||
|
||||
```cpp
|
||||
void SetMaxAnisotropy(Core::uint32 anisotropy);
|
||||
Core::uint32 GetMaxAnisotropy() const;
|
||||
```
|
||||
|
||||
设置或获取最大各向异性过滤级别。
|
||||
|
||||
**参数:**
|
||||
- `anisotropy` - 各向异性级别(通常为 1, 2, 4, 8, 16)
|
||||
|
||||
**返回:** `Core::uint32` / `void`
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
TextureImportSettings settings;
|
||||
settings.SetMaxAnisotropy(16);
|
||||
Core::uint32 anisotropy = settings.GetMaxAnisotropy(); // 16
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [TextureImportSettings 总览](textureimportsettings.md) - 返回类总览
|
||||
27
docs/api/resources/textureimportsettings/setmaxsize.md
Normal file
27
docs/api/resources/textureimportsettings/setmaxsize.md
Normal file
@@ -0,0 +1,27 @@
|
||||
# TextureImportSettings::SetMaxSize / GetMaxSize
|
||||
|
||||
```cpp
|
||||
void SetMaxSize(Core::uint32 size);
|
||||
Core::uint32 GetMaxSize() const;
|
||||
```
|
||||
|
||||
设置或获取最大纹理尺寸。纹理将被缩放以适应此尺寸。
|
||||
|
||||
**参数:**
|
||||
- `size` - 最大边长(像素)
|
||||
|
||||
**返回:** `Core::uint32` / `void`
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
TextureImportSettings settings;
|
||||
settings.SetMaxSize(2048);
|
||||
Core::uint32 size = settings.GetMaxSize(); // 2048
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [TextureImportSettings 总览](textureimportsettings.md) - 返回类总览
|
||||
27
docs/api/resources/textureimportsettings/setmipmapfilter.md
Normal file
27
docs/api/resources/textureimportsettings/setmipmapfilter.md
Normal file
@@ -0,0 +1,27 @@
|
||||
# TextureImportSettings::SetMipmapFilter / GetMipmapFilter
|
||||
|
||||
```cpp
|
||||
void SetMipmapFilter(MipmapFilter filter);
|
||||
MipmapFilter GetMipmapFilter() const;
|
||||
```
|
||||
|
||||
设置或获取 Mipmap 滤波算法。
|
||||
|
||||
**参数:**
|
||||
- `filter` - Mipmap 滤波器类型(`MipmapFilter::Box` 或 `MipmapFilter::Kaiser`)
|
||||
|
||||
**返回:** `MipmapFilter` / `void`
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
TextureImportSettings settings;
|
||||
settings.SetMipmapFilter(MipmapFilter::Kaiser);
|
||||
MipmapFilter filter = settings.GetMipmapFilter(); // MipmapFilter::Kaiser
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [TextureImportSettings 总览](textureimportsettings.md) - 返回类总览
|
||||
@@ -0,0 +1,27 @@
|
||||
# TextureImportSettings::SetNormalMapStrength / GetNormalMapStrength
|
||||
|
||||
```cpp
|
||||
void SetNormalMapStrength(float strength);
|
||||
float GetNormalMapStrength() const;
|
||||
```
|
||||
|
||||
设置或获取法线贴图强度。
|
||||
|
||||
**参数:**
|
||||
- `strength` - 法线贴图强度系数
|
||||
|
||||
**返回:** `float` / `void`
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
TextureImportSettings settings;
|
||||
settings.SetNormalMapStrength(2.0f);
|
||||
float strength = settings.GetNormalMapStrength(); // 2.0f
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [TextureImportSettings 总览](textureimportsettings.md) - 返回类总览
|
||||
27
docs/api/resources/textureimportsettings/setsrgb.md
Normal file
27
docs/api/resources/textureimportsettings/setsrgb.md
Normal file
@@ -0,0 +1,27 @@
|
||||
# TextureImportSettings::SetSRGB / GetSRGB
|
||||
|
||||
```cpp
|
||||
void SetSRGB(bool srgb);
|
||||
bool GetSRGB() const;
|
||||
```
|
||||
|
||||
设置或获取 sRGB 颜色空间标记。
|
||||
|
||||
**参数:**
|
||||
- `srgb` - 是否使用 sRGB 颜色空间
|
||||
|
||||
**返回:** `bool` / `void`
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
TextureImportSettings settings;
|
||||
settings.SetSRGB(true);
|
||||
bool srgb = settings.GetSRGB(); // true
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [TextureImportSettings 总览](textureimportsettings.md) - 返回类总览
|
||||
28
docs/api/resources/textureimportsettings/settargetformat.md
Normal file
28
docs/api/resources/textureimportsettings/settargetformat.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# TextureImportSettings::SetTargetFormat / GetTargetFormat
|
||||
|
||||
```cpp
|
||||
void SetTargetFormat(TextureFormat format);
|
||||
TextureFormat GetTargetFormat() const;
|
||||
```
|
||||
|
||||
设置或获取目标纹理格式。
|
||||
|
||||
**参数:**
|
||||
- `format` - 目标格式(参见 `TextureFormat` 枚举)
|
||||
|
||||
**返回:** `TextureFormat` / `void`
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
TextureImportSettings settings;
|
||||
settings.SetTargetFormat(TextureFormat::RGBA8);
|
||||
TextureFormat format = settings.GetTargetFormat(); // TextureFormat::RGBA8
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [TextureImportSettings 总览](textureimportsettings.md) - 返回类总览
|
||||
- [Texture](../texture/texture.md) - 纹理格式定义
|
||||
28
docs/api/resources/textureimportsettings/settexturetype.md
Normal file
28
docs/api/resources/textureimportsettings/settexturetype.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# TextureImportSettings::SetTextureType / GetTextureType
|
||||
|
||||
```cpp
|
||||
void SetTextureType(TextureType type);
|
||||
TextureType GetTextureType() const;
|
||||
```
|
||||
|
||||
设置或获取纹理类型。
|
||||
|
||||
**参数:**
|
||||
- `type` - 纹理类型(参见 `TextureType` 枚举)
|
||||
|
||||
**返回:** `TextureType` / `void`
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
TextureImportSettings settings;
|
||||
settings.SetTextureType(TextureType::Texture2D);
|
||||
TextureType type = settings.GetTextureType(); // TextureType::Texture2D
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [TextureImportSettings 总览](textureimportsettings.md) - 返回类总览
|
||||
- [Texture](../texture/texture.md) - 纹理类型定义
|
||||
@@ -0,0 +1,27 @@
|
||||
# TextureImportSettings::SetUseHardwareCompression / GetUseHardwareCompression
|
||||
|
||||
```cpp
|
||||
void SetUseHardwareCompression(bool use);
|
||||
bool GetUseHardwareCompression() const;
|
||||
```
|
||||
|
||||
设置或获取是否使用硬件压缩(GPU 压缩格式)。
|
||||
|
||||
**参数:**
|
||||
- `use` - 是否使用硬件压缩
|
||||
|
||||
**返回:** `bool` / `void`
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
TextureImportSettings settings;
|
||||
settings.SetUseHardwareCompression(true);
|
||||
bool use = settings.GetUseHardwareCompression(); // true
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [TextureImportSettings 总览](textureimportsettings.md) - 返回类总览
|
||||
@@ -0,0 +1,101 @@
|
||||
# TextureImportSettings
|
||||
|
||||
**命名空间**: `XCEngine::Resources`
|
||||
|
||||
**类型**: `class`
|
||||
|
||||
**继承**: `ImportSettings`
|
||||
|
||||
**描述**: 纹理资源导入设置类,配置纹理导入时的各种参数选项。
|
||||
|
||||
## 概述
|
||||
|
||||
`TextureImportSettings` 继承自 `ImportSettings`,提供了纹理资源导入时的完整配置选项。包括纹理类型、目标格式、Mipmap 生成、压缩质量、各向异性、sRGB 转换、翻转操作、法线图生成等功能。
|
||||
|
||||
## 公共方法
|
||||
|
||||
| 方法 | 描述 |
|
||||
|------|------|
|
||||
| [`Clone`](clone.md) | 克隆一份导入设置 |
|
||||
| [`LoadFromJSON`](loadfromjson.md) | 从 JSON 加载设置 |
|
||||
| [`SaveToJSON`](savetojson.md) | 保存设置到 JSON |
|
||||
| [`SetTextureType`](settexturetype.md) | 设置纹理类型 |
|
||||
| [`GetTextureType`](gettexturetype.md) | 获取纹理类型 |
|
||||
| [`SetTargetFormat`](settargetformat.md) | 设置目标格式 |
|
||||
| [`GetTargetFormat`](gettargetformat.md) | 获取目标格式 |
|
||||
| [`SetGenerateMipmaps`](setgeneratemipmaps.md) | 设置是否生成 Mipmap |
|
||||
| [`GetGenerateMipmaps`](getgeneratemipmaps.md) | 获取是否生成 Mipmap |
|
||||
| [`SetMipmapFilter`](setmipmapfilter.md) | 设置 Mipmap 滤波器 |
|
||||
| [`GetMipmapFilter`](getmipmapfilter.md) | 获取 Mipmap 滤波器 |
|
||||
| [`SetMaxAnisotropy`](setmaxanisotropy.md) | 设置最大各向异性级别 |
|
||||
| [`GetMaxAnisotropy`](getmaxanisotropy.md) | 获取最大各向异性级别 |
|
||||
| [`SetSRGB`](setsrgb.md) | 设置是否 sRGB |
|
||||
| [`GetSRGB`](getsrgb.md) | 获取 sRGB 设置 |
|
||||
| [`SetFlipVertical`](setflipvertical.md) | 设置是否垂直翻转 |
|
||||
| [`GetFlipVertical`](getflipvertical.md) | 获取垂直翻转设置 |
|
||||
| [`SetFlipHorizontal`](setfliphhorizontal.md) | 设置是否水平翻转 |
|
||||
| [`GetFlipHorizontal`](getfliphhorizontal.md) | 获取水平翻转设置 |
|
||||
| [`SetBorderColor`](setbordercolor.md) | 设置边框颜色 |
|
||||
| [`GetBorderColor`](getbordercolor.md) | 获取边框颜色 |
|
||||
| [`SetCompressionQuality`](setcompressionquality.md) | 设置压缩质量 |
|
||||
| [`GetCompressionQuality`](getcompressionquality.md) | 获取压缩质量 |
|
||||
| [`SetUseHardwareCompression`](setusehardwarecompression.md) | 设置是否使用硬件压缩 |
|
||||
| [`GetUseHardwareCompression`](getusehardwarecompression.md) | 获取硬件压缩设置 |
|
||||
| [`SetMaxSize`](setmaxsize.md) | 设置最大纹理尺寸 |
|
||||
| [`GetMaxSize`](getmaxsize.md) | 获取最大纹理尺寸 |
|
||||
| [`SetGenerateNormalMap`](setgeneratenormalmap.md) | 设置是否生成法线贴图 |
|
||||
| [`GetGenerateNormalMap`](getgeneratenormalmap.md) | 获取法线贴图生成设置 |
|
||||
| [`SetNormalMapStrength`](setnormalmapstrength.md) | 设置法线贴图强度 |
|
||||
| [`GetNormalMapStrength`](getnormalmapstrength.md) | 获取法线贴图强度 |
|
||||
|
||||
## 枚举类型
|
||||
|
||||
### MipmapFilter
|
||||
|
||||
Mipmap 滤波算法。
|
||||
|
||||
| 值 | 描述 |
|
||||
|----|------|
|
||||
| `Box` | Box 滤波器 |
|
||||
| `Kaiser` | Kaiser 滤波器 |
|
||||
|
||||
### CompressionQuality
|
||||
|
||||
纹理压缩质量级别。
|
||||
|
||||
| 值 | 描述 |
|
||||
|----|------|
|
||||
| `Low` | 低质量压缩 |
|
||||
| `Medium` | 中等质量压缩 |
|
||||
| `High` | 高质量压缩 |
|
||||
| `Ultra` | 超高质量压缩 |
|
||||
|
||||
## 使用示例
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Resources/TextureImportSettings.h>
|
||||
|
||||
TextureImportSettings settings;
|
||||
settings.SetTextureType(TextureType::Texture2D);
|
||||
settings.SetGenerateMipmaps(true);
|
||||
settings.SetMipmapFilter(MipmapFilter::Kaiser);
|
||||
settings.SetSRGB(true);
|
||||
settings.SetCompressionQuality(CompressionQuality::High);
|
||||
settings.SetMaxAnisotropy(16);
|
||||
settings.SetMaxSize(2048);
|
||||
settings.SetGenerateNormalMap(true);
|
||||
settings.SetNormalMapStrength(1.0f);
|
||||
|
||||
// 保存设置
|
||||
Containers::String json = settings.SaveToJSON();
|
||||
|
||||
// 克隆设置
|
||||
auto cloned = settings.Clone();
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [ImportSettings](../importsettings/importsettings.md) - 导入设置基类
|
||||
- [Texture](../texture/texture.md) - 纹理资源
|
||||
- [ResourceManager](../resourcemanager/resourcemanager.md) - 资源管理器
|
||||
- [Resources 总览](../resources.md) - 返回模块总览
|
||||
Reference in New Issue
Block a user