Use GIF files for effects (#477)

* Add new Effects

* add schema file for gif based effects

* add background color to snake effect

* add background color to snake effect

* Update schema file for snake effect

* Add function getImage

* add function getImage

* optimize lights.gif

* Add format to GIF schema
This commit is contained in:
Paulchen Panther
2017-10-12 12:00:32 +02:00
committed by brindosch
parent 838008568a
commit 9cc6c75633
11 changed files with 179 additions and 7 deletions

16
effects/gif.py Normal file
View File

@@ -0,0 +1,16 @@
import os, hyperion, time
# Get the parameters
imageFile = hyperion.args.get('image')
framesPerSecond = float(hyperion.args.get('fps', 25))
reverse = bool(hyperion.args.get('reverse', False))
sleepTime = 1./framesPerSecond
if imageFile:
imageList = list(reversed(hyperion.getImage(imageFile))) if reverse else hyperion.getImage(imageFile)
# Start the write data loop
while not hyperion.abort() and imageList:
for image in imageList:
hyperion.setImage(image.imageWidth, image.imageHeight, image.imageData)
time.sleep(sleepTime)