20 lines
409 B
Go
20 lines
409 B
Go
package nori
|
|
|
|
import "gitlab.com/gfxlabs/gfximg/apng"
|
|
|
|
func (n *Nori) ExportAnimation() *apng.APNG {
|
|
g := n.Gawi
|
|
a := &apng.APNG{
|
|
Frames: make([]apng.Frame, 0, len(g.Images)),
|
|
}
|
|
for i := 0; i < len(g.Images); i++ {
|
|
fr := apng.Frame{
|
|
Image: g.Images[i].Frame,
|
|
DelayNumerator: uint16(g.Images[i].Delay),
|
|
DelayDenominator: 1000,
|
|
}
|
|
a.Frames = append(a.Frames, fr)
|
|
}
|
|
return a
|
|
}
|