effects: image: make saving and minsize work (#433)

This commit is contained in:
redPanther
2017-04-14 07:58:34 +02:00
committed by GitHub
parent b65d811640
commit f6209174c3
4 changed files with 128 additions and 100 deletions

View File

@@ -2,8 +2,8 @@ import hyperion, time, datetime
# Get the parameters
showSeconds = bool(hyperion.args.get('show_seconds', True))
centerX = int(round(hyperion.imageWidth)/2)
centerY = int(round(float(hyperion.imageHeight)/2))
centerX = int(round(hyperion.imageWidth())/2)
centerY = int(round(float(hyperion.imageHeight())/2))
colorsSecond = bytearray([
0, 255,255,0,255,

View File

@@ -1,5 +1,8 @@
import hyperion, time, math
# set minimum image size - must be done asap
hyperion.imageMinSize(32,32)
# Get the parameters
rotationTime = float(hyperion.args.get('rotation-time', 3.0))
reverse = bool(hyperion.args.get('reverse', False))
@@ -9,8 +12,8 @@ centerY = float(hyperion.args.get('center_y', 0.5))
minStepTime = float(hyperion.latchTime)/1000.0
sleepTime = max(0.1, rotationTime) / 360
angle = 0
centerX = int(round(float(hyperion.imageWidth)*centerX))
centerY = int(round(float(hyperion.imageHeight)*centerY))
centerX = int(round(float(hyperion.imageWidth())*centerX))
centerY = int(round(float(hyperion.imageHeight())*centerY))
increment = -1 if reverse else 1
# adapt sleeptime to hardware