aboutsummaryrefslogtreecommitdiff
path: root/pixelmappers
diff options
context:
space:
mode:
authorGravatar eugue <eug.sun@gmail.com>2011-01-27 20:27:12 -0500
committerGravatar eugue <eug.sun@gmail.com>2011-01-27 20:27:12 -0500
commit6341992254c837b1d814b3eaa24b2ab3e729c8e2 (patch)
tree4cdf2f65e7a5b1d0a4be0f667754e73053af8493 /pixelmappers
parentf103e47da5d563d1b8448bc021676ed7db0f529d (diff)
Added HTMLInput, SmootWind behavior, and a config file for testing.
Diffstat (limited to 'pixelmappers')
-rwxr-xr-xpixelmappers/WindGaussianMapper.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/pixelmappers/WindGaussianMapper.py b/pixelmappers/WindGaussianMapper.py
new file mode 100755
index 0000000..c5d77ca
--- /dev/null
+++ b/pixelmappers/WindGaussianMapper.py
@@ -0,0 +1,18 @@
+from operationscore.PixelMapper import *
+import util.Geo as Geo
+import math
+class WindGaussianMapper(PixelMapper):
+ def mappingFunction(self, eventLocation, screen):
+ returnPixels = [] #TODO: consider preallocation and trimming
+ [x,y] = eventLocation
+ potentialPixels = screen.pixelsInRange(x-self.CutoffDist, x)
+ for (xloc,pixel) in screen.pixelsInRange(x-self.CutoffDist, x):
+ pixelDistx = math.fabs(pixel.location[0] - x)
+ pixelDisty = math.fabs(pixel.location[1] - y)
+ if pixelDistx < self.CutoffDist:
+ if pixelDisty < 30:
+ w = Geo.windtrail(pixelDistx, pixelDisty, self.Height, 0, self.Width)
+ if w > self.MinWeight:
+ returnPixels.append((pixel, w))
+
+ return returnPixels