octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: First set of ported octave-forge functions


From: David Bateman
Subject: Re: First set of ported octave-forge functions
Date: Tue, 24 Jul 2007 18:24:55 +0200
User-agent: Thunderbird 1.5.0.7 (X11/20060921)

John W. Eaton wrote:
> On 24-Jul-2007, David Bateman wrote:
>
> | Ok committed. However, one point is that gray.m and ocean.m assume a 64
> | element colormap whereas the octave-forge colormap functions use
> | 
> |  number = rows (colormap);
> | 
> | to find the number of elements in the current colormap and use that.
> | Should we do the same for gray and ocean.
>
> I think Octave should do the same as Matlab in this case.
>
> jwe
>
>   
Patch attached, that also changes the deprecated is_scalar in the
colormap functions from octave-forge to isscalar...

D.

-- 
David Bateman                                address@hidden
Motorola Labs - Paris                        +33 1 69 35 48 04 (Ph) 
Parc Les Algorithmes, Commune de St Aubin    +33 6 72 01 06 33 (Mob) 
91193 Gif-Sur-Yvette FRANCE                  +33 1 69 35 77 01 (Fax) 

The information contained in this communication has been classified as: 

[x] General Business Information 
[ ] Motorola Internal Use Only 
[ ] Motorola Confidential Proprietary

*** ./scripts/image/rainbow.m.orig52    2007-07-24 18:23:43.722785989 +0200
--- ./scripts/image/rainbow.m   2007-07-24 18:23:43.728785686 +0200
***************
*** 34,40 ****
    if (nargin == 0)
      number = rows (colormap);
    elseif (nargin == 1)
!     if (! is_scalar (number))
        error ("rainbow: argument must be a scalar");
      endif
    else
--- 34,40 ----
    if (nargin == 0)
      number = rows (colormap);
    elseif (nargin == 1)
!     if (! isscalar (number))
        error ("rainbow: argument must be a scalar");
      endif
    else
*** ./scripts/image/summer.m.orig52     2007-07-24 18:23:43.743784927 +0200
--- ./scripts/image/summer.m    2007-07-24 18:23:43.749784623 +0200
***************
*** 32,38 ****
    if (nargin == 0)
      number = rows (colormap);
    elseif (nargin == 1)
!     if (! is_scalar (number))
        error ("summer: argument must be a scalar");
      endif
    else
--- 32,38 ----
    if (nargin == 0)
      number = rows (colormap);
    elseif (nargin == 1)
!     if (! isscalar (number))
        error ("summer: argument must be a scalar");
      endif
    else
*** ./scripts/image/winter.m.orig52     2007-07-24 18:23:43.764783864 +0200
--- ./scripts/image/winter.m    2007-07-24 18:23:43.770783560 +0200
***************
*** 32,38 ****
    if (nargin == 0)
      number = rows (colormap);
    elseif (nargin == 1)
!     if (! is_scalar (number))
        error ("winter: argument must be a scalar");
      endif
    else
--- 32,38 ----
    if (nargin == 0)
      number = rows (colormap);
    elseif (nargin == 1)
!     if (! isscalar (number))
        error ("winter: argument must be a scalar");
      endif
    else
*** ./scripts/image/ocean.m.orig52      2007-07-24 18:13:51.553243278 +0200
--- ./scripts/image/ocean.m     2007-07-24 18:18:30.724535386 +0200
***************
*** 20,26 ****
  ## -*- texinfo -*-
  ## @deftypefn {Function File} {} ocean (@var{n})
  ## Create color colormap.  The argument @var{n} should be a scalar.  If it
! ## is omitted, 64 is assumed.
  ## @end deftypefn
  
  ## Author: Tony Richardson <address@hidden>
--- 20,26 ----
  ## -*- texinfo -*-
  ## @deftypefn {Function File} {} ocean (@var{n})
  ## Create color colormap.  The argument @var{n} should be a scalar.  If it
! ## is omitted, the length of the current colormap or 64 is assumed.
  ## @end deftypefn
  
  ## Author: Tony Richardson <address@hidden>
***************
*** 30,36 ****
  function map = ocean (number)
  
    if (nargin == 0)
!     number = 64;
    elseif (nargin == 1)
      if (! isscalar (number))
        error ("ocean: argument must be a scalar");
--- 30,36 ----
  function map = ocean (number)
  
    if (nargin == 0)
!     number = rows (colormap);
    elseif (nargin == 1)
      if (! isscalar (number))
        error ("ocean: argument must be a scalar");
