making moves
All checks were successful
build rgb-board / build (push) Successful in 2m24s

This commit is contained in:
2024-02-15 22:42:18 +00:00
parent 89ad771eab
commit 476ed823bc
6 changed files with 191 additions and 151 deletions

23
animateDoorbell.go Normal file
View File

@@ -0,0 +1,23 @@
package main
import (
"bytes"
b64 "encoding/base64"
"image"
"github.com/disintegration/imaging"
)
type Doorbell struct {
image image.Image
}
func (a *Animation) clearDoorbell() {
var door Doorbell
a.doorbell = door
}
func loadImage(imgType string, img string, a *Animation) {
baseImage, _ := b64.StdEncoding.DecodeString(img)
bigImage, _, _ := image.Decode(bytes.NewReader(baseImage))
a.doorbell.image = imaging.Resize(bigImage, 64, 64, imaging.Lanczos)
}