|
@@ -1,21 +1,21 @@
|
|
|
"""
|
|
"""
|
|
|
-
|
|
|
|
|
Class CommonFilters implements certain common image
|
|
Class CommonFilters implements certain common image
|
|
|
postprocessing filters. See the :ref:`common-image-filters` page for
|
|
postprocessing filters. See the :ref:`common-image-filters` page for
|
|
|
more information about how to use these filters.
|
|
more information about how to use these filters.
|
|
|
|
|
|
|
|
-It is not ideal that these filters are all included in a single
|
|
|
|
|
-monolithic module. Unfortunately, when you want to apply two filters
|
|
|
|
|
-at the same time, you have to compose them into a single shader, and
|
|
|
|
|
-the composition process isn't simply a question of concatenating them:
|
|
|
|
|
-you have to somehow make them work together. I suspect that there
|
|
|
|
|
-exists some fairly simple framework that would make this automatable.
|
|
|
|
|
-However, until I write some more filters myself, I won't know what
|
|
|
|
|
-that framework is. Until then, I'll settle for this
|
|
|
|
|
-clunky approach. - Josh
|
|
|
|
|
-
|
|
|
|
|
|
|
+These filters are written in the Cg shading language.
|
|
|
"""
|
|
"""
|
|
|
|
|
|
|
|
|
|
+# It is not ideal that these filters are all included in a single
|
|
|
|
|
+# monolithic module. Unfortunately, when you want to apply two filters
|
|
|
|
|
+# at the same time, you have to compose them into a single shader, and
|
|
|
|
|
+# the composition process isn't simply a question of concatenating them:
|
|
|
|
|
+# you have to somehow make them work together. I suspect that there
|
|
|
|
|
+# exists some fairly simple framework that would make this automatable.
|
|
|
|
|
+# However, until I write some more filters myself, I won't know what
|
|
|
|
|
+# that framework is. Until then, I'll settle for this
|
|
|
|
|
+# clunky approach. - Josh
|
|
|
|
|
+
|
|
|
from .FilterManager import FilterManager
|
|
from .FilterManager import FilterManager
|
|
|
from .filterBloomI import BLOOM_I
|
|
from .filterBloomI import BLOOM_I
|
|
|
from .filterBloomX import BLOOM_X
|
|
from .filterBloomX import BLOOM_X
|
|
@@ -459,6 +459,11 @@ class CommonFilters:
|
|
|
return True
|
|
return True
|
|
|
|
|
|
|
|
def setBloom(self, blend=(0.3,0.4,0.3,0.0), mintrigger=0.6, maxtrigger=1.0, desat=0.6, intensity=1.0, size="medium"):
|
|
def setBloom(self, blend=(0.3,0.4,0.3,0.0), mintrigger=0.6, maxtrigger=1.0, desat=0.6, intensity=1.0, size="medium"):
|
|
|
|
|
+ """
|
|
|
|
|
+ Applies the Bloom filter to the output.
|
|
|
|
|
+ size can either be "off", "small", "medium", or "large".
|
|
|
|
|
+ Setting size to "off" will remove the Bloom filter.
|
|
|
|
|
+ """
|
|
|
if (size==0): size="off"
|
|
if (size==0): size="off"
|
|
|
elif (size==1): size="small"
|
|
elif (size==1): size="small"
|
|
|
elif (size==2): size="medium"
|
|
elif (size==2): size="medium"
|
|
@@ -542,7 +547,7 @@ class CommonFilters:
|
|
|
return True
|
|
return True
|
|
|
|
|
|
|
|
def setBlurSharpen(self, amount=0.0):
|
|
def setBlurSharpen(self, amount=0.0):
|
|
|
- """Enables the blur/sharpen filter. If the 'amount' parameter is 1.0, it will not have effect.
|
|
|
|
|
|
|
+ """Enables the blur/sharpen filter. If the 'amount' parameter is 1.0, it will not have any effect.
|
|
|
A value of 0.0 means fully blurred, and a value higher than 1.0 sharpens the image."""
|
|
A value of 0.0 means fully blurred, and a value higher than 1.0 sharpens the image."""
|
|
|
fullrebuild = (("BlurSharpen" in self.configuration) == False)
|
|
fullrebuild = (("BlurSharpen" in self.configuration) == False)
|
|
|
self.configuration["BlurSharpen"] = amount
|
|
self.configuration["BlurSharpen"] = amount
|