From 12ce2a2a4a6df0a508d439d3f58d62c277b7f5b3 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 5 Apr 2014 14:43:57 +0200 Subject: doc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/interpolation.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/interpolation.py') 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{3})?→[list{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 -- cgit v1.2.3-70-g09d2