comparison scripts/image/cmpermute.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 0ba7be7fed1c
children d1285ebe60ca
comparison
equal deleted inserted replaced
15514:8d64e87c00cf 15515:4beb3a4bd440
52 if (! isreal (X) || issparse (X) 52 if (! isreal (X) || issparse (X)
53 || (isfloat (X) && (any (X(:) < 1 || any (X(:) != fix (X(:))))))) 53 || (isfloat (X) && (any (X(:) < 1 || any (X(:) != fix (X(:)))))))
54 error ("cmpermute: X must be an indexed image"); 54 error ("cmpermute: X must be an indexed image");
55 endif 55 endif
56 56
57 if (! isnumeric (map) || iscomplex (map) 57 if (! iscolormap (map))
58 || ndims (map) != 2 || columns (map) != 3
59 || any (map(:) < 0) || any (map(:) > 1))
60 error ("cmpermute: MAP must be a valid colormap"); 58 error ("cmpermute: MAP must be a valid colormap");
61 endif 59 endif
62 60
63 if (nargin < 3) 61 if (nargin < 3)
64 index = randperm (rows (map)); 62 index = randperm (rows (map));