summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2014-04-19 22:26:37 +0000
committerJabiertxof <jtx@jtx.marker.es>2014-04-19 22:26:37 +0000
commit23be58fdf34cbcb29040b312de7e2b6764f60c50 (patch)
treed25a24e24f830c7618edeadc9d211e15e576c3fa /share
parentupdate to trunk (diff)
parentMerge in outline bitmap image preference feature (diff)
downloadinkscape-23be58fdf34cbcb29040b312de7e2b6764f60c50.tar.gz
inkscape-23be58fdf34cbcb29040b312de7e2b6764f60c50.zip
update to trunk
(bzr r11950.1.329)
Diffstat (limited to 'share')
-rw-r--r--share/extensions/color_blackandwhite.inx1
-rwxr-xr-xshare/extensions/color_blackandwhite.py9
-rwxr-xr-xshare/extensions/inkex.py4
3 files changed, 11 insertions, 3 deletions
diff --git a/share/extensions/color_blackandwhite.inx b/share/extensions/color_blackandwhite.inx
index 8432ab2d3..0fa58a128 100644
--- a/share/extensions/color_blackandwhite.inx
+++ b/share/extensions/color_blackandwhite.inx
@@ -5,6 +5,7 @@
<dependency type="executable" location="extensions">coloreffect.py</dependency>
<dependency type="executable" location="extensions">color_blackandwhite.py</dependency>
<dependency type="executable" location="extensions">simplestyle.py</dependency>
+ <param name="threshold" type="int" min="1" max="255" _gui-text="Threshold Color (1-255):">127</param>
<effect>
<object-type>all</object-type>
<effects-menu>
diff --git a/share/extensions/color_blackandwhite.py b/share/extensions/color_blackandwhite.py
index 57e6e2ae8..fcee057c7 100755
--- a/share/extensions/color_blackandwhite.py
+++ b/share/extensions/color_blackandwhite.py
@@ -2,12 +2,19 @@
import coloreffect,sys
class C(coloreffect.ColorEffect):
+ def __init__(self):
+ coloreffect.ColorEffect.__init__(self)
+ self.OptionParser.add_option("-t", "--threshold",
+ action="store", type="int",
+ dest="threshold", default=127,
+ help="Threshold Color Level")
+
def colmod(self,r,g,b):
#ITU-R Recommendation BT.709
#l = 0.2125 * r + 0.7154 * g + 0.0721 * b
#NTSC and PAL
l = 0.299 * r + 0.587 * g + 0.114 * b
- if l > 127:
+ if l > self.options.threshold:
ig = 255
else:
ig = 0
diff --git a/share/extensions/inkex.py b/share/extensions/inkex.py
index d71b7d7e7..947cb5b30 100755
--- a/share/extensions/inkex.py
+++ b/share/extensions/inkex.py
@@ -285,8 +285,8 @@ class Effect:
return 'px'
#a dictionary of unit to user unit conversion factors
- __uuconv = {'in':90.0, 'pt':1.25, 'px':1, 'mm':3.5433070866, 'cm':35.433070866, 'm':3543.3070866,
- 'km':3543307.0866, 'pc':15.0, 'yd':3240 , 'ft':1080}
+ __uuconv = {'in':90.0, 'pt':1.25, 'px':1.0, 'mm':3.5433070866, 'cm':35.433070866, 'm':3543.3070866,
+ 'km':3543307.0866, 'pc':15.0, 'yd':3240.0 , 'ft':1080.0}
def unittouu(self, string):
'''Returns userunits given a string representation of units in another system'''
unit = re.compile('(%s)$' % '|'.join(self.__uuconv.keys()))