ToolKit: transform function

This commit is contained in:
Máximo Cuadros
2016-10-24 02:43:31 +02:00
parent 53fa87a5d3
commit 8b18dc26f8
2 changed files with 27 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ import (
"os"
"time"
"github.com/disintegration/imaging"
"github.com/mcuadros/go-rpi-rgb-led-matrix"
)
@@ -13,6 +14,7 @@ var (
chain = flag.Int("led-chain", 2, "number of displays daisy-chained")
brightness = flag.Int("brightness", 100, "brightness (0-100)")
image = flag.String("image", "", "image path")
rotate = flag.Int("rotate", 0, "rotate angle, 90, 180, 270")
)
func main() {
@@ -30,6 +32,15 @@ func main() {
tk := rgbmatrix.NewToolKit(m)
defer tk.Close()
switch *rotate {
case 90:
tk.Transform = imaging.Rotate90
case 180:
tk.Transform = imaging.Rotate180
case 270:
tk.Transform = imaging.Rotate270
}
close, err := tk.PlayGIF(f)
fatal(err)