def stripe_rl(y): global height, width, imageData color = randomColor() for x in range(width-1, -1, -1): setPixel(x,y,color) hyperion.setImage(width, height, imageData) time.sleep(sleepTime)
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 imageList = [] if imageFile: imageList = [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)
for r in tr: r['x'], r['data'], c = r['exec'].getdata() if c: if randomise: col = (random.uniform(0.0, 1.0),1,1) else: col = colorsys.rgb_to_hsv(color[0]/255.0, color[1]/255.0, color[2]/255.0) r['exec'].start( random.randint(0, iWidth), random.randint(0, iHeight), random.uniform(0.2, 0.8), col, random.randint(min_len, max_len), iHeight ) for y in range(0, iHeight): for x in range(0, iWidth): for r in tr: if x == r['x']: led = bytearray(r['data'][y]) break led = bytearray((0,0,0)) ledData += led hyperion.setImage(iWidth,iHeight,ledData) time.sleep(sleepTime)
import hyperion, time # Get the parameters imageData = hyperion.args.get('url') if hyperion.args.get('imageSource', "") == "url" else hyperion.args.get('file') framesPerSecond = float(hyperion.args.get('fps', 25)) reverse = bool(hyperion.args.get('reverse', False)) cropLeft = int(hyperion.args.get('cropLeft', 0)) cropTop = int(hyperion.args.get('cropTop', 0)) cropRight = int(hyperion.args.get('cropRight', 0)) cropBottom = int(hyperion.args.get('cropBottom', 0)) grayscale = bool(hyperion.args.get('grayscale', False)) sleepTime = 1./framesPerSecond imageFrameList = [] if imageData: if reverse: imageFrameList = reversed(hyperion.getImage(imageData, cropLeft, cropTop, cropRight, cropBottom, grayscale)) else: imageFrameList = hyperion.getImage(imageData, cropLeft, cropTop, cropRight, cropBottom, grayscale) # Start the write data loop while not hyperion.abort() and imageFrameList: for image in imageFrameList: if not hyperion.abort(): hyperion.setImage(image["imageWidth"], image["imageHeight"], image["imageData"]) time.sleep(sleepTime)
# Start the write data loop for i in range(6): if hyperion.abort(): off = False break if i % 2: hyperion.setColor(alarmColor[0], alarmColor[1], alarmColor[2]) else: hyperion.setColor(0, 0, 0) time.sleep(sleepTime) for y in range(height,0,-1): if hyperion.abort(): off = False break for x in range(width): setPixel(x, y-1, alarmColor) hyperion.setImage(width, height, imageData) time.sleep(sleepTime) time.sleep(1) for y in range(height): for x in range(width): setPixel(x, y, postColor) hyperion.setImage(width, height, imageData) time.sleep(2) if off and not hyperion.abort(): subprocess.call("halt")
imageData[0] = color[0] imageData[1] = color[1] imageData[2] = color[2] # Calculate the sleep time and rotation increment increment = 1 sleepTime = 1.0 / (speed * width) while sleepTime < 0.05: increment *= 2 sleepTime *= 2 # Start the write data loop position = 0 direction = 1 while not hyperion.abort(): hyperion.setImage(width, 1, imageData) # Move data into next state for i in range(increment): position += direction if position == -1: position = 1 direction = 1 elif position == width: position = width-2 direction = -1 # Fade the old data for j in range(width): imageData[3*j] = int(fadeFactor * imageData[3*j]) imageData[3*j+1] = int(fadeFactor * imageData[3*j+1])
# Start the write data loop while not hyperion.abort(): ledData = bytearray() for r in tr: r['x'], r['data'], c = r['exec'].getdata() if c: if randomise: col = (random.uniform(0.1, 1.0), random.uniform(0.1, 1.0), random.uniform(0.1, 1.0)) else: col = colorsys.rgb_to_hsv(color[0] / 255.0, color[1] / 255.0, color[2] / 255.0) r['exec'].start(random.randint(0, whidth), random.randint(0, height), random.uniform(0.2, 0.8), col, random.randint(min_len, max_len), height) for y in range(0, height): for x in range(0, whidth): for r in tr: if x == r['x']: led = bytearray(r['data'][y]) break led = bytearray((0, 0, 0)) ledData += led hyperion.setImage(whidth, height, ledData) time.sleep(sleepTime)