From: Simon C. <si...@li...> - 2002-11-27 08:48:23
|
Greetings, I've altered brighten so that the two argument version is now brighten (beta,map). Since the old brighten (map,beta) didn't seem to work this shouldn't cause any problems. Putting beta first agress with the tex-info documentation and it seems more logical to put optional arguments at the end. Also, the two argument version now writes the result to the current colormap if the result is not assigned to variable. *** START DIFF of brighten-old.m against brighten-new.m *** 18,20c18,25 < ## @deftypefn {Function File} @var{map}= brighten (@var{beta},@var{map}) < ## darkens or brightens the current colormap. < ## The argument @var{beta} should be a scalar between -1...1, --- > ## @deftypefn {Function File} @var{map_out}= brighten (@var{beta},@var{map}) > ## @deftypefnx {Function File} @var{map_out}= brighten (@var{beta}) > ## darkens or brightens the given colormap. > ## If the @var{map} argument is omitted, the function is applied to the > ## current colormap. > ## Should the resulting colormap @var{map_out} not assigned, it will be > ## written to the current colormap. > ## The argument @var{beta} should be a scalar between -1 and 1, 23,24c28 < ## If the @var{map} argument is omitted, < ## the function is applied to the current colormap --- > ## 30c34 < function [...] = brighten (m, beta) --- > function [...] = brighten (beta, m) 35d38 < beta = m; 39,48c42,43 < if (nargout == 0) < usage ("map_out=brighten(map,beta)") < endif < < if !(is_scalar (beta) || beta < -1 || beta > 1) < error ("brighten(...,beta) beta must be a scalar in the range -1..1"); < endif < < if !( is_matrix (m) && size (m, 2) == 3 ) < error ("brighten(map,beta) map must be a matrix of size nx3"); --- > if ( (!is_matrix (m)) || (size (m, 2) != 3) ) > error ("brighten(beta,map): map must be a matrix of size nx3."); 52c47,51 < usage ("brighten(...) number of arguments must be 1 or 2"); --- > usage ("brighten(...) number of arguments must be 1 or 2."); > endif > > if ( (!is_scalar (beta)) || (beta <= -1) || (beta >= 1) ) > error ("brighten(beta,...) beta must be a scalar in the range (-1,1)."); 62c61 < __current_color_map__ = __current_color_map__ .^ gamma; --- > __current_color_map__ = m .^ gamma; 64c63 < vr_val (map .^ gamma); --- > vr_val (m .^ gamma); *** END DIFF *** Schiavo Simon -- The fact that one can live a life where morality is solely a human affair; where the natural world offers beauty in abundance; and where life is even more precious for being finite is one all freethinkers know, and that's why religion doesn't matter. - coljac on www.kuro5hin.org [ email: ten.az.noulg@nomis Reversed to foil tel: (c) 4979 486 380 (w) 3123 056 (120) spambots ] |