update readme

This commit is contained in:
a 2022-03-25 17:27:42 -05:00
parent ac8a79db87
commit 18a0a84b99
2 changed files with 26 additions and 2 deletions

View File

@ -57,12 +57,12 @@ func dump(filename string, output string) {
}
out := new(bytes.Buffer)
printIf("rendering %d animation(s)\n", n.AnimationCount)
frames, err := nori.RenderAnimations(n)
animations, err := nori.RenderAnimations(n)
if err != nil {
log.Panicln("animation: %s", err)
}
printIf("saving to %s \n", output)
if err := utils.ZipApngs(out, frames); err != nil {
if err := utils.ZipApngs(out, animations); err != nil {
log.Panicln("zipping: %s", err)
}
printIf("done in %v \n", time.Now().Sub(start))

View File

@ -4,6 +4,30 @@
common/nori provides structs and decoders for nori file
usage:
```
import (
"log"
"git.tuxpa.in/a/gotagonist/common/nori"
)
func main() {
n, err := nori.FromFile(filename)
if err != nil {
log.Panicln("decode: %s", err)
}
// uses apng encoder/decoder from https://gitlab.com/gfxlabs/gfximg
animations, err := n.RenderAnimations(n)
if err != nil {
log.Panicln("render: %s", err)
}
// each animation has slice of frames
// each frame contains an image.Image, if another format is needed
// internally they are stored as &image.NRGBA64{}
log.Println(animations[0].Frames[])
}
```
## cory
cmd/cory is command line util for working with nori files