Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/blob1807/odin-aseprite
Handler for Aseprite's .ase/.aseprite, .aseprite-extension & extended .gpl files writen in Odin.
https://github.com/blob1807/odin-aseprite
Last synced: 18 days ago
JSON representation
Handler for Aseprite's .ase/.aseprite, .aseprite-extension & extended .gpl files writen in Odin.
- Host: GitHub
- URL: https://github.com/blob1807/odin-aseprite
- Owner: blob1807
- License: bsd-3-clause
- Created: 2024-03-07T02:24:02.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-11-24T04:43:40.000Z (20 days ago)
- Last Synced: 2024-11-24T05:25:07.411Z (20 days ago)
- Language: Odin
- Homepage:
- Size: 6.65 MB
- Stars: 17
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-odin - Aseprite loader - extension & extended .gpl files writen in Odin | [BSD 3-Clause](https://github.com/blob1807/odin-aseprite/blob/main/LICENSE) | Gamedev, 2D, Format (Libraries / Gamedev)
- awesome-odin - Aseprite loader - extension & extended .gpl files writen in Odin | [BSD 3-Clause](https://github.com/blob1807/odin-aseprite/blob/main/LICENSE) | Gamedev, 2D, Format (Libraries / Gamedev)
README
# Odin Aseprite
Handler for Aseprite's `.ase`/`.aseprite`, `.aseprite-extension` & extended `.gpl` files writen in Odin.* `.\`: Main un/marshaler for `.ase`
* `.\utils`: Creates Images & Animations from Documents
* `.\raw`: un/marshals `.ase` exactly as given by the spec
* `.\gpl`: extended & normal .gpl
* `.\extensions`: .aseprite-extension. WIP
* `.\tests`: test files## Examples
### aseprite
```odin
package mainimport "core:fmt"
import ase "odin-aseprite"main :: proc() {
data := #load("geralt.aseprite")doc: ase.Document
defer ase.destroy_doc(&doc)umerr := ase.unmarshal(data[:], &doc)
if umerr != nil {
fmt.println(umerr)
return
}buf: [dynamic]byte
defer delete(buf)written, merr := ase.marshal(&buf, &doc)
if merr != nil {
fmt.println(merr)
return
}
}
```### utils
```odin
package mainimport "core:fmt"
import ase "odin-aseprite"
import "odin-aseprite/utils"main :: proc() {
data := #load("geralt.aseprite")doc: ase.Document
defer ase.destroy_doc(&doc)umerr := ase.unmarshal(data[:], &doc)
if umerr != nil {
fmt.println(umerr)
return
}imgs, imgs_err := utils.get_all_images(&doc)
defer utils.destroy(imgs)if imgs_err != nil {
fmt.println(imgs_err)
return
}
}
```### gpl
```odin
package mainimport "core:fmt"
import "odin-aseprite/gpl"main :: proc() {
data := #load("geralt.gpl")palette, err := gpl.parse(data[:])
if err != nil {
fmt.println(err)
return
}
defer destroy_gpl(&palette)buf, err2 := gpl.to_bytes(palette)
if err2 != nil {
fmt.println(err2)
return
}
defer delete(buf)
}
```## Warnings
ICC Colour Profiles aren't supported. The raw data will be saved to doc.## Errors
Any errors please make an issue or DM them to me, `blob1807`, on the [Odin Discord](https://discord.com/invite/sVBPHEv).
If you DM me please include the offending file/s.
If you want to test your own files for errors. Add them to a new folder in `./tests` and run `odin test .` in the `./tests` directory.