blob: 552f5c9df88acc04d97184de69acfe4c23ec8a4d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
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
|