aboutsummaryrefslogtreecommitdiff
path: root/pixelmappers/GaussianMapper.py
blob: 1cf9e889cfc5fe4249926a4377902ae3a11df149 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from operationscore.PixelMapper import *
import Util
class GaussianMapper(PixelMapper):
    def mappingFunction(self, eventLocation, screen):
        returnPixels = []
        [x,y] = eventLocation
        for (x,pixel) in screen.pixelsInRange(x-self['CutoffDist'], \
                x+self['CutoffDist']):
            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()
                    pass
                returnPixels.append((pixel, w))
        return returnPixels