aboutsummaryrefslogtreecommitdiff
path: root/pixelcore/Pixel.py
diff options
context:
space:
mode:
authorGravatar Russell Cohen <rcoh@mit.edu>2011-01-21 00:57:14 -0500
committerGravatar Russell Cohen <rcoh@mit.edu>2011-01-21 00:57:14 -0500
commita223608dda0751551c6e8688c0c0e1c9a1d4e69c (patch)
treecd0620097745b7053abec7346f6bd7e65d99dafe /pixelcore/Pixel.py
parentf45b5e262c394cf00ef88f7fca1eab1b4de0fec9 (diff)
Added a new config file to run the upstairs lights. Modified PixelMapper to
track cache hits. Added 60-strip layouts and renderer configs.
Diffstat (limited to 'pixelcore/Pixel.py')
-rw-r--r--pixelcore/Pixel.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/pixelcore/Pixel.py b/pixelcore/Pixel.py
index b9fc07f..7260e56 100644
--- a/pixelcore/Pixel.py
+++ b/pixelcore/Pixel.py
@@ -29,10 +29,10 @@ class Pixel:
#arg
#Add a pixelEvent to the list of active events
- def processInput(self,pixelEvent,zindex, currentTime=None): #consider migrating arg to dict
+ def processInput(self,pixelEvent,zindex, scale=1,currentTime=None): #consider migrating arg to dict
if currentTime == None:
currentTime = timeops.time()
- self.events[currentTime] = (zindex, pixelEvent)
+ self.events[currentTime] = (zindex,scale, pixelEvent)
def clearAllEvents(self):
self.events = {}
@@ -49,10 +49,10 @@ class Pixel:
resultingColor = (0,0,0)
colors = []
for eventTime in self.events: #TODO: right color weighting code
- (zindex,event) = self.events[eventTime]
+ (zindex,scale,event) = self.events[eventTime]
eventResult = event.state(currentTime-eventTime)
if eventResult != None:
- colors.append(eventResult)
+ colors.append(color.multiplyColor(eventResult,scale))
else:
deadEvents.append(eventTime)