Mercurial > octave
diff scripts/image/imshow.m @ 559:4e826edfbc56
[project @ 1994-07-25 22:18:28 by jwe]
Initial revision
author | jwe |
---|---|
date | Mon, 25 Jul 1994 22:19:05 +0000 |
parents | |
children | 3470f1e25a79 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/image/imshow.m Mon Jul 25 22:19:05 1994 +0000 @@ -0,0 +1,33 @@ +function imshow(a1,a2,a3) +#Display images. +# +#imshow(X) displays an indexed image using the current colormap. +# +#imshow(X,map) displays an indexed image using the specified colormap. +# +#imshow(I,n) displays a gray scale intensity image. +# +#imshow(R,G,B) displays an RGB image. +# +#SEE ALSO: image, imagesc, colormap, gray2ind, rgb2ind. + +#Author: +# Tony Richardson +# amr@mpl.ucsd.edu +# July 1994 + + if (nargin == 0) + error("usage: imshow requires at least one argument."); + elseif(nargin == 2) + if(length(a2)==1) + [a1 a2] = gray2ind(a1,a2); + endif + colormap(a2); + elseif(nargin == 3) + [a1 a2] = rgb2ind(a1,a2,a3); + colormap(a2); + endif + + image(a1); + +endfunction