From 2a7174bc25e5dab007db2fc7dc76c97fd2636069 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 6 Apr 2014 15:36:54 +0200 Subject: demo tension parameter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- examples/comprehensive | 4 ++++ src/interpolation.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/comprehensive b/examples/comprehensive index b8c7178..1fcf299 100644 --- a/examples/comprehensive +++ b/examples/comprehensive @@ -322,6 +322,8 @@ for i in range(len(current_calibration)): f = interpolate_function(f, linearly_interpolate_ramp) # Use cubic interpolation #f = interpolate_function(f, cubicly_interpolate_ramp) + # Use semitense cubic interpolation + #f = interpolate_function(f, lambda *c : cubicly_interpolate_ramp(*c, tension = 0.5)) # Otherwise use nearest-neighbour current_calibration[i] = f @@ -512,6 +514,8 @@ def periodically(year, month, day, hour, minute, second, weekday, fade): f = interpolate_function(f, linearly_interpolate_ramp) # Use cubic interpolation #f = interpolate_function(f, cubicly_interpolate_ramp) + # Use semitense cubic interpolation + #f = interpolate_function(f, lambda *c : cubicly_interpolate_ramp(*c, tension = 0.5)) # Otherwise use nearest-neighbour icc_calibration_profile[i] = f diff --git a/src/interpolation.py b/src/interpolation.py index 32dd2fa..e6bb896 100644 --- a/src/interpolation.py +++ b/src/interpolation.py @@ -47,7 +47,7 @@ def linearly_interpolate_ramp(r, g, b): return (R, G, B) -def cubicly_interpolate_ramp(r, g, b, tension = 0): # TODO demo tension parameter +def cubicly_interpolate_ramp(r, g, b, tension = 0): ''' Interpolate ramps to the size of the output axes using cubic Hermite spline -- cgit v1.2.3-70-g09d2