summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/Benau/tgsconverter/libtgsconverter/png.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/Benau/tgsconverter/libtgsconverter/png.go')
-rw-r--r--vendor/github.com/Benau/tgsconverter/libtgsconverter/png.go30
1 files changed, 30 insertions, 0 deletions
diff --git a/vendor/github.com/Benau/tgsconverter/libtgsconverter/png.go b/vendor/github.com/Benau/tgsconverter/libtgsconverter/png.go
new file mode 100644
index 00000000..cf492ea4
--- /dev/null
+++ b/vendor/github.com/Benau/tgsconverter/libtgsconverter/png.go
@@ -0,0 +1,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
+}