Home > freetb4matlab > image > cmpermute.m

cmpermute

PURPOSE ^

% Reorders colors in a colormap.

SYNOPSIS ^

function [Y, newmap] = cmpermute(X, map, index)

DESCRIPTION ^

% -*- texinfo -*-
% @deftypefn {Function File} {[@var{Y}, @var{newmap}] = } cmpermute (@var{X},@var{map})
% @deftypefnx {Function File} {[@var{Y}, @var{newmap}] = } cmpermute (@var{X},@var{map},@var{index})
% Reorders colors in a colormap.
%
% @code{[Y,newmap]=cmpermute(X,map)} rearranges colormap @var{map}
% randomly returning colormap @var{newmap} and generates indexed image
% @var{Y} so that it mantains correspondence between indices and the
% colormap from original indexed image @var{X} (both image and colormap
% pairs produce the same result).
%
% @code{[Y,newmap]=cmpermute(X,map,index)} behaves as described above
% but instead of sorting colors randomly, it uses @var{index} to define
% the order of the colors in the new colormap.
%
% @strong{Note:} @code{index} shouldn't have repeated elements, this
% function won't explicitly check this, but it will fail if it has.
%
% @end deftypefn

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Sat 16-May-2009 00:04:49 by m2html © 2003