aboutsummaryrefslogtreecommitdiff
path: root/pixelmappers
diff options
context:
space:
mode:
authorGravatar Russell Cohen <rcoh@mit.edu>2010-12-01 19:46:14 -0500
committerGravatar Russell Cohen <rcoh@mit.edu>2010-12-01 19:46:14 -0500
commit0366f46d3d7e946e254f933888aea4beb4e70658 (patch)
tree81e69d857c41d9ff6ab0ee49315c26cd6112f3a9 /pixelmappers
parentcf1f2224b3625b01a6aa7db221403849b308b3bc (diff)
Added support for RecursiveHooks, RecursiveBehaviors and GaussianMapper
supporting Gaussian based pixel mapping.
Diffstat (limited to 'pixelmappers')
-rw-r--r--pixelmappers/GaussianMapper.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/pixelmappers/GaussianMapper.py b/pixelmappers/GaussianMapper.py
new file mode 100644
index 0000000..552f5c9
--- /dev/null
+++ b/pixelmappers/GaussianMapper.py
@@ -0,0 +1,13 @@
+from operationscore.PixelMapper import *
+import Util
+class GaussianMapper(PixelMapper):
+ def mappingFunction(self, eventLocation, screen):
+ returnPixels = []
+ for pixel in screen:
+ 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()
+ returnPixels.append((pixel, w))
+ return returnPixels