Mercurial > hg > octave-avbm
comparison scripts/image/rgb2ind.m @ 15715:6ae93518356c
rgbplot.m. Match variable in docstring to function prototype.
* rgb2ind.m: Use Octave coding convention for parenthesis around switch arg.
* rgbplot.m: Match variable in docstring to function prototype.
Tweak docstring. Use Octave coding convention for parenthesis around
switch arg.
author | Rik <rik@octave.org> |
---|---|
date | Sun, 02 Dec 2012 10:17:46 -0800 |
parents | b1cd65881592 |
children | 5d6243c2acbf |
comparison
equal
deleted
inserted
replaced
15714:b1cd65881592 | 15715:6ae93518356c |
---|---|
56 map = unique ([R(:) G(:) B(:)], "rows"); | 56 map = unique ([R(:) G(:) B(:)], "rows"); |
57 [~, x] = ismember ([R(:) G(:) B(:)], map, "rows"); | 57 [~, x] = ismember ([R(:) G(:) B(:)], map, "rows"); |
58 x = reshape (x, size (R)); | 58 x = reshape (x, size (R)); |
59 | 59 |
60 ## a colormap is of class double and values between 0 and 1 | 60 ## a colormap is of class double and values between 0 and 1 |
61 switch class (R) | 61 switch (class (R)) |
62 case {"single", "double", "logical"} | 62 case {"single", "double", "logical"} |
63 ## do nothing, return the same | 63 ## do nothing, return the same |
64 case {"uint8", "uint16"} | 64 case {"uint8", "uint16"} |
65 map = double (map) / double (intmax (class (R))); | 65 map = double (map) / double (intmax (class (R))); |
66 case "int16" | 66 case "int16" |