diff options
author | rcoh <rcoh@mit.edu> | 2011-02-01 23:14:12 -0500 |
---|---|---|
committer | rcoh <rcoh@mit.edu> | 2011-02-01 23:14:12 -0500 |
commit | 5a97e7548b0ec44f0d61a724903748197e69df7c (patch) | |
tree | 7bb6b8ea7e488949eeb16ae18b0ad2230f1f7c9b /pixelmappers/SimpleMapper.py | |
parent | 082e4b0c53123dd377da148541f7d98516716862 (diff) | |
parent | 482a94fd48627153b923931d6ff21ebf57fad6f7 (diff) |
Merge branch 'osc' of github.com:rcoh/SmootLight into osc
Diffstat (limited to 'pixelmappers/SimpleMapper.py')
-rw-r--r-- | pixelmappers/SimpleMapper.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/pixelmappers/SimpleMapper.py b/pixelmappers/SimpleMapper.py index 19d44c4..1568de3 100644 --- a/pixelmappers/SimpleMapper.py +++ b/pixelmappers/SimpleMapper.py @@ -2,6 +2,10 @@ from operationscore.PixelMapper import * import util.Geo as Geo import sys class SimpleMapper(PixelMapper): + """SimpleMapper is a PixelMapper which maps events to the nearest Pixel. It also supports + strings of the form: + {x}>5, {y}<10, {x}*{y}<{x}, etc. (Conditons, separated by commas. and and or may also be + used).""" def mappingFunction(self, eventLocation, screen): if type(eventLocation) == type(tuple()): bestDist = sys.maxint @@ -19,7 +23,6 @@ class SimpleMapper(PixelMapper): return [] else: #{x}>5,{y}<k - #TODO: we should probably encapsulate this somewhere ret = [] eventLocation = eventLocation.replace('{x}', 'pixel.location[0]') eventLocation = eventLocation.replace('{y}', 'pixel.location[1]') |