aboutsummaryrefslogtreecommitdiff
path: root/operationscore/PixelMapper.py
blob: e3f2515383e9e8573cd91bb24837b9e8558d10c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from operationscore.SmootCoreObject import *
import pdb
class PixelMapper(SmootCoreObject):
    def init(self):
        self.mem = {} #Dictionary of all seen events
    def mapEvent(self, eventLocation, screen):
        if eventLocation in self.mem:
            return self.mem[eventLocation]
        else:
            self.mem[eventLocation] = self.mappingFunction(eventLocation, screen)
            return self.mem[eventLocation]
    #Takes a Screen and returns a list of tuples
    #(pixel, weight), with the sum of weights = 1
    #TODO: consider abstracting away from pixels
    def mappingFunction(self,eventLocation, screen):
        pass