aboutsummaryrefslogtreecommitdiff
path: root/pixelmappers
diff options
context:
space:
mode:
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