bestdori-noteskin

Crates.iobestdori-noteskin
lib.rsbestdori-noteskin
version0.2.0
created_at2025-12-20 12:26:55.360375+00
updated_at2025-12-31 14:31:41.829512+00
descriptionBestdori noteskin 包的解包/打包与 FFI 支持
homepagehttps://github.com/bestdori-noteskin/bestdori-noteskin
repositoryhttps://github.com/bestdori-noteskin/bestdori-noteskin
max_upload_size
id1996449
size31,614
WindowsSov8 (WindowsSov8forUs)

documentation

https://github.com/bestdori-noteskin/bestdori-noteskin

README

bestdori-noteskin

Bestdori .noteskin 包的解包库、FFI、以及打包 CLI 工具。

功能

  • 解包:读取 .noteskin 自定义包(头含 NSPK + 版本 + 类型 + 数量,索引含名称/偏移/长度,数据为 PNG 字节),解码为 RgbaImage 组合。
  • FFI:导出 noteskin_decode(path, out_buf, out_len, out_written, err_buf, err_len),返回一次性打包的 RGBA 序列,错误写入 err_buf
  • 打包:根据素材目录与 manifest.toml 校验文件存在、PNG 头、重复键,生成 .noteskin。CLI 名称 bestdori-noteskin-packer

使用方法

Rust 解包

use bestdori_noteskin::decode_noteskin;

let bundle = decode_noteskin("skin00_rip.noteskin")?;
for img in bundle.images {
    println!("{}: {}x{}", img.key, img.image.width(), img.image.height());
}

C FFI 解包

// noteskin_decode(path, out_buf, out_len, out_written, err_buf, err_len)
// out_buf 需足够大;out_written 返回实际写入字节;错误消息写入 err_buf(英文)。
Commit count: 0

cargo fmt