From 0366f46d3d7e946e254f933888aea4beb4e70658 Mon Sep 17 00:00:00 2001 From: Russell Cohen Date: Wed, 1 Dec 2010 19:46:14 -0500 Subject: Added support for RecursiveHooks, RecursiveBehaviors and GaussianMapper supporting Gaussian based pixel mapping. --- pixelmappers/GaussianMapper.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 pixelmappers/GaussianMapper.py (limited to 'pixelmappers') 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 -- cgit v1.2.3