Mercurial > hg > octave-lyh
changeset 6165:ea26b8fda4d7
[project @ 2006-11-14 23:32:28 by jwe]
author | jwe |
---|---|
date | Tue, 14 Nov 2006 23:32:28 +0000 |
parents | d90b16110095 |
children | 17f25cd588b2 |
files | scripts/image/image_viewer.m |
diffstat | 1 files changed, 30 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/image/image_viewer.m +++ b/scripts/image/image_viewer.m @@ -82,28 +82,41 @@ print_usage (); endif - ocmd = view_cmd; - ofcn = view_fcn; - ozoom = view_zoom; - - if (nargin > 0) - view_cmd = cmd; + if (nargout > 0) + ocmd = view_cmd; + ofcn = view_fcn; + ozoom = view_zoom; endif - if (nargin > 1) - if (isa (fcn, "function_handle")) - view_fcn = fcn; - else - error ("image_viewer: expecting second argument to be a function handle"); + if (nargin > 0) + + if (nargin < 3) + zoom = 1; + if (nargin < 2) + fcn = []; + endif endif - endif + + view_cmd = cmd; + view_fcn = fcn; + view_zoom = zoom; - if (nargin > 2) - if (isnumeric (zoom) && isscalar (zoom) && isreal (zoom)) - view_zoom = zoom; - else - error ("image_viewer: expecting third argument to be a real scalar"); + if (nargin > 1) + if (isa (fcn, "function_handle")) + view_fcn = fcn; + else + error ("image_viewer: expecting second argument to be a function handle"); + endif endif + + if (nargin > 2) + if (isnumeric (zoom) && isscalar (zoom) && isreal (zoom)) + view_zoom = zoom; + else + error ("image_viewer: expecting third argument to be a real scalar"); + endif + endif + endif endfunction