From 792dd4d7139f9080bf6d3d760efe763b8b3f60cc Mon Sep 17 00:00:00 2001 From: dxiao Date: Sun, 20 Feb 2011 16:18:43 -0500 Subject: Added LocationMask, which limits affected pixels to a specified region of the screen --- behaviors/LocationMask.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 behaviors/LocationMask.py (limited to 'behaviors') 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, []) -- cgit v1.2.3