2847
|
1 ## Copyright (C) 1996, 1997 John W. Eaton |
2313
|
2 ## |
|
3 ## This file is part of Octave. |
|
4 ## |
|
5 ## Octave is free software; you can redistribute it and/or modify it |
|
6 ## under the terms of the GNU General Public License as published by |
|
7 ## the Free Software Foundation; either version 2, or (at your option) |
|
8 ## any later version. |
|
9 ## |
|
10 ## Octave is distributed in the hope that it will be useful, but |
|
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
13 ## General Public License for more details. |
|
14 ## |
|
15 ## You should have received a copy of the GNU General Public License |
|
16 ## along with Octave; see the file COPYING. If not, write to the Free |
|
17 ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA |
|
18 ## 02111-1307, USA. |
1024
|
19 |
3381
|
20 ## -*- texinfo -*- |
3373
|
21 ## @deftypefn {Function File} {} imshow (@var{x}, @var{map}) |
|
22 ## @deftypefnx {Function File} {} imshow (@var{x}, @var{n}) |
|
23 ## @deftypefnx {Function File} {} imshow (@var{i}, @var{n}) |
|
24 ## @deftypefnx {Function File} {} imshow (@var{r}, @var{g}, @var{b}) |
2311
|
25 ## Display images. |
3426
|
26 ## |
3373
|
27 ## @code{imshow (@var{x})} displays an indexed image using the current |
|
28 ## colormap. |
3426
|
29 ## |
3373
|
30 ## @code{imshow (@var{x}, @var{map})} displays an indexed image using the |
|
31 ## specified colormap. |
3426
|
32 ## |
3373
|
33 ## @code{imshow (@var{i}, @var{n})} displays a gray scale intensity image. |
3426
|
34 ## |
3373
|
35 ## @code{imshow (@var{r}, @var{g}, @var{b})} displays an RGB image. |
|
36 ## @end deftypefn |
3457
|
37 ## @seealso{image, imagesc, colormap, gray2ind, and rgb2ind} |
904
|
38 |
3202
|
39 ## Author: Tony Richardson <arichard@stark.cc.oh.us> |
2312
|
40 ## Created: July 1994 |
|
41 ## Adapted-By: jwe |
559
|
42 |
2312
|
43 function imshow (a1, a2, a3) |
559
|
44 |
1024
|
45 if (nargin < 0 || nargin > 3) |
|
46 usage ("imshow (args)"); |
|
47 elseif (nargin == 2) |
|
48 if (length (a2) == 1) |
|
49 [a1, a2] = gray2ind (a1, a2); |
559
|
50 endif |
1024
|
51 colormap (a2); |
|
52 elseif (nargin == 3) |
|
53 [a1, a2] = rgb2ind (a1, a2, a3); |
|
54 colormap (a2); |
559
|
55 endif |
|
56 |
1024
|
57 image (a1); |
559
|
58 |
|
59 endfunction |