diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-02-24 16:28:06 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-02-24 16:28:06 +0100 |
commit | e9e22100195a3b8bd9a93ed3210bde262af714e2 (patch) | |
tree | 212672e4e4f4a0dfcd009f5c7250d38dc04effb8 /examples/comprehensive | |
parent | improve print_curves with compact parameters + fix lower_resolution (diff) | |
download | blueshift-e9e22100195a3b8bd9a93ed3210bde262af714e2.tar.gz blueshift-e9e22100195a3b8bd9a93ed3210bde262af714e2.tar.bz2 blueshift-e9e22100195a3b8bd9a93ed3210bde262af714e2.tar.xz |
improve lower_resolution and add the comprehensive test
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r-- | examples/comprehensive | 21 |
1 files changed, 20 insertions, 1 deletions
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() |