|
|
@ -127,17 +127,18 @@ func NewAnimation(sz image.Point, mqMessages chan mqtt.Message) *Animation {
|
|
|
|
log.Fatal(err)
|
|
|
|
log.Fatal(err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
rawMario, _, err = image.Decode(reader)
|
|
|
|
rawMario, _, err = image.Decode(reader)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
log.Fatal(err)
|
|
|
|
|
|
|
|
}
|
|
|
|
//marioDown := imaging.FlipH(imaging.Resize(rawMario, 16, 16, imaging.Lanczos))
|
|
|
|
//marioDown := imaging.FlipH(imaging.Resize(rawMario, 16, 16, imaging.Lanczos))
|
|
|
|
marioDown := imaging.Resize(rawMario, 16, 16, imaging.Lanczos)
|
|
|
|
marioDown := imaging.Resize(rawMario, 16, 16, imaging.Lanczos)
|
|
|
|
imageMap["marioDown"] = marioDown
|
|
|
|
imageMap["marioDown"] = marioDown
|
|
|
|
imageSlice := []image.Image{marioUp, marioDown}
|
|
|
|
|
|
|
|
return &Animation{
|
|
|
|
return &Animation{
|
|
|
|
ctx: gg.NewContext(sz.X, sz.Y),
|
|
|
|
ctx: gg.NewContext(sz.X, sz.Y),
|
|
|
|
dir: image.Point{1, 1},
|
|
|
|
dir: image.Point{1, 1},
|
|
|
|
height: 8,
|
|
|
|
height: 8,
|
|
|
|
width: 8,
|
|
|
|
width: 8,
|
|
|
|
stroke: 8,
|
|
|
|
stroke: 8,
|
|
|
|
image: imageSlice,
|
|
|
|
|
|
|
|
images: imageMap,
|
|
|
|
images: imageMap,
|
|
|
|
updown: "marioUp",
|
|
|
|
updown: "marioUp",
|
|
|
|
mqmsg: mqMessages,
|
|
|
|
mqmsg: mqMessages,
|
|
|
|