From: Paul K. <pki...@ja...> - 2002-11-27 09:08:03
|
On Wed, Nov 27, 2002 at 10:39:59AM +0200, Simon Cross wrote: > 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. Regardless, the equivalent function in matlab is brighten(cmap,beta). Unless there is a good reason to introduce an incompatibility, we should follow the matlab convention. > > Also, the two argument version now writes the result to the current > colormap if the result is not assigned to variable. Okay. > > *** START DIFF of brighten-old.m against brighten-new.m *** Could you please use a context diff: diff -c old new Even with a context diff, the patch still wouldn't apply in this case because your are changing the same things that have already been changed in CVS. See: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/~checkout~/octave/octave-forge/main/image/brighten.m?rev=HEAD&content-type=text/plain You will need an octave version of at least 2.1.37? in order to use the new varargin/varargout style of processing. Sorry :-( > > 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 ] > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Get the new Palm Tungsten T > handheld. Power & Color in a compact size! > http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en > _______________________________________________ > Octave-dev mailing list > Oct...@li... > https://lists.sourceforge.net/lists/listinfo/octave-dev |