Mercurial > octave
comparison scripts/image/imshow.m @ 4914:1c0442da75fd
[project @ 2004-07-23 16:55:13 by jwe]
author | jwe |
---|---|
date | Fri, 23 Jul 2004 16:55:13 +0000 |
parents | 048db020498c |
children | 4c8a2e4e0717 |
comparison
equal
deleted
inserted
replaced
4913:c8368716bab3 | 4914:1c0442da75fd |
---|---|
67 ## All except imshow (r, g, b) | 67 ## All except imshow (r, g, b) |
68 | 68 |
69 if (mvars != 3) | 69 if (mvars != 3) |
70 I = varargin{1}; | 70 I = varargin{1}; |
71 if (iscomplex (I)) | 71 if (iscomplex (I)) |
72 warning ("imshow: displaying real part of complex image"); | 72 warning ("imshow: displaying real part of complex image"); |
73 I = real (I); | 73 I = real (I); |
74 endif | 74 endif |
75 if (max (I(:)) <= 1) | 75 if (max (I(:)) <= 1) |
76 ## image in [0-1]; scale to [0-255] | 76 ## image in [0-1]; scale to [0-255] |
77 I = I * 255; | 77 I = I * 255; |
78 M = gray (256); | 78 M = gray (256); |
107 g = real (g); | 107 g = real (g); |
108 b = real (b); | 108 b = real (b); |
109 endif | 109 endif |
110 if (max (tmp(:)) > 1) | 110 if (max (tmp(:)) > 1) |
111 ## Normalise to [0-1]. | 111 ## Normalise to [0-1]. |
112 r = r/255; | 112 r = r / 255; |
113 g = g/255; | 113 g = g / 255; |
114 b = b/255; | 114 b = b / 255; |
115 endif | 115 endif |
116 [I, M] = rgb2ind (r, g, b); | 116 [I, M] = rgb2ind (r, g, b); |
117 endif | 117 endif |
118 | 118 |
119 ## Check for "truesize". | 119 ## Check for "truesize". |