% 
% Usage:   Y =mexBayer(X,offset);
%
% Name: mexBayer
%
% Description: mexBayer applies a Bayer pattern to an image X.
%       There are four possible offsets.
%
% Inputs: X:  double m x n matrix   
%         offset: scalar, 0,1,2 or 3   
%
% Output: Y: double m x m matrix 
%
% Author: Julien Mairal, 2009


