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: CalcImgEntropy.m
    path of file: ./repos/StackExchangeCodes/SignalProcessing/Q84826
    
    the code of the file until where you have to start completion: function [ imgEntropy ] = CalcImgEntropy( mI, entropyMode )
% ----------------------------------------------------------------------------------------------- %
% [ imgEntropy ] = CalcImgEntropy( mI, entropyMode )
% Calculates the entropy of an image with up to 8 channels. Supports per
% channel clauclation or represenation of the pixel as a single number.
% Input:
%   - mI                -   Input Image.
%                           The image to have its entropy calculated.
%                           Structure: Matrix (numRowx x numCols).
%                           Type: 'unit8'.
%                           Range: [0, 255].
%   - entropyMode       -   Entropy Mode.
%                           Sets the entropy calculation mode: Per channel
%                           or as an integrated pixel value.
%                           Structure: Scalar.
%                           Type: 'Single' / 'Double'.
%                           Range: {1, 2}.
% Output:
%   - imgEntropy        -   The Image Entropy.
%                           The calculated entropy value.
%                           Structure: Scalar (1 x 1).
%                           Type: 'Single' / 'Double'.
%                           Range: (-inf, inf).
% References:
%   1.  A
% Remarks:

    
function [ imgEntropy ] = CalcImgEntropy( mI, entropyMode )
% ----------------------------------------------------------------------------------------------- %
% [ imgEntropy ] = CalcImgEntropy( mI, entropyMode )
% Calculates the entropy of an image with up to 8 channels. Supports per
% channel clauclation or represenation of the pixel as a single number.
% Input:
%   - mI                -   Input Image.
%                           The image to have its entropy calculated.
%                           Structure: Matrix (numRowx x numCols).
%                           Type: 'unit8'.
%                           Range: [0, 255].
%   - entropyMode       -   Entropy Mode.
%                           Sets the entropy calculation mode: Per channel
%                           or as an integrated pixel value.
%                           Structure: Scalar.
%                           Type: 'Single' / 'Double'.
%                           Range: {1, 2}.
% Output:
%   - imgEntropy        -   The Image Entropy.
%                           The calculated entropy value.
%                           Structure: Scalar (1 x 1).
%                           Type: 'Single' / 'Double'.
%                           Range: (-inf, inf).
% References:
%   1.  A
% Remarks:
%   1.  The "Vector" calculation basically concatentate each pixel value
%       in its bits representation. For instance, for RGB image of input
%       `uint8` we basically creates a value of 24 Bits by shifting the G
%       channel by 8 bits and the B channel by 16 bits.
%   2.  Remove the `areguments` blocks for compatibility with MATLAB
%       versions prior to R2022b.
% TODO:
%   1.  Add support for `uint16` input with up to 3 channels.
% Release Notes:
%   -   1.0.000     10/10/2022  Royi Avital
%       *   First release version.
% ----------------------------------------------------------------------------------------------- %

arguments (Input)
    mI (:, :, :) {mustBeA(mI, {'uint8'})}
    entropyMode (1, 1) {mustBeNumeric, mustBeReal, mustBePositive, mustBeInteger, mustBeMember(entropyMode, [1, 2])} = 1
end