|
Deki 1.3.0
Modular C++ 2D engine for embedded displays and desktop
|
#include <TextureImporter.h>
Inherits DekiEditor::IAssetImporter.
Public Member Functions | |
| std::vector< std::string > | GetSupportedExtensions () const override |
| std::string | GetImporterName () const override |
| ImportResult | Import (const std::string &sourcePath, const std::string &cachePath) override |
| ImportResult | ImportWithFormat (const std::string &sourcePath, const std::string &cachePath, TextureFormat format) |
| Public Member Functions inherited from DekiEditor::IAssetImporter | |
| virtual | ~IAssetImporter ()=default |
| virtual bool | NeedsReimport (const std::string &sourcePath, const std::string &cachePath) const |
Static Public Member Functions | |
| static bool | WriteTexFile (const std::string &path, const uint8_t *rgbaData, uint32_t width, uint32_t height, TextureFormat format=TextureFormat::RGB565A8, const SpriteSettings *spriteSettings=nullptr, const std::vector< SubAssetInfo > *frameSubAssets=nullptr, const ChromaKeySettings *chromaKey=nullptr) |
| static bool | ReadTexFile (const std::string &path, TexData &outData) |
| static std::vector< uint8_t > | ConvertToRGBA (const TexData &data) |
| static bool | HasAlphaChannel (const uint8_t *rgbaData, size_t pixelCount) |
| static std::vector< AtlasFrame > | AutoDetectFrames (const uint8_t *rgbaData, uint32_t width, uint32_t height, uint8_t alphaThreshold=10, int minWidth=1, int minHeight=1) |
| Automatically detect sprite frames from texture by analyzing transparent regions. | |
| static std::vector< SubAssetInfo > | GenerateFrameSubAssets (const std::string &parentGuid, int texWidth, int texHeight, const SpriteSettings &settings) |
| Generate sprite frame sub-assets from sprite settings. | |
| static const SpriteFrameData * | GetFrameData (const std::string &frameGuid) |
| Get sprite frame data by frame GUID. | |
| static void | RegisterFrameData (const std::string &frameGuid, const SpriteFrameData &data) |
| Register sprite frame data for a frame GUID. | |
| static void | ClearFrameData () |
| Clear all registered frame data (called when rebuilding asset cache). | |
| static bool | HasFrameListChunk (const std::string &texPath) |
| Check if a .tex file contains a FrameList metadata chunk. | |
|
inlineoverridevirtual |
Implements DekiEditor::IAssetImporter.
|
inlineoverridevirtual |
Implements DekiEditor::IAssetImporter.
|
overridevirtual |
Implements DekiEditor::IAssetImporter.
| ImportResult DekiEditor::TextureImporter::ImportWithFormat | ( | const std::string & | sourcePath, |
| const std::string & | cachePath, | ||
| TextureFormat | format ) |
|
static |
|
static |
|
static |
|
static |
|
static |
Automatically detect sprite frames from texture by analyzing transparent regions.
| rgbaData | RGBA pixel data (4 bytes per pixel) |
| width | Texture width |
| height | Texture height |
| alphaThreshold | Alpha value below which pixels are considered transparent (0-255) |
| minWidth | Minimum frame width to detect (ignore smaller regions) |
| minHeight | Minimum frame height to detect (ignore smaller regions) |
|
static |
Generate sprite frame sub-assets from sprite settings.
| parentGuid | Parent texture asset GUID |
| texWidth | Texture width in pixels |
| texHeight | Texture height in pixels |
| settings | Sprite slicing settings |
|
static |
Get sprite frame data by frame GUID.
| frameGuid | Frame GUID |
|
static |
Register sprite frame data for a frame GUID.
| frameGuid | Frame GUID |
| data | Frame coordinate data |
|
static |
Clear all registered frame data (called when rebuilding asset cache).
|
static |
Check if a .tex file contains a FrameList metadata chunk.
| texPath | Path to the .tex file |