% videoColorMap.m This function plot a colormap for video superimposed to a black/white background image

function [ ] = ambisonicsVideoColorMapFFMPEG( azi, elev, ZI, lowerLimit, upperLimit, v, contourEnable, ...
                                              valueTickEnable, cmap, aziMat, elevMat, tickSize, tickBold )

% compute color map                                                    
pcolor( azi, elev, ZI );
axis off
colormap( cmap )
shading interp                                                              % better quality setting for colormap
                    
caxis( [ lowerLimit upperLimit ] )                                          % set relative limits to Z-axis [dB]

    if contourEnable && valueTickEnable
        hold on
        [ C, ~ ] = contour( aziMat, elevMat, ZI, v , 'k' );                          % compute iso-lines
        if tickBold == 1
            clabel( C, 'FontSize', tickSize, 'FontWeight', 'bold' );
        else
            clabel( C, 'FontSize', tickSize );
        end
        hold off
    elseif contourEnable
        hold on
        [ ~, h ] = contour( aziMat, elevMat, ZI, v );                                % compute iso-lines
        h.LineColor = [0.5 0.5 0.5];
        h.LineWidth = 1.5;
        hold off
    end
    
end