aboutsummaryrefslogtreecommitdiff
path: root/behaviors/LocationMask.py
diff options
context:
space:
mode:
authorGravatar Merritt Boyd <mboyd@mit.edu>2011-02-20 18:28:11 -0500
committerGravatar Merritt Boyd <mboyd@mit.edu>2011-02-20 18:28:11 -0500
commitcd6217a54ac34cd13cc43dc17fe35a834f98b278 (patch)
tree2a23fed9468992bf4fb877006fcf4a712ab2e8a4 /behaviors/LocationMask.py
parent868c8206ac18e07f4e9d2eae32ec804344e31f2b (diff)
parenta841c8efe5667bf99541a71f37311037cfd1210d (diff)
Merge branch 'conner5' of https://github.com/dxiao/SmootLight into conner5
Diffstat (limited to 'behaviors/LocationMask.py')
-rw-r--r--behaviors/LocationMask.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/behaviors/LocationMask.py b/behaviors/LocationMask.py
new file mode 100644
index 0000000..51eafeb
--- /dev/null
+++ b/behaviors/LocationMask.py
@@ -0,0 +1,19 @@
+from operationscore.Behavior import *
+
+class LocationMask (Behavior):
+ """Modifies Pixels such that only ones in the pixels specified by the "location"
+ argument will show"""
+
+ def processResponse(self, inputs, state):
+
+ ret = []
+ inputs = list(inputs)
+
+ for inputset in inputs:
+ inputset = dict(inputset)
+
+ inputset['Location'] += '@' + self['Location']
+
+ ret.append(inputset)
+
+ return (ret, [])