Update 'main.go'
All checks were successful
build lightwatch / build (push) Successful in 7m58s

This commit is contained in:
2023-10-19 22:13:36 +00:00
parent 3c212a5186
commit d80d062f02

View File

@@ -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