Update 'main.go'
build lightwatch / build (push) Successful in 7m58s Details

pull/3/head
nathan 1 year ago
parent 3c212a5186
commit d80d062f02

@ -75,7 +75,7 @@ func listener(mqMessages chan mqtt.Message) {
//animator is a wrapping function for go routine that can receive an mq channel
func animator(tk *rgbmatrix.ToolKit, mqMessages chan mqtt.Message) {
//Playanimation comes from the toolkit, all it takes is an animation struct
tk.PlayAnimation(NewAnimation(image.Point{64, 32}, mqMessages))
tk.PlayAnimation(NewAnimation(image.Point{64, 64}, mqMessages))
}
@ -144,7 +144,7 @@ func NewAnimation(sz image.Point, mqMessages chan mqtt.Message) *Animation {
func appendImage(img string, a *Animation) {
baseImage, _ := b64.StdEncoding.DecodeString(img)
bigImage, _, _ := image.Decode(bytes.NewReader(baseImage))
a.image = append(a.image, imaging.Resize(bigImage, 32, 32, imaging.Lanczos))
a.image = append(a.image, imaging.Resize(bigImage, 64, 64, imaging.Lanczos))
}
// what happens each frame, at an interval of 50 milliseconds

Loading…
Cancel
Save