diff options
author | rcoh <rcoh@mit.edu> | 2011-01-04 17:23:30 -0500 |
---|---|---|
committer | rcoh <rcoh@mit.edu> | 2011-01-04 17:23:30 -0500 |
commit | 1679719e7ca8ce433c5714474a32c926161dc5b8 (patch) | |
tree | dc75dc66ee8695fe786df2b48c0e6911332ed7c5 /pixelmappers/GaussianMapper.py | |
parent | 395e99394ead5d0d656e74fed23dc780652b6090 (diff) |
Some performance improvements -- we also synchronize all the frames, giving us a meaning that even
if things slow down, rendering doesn't look weird.
Diffstat (limited to 'pixelmappers/GaussianMapper.py')
-rw-r--r-- | pixelmappers/GaussianMapper.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/pixelmappers/GaussianMapper.py b/pixelmappers/GaussianMapper.py index 8fdf16b..686ebcd 100644 --- a/pixelmappers/GaussianMapper.py +++ b/pixelmappers/GaussianMapper.py @@ -4,11 +4,11 @@ class GaussianMapper(PixelMapper): def mappingFunction(self, eventLocation, screen): returnPixels = [] #TODO: consider preallocation and trimming [x,y] = eventLocation - for (x,pixel) in screen.pixelsInRange(x-self['CutoffDist'], \ - x+self['CutoffDist']): + for (x,pixel) in screen.pixelsInRange(x-self.CutoffDist, \ + x+self.CutoffDist): pixelDist = Geo.dist(pixel.location, eventLocation) - if pixelDist < self['CutoffDist']: - w = Geo.gaussian(pixelDist, self['Height'], 0, self['Width']) - if w > self['MinWeight']: + if pixelDist < self.CutoffDist: + w = Geo.gaussian(pixelDist, self.Height, 0, self.Width) + if w > self.MinWeight: returnPixels.append((pixel, w)) return returnPixels |