summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-04-05 14:43:57 +0200
committerMattias Andrée <maandree@operamail.com>2014-04-05 14:43:57 +0200
commit12ce2a2a4a6df0a508d439d3f58d62c277b7f5b3 (patch)
tree000ca7ea9c233f761ab4c7ee03ba4727ea7ebeea /src
parentm (diff)
downloadblueshift-12ce2a2a4a6df0a508d439d3f58d62c277b7f5b3.tar.gz
blueshift-12ce2a2a4a6df0a508d439d3f58d62c277b7f5b3.tar.bz2
blueshift-12ce2a2a4a6df0a508d439d3f58d62c277b7f5b3.tar.xz
doc
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src')
-rw-r--r--src/interpolation.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/interpolation.py b/src/interpolation.py
index 9039c11..0d16838 100644
--- a/src/interpolation.py
+++ b/src/interpolation.py
@@ -21,7 +21,7 @@ from aux import *
from curve import *
-def linearly_interpolate_ramp(r, g, b): # TODO demo this
+def linearly_interpolate_ramp(r, g, b):
'''
Linearly interpolate ramps to the size of the output axes
@@ -47,7 +47,7 @@ def linearly_interpolate_ramp(r, g, b): # TODO demo this
return (R, G, B)
-def cubicly_interpolate_ramp(r, g, b): # TODO demo this
+def cubicly_interpolate_ramp(r, g, b):
'''
Interpolate ramps to the size of the output axes using cubic Hermite spline
@@ -198,12 +198,22 @@ def interpolate_function(function, interpolator):
@param interpolator:(list<float>{3})?→[list<float>{3}] Function that interpolates lookup tables
@return :()→void `function` interpolated
'''
+ # Do not interpolation if none is selected
if interpolator is None:
return function
+ # Store the current adjustments, we
+ # will need to apply our own temporary
+ # adjustments
stored = store()
+ # Clean any adjustments,
start_over()
+ # and apply those we should interpolate.
function()
+ # Interpolate the adjustments we just
+ # made and make a function out of it
rc = functionise(interpolator(*store()))
+ # Restore the adjustments to those
+ # that were applied when we started
restore(stored)
return rc