changeset 1124:4eb7dc40797f

just called Strip now Ignore-this: b563277b80d12713d6ed589f6c271d0
author Drew Perttula <drewp@bigasterisk.com>
date Fri, 13 Jun 2014 07:47:22 +0000
parents 9f4d68612d56
children 57eb333e6a4c
files light9/Effects.py light9/effecteval/effectloop.py
diffstat 2 files changed, 11 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/light9/Effects.py	Fri Jun 13 07:37:54 2014 +0000
+++ b/light9/Effects.py	Fri Jun 13 07:47:22 2014 +0000
@@ -15,17 +15,21 @@
     registered.append(f)
     return f
 
-class ColorStrip(object):
+@register
+class Strip(object):
     """list of r,g,b tuples for sending to an LED strip"""
     which = 'L'
     pixels = []
-    
+    @classmethod
+    def solid(cls, which='L', color=(1,1,1)):
+        x = cls()
+        x.which = which
+        x.pixels = [tuple(color)] * 50
+        return x
+
+@register
 class Blacklight(float):
     """a level for the blacklight PWM output"""
-
-@register
-def blacklight(v):
-    return Blacklight(v)
     
 @register
 def chase(t, ontime=0.5, offset=0.2, onval=1.0, 
@@ -61,20 +65,6 @@
     if light in ['center', 'all']:
         lev[88], lev[89], lev[90] = r*centerScale,g*centerScale,b*centerScale
     return Submaster.Submaster(name='hsv', levels=lev)
-
-@register
-def colorDemo():
-    s = ColorStrip()
-    s.which = 'L'
-    s.pixels = [(0,0,1)] * 50
-    return s
-
-@register
-def colorSolid(which='L', color=[1,1,1]):
-    s = ColorStrip()
-    s.which = which
-    s.pixels = [tuple(color)] * 50
-    return s
     
 @register
 def stack(t, names=None, fade=0):
--- a/light9/effecteval/effectloop.py	Fri Jun 13 07:37:54 2014 +0000
+++ b/light9/effecteval/effectloop.py	Fri Jun 13 07:47:22 2014 +0000
@@ -155,7 +155,7 @@
         for out in outputs:
             if isinstance(out, Effects.Blacklight):
                 combined['blacklight'] = max(combined['blacklight'], int(out * 255))
-            elif isinstance(out, Effects.ColorStrip):
+            elif isinstance(out, Effects.Strip):
                 pixels = numpy.array(out.pixels, dtype=numpy.float16)
                 px255 = (numpy.clip(pixels, 0, 1) * 255).astype(numpy.uint8)
                 combined[out.which] = numpy.maximum(combined[out.which], px255)