Raymonf
50f50ac0ab
lol |
||
---|---|---|
_cmd/bulk-bin | ||
cmd/cory-bin | ||
render_test | ||
renderer | ||
utils | ||
.gitignore | ||
Makefile | ||
animation.go | ||
const.go | ||
decode.go | ||
frame.go | ||
gawi.go | ||
go.mod | ||
go.sum | ||
image.go | ||
nori.go | ||
palette.go | ||
plane.go | ||
reader.go | ||
readme.md | ||
render.go | ||
render_test.go | ||
server.Dockerfile |
readme.md
nri file reader
about
common/nori provides structs and decoders for nori file
usage:
import (
"log"
"git.tuxpa.in/a/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.RenderAnimationsApng(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
get a zip file of animations from a nori file
usage: ./cory -d -f=filename.nri -o=output.zip
optionally, use webserver
start: ./cory -serve
example with curl: curl -X POST --data-binary "@filename.nri" localhost:3333/animations --output output.zip
building cory
make cory
docker
oh yeah there's also a docker image for cory lol
make docker
and to run server
make server-run