function hLib = Ifx_IntLkUpBaseMap_CRLEntry(hLib)
% Key: lookup2D
% y1: Result
% u1: Yin 
% u2: Xin
% u3: Y_array
% u4: X_array
% u5: Val_array
% u6: Nx
% u7: Ny    
    
%% DataType
               % Conceptual datatype       Implementation datatype 
int8datatype =   {'fixdt(1,8,0)',            'int8'};
int16datatype =  {'fixdt(1,16,0)',           'int16'};
uint8datatype =  {'fixdt(0,8,0)',            'uint8'};
uint16datatype = {'fixdt(0,16,0)',           'uint16'};

%% Code Replacement Library Entries
%% Column-major routines (COLUMN_DIR)
%0x0AA
hLib.addEntry( Ifx_addEntry_IntLkUpBaseMap('Ifx_IntLkUpBaseMap_u8u8_u8', uint8datatype, uint8datatype, uint8datatype, uint8datatype, ...
    uint8datatype, uint8datatype, uint8datatype, uint8datatype, false) );
%0x0AB
hLib.addEntry( Ifx_addEntry_IntLkUpBaseMap('Ifx_IntLkUpBaseMap_s8s8_s8', int8datatype, int8datatype, int8datatype, int8datatype, ...
    int8datatype, int8datatype, int8datatype, int8datatype, false) );
%0x0AC
hLib.addEntry( Ifx_addEntry_IntLkUpBaseMap('Ifx_IntLkUpBaseMap_u16u16_u16', uint16datatype, uint16datatype, uint16datatype, uint16datatype, ...
    uint16datatype, uint16datatype, uint16datatype, uint16datatype, false) );
%0x0AD
hLib.addEntry( Ifx_addEntry_IntLkUpBaseMap('Ifx_IntLkUpBaseMap_s16s16_s16', int16datatype, int16datatype, int16datatype, int16datatype, ...
    int16datatype, int16datatype, int16datatype, int16datatype, false) );

%% Row-major routines (ROW_DIR)
%0x0AA
hLib.addEntry( Ifx_addEntry_IntLkUpBaseMap('Ifx_IntLkUpBaseMap_u8u8_u8', uint8datatype, uint8datatype, uint8datatype, uint8datatype, ...
    uint8datatype, uint8datatype, uint8datatype, uint8datatype, true) );
%0x0AB
hLib.addEntry( Ifx_addEntry_IntLkUpBaseMap('Ifx_IntLkUpBaseMap_s8s8_s8', int8datatype, int8datatype, int8datatype, int8datatype, ...
    int8datatype, int8datatype, int8datatype, int8datatype, true) );
%0x0AC
hLib.addEntry( Ifx_addEntry_IntLkUpBaseMap('Ifx_IntLkUpBaseMap_u16u16_u16', uint16datatype, uint16datatype, uint16datatype, uint16datatype, ...
    uint16datatype, uint16datatype, uint16datatype, uint16datatype, true) );
%0x0AD
hLib.addEntry( Ifx_addEntry_IntLkUpBaseMap('Ifx_IntLkUpBaseMap_s16s16_s16', int16datatype, int16datatype, int16datatype, int16datatype, ...
    int16datatype, int16datatype, int16datatype, int16datatype, true) );

end

function hEnt = Ifx_addEntry_IntLkUpBaseMap(signature, datatype_y1, datatype_u1, ...
    datatype_u2, datatype_Nx, datatype_Ny, datatype_u3, datatype_u4, datatype_u5, ...
    createRowMajorRoutine)

hEnt = coder.Ifx_IntMapCustomEntry;

%% Set Function Entry Parameters
hEnt.setTflCFunctionEntryParameters( ...
    'Key', 'lookup2D', ...
    'Priority', 100, ...
    'SupportSymbolicDimensions', true, ...
    'ImplementationName', signature, ...
    'ImplementationHeaderFile', 'Ifx.h');

%% Add Algorithm Properties
                    % Parameter                                     Value
algPropertyList = {{'InterpMethod',                               'Flat'},...
                   {'ExtrapMethod',                               'Clip'},...
                   {'IndexSearchMethod',                          {'Linear search', 'Binary search'}},...
                   {'UseLastTableValue'                           'on'},...
                   {'RemoveProtectionInput'                       'off'},...
                   {'RndMeth',                                    {'Round', 'Zero'}}};
               
%% Set ArrayLayout and UseRowMajorAlgorithm
[hEnt, algPropertyList] = Ifx_setMapRowMajorAttributes(hEnt, algPropertyList, createRowMajorRoutine);   

hEnt = addAlgorithmParameters(hEnt, algPropertyList);

%% Add Conceptual and implementation Arguments
% Conceptual Arguments
hEnt = Ifx_addIntMapConceptualArguments(hEnt, datatype_y1, datatype_u1, datatype_u2, datatype_u3, datatype_u4, datatype_u5);

% Implementation Arguments
hEnt = Ifx_addIntMapImplementationArguments(hEnt, datatype_y1, datatype_u1, datatype_u2, datatype_u3, datatype_u4, ...
    datatype_u5, datatype_Nx, datatype_Ny, createRowMajorRoutine);

%% Map and cache argument locations for use in do_match tasks
hEnt.mapAndCacheLabeledArgLocations();

end
