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

function [ ] = videoColorMapFFMPEG( XI, YI, ZI, lowerLimit, upperLimit, v, contourEnable, useFixedSplPlotBounds, fixedLowerLimit, ...
                                    fixedUpperLimit, valueTickEnable, cmap, tickSize, tickBold )

    % compute color map                                                    
    pcolor( -XI, YI, ZI );
    axis off
    colormap( cmap )
    %colormap jet                                                                % define color set
    shading interp                                                              % better quality setting for colormap

    if useFixedSplPlotBounds == 1
        caxis( [ fixedLowerLimit fixedUpperLimit ] );                           % set absolute limits to Z-axis [dB]
    else                         
        caxis( [ lowerLimit upperLimit ] )                                      % set relative limits to Z-axis [dB]
    end

    if contourEnable && valueTickEnable
        hold on
        [ C, ~ ] = contour( -XI, YI, 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( -XI, YI, ZI, v );                                        % compute iso-lines
        h.LineColor = [0.5 0.5 0.5];
        h.LineWidth = 1.5;
        hold off
    end

end

