function newmap=mapoffset(map, c) %MAPOFFSET Move the colormap offset % % Copyright (c) 1995 by Claudio Rivetti and Mark Young % claudio@alice.uoregon.edu, mark@alice.uoregon.edu % global ed_contrast MapSize if nargin>2 error('Too many input arguments.'); end if nargin<1 c=0; end if c<-10 | c>10 error('Input argument must be between -10 and 10'); end if c>0 bc=round(MapSize*(1-c*0.1)); ab=MapSize-bc; abmap=zeros(ab,3); for i=1:size(abmap,2) abmap(:,i)=abmap(:,i)+map(1,i); end bcmap=map(1:bc,:); else ab=round(MapSize*(1+c*0.1)); bc=MapSize-ab; bcmap=zeros(bc,3); if bc>0 for i=1:size(bcmap,2) bcmap(:,i)=bcmap(:,i)+map(MapSize,i); end end abmap=map(bc+1:MapSize,:); end newmap=[abmap;bcmap]; return