diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | examples/logarithmic | 24 |
2 files changed, 25 insertions, 1 deletions
@@ -64,7 +64,7 @@ PYFILES = __main__.py colour.py curve.py monitor.py solar.py icc.py adhoc.py # Library files CBINDINGS = $(foreach B,$(SERVER_BINDINGS),blueshift_$(B).so) # Configuration script example files -EXAMPLES = comprehensive sleepmode crtc-detection crtc-searching +EXAMPLES = comprehensive sleepmode crtc-detection crtc-searching logarithmic # Build rules diff --git a/examples/logarithmic b/examples/logarithmic new file mode 100644 index 0000000..33b3ad8 --- /dev/null +++ b/examples/logarithmic @@ -0,0 +1,24 @@ +# -*- python -*- + +# This example uses free function modifier and temporary curve +# manipulation to make the colour curves logarithmic. + + +import math + +# Use linear RGB. +linearise() + +# Make the curves logarithmic. The function applies +# to all colour curves, but you can change them +# individually by specifing three functions: red, +# green and blue. +manipulate(lambda x : math.log(x + 1, 2)) + +# Switch back to sRGB. +standardise() + +# Apply settings, using vidmode. +vidmode() +#randr() + |