aboutsummaryrefslogtreecommitdiff
path: root/operationscore/PixelMapper.py
diff options
context:
space:
mode:
authorGravatar rcoh <rcoh@mit.edu>2011-02-01 23:14:12 -0500
committerGravatar rcoh <rcoh@mit.edu>2011-02-01 23:14:12 -0500
commit5a97e7548b0ec44f0d61a724903748197e69df7c (patch)
tree7bb6b8ea7e488949eeb16ae18b0ad2230f1f7c9b /operationscore/PixelMapper.py
parent082e4b0c53123dd377da148541f7d98516716862 (diff)
parent482a94fd48627153b923931d6ff21ebf57fad6f7 (diff)
Merge branch 'osc' of github.com:rcoh/SmootLight into osc
Diffstat (limited to 'operationscore/PixelMapper.py')
-rw-r--r--operationscore/PixelMapper.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/operationscore/PixelMapper.py b/operationscore/PixelMapper.py
index 7e2b0af..3937973 100644
--- a/operationscore/PixelMapper.py
+++ b/operationscore/PixelMapper.py
@@ -2,6 +2,9 @@ from operationscore.SmootCoreObject import *
from logger import main_log
import pdb
class PixelMapper(SmootCoreObject):
+ """PixelMapper is the parent class for PixelMappers. Inheriting classes should define
+ mappingFunction which takes an eventLocation and a screen and returns a list of (weight, pixels). PixelMapper
+ handles caching automatically."""
def init(self):
self.mem = {} #Dictionary of all seen events
self.totalCalls = 0
@@ -19,6 +22,7 @@ class PixelMapper(SmootCoreObject):
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
+ """Takes a Screen and event location and returns a list of tuples (pixel,weight) with
+ sum(weights)=1"""
+ raise Exception('Mapping function not defined!')