function colr = stainedGlass(imName,nr,nc)
% Draw a "stained glass version" of a jpeg color image.
% imName is the string name of the jpeg file
% The stained glass picture has nr rows by nc columns of quadrilateral glass
% tiles.  Each tile has a color that is calculated from the jpeg image.
% colr is a 3-d array of rgb values (type double and size nr-by-nc-by-3):
%   colr(r,c,1) is the red value of tile (r,c),
%   colr(r,c,2) is the green value of tile (r,c), and
%   colr(r,c,3) is the blue value of tile (r,c).

close all

im= imread(imName);
imshow(im)
[nrIm,ncIm,np]= size(im);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% DO NOT modify the code above.  Write your code below.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Divide image into nr rows and nc columns of "blocks" and calculate
% the average rgb values of each block.  Scale the uint8 values to the
% range [0,1].




%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% DO NOT modify the code below.  Write your code above.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Generate coordinates of all "glass tiles"
[x, y] = allCoordinates(ncIm,nrIm,nc+1,nr+1);

% Draw the glass tiles
drawAllTiles(x,y,colr)


            