% Puts NaN around image                        Steve Mann
%
% Y = bordernan(X,10);       % NaN border 10 pixels all around
%
% Y = border(X,3,4);   % 3 rows of zeros, 4 cols of zeros;
%                      % looks nice on a 3by4 image (eg. TV screen size)
%
% Y = border(X,0,0,10,20);   % pads 10 rows at bottom and 20 to right

function Y = dummy(X,thicknessrow,thicknesscol,thicknessrow2,thicknesscol2)

if nargin == 2
  thicknesscol = thicknessrow;
end%if
if nargin == 1
  disp('bordernan: width of border not specified; defaulting to 1 pixel wide')
  thicknesscol = 1;
  thicknessrow = 1;
end%if

if nargin==4
  error('bordernan: 4 input arguments not supported')
end%if

[M N] = size(X);

if nargin < 4 % pad all the way around
  rowpad = NaN*ones(thicknessrow,N);
  colpad = NaN*ones(M+2*thicknessrow,thicknesscol);
  Y = [colpad [rowpad; X; rowpad] colpad];
else%if
  rowpad = NaN*ones(thicknessrow,N);
  rowpad2 = NaN*ones(thicknessrow2,N);
  colpad = NaN*ones(M+thicknessrow+thicknessrow2,thicknesscol);
  colpad2 = NaN*ones(M+thicknessrow+thicknessrow2,thicknesscol2);
  Y = [colpad [rowpad; X; rowpad2] colpad2];
end%if
