blob: c5d77ca7844d348ed9a93f4ab99d59055a300d99 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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
|