Changeset - eb8c4352798c
[Not reviewed]
default
0 2 0
drewp@bigasterisk.com - 11 years ago 2014-06-14 23:03:46
drewp@bigasterisk.com
LR support in EE
Ignore-this: 55d3491da3979e323c465b32b2b304a4
2 files changed with 3 insertions and 2 deletions:
0 comments (0 inline, 0 general)
light9/Effects.py
Show inline comments
 
@@ -15,13 +15,13 @@ def register(f):
 
    registered.append(f)
 
    return f
 

	
 
@register
 
class Strip(object):
 
    """list of r,g,b tuples for sending to an LED strip"""
 
    which = 'L'
 
    which = 'L' # LR means both
 
    pixels = []
 
    @classmethod
 
    def solid(cls, which='L', color=(1,1,1)):
 
        x = cls()
 
        x.which = which
 
        x.pixels = [tuple(color)] * 50
light9/effecteval/effectloop.py
Show inline comments
 
@@ -183,13 +183,14 @@ class LedLoop(EffectLoop):
 
        for out in outputs:
 
            if isinstance(out, Effects.Blacklight):
 
                combined['blacklight'] = max(combined['blacklight'], int(out * 255))
 
            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)
 
                for w in out.which:
 
                    combined[w] = numpy.maximum(combined[w], px255)
 
                
 
        return combined
 

	
 
    @inlineCallbacks
 
    def sendOutput(self, combined):
 
        for which, px255 in combined.items():
0 comments (0 inline, 0 general)