aboutsummaryrefslogtreecommitdiff
path: root/pixelmappers
diff options
context:
space:
mode:
authorGravatar Russell Cohen <rcoh@mit.edu>2010-12-03 04:20:17 -0500
committerGravatar Russell Cohen <rcoh@mit.edu>2010-12-03 04:20:17 -0500
commit353ab16db64c86122c0fcb9e1852b85c14b354b8 (patch)
tree8904f1cd312974a849ad5bcf0c8520fd20175cda /pixelmappers
parent0366f46d3d7e946e254f933888aea4beb4e70658 (diff)
Speed optimizations abound! Caching on parameter validation, Binary
searching for light locations in pixel mappers, actual thread safety for inputs means we don't drop them randomly, anymore. Caching on PixelStates to reduce multi-renderer costs + a short circuit to speed up processing on pixels that are turned off.
Diffstat (limited to 'pixelmappers')
-rw-r--r--pixelmappers/GaussianMapper.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/pixelmappers/GaussianMapper.py b/pixelmappers/GaussianMapper.py
index 552f5c9..1cf9e88 100644
--- a/pixelmappers/GaussianMapper.py
+++ b/pixelmappers/GaussianMapper.py
@@ -3,11 +3,14 @@ import Util
class GaussianMapper(PixelMapper):
def mappingFunction(self, eventLocation, screen):
returnPixels = []
- for pixel in screen:
+ [x,y] = eventLocation
+ for (x,pixel) in screen.pixelsInRange(x-self['CutoffDist'], \
+ x+self['CutoffDist']):
pixelDist = Util.dist(pixel.location, eventLocation)
if pixelDist < self['CutoffDist']:
w = Util.gaussian(pixelDist, self['Height'], 0, self['Width'])
if w>1:
- pdb.set_trace()
+ #pdb.set_trace()
+ pass
returnPixels.append((pixel, w))
return returnPixels