Package SmootLight :: Package pixelmappers :: Module WindGaussianMapper
[hide private]
[frames] | no frames]

Source Code for Module SmootLight.pixelmappers.WindGaussianMapper

 1  from operationscore.PixelMapper import * 
 2  import util.Geo as Geo 
 3  import math 
4 -class WindGaussianMapper(PixelMapper):
5 - def mappingFunction(self, eventLocation, screen):
6 returnPixels = [] #TODO: consider preallocation and trimming 7 [x,y] = eventLocation 8 potentialPixels = screen.pixelsInRange(x-self.CutoffDist, x) 9 for (xloc,pixel) in screen.pixelsInRange(x-self.CutoffDist, x): 10 pixelDistx = math.fabs(pixel.location[0] - x) 11 pixelDisty = math.fabs(pixel.location[1] - y) 12 if pixelDistx < self.CutoffDist: 13 if pixelDisty < 30: 14 w = Geo.windtrail(pixelDistx, pixelDisty, self.Height, 0, self.Width) 15 if w > self.MinWeight: 16 returnPixels.append((pixel, w)) 17 18 return returnPixels
19