|
| std::vector< std::string > | GetSupportedExtensions () const override |
| | The extensions it handles, e.g. {".png", ".jpg", ".bmp"}.
|
| std::string | GetImporterName () const override |
| | A name for logs.
|
| ImportResult | Import (const std::string &sourcePath, const std::string &cachePath) override |
| | Imports the source file into the cache.
|
| ImportResult | ImportWithFormat (const std::string &sourcePath, const std::string &cachePath, TextureFormat format) |
| | Imports with the given stored format.
|
| virtual | ~IAssetImporter ()=default |
| virtual bool | NeedsReimport (const std::string &sourcePath, const std::string &cachePath) const |
| | Whether the asset needs importing again.
|
|
| 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, uint32_t sourceWidth=0, uint32_t sourceHeight=0) |
| static bool | ReadTexFile (const std::string &path, TexData &outData) |
| static bool | ReadSourceSize (const std::string &texPath, int &outWidth, int &outHeight) |
| | The size of the image a compiled texture was made from.
|
| static std::vector< uint8_t > | ConvertToRGBA (const TexData &data) |
| static bool | HasAlphaChannel (const uint8_t *rgbaData, size_t pixelCount) |
| | True if any pixel in the RGBA buffer has alpha < 255.
|
| 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) |
| | Finds sprite frames in an RGBA image by looking for regions separated by transparent pixels.
|
| static void | CarryFrameIds (const std::vector< AtlasFrame > &previous, std::vector< AtlasFrame > &frames, int32_t &nextId) |
| | Gives re-sliced frames the ids of the frames they replace, so references to a frame survive a new grid size or a fresh auto-detect.
|
| static std::vector< SubAssetInfo > | GenerateFrameSubAssets (const std::string &parentGuid, int texWidth, int texHeight, const SpriteSettings &settings) |
| | One sub-asset per sprite frame that settings slices from the texture parentGuid.
|
| static const SpriteFrameData * | GetFrameData (const std::string &frameGuid) |
| | The frame registered as frameGuid, or nullptr.
|
| static void | RegisterFrameData (const std::string &frameGuid, const SpriteFrameData &data) |
| static void | ClearFrameData () |
| | Clears all registered frames. Called when the asset cache is rebuilt.
|
| static void | SetFrameNineSlice (const std::string &frameGuid, bool has, uint16_t left, uint16_t right, uint16_t top, uint16_t bottom) |
| | Sets a frame's own 9-slice borders, measured inside the frame in the image's pixels.
|
| static bool | HasFrameListChunk (const std::string &texPath) |
| | True if the .tex file at texPath has a FrameList metadata chunk.
|
| void DekiEditor::TextureImporter::CarryFrameIds |
( |
const std::vector< AtlasFrame > & | previous, |
|
|
std::vector< AtlasFrame > & | frames, |
|
|
int32_t & | nextId ) |
|
static |
Gives re-sliced frames the ids of the frames they replace, so references to a frame survive a new grid size or a fresh auto-detect.
A frame with exactly the rect of an earlier one takes its id; next, one that overlaps an earlier one by at least half of their union does. The rest get new ids from nextId, which never hands out an id twice, so a reference to a deleted frame never lands on a new one. A previous id of -1 means the frame's position.