diff options
author | rcoh <rcoh@mit.edu> | 2010-12-22 14:27:33 -0500 |
---|---|---|
committer | rcoh <rcoh@mit.edu> | 2010-12-22 14:27:33 -0500 |
commit | c581408f028d5b8ceadc53c68d7c1252fbe09e6d (patch) | |
tree | 8724862d05bde3bb3427cdff378cdb08da8babd2 /pixelmappers | |
parent | a1d9b85320c9b07d62470d78ef0c5f9015baf813 (diff) |
About halfway done with support for pixel regions. Modified the component registry a bit. Added
support for multiple pixel mappers (and along with that, default components). RCOH
Diffstat (limited to 'pixelmappers')
-rw-r--r-- | pixelmappers/GaussianMapper.py | 1 | ||||
-rw-r--r-- | pixelmappers/SimpleMapper.py | 4 |
2 files changed, 2 insertions, 3 deletions
diff --git a/pixelmappers/GaussianMapper.py b/pixelmappers/GaussianMapper.py index e94235e..8755acf 100644 --- a/pixelmappers/GaussianMapper.py +++ b/pixelmappers/GaussianMapper.py @@ -1,6 +1,5 @@ from operationscore.PixelMapper import * import util.Geo as Geo -import Util class GaussianMapper(PixelMapper): def mappingFunction(self, eventLocation, screen): returnPixels = [] #TODO: consider preallocation and trimming diff --git a/pixelmappers/SimpleMapper.py b/pixelmappers/SimpleMapper.py index fdcf8b9..6b414ea 100644 --- a/pixelmappers/SimpleMapper.py +++ b/pixelmappers/SimpleMapper.py @@ -1,12 +1,12 @@ from operationscore.PixelMapper import * -import Util +import util.Geo as Geo class SimpleMapper(PixelMapper): def mappingFunction(self, eventLocation, screen): if type(eventLocation) == type(tuple()): bestDist = 10**10 #don't kill me, I'm lazy bestPixel = None for pixel in screen: - pixelDist = Util.dist(pixel.location, eventLocation) + pixelDist = Geo.dist(pixel.location, eventLocation) if pixelDist < bestDist: bestPixel = pixel bestDist = pixelDist |