From bcec7f5b772067aadbbd69a86c5294a2cccd98a3 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 24 Feb 2014 15:20:14 +0100 Subject: make lower_resultion's parameters optional MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/curve.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/curve.py b/src/curve.py index 4f1d58d..c559e73 100644 --- a/src/curve.py +++ b/src/curve.py @@ -462,13 +462,15 @@ def manipulate(r, g = None, b = None): # TODO document this elsewhere, and make it possible to have non-round x_colours -def lower_resolution(x_colours, y_colours): +def lower_resolution(x_colours = None, y_colours = None): ''' Emulates low colour resolution - @param x_colours:int The number of colours to emulate on the encoding axis - @param y_colours:int The number of colours to emulate on the output axis + @param x_colours:int? The number of colours to emulate on the encoding axis, `i_size` if `None` + @param y_colours:int? The number of colours to emulate on the output axis, `o_size` if `None` ''' + if x_colours is None: x_colours = i_size + if y_colours is None: y_colours = o_size x_r = i_size / x_colours y_r = o_size / y_colours for curve in (r_curve, g_curve, b_curve): -- cgit v1.2.3-70-g09d2