Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornrp <olpc@spongezone.net>2009-01-20 05:24:11 (GMT)
committer nrp <olpc@spongezone.net>2009-01-20 05:24:11 (GMT)
commita8c615cc33b289a95ce861d3c3168f4a86451c12 (patch)
tree1c70602b29c6ad73bc97bafbe0b52d492ee162fb
parent084a0671ed0d90c7e80acd4bb88753db139057af (diff)
added pressure sensitivity
-rwxr-xr-xcolors.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/colors.py b/colors.py
index e1ceb4d..06899d1 100755
--- a/colors.py
+++ b/colors.py
@@ -1737,11 +1737,13 @@ class Colors(activity.Activity, ExportedGObject):
camcomponent = cammask.connected_component()
camcount = camcomponent.count()
# make sure its not just noise
- if camcount > 1500:
+ if camcount > 1000:
campos = camcomponent.centroid()
size = self.window.get_size()
self.lastmx = self.mx
self.lastmy = self.my
+ self.lastr = self.pressure
+ self.pressure = int(min(255,camcount/20))
# scale and adjust it so the borders can still be reached
self.mx = int(25+max(0.0, min(1.0, (campos[0]*1.2-16)/160.0))*(size[0]-50))
self.my = int(25+max(0.0, min(1.0, (campos[1]*1.2-12)/120.0))*(size[1]-50))