*** ./scripts/image/gray.m.orig52       2007-07-24 18:13:43.614639853 +0200
--- ./scripts/image/gray.m      2007-07-24 18:18:25.683783013 +0200
***************
*** 21,27 ****
  ## @deftypefn {Function File} {} gray (@var{n})
  ## Return a gray colormap with @var{n} entries corresponding to values from
  ## 0 to @var{n}-1.  The argument @var{n} should be a scalar.  If it is
! ## omitted, 64 is assumed.
  ## @end deftypefn
  
  ## Author: Tony Richardson <address@hidden>
--- 21,27 ----
  ## @deftypefn {Function File} {} gray (@var{n})
  ## Return a gray colormap with @var{n} entries corresponding to values from
  ## 0 to @var{n}-1.  The argument @var{n} should be a scalar.  If it is
! ## omitted, the length of the current colormap or 64 is assumed.
  ## @end deftypefn
  
  ## Author: Tony Richardson <address@hidden>
***************
*** 31,38 ****
  function map = gray (number)
  
    if (nargin == 0)
!     number = 64;
!   elseif (nargin > 1)
      print_usage ();
    endif
  
--- 31,42 ----
  function map = gray (number)
  
    if (nargin == 0)
!     number = rows (colormap);
!   elseif (nargin == 1)
!     if (! isscalar (number))
!       error ("gray: argument must be a scalar");
!     endif
!   else
      print_usage ();
    endif
  
*** ./scripts/image/autumn.m.orig52     2007-07-24 18:23:43.624790949 +0200
--- ./scripts/image/autumn.m    2007-07-24 18:23:43.630790646 +0200
***************
*** 32,38 ****
    if (nargin == 0)
      number = rows (colormap);
    elseif (nargin == 1)
!     if (! is_scalar (number))
        error ("autumn: argument must be a scalar");
      endif
    else
--- 32,38 ----
    if (nargin == 0)
      number = rows (colormap);
    elseif (nargin == 1)
!     if (! isscalar (number))
        error ("autumn: argument must be a scalar");
      endif
    else
*** ./scripts/image/bone.m.orig52       2007-07-24 18:23:43.634790443 +0200
--- ./scripts/image/bone.m      2007-07-24 18:23:43.640790140 +0200
***************
*** 32,38 ****
    if (nargin == 0)
      number = rows (colormap);
    elseif (nargin == 1)
!     if (! is_scalar (number))
        error ("bone: argument must be a scalar");
      endif
    else
--- 32,38 ----
    if (nargin == 0)
      number = rows (colormap);
    elseif (nargin == 1)
!     if (! isscalar (number))
        error ("bone: argument must be a scalar");
      endif
    else
*** ./scripts/image/brighten.m.orig52   2007-07-24 18:23:43.645789887 +0200
--- ./scripts/image/brighten.m  2007-07-24 18:23:43.649789684 +0200
***************
*** 52,58 ****
      print_usage ();
    endif
  
!   if ( (!is_scalar (beta)) || (beta <= -1) || (beta >= 1) )
      error ("brighten(...,beta) beta must be a scalar in the range (-1,1).");
    endif
  
--- 52,58 ----
      print_usage ();
    endif
  
!   if ( (!isscalar (beta)) || (beta <= -1) || (beta >= 1) )
      error ("brighten(...,beta) beta must be a scalar in the range (-1,1).");
    endif
  
*** ./scripts/image/cool.m.orig52       2007-07-24 18:23:43.654789431 +0200
--- ./scripts/image/cool.m      2007-07-24 18:23:43.658789229 +0200
***************
*** 32,38 ****
    if (nargin == 0)
      number = rows (colormap);
    elseif (nargin == 1)
!     if (! is_scalar (number))
        error ("cool: argument must be a scalar");
      endif
    else
--- 32,38 ----
    if (nargin == 0)
      number = rows (colormap);
    elseif (nargin == 1)
!     if (! isscalar (number))
        error ("cool: argument must be a scalar");
      endif
    else
*** ./scripts/image/copper.m.orig52     2007-07-24 18:23:43.663788976 +0200
--- ./scripts/image/copper.m    2007-07-24 18:23:43.667788773 +0200
***************
*** 32,38 ****
    if (nargin == 0)
      number = rows (colormap);
    elseif (nargin == 1)
!     if (! is_scalar (number))
        error ("copper: argument must be a scalar");
      endif
    else
--- 32,38 ----
    if (nargin == 0)
      number = rows (colormap);
    elseif (nargin == 1)
!     if (! isscalar (number))
        error ("copper: argument must be a scalar");
      endif
    else
*** ./scripts/image/hot.m.orig52        2007-07-24 18:23:43.672788520 +0200
--- ./scripts/image/hot.m       2007-07-24 18:23:43.676788318 +0200
***************
*** 32,38 ****
    if (nargin == 0)
      number = rows (colormap);
    elseif (nargin == 1) 
!       if (! is_scalar (number))
        error ("hot: argument must be a scalar");
      endif
    else
--- 32,38 ----
    if (nargin == 0)
      number = rows (colormap);
    elseif (nargin == 1) 
!       if (! isscalar (number))
        error ("hot: argument must be a scalar");
      endif
    else
*** ./scripts/image/hsv.m.orig52        2007-07-24 18:23:43.681788065 +0200
--- ./scripts/image/hsv.m       2007-07-24 18:23:43.685787862 +0200
***************
*** 32,38 ****
    if (nargin == 0)
      number = rows (colormap);
    elseif (nargin == 1)
!     if (! is_scalar (number))
        error ("hsv: argument must be a scalar");
      endif
    else
--- 32,38 ----
    if (nargin == 0)
      number = rows (colormap);
    elseif (nargin == 1)
!     if (! isscalar (number))
        error ("hsv: argument must be a scalar");
      endif
    else
*** ./scripts/image/jet.m.orig52        2007-07-24 18:23:43.691787558 +0200
--- ./scripts/image/jet.m       2007-07-24 18:23:43.697787255 +0200
***************
*** 32,38 ****
    if (nargin == 0)
      number = rows (colormap);
    elseif (nargin == 1)
!     if (! is_scalar (number))
        error ("jet: argument must be a scalar");
      endif
    else
--- 32,38 ----
    if (nargin == 0)
      number = rows (colormap);
    elseif (nargin == 1)
!     if (! isscalar (number))
        error ("jet: argument must be a scalar");
      endif
    else
*** ./scripts/image/pink.m.orig52       2007-07-24 18:23:43.701787052 +0200
--- ./scripts/image/pink.m      2007-07-24 18:23:43.707786749 +0200
***************
*** 32,38 ****
    if (nargin == 0)
      number = rows (colormap);
    elseif (nargin == 1)
!     if (! is_scalar (number))
        error ("pink: argument must be a scalar");
      endif
    else
--- 32,38 ----
    if (nargin == 0)
      number = rows (colormap);
    elseif (nargin == 1)
!     if (! isscalar (number))
        error ("pink: argument must be a scalar");
      endif
    else
*** ./scripts/image/prism.m.orig52      2007-07-24 18:23:43.712786496 +0200
--- ./scripts/image/prism.m     2007-07-24 18:23:43.718786192 +0200
***************
*** 32,38 ****
    if (nargin == 0)
      number = rows (colormap);
    elseif (nargin == 1)
!     if (! is_scalar (number))
        error ("prism: argument must be a scalar");
      endif
    else
--- 32,38 ----
    if (nargin == 0)
      number = rows (colormap);
    elseif (nargin == 1)
!     if (! isscalar (number))
        error ("prism: argument must be a scalar");
      endif
    else
*** ./scripts/image/spring.m.orig52     2007-07-24 18:23:43.733785433 +0200
--- ./scripts/image/spring.m    2007-07-24 18:23:43.739785129 +0200
***************
*** 32,38 ****
    if (nargin == 0)
      number = rows (colormap);
    elseif (nargin == 1)
!     if (! is_scalar (number))
        error ("spring: argument must be a scalar");
      endif
    else
--- 32,38 ----
    if (nargin == 0)
      number = rows (colormap);
    elseif (nargin == 1)
!     if (! isscalar (number))
        error ("spring: argument must be a scalar");
      endif
    else
*** ./scripts/image/white.m.orig52      2007-07-24 18:23:43.754784370 +0200
--- ./scripts/image/white.m     2007-07-24 18:23:43.759784117 +0200
***************
*** 32,38 ****
    if (nargin == 0)
      number = rows (colormap);
    elseif (nargin == 1)
!     if (! is_scalar (number))
        error ("white: argument must be a scalar");
      endif
    else
--- 32,38 ----
    if (nargin == 0)
      number = rows (colormap);
    elseif (nargin == 1)
!     if (! isscalar (number))
        error ("white: argument must be a scalar");
      endif
    else

reply via email to

[Prev in Thread] Current Thread [Next in Thread]