You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: ConvertXYZtoCIELab.m
    path of file: ./repos/HDR_Toolbox/source_code/ColorSpace
    
    the code of the file until where you have to start completion: function imgOut = ConvertXYZtoCIELab(img, inverse, conv_whitePoint)
%
%       imgOut = ConvertXYZtoCIELab(img, inverse, conv_whitePoint)
%

    
function imgOut = ConvertXYZtoCIELab(img, inverse, conv_whitePoint)
%
%       imgOut = ConvertXYZtoCIELab(img, inverse, conv_whitePoint)
%
%
%        Input:
%           -img: image to convert from XYZ to CIE Lab or from Lab to XYZ
%           -inverse: takes as values 0 or 1. If it is set to 0 the
%                     transformation from XYZ to CIE Lab is applied, otherwise
%                     the transformation from CIE Lab to XYZ
%           -conv_whitePoint: the white point in XYZ coordiantes
%
%        Output:
%           -imgOut: converted image in CIE Lab if inverse = 0, otherwise XYZ
%
%     Copyright (C) 2013  Francesco Banterle
% 
%     This program is free software: you can redistribute it and/or modify
%     it under the terms of the GNU General Public License as published by
%     the Free Software Foundation, either version 3 of the License, or
%     (at your option) any later version.
% 
%     This program is distributed in the hope that it will be useful,
%     but WITHOUT ANY WARRANTY; without even the implied warranty of
%     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%     GNU General Public License for more details.
% 
%     You should have received a copy of the GNU General Public License
%     along with this program.  If not, see <http://www.gnu.org/licenses/>.
%

check3Color(img);

imgOut = zeros(size(img));

if(~exist('conv_whitePoint', 'var'))
    conv_whitePoint = [1, 1, 1];
end