comparison scripts/image/ind2rgb.m @ 15515:4beb3a4bd440

rgbplot.m, cmpermute.m, cmunique.m, ind2rgb.m, imwrite.m: use core iscolormap function
author Carnë Draug <carandraug+dev@gmail.com>
date Fri, 12 Oct 2012 23:11:08 +0200
parents 1f911333ed3d
children 806ea52af230 4db08f52a6ed
comparison
equal deleted inserted replaced
15514:8d64e87c00cf 15515:4beb3a4bd440
44 if (ndims (x) != 2 || any (x(:) != fix (x(:))) || min (x(:)) < 1) 44 if (ndims (x) != 2 || any (x(:) != fix (x(:))) || min (x(:)) < 1)
45 error ("ind2rgb: X must be an indexed image"); 45 error ("ind2rgb: X must be an indexed image");
46 endif 46 endif
47 47
48 ## Check the color map. 48 ## Check the color map.
49 if (ndims (map) != 2 || columns (map) != 3) 49 if (! iscolormap (map))
50 error ("ind2rgb: MAP must be a valid colormap"); 50 error ("ind2rgb: MAP must be a valid colormap");
51 endif 51 endif
52 52
53 ## Do we have enough colors in the color map? 53 ## Do we have enough colors in the color map?
54 maxidx = max (x(:)); 54 maxidx = max (x(:));