From e9e22100195a3b8bd9a93ed3210bde262af714e2 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 24 Feb 2014 16:28:06 +0100 Subject: improve lower_resolution and add the comprehensive test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- examples/comprehensive | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'examples/comprehensive') diff --git a/examples/comprehensive b/examples/comprehensive index 8b55ed5..05407b5 100644 --- a/examples/comprehensive +++ b/examples/comprehensive @@ -10,7 +10,7 @@ # Geographical coodinates. -# (KTH computer laboratories in this example.) +# (KTH building D computer laboratories in this example.) latitude, longitude = 59.3472, 18.0728 # Custom dayness by time settings. @@ -137,6 +137,16 @@ if not panicgate: current_calibration = [calib_get] +# These are fun curve manipulator settings that lowers the +# colour resolution. `red_x_resolution` is the number of colours +# colours there are one encoding axis of the red curve. +# `red_y_resolution` is how many colours there are on the +# output axis of the red curve. +red_x_resolution, red_y_resolution = [i_size], [o_size] +green_x_resolution, green_y_resolution = [i_size], [o_size] +blue_x_resolution, blue_y_resolution = [i_size], [o_size] + + # Loads the current monitor calibrations. m = 0 for i in range(len(current_calibration)): @@ -265,6 +275,15 @@ def periodically(year, month, day, hour, minute, second, weekday, fade): # If we only used one parameter, it would be applied to all colour components. rgb_contrast(contrast_red_, contrast_green_, contrast_blue_) + # Apply low colour resolution emulation. + rx = red_x_resolution[m % len(red_x_resolution)] + ry = red_y_resolution[m % len(red_y_resolution)] + gx = green_x_resolution[m % len(green_x_resolution)] + gy = green_y_resolution[m % len(green_y_resolution)] + bx = blue_x_resolution[m % len(blue_x_resolution)] + by = blue_y_resolution[m % len(blue_y_resolution)] + lower_resolution(rx, ry, gx, gy, bx, by) + # Clip colour curves to fit [0, 1] to avoid errors by complex numbers. clip() -- cgit v1.2.3-70-g09d2