summaryrefslogtreecommitdiffstats
path: root/examples/logarithmic
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-02-25 14:42:45 +0100
committerMattias Andrée <maandree@operamail.com>2014-02-25 14:42:45 +0100
commit1ec97da0cdfc443b5c4e14161d602e7432481899 (patch)
tree6f12ffd9b893553728ee4dd5296137d4f5e198ef /examples/logarithmic
parentbuf cause by typo + add example: crtc-searching (diff)
downloadblueshift-1ec97da0cdfc443b5c4e14161d602e7432481899.tar.gz
blueshift-1ec97da0cdfc443b5c4e14161d602e7432481899.tar.bz2
blueshift-1ec97da0cdfc443b5c4e14161d602e7432481899.tar.xz
add example logarithmic
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'examples/logarithmic')
-rw-r--r--examples/logarithmic24
1 files changed, 24 insertions, 0 deletions
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()
+