From 6341992254c837b1d814b3eaa24b2ab3e729c8e2 Mon Sep 17 00:00:00 2001 From: eugue Date: Thu, 27 Jan 2011 20:27:12 -0500 Subject: Added HTMLInput, SmootWind behavior, and a config file for testing. --- pixelmappers/WindGaussianMapper.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 pixelmappers/WindGaussianMapper.py (limited to 'pixelmappers') 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 -- cgit v1.2.3