summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/Benau/tgsconverter/libtgsconverter/png.go
blob: cf492ea4b795cb0ed3c659d414db43da012be6f7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package libtgsconverter

import "bytes"
import "image"
import "image/png"

type topng struct {
	result []byte
}

func(to_png *topng) init(w uint, h uint, options ConverterOptions) {
}

func(to_png *topng) SupportsAnimation() bool {
	return false
}

func (to_png *topng) AddFrame(image *image.RGBA, fps uint) error {
	var data []byte
	w := bytes.NewBuffer(data)
	if err := png.Encode(w, image); err != nil {
		return err
	}
	to_png.result = w.Bytes()
	return nil
}

func (to_png *topng) Result() []byte {
	return to_png.result
}