////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
// All Rights Reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// THIS IS AUTO-GENERATED CODE.  PLEASE DO NOT EDIT (File bug reports against tools).
///
/// Auto-generated by: Parameter Parser V5.5.1 (2411131018)
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @file  demosaic_3_6_0.cpp
/// @brief Auto-generated Chromatix parameter file
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#include "demosaic_3_6_0.h"
#include "parametersetmanager.h"

DEMOSAIC_3_6_0_NAMESPACE_BEGIN

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// SetValue/GetValue Functions
/// Gets or sets the requested value
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool demosaic36_rgn_dataType::GetValue(
    const CHAR* const __path,
    CHAR* const       __value,
    UINT32 const      __size)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "edge_det_weight") == 0)
    {
        ParameterUtils::DoubleToString((double)edge_det_weight, __value, __size);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "edge_det_noise_offset") == 0)
    {
        ParameterUtils::DoubleToString((double)edge_det_noise_offset, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "dis_directional_g") == 0)
    {
        ParameterUtils::DoubleToString((double)dis_directional_g, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "dis_directional_rb") == 0)
    {
        ParameterUtils::DoubleToString((double)dis_directional_rb, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "lambda_g") == 0)
    {
        ParameterUtils::DoubleToString((double)lambda_g, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "lambda_rb") == 0)
    {
        ParameterUtils::DoubleToString((double)lambda_rb, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "en_dyna_clamp_g") == 0)
    {
        ParameterUtils::DoubleToString((double)en_dyna_clamp_g, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "en_dyna_clamp_rb") == 0)
    {
        ParameterUtils::DoubleToString((double)en_dyna_clamp_rb, __value, __size, 0);
        __result = true;
    }

    return __result;
}

bool demosaic36_rgn_dataType::SetValue(
    const CHAR* const __path,
    const CHAR* const __value)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "edge_det_weight") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            edge_det_weight = (float)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "edge_det_noise_offset") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            edge_det_noise_offset = (float)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "dis_directional_g") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            dis_directional_g = (float)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "dis_directional_rb") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            dis_directional_rb = (float)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "lambda_g") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            lambda_g = (float)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "lambda_rb") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            lambda_rb = (float)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "en_dyna_clamp_g") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            en_dyna_clamp_g = (float)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "en_dyna_clamp_rb") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            en_dyna_clamp_rb = (float)dblValue; 
        }
    }

    return __result;
}

bool demosaic36_rgn_dataType::GetInfo(
    const CHAR* const           __path,
    PList<ParameterParserInfo>& __info)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    // edge_det_weight
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("edge_det_weight", ParameterParserDataType::Float, (double)edge_det_weight));
    }
    else if (PARAMETER_STRCMP(__name, "edge_det_weight") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Float, (double)edge_det_weight));
    }

    // edge_det_noise_offset
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("edge_det_noise_offset", ParameterParserDataType::UInt32, (double)edge_det_noise_offset, 0));
    }
    else if (PARAMETER_STRCMP(__name, "edge_det_noise_offset") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::UInt32, (double)edge_det_noise_offset, 0));
    }

    // dis_directional_g
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("dis_directional_g", ParameterParserDataType::UInt32, (double)dis_directional_g, 0));
    }
    else if (PARAMETER_STRCMP(__name, "dis_directional_g") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::UInt32, (double)dis_directional_g, 0));
    }

    // dis_directional_rb
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("dis_directional_rb", ParameterParserDataType::UInt32, (double)dis_directional_rb, 0));
    }
    else if (PARAMETER_STRCMP(__name, "dis_directional_rb") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::UInt32, (double)dis_directional_rb, 0));
    }

    // lambda_g
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("lambda_g", ParameterParserDataType::Int32, (double)lambda_g, 0));
    }
    else if (PARAMETER_STRCMP(__name, "lambda_g") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Int32, (double)lambda_g, 0));
    }

    // lambda_rb
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("lambda_rb", ParameterParserDataType::Int32, (double)lambda_rb, 0));
    }
    else if (PARAMETER_STRCMP(__name, "lambda_rb") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Int32, (double)lambda_rb, 0));
    }

    // en_dyna_clamp_g
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("en_dyna_clamp_g", ParameterParserDataType::UInt32, (double)en_dyna_clamp_g, 0));
    }
    else if (PARAMETER_STRCMP(__name, "en_dyna_clamp_g") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::UInt32, (double)en_dyna_clamp_g, 0));
    }

    // en_dyna_clamp_rb
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("en_dyna_clamp_rb", ParameterParserDataType::UInt32, (double)en_dyna_clamp_rb, 0));
    }
    else if (PARAMETER_STRCMP(__name, "en_dyna_clamp_rb") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::UInt32, (double)en_dyna_clamp_rb, 0));
    }

    return __result;
}

bool mod_demosaic36_aec_dataType::GetValue(
    const CHAR* const __path,
    CHAR* const       __value,
    UINT32 const      __size)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    const UINT32 __pos = ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "aec_trigger") == 0)
    {
        __result = aec_trigger.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "demosaic36_rgn_data") == 0)
    {
        __result = demosaic36_rgn_data.GetValue(&__path[__pos], __value, __size);
    }

    return __result;
}

bool mod_demosaic36_aec_dataType::SetValue(
    const CHAR* const __path,
    const CHAR* const __value)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    const UINT32 __pos = ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "aec_trigger") == 0)
    {
        __result = aec_trigger.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "demosaic36_rgn_data") == 0)
    {
        __result = demosaic36_rgn_data.SetValue(&__path[__pos], __value);
    }

    return __result;
}

bool mod_demosaic36_aec_dataType::GetInfo(
    const CHAR* const           __path,
    PList<ParameterParserInfo>& __info)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    const UINT32 __pos = ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    // aec_trigger
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("aec_trigger", ParameterParserDataType::Structure));
    }
    else if (PARAMETER_STRCMP(__name, "aec_trigger") == 0)
    {
        __result = aec_trigger.GetInfo(&__path[__pos], __info);
    }

    // demosaic36_rgn_data
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("demosaic36_rgn_data", ParameterParserDataType::Structure));
    }
    else if (PARAMETER_STRCMP(__name, "demosaic36_rgn_data") == 0)
    {
        __result = demosaic36_rgn_data.GetInfo(&__path[__pos], __info);
    }

    return __result;
}

bool mod_demosaic36_hdr_aec_dataType::GetValue(
    const CHAR* const __path,
    CHAR* const       __value,
    UINT32 const      __size)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    const UINT32 __pos = ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "hdr_aec_trigger") == 0)
    {
        __result = hdr_aec_trigger.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "hdr_aec_data") == 0)
    {
        __result = hdr_aec_data.GetValue(&__path[__pos], __value, __size);
    }

    return __result;
}

bool mod_demosaic36_hdr_aec_dataType::SetValue(
    const CHAR* const __path,
    const CHAR* const __value)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    const UINT32 __pos = ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "hdr_aec_trigger") == 0)
    {
        __result = hdr_aec_trigger.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "hdr_aec_data") == 0)
    {
        __result = hdr_aec_data.SetValue(&__path[__pos], __value);
    }

    return __result;
}

bool mod_demosaic36_hdr_aec_dataType::GetInfo(
    const CHAR* const           __path,
    PList<ParameterParserInfo>& __info)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    const UINT32 __pos = ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    // hdr_aec_trigger
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("hdr_aec_trigger", ParameterParserDataType::Structure));
    }
    else if (PARAMETER_STRCMP(__name, "hdr_aec_trigger") == 0)
    {
        __result = hdr_aec_trigger.GetInfo(&__path[__pos], __info);
    }

    // hdr_aec_data
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("hdr_aec_data", ParameterParserDataType::Structure));
    }
    else if (PARAMETER_STRCMP(__name, "hdr_aec_data") == 0)
    {
        __result = hdr_aec_data.GetInfo(&__path[__pos], __info);
    }

    return __result;
}

bool mod_demosaic36_hdr_aec_dataType::hdr_aec_dataStruct::GetValue(
    const CHAR* const __path,
    CHAR* const       __value,
    UINT32 const      __size)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    const UINT32 __pos = ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "mod_demosaic36_aec_data") == 0)
    {
        if (__index < mod_demosaic36_aec_dataCount)
        {
            __result = mod_demosaic36_aec_data[__index].GetValue(&__path[__pos], __value, __size);
        }
    }

    return __result;
}

bool mod_demosaic36_hdr_aec_dataType::hdr_aec_dataStruct::SetValue(
    const CHAR* const __path,
    const CHAR* const __value)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    const UINT32 __pos = ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "mod_demosaic36_aec_data") == 0)
    {
        if (__index < mod_demosaic36_aec_dataCount)
        {
            __result = mod_demosaic36_aec_data[__index].SetValue(&__path[__pos], __value);
        }
    }

    return __result;
}

bool mod_demosaic36_hdr_aec_dataType::hdr_aec_dataStruct::GetInfo(
    const CHAR* const           __path,
    PList<ParameterParserInfo>& __info)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    const UINT32 __pos = ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    // mod_demosaic36_aec_data
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("mod_demosaic36_aec_data", ParameterParserDataType::Structure, true, false, mod_demosaic36_aec_dataCount));
    }
    else if (PARAMETER_STRCMP(__name, "mod_demosaic36_aec_data") == 0)
    {
        if (__index < mod_demosaic36_aec_dataCount)
        {
            __result = mod_demosaic36_aec_data[__index].GetInfo(&__path[__pos], __info);
        }
        else
        {
            __result = true;
            __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Structure, true, false, mod_demosaic36_aec_dataCount));
        }
    }

    return __result;
}

bool mod_demosaic36_drc_gain_dataType::GetValue(
    const CHAR* const __path,
    CHAR* const       __value,
    UINT32 const      __size)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    const UINT32 __pos = ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "drc_gain_trigger") == 0)
    {
        __result = drc_gain_trigger.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "drc_gain_data") == 0)
    {
        __result = drc_gain_data.GetValue(&__path[__pos], __value, __size);
    }

    return __result;
}

bool mod_demosaic36_drc_gain_dataType::SetValue(
    const CHAR* const __path,
    const CHAR* const __value)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    const UINT32 __pos = ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "drc_gain_trigger") == 0)
    {
        __result = drc_gain_trigger.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "drc_gain_data") == 0)
    {
        __result = drc_gain_data.SetValue(&__path[__pos], __value);
    }

    return __result;
}

bool mod_demosaic36_drc_gain_dataType::GetInfo(
    const CHAR* const           __path,
    PList<ParameterParserInfo>& __info)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    const UINT32 __pos = ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    // drc_gain_trigger
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("drc_gain_trigger", ParameterParserDataType::Structure));
    }
    else if (PARAMETER_STRCMP(__name, "drc_gain_trigger") == 0)
    {
        __result = drc_gain_trigger.GetInfo(&__path[__pos], __info);
    }

    // drc_gain_data
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("drc_gain_data", ParameterParserDataType::Structure));
    }
    else if (PARAMETER_STRCMP(__name, "drc_gain_data") == 0)
    {
        __result = drc_gain_data.GetInfo(&__path[__pos], __info);
    }

    return __result;
}

bool mod_demosaic36_drc_gain_dataType::drc_gain_dataStruct::GetValue(
    const CHAR* const __path,
    CHAR* const       __value,
    UINT32 const      __size)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    const UINT32 __pos = ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "mod_demosaic36_hdr_aec_data") == 0)
    {
        if (__index < mod_demosaic36_hdr_aec_dataCount)
        {
            __result = mod_demosaic36_hdr_aec_data[__index].GetValue(&__path[__pos], __value, __size);
        }
    }

    return __result;
}

bool mod_demosaic36_drc_gain_dataType::drc_gain_dataStruct::SetValue(
    const CHAR* const __path,
    const CHAR* const __value)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    const UINT32 __pos = ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "mod_demosaic36_hdr_aec_data") == 0)
    {
        if (__index < mod_demosaic36_hdr_aec_dataCount)
        {
            __result = mod_demosaic36_hdr_aec_data[__index].SetValue(&__path[__pos], __value);
        }
    }

    return __result;
}

bool mod_demosaic36_drc_gain_dataType::drc_gain_dataStruct::GetInfo(
    const CHAR* const           __path,
    PList<ParameterParserInfo>& __info)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    const UINT32 __pos = ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    // mod_demosaic36_hdr_aec_data
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("mod_demosaic36_hdr_aec_data", ParameterParserDataType::Structure, true, false, mod_demosaic36_hdr_aec_dataCount));
    }
    else if (PARAMETER_STRCMP(__name, "mod_demosaic36_hdr_aec_data") == 0)
    {
        if (__index < mod_demosaic36_hdr_aec_dataCount)
        {
            __result = mod_demosaic36_hdr_aec_data[__index].GetInfo(&__path[__pos], __info);
        }
        else
        {
            __result = true;
            __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Structure, true, false, mod_demosaic36_hdr_aec_dataCount));
        }
    }

    return __result;
}

bool chromatix_demosaic36_coreType::GetValue(
    const CHAR* const __path,
    CHAR* const       __value,
    UINT32 const      __size)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    const UINT32 __pos = ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "mod_demosaic36_drc_gain_data") == 0)
    {
        if (__index < mod_demosaic36_drc_gain_dataCount)
        {
            __result = mod_demosaic36_drc_gain_data[__index].GetValue(&__path[__pos], __value, __size);
        }
    }

    return __result;
}

bool chromatix_demosaic36_coreType::SetValue(
    const CHAR* const __path,
    const CHAR* const __value)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    const UINT32 __pos = ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "mod_demosaic36_drc_gain_data") == 0)
    {
        if (__index < mod_demosaic36_drc_gain_dataCount)
        {
            __result = mod_demosaic36_drc_gain_data[__index].SetValue(&__path[__pos], __value);
        }
    }

    return __result;
}

bool chromatix_demosaic36_coreType::GetInfo(
    const CHAR* const           __path,
    PList<ParameterParserInfo>& __info)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    const UINT32 __pos = ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    // mod_demosaic36_drc_gain_data
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("mod_demosaic36_drc_gain_data", ParameterParserDataType::Structure, true, false, mod_demosaic36_drc_gain_dataCount));
    }
    else if (PARAMETER_STRCMP(__name, "mod_demosaic36_drc_gain_data") == 0)
    {
        if (__index < mod_demosaic36_drc_gain_dataCount)
        {
            __result = mod_demosaic36_drc_gain_data[__index].GetInfo(&__path[__pos], __info);
        }
        else
        {
            __result = true;
            __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Structure, true, false, mod_demosaic36_drc_gain_dataCount));
        }
    }

    return __result;
}

bool chromatix_demosaic36Type::GetValue(
    const CHAR* const __path,
    CHAR* const       __value,
    UINT32 const      __size)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    const UINT32 __pos = ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "enable_section") == 0)
    {
        __result = enable_section.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "module_version") == 0)
    {
        __result = module_version.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "parameter_version") == 0)
    {
        __result = parameter_version.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "control_variables") == 0)
    {
        __result = control_variables.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "control_method") == 0)
    {
        __result = control_method.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "chromatix_demosaic36_core") == 0)
    {
        __result = chromatix_demosaic36_core.GetValue(&__path[__pos], __value, __size);
    }

    return __result;
}

bool chromatix_demosaic36Type::SetValue(
    const CHAR* const __path,
    const CHAR* const __value)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    const UINT32 __pos = ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "enable_section") == 0)
    {
        __result = enable_section.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "module_version") == 0)
    {
        __result = module_version.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "parameter_version") == 0)
    {
        __result = parameter_version.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "control_variables") == 0)
    {
        __result = control_variables.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "control_method") == 0)
    {
        __result = control_method.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "chromatix_demosaic36_core") == 0)
    {
        __result = chromatix_demosaic36_core.SetValue(&__path[__pos], __value);
    }

    return __result;
}

bool chromatix_demosaic36Type::GetInfo(
    const CHAR* const           __path,
    PList<ParameterParserInfo>& __info)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    const UINT32 __pos = ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    // enable_section
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("enable_section", ParameterParserDataType::Structure));
    }
    else if (PARAMETER_STRCMP(__name, "enable_section") == 0)
    {
        __result = enable_section.GetInfo(&__path[__pos], __info);
    }

    // module_version
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("module_version", ParameterParserDataType::Structure));
    }
    else if (PARAMETER_STRCMP(__name, "module_version") == 0)
    {
        __result = module_version.GetInfo(&__path[__pos], __info);
    }

    // parameter_version
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("parameter_version", ParameterParserDataType::Structure));
    }
    else if (PARAMETER_STRCMP(__name, "parameter_version") == 0)
    {
        __result = parameter_version.GetInfo(&__path[__pos], __info);
    }

    // control_variables
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("control_variables", ParameterParserDataType::Structure));
    }
    else if (PARAMETER_STRCMP(__name, "control_variables") == 0)
    {
        __result = control_variables.GetInfo(&__path[__pos], __info);
    }

    // control_method
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("control_method", ParameterParserDataType::Structure));
    }
    else if (PARAMETER_STRCMP(__name, "control_method") == 0)
    {
        __result = control_method.GetInfo(&__path[__pos], __info);
    }

    // chromatix_demosaic36_core
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("chromatix_demosaic36_core", ParameterParserDataType::Structure));
    }
    else if (PARAMETER_STRCMP(__name, "chromatix_demosaic36_core") == 0)
    {
        __result = chromatix_demosaic36_core.GetInfo(&__path[__pos], __info);
    }

    return __result;
}

bool chromatix_demosaic36Type::enable_sectionStruct::GetValue(
    const CHAR* const __path,
    CHAR* const       __value,
    UINT32 const      __size)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "demosaic_enable") == 0)
    {
        ParameterUtils::DoubleToString((double)demosaic_enable, __value, __size, 0);
        __result = true;
    }

    return __result;
}

bool chromatix_demosaic36Type::enable_sectionStruct::SetValue(
    const CHAR* const __path,
    const CHAR* const __value)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "demosaic_enable") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            demosaic_enable = (globalelements::enable_flag_type)dblValue; 
        }
    }

    return __result;
}

bool chromatix_demosaic36Type::enable_sectionStruct::GetInfo(
    const CHAR* const           __path,
    PList<ParameterParserInfo>& __info)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    // demosaic_enable
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("demosaic_enable", ParameterParserDataType::Int32, (double)demosaic_enable, 0));
    }
    else if (PARAMETER_STRCMP(__name, "demosaic_enable") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Int32, (double)demosaic_enable, 0));
    }

    return __result;
}

bool chromatix_demosaic36Type::module_versionStruct::GetValue(
    const CHAR* const __path,
    CHAR* const       __value,
    UINT32 const      __size)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "major_revision") == 0)
    {
        ParameterUtils::DoubleToString((double)major_revision, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "minor_revision") == 0)
    {
        ParameterUtils::DoubleToString((double)minor_revision, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "incr_revision") == 0)
    {
        ParameterUtils::DoubleToString((double)incr_revision, __value, __size, 0);
        __result = true;
    }

    return __result;
}

bool chromatix_demosaic36Type::module_versionStruct::SetValue(
    const CHAR* const __path,
    const CHAR* const __value)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "major_revision") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            major_revision = (INT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "minor_revision") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            minor_revision = (INT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "incr_revision") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            incr_revision = (INT32)dblValue; 
        }
    }

    return __result;
}

bool chromatix_demosaic36Type::module_versionStruct::GetInfo(
    const CHAR* const           __path,
    PList<ParameterParserInfo>& __info)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    // major_revision
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("major_revision", ParameterParserDataType::Int32, (double)major_revision, 0));
    }
    else if (PARAMETER_STRCMP(__name, "major_revision") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Int32, (double)major_revision, 0));
    }

    // minor_revision
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("minor_revision", ParameterParserDataType::Int32, (double)minor_revision, 0));
    }
    else if (PARAMETER_STRCMP(__name, "minor_revision") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Int32, (double)minor_revision, 0));
    }

    // incr_revision
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("incr_revision", ParameterParserDataType::Int32, (double)incr_revision, 0));
    }
    else if (PARAMETER_STRCMP(__name, "incr_revision") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Int32, (double)incr_revision, 0));
    }

    return __result;
}

bool chromatix_demosaic36Type::parameter_versionStruct::GetValue(
    const CHAR* const __path,
    CHAR* const       __value,
    UINT32 const      __size)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "revision") == 0)
    {
        PARAMETER_STRCPY(__value, __size, revision);
        __result = true;
    }

    return __result;
}

bool chromatix_demosaic36Type::parameter_versionStruct::SetValue(
    const CHAR* const __path,
    const CHAR* const /*__value*/)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "revision") == 0)
    {
        // Cannot modify strings, risk of memory leaks or corruption
    }

    return __result;
}

bool chromatix_demosaic36Type::parameter_versionStruct::GetInfo(
    const CHAR* const           __path,
    PList<ParameterParserInfo>& __info)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    // revision
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("revision", ParameterParserDataType::String, revision));
    }
    else if (PARAMETER_STRCMP(__name, "revision") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::String, revision));
    }

    return __result;
}

bool chromatix_demosaic36Type::control_variablesStruct::GetValue(
    const CHAR* const __path,
    CHAR* const       __value,
    UINT32 const      __size)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "control_var_type") == 0)
    {
        if (__index < 3)
        {
            ParameterUtils::DoubleToString((double)(UINT32)control_var_type[__index], __value, __size, 0);
            __result = true;
        }
        else
        {
            SIZE_T __valuePos = 0;
            for (UINT32 i = 0; i < 3; i++)
            {
                if (i > 0)
                {
                    PARAMETER_STRCAT(__value, __size, ",");
                    __valuePos = PARAMETER_STRLEN(__value);
                }
                ParameterUtils::DoubleToString((double)(UINT32)control_var_type[i], &__value[__valuePos], (INT32)(__size - __valuePos), 0);
            }
            __result = true;
        }
    }

    return __result;
}

bool chromatix_demosaic36Type::control_variablesStruct::SetValue(
    const CHAR* const __path,
    const CHAR* const __value)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "control_var_type") == 0)
    {
        if (__index < 3)
        {
            const double dblValue = ParameterUtils::StringToDouble(__value, __result);
            if (__result)
            {
                control_var_type[__index] = (control_var_typeEnum)(UINT32)dblValue; 
            }
        }
        else
        {
            SIZE_T __valueLen = PARAMETER_STRLEN(__value);
            UINT32 __pos = 0;

            __index = 0;
            while (__pos < __valueLen && __index < 3)
            {
                CHAR __valueStr[MAX_SIZE];

                __pos += ParameterUtils::GetSubString(&__value[__pos], ',', __valueStr, MAX_SIZE);
                __pos++;

                const double dblValue = ParameterUtils::StringToDouble(__valueStr, __result);
                if (__result)
                {
                    control_var_type[__index] = (control_var_typeEnum)(UINT32)dblValue; 
                }
                __index++;
            }
            __result = true;
        }
    }

    return __result;
}

bool chromatix_demosaic36Type::control_variablesStruct::GetInfo(
    const CHAR* const           __path,
    PList<ParameterParserInfo>& __info)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    // control_var_type
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("control_var_type", ParameterParserDataType::Enum, true, false, 3));
    }

    return __result;
}

bool chromatix_demosaic36Type::control_methodStruct::GetValue(
    const CHAR* const __path,
    CHAR* const       __value,
    UINT32 const      __size)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "aec_exp_control") == 0)
    {
        ParameterUtils::DoubleToString((double)(UINT32)aec_exp_control, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "aec_hdr_control") == 0)
    {
        ParameterUtils::DoubleToString((double)(UINT32)aec_hdr_control, __value, __size, 0);
        __result = true;
    }

    return __result;
}

bool chromatix_demosaic36Type::control_methodStruct::SetValue(
    const CHAR* const __path,
    const CHAR* const __value)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "aec_exp_control") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            aec_exp_control = (ispglobalelements::tuning_control_aec_type)(UINT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "aec_hdr_control") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            aec_hdr_control = (ispglobalelements::tuning_control_aec_hdr_type)(UINT32)dblValue; 
        }
    }

    return __result;
}

bool chromatix_demosaic36Type::control_methodStruct::GetInfo(
    const CHAR* const           __path,
    PList<ParameterParserInfo>& __info)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    // aec_exp_control
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("aec_exp_control", ParameterParserDataType::Enum, (double)(UINT32)aec_exp_control, 0));
    }
    else if (PARAMETER_STRCMP(__name, "aec_exp_control") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Enum, (double)(UINT32)aec_exp_control, 0));
    }

    // aec_hdr_control
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("aec_hdr_control", ParameterParserDataType::Enum, (double)(UINT32)aec_hdr_control, 0));
    }
    else if (PARAMETER_STRCMP(__name, "aec_hdr_control") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Enum, (double)(UINT32)aec_hdr_control, 0));
    }

    return __result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Read enum value
/// @param entry [in] Symbol table entry
/// @param enumValue [out] Enum value to read
/// @param alignment [in] Symbol table byte alignment
/// @return true if successful
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool chromatix_demosaic36Type::control_variablesStruct::ReadEnum_control_var_typeEnum(
    ParameterFileSymbolTableEntry* const entry,
    chromatix_demosaic36Type::control_variablesStruct::control_var_typeEnum& enumValue,
    BYTE const alignment)
{
    bool result {false};

    UINT32 uintValue {entry->ReadEnum(&result, alignment)};

    if (result)
    {
        switch (uintValue)
        {
        case static_cast<UINT32>(chromatix_demosaic36Type::control_variablesStruct::control_var_typeEnum::control_lux_idx):
            enumValue = chromatix_demosaic36Type::control_variablesStruct::control_var_typeEnum::control_lux_idx;
            result    = true;
            break;
        case static_cast<UINT32>(chromatix_demosaic36Type::control_variablesStruct::control_var_typeEnum::control_gain):
            enumValue = chromatix_demosaic36Type::control_variablesStruct::control_var_typeEnum::control_gain;
            result    = true;
            break;
        case static_cast<UINT32>(chromatix_demosaic36Type::control_variablesStruct::control_var_typeEnum::control_drc_gain):
            enumValue = chromatix_demosaic36Type::control_variablesStruct::control_var_typeEnum::control_drc_gain;
            result    = true;
            break;
        case static_cast<UINT32>(chromatix_demosaic36Type::control_variablesStruct::control_var_typeEnum::control_exp_time_ratio):
            enumValue = chromatix_demosaic36Type::control_variablesStruct::control_var_typeEnum::control_exp_time_ratio;
            result    = true;
            break;
        case static_cast<UINT32>(chromatix_demosaic36Type::control_variablesStruct::control_var_typeEnum::control_aec_exp_sensitivity_ratio):
            enumValue = chromatix_demosaic36Type::control_variablesStruct::control_var_typeEnum::control_aec_exp_sensitivity_ratio;
            result    = true;
            break;
        case static_cast<UINT32>(chromatix_demosaic36Type::control_variablesStruct::control_var_typeEnum::control_exp_gain_ratio):
            enumValue = chromatix_demosaic36Type::control_variablesStruct::control_var_typeEnum::control_exp_gain_ratio;
            result    = true;
            break;
        default:
            PARAMETER_LOG_ERROR(entry->SetManager, "Invalid value(% u) converting UINT32 to chromatix_demosaic36Type::control_variablesStruct::control_var_typeEnum", uintValue);
            break;
        }
    }
    return result;
}


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Default Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
chromatix_demosaic36TypeClass::chromatix_demosaic36TypeClass(
    const CHAR* const name)
    : ParameterModule(name, MAJOR, MINOR, PATCH, nullptr)
{
    PARAMETER_INITIALIZE(SymbolTableID);
    PARAMETER_INITIALIZE(enable_section);
    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(parameter_version);
    PARAMETER_INITIALIZE(control_variables);
    PARAMETER_INITIALIZE(control_method);
    PARAMETER_INITIALIZE(chromatix_demosaic36_core);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
chromatix_demosaic36TypeClass::chromatix_demosaic36TypeClass(
    const CHAR* const name,
    ModuleData* const moduleData)
    : ParameterModule(name, MAJOR, MINOR, PATCH, moduleData)
{
    PARAMETER_INITIALIZE(SymbolTableID);
    PARAMETER_INITIALIZE(enable_section);
    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(parameter_version);
    PARAMETER_INITIALIZE(control_variables);
    PARAMETER_INITIALIZE(control_method);
    PARAMETER_INITIALIZE(chromatix_demosaic36_core);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Destructor
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
chromatix_demosaic36TypeClass::~chromatix_demosaic36TypeClass()
{
    if (Loaded)
    {
        UnloadModule();
    }
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// GetName
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
const CHAR* chromatix_demosaic36TypeClass::GetName(
    const CHAR* const type)
{
    const CHAR* name = type;
    CHAR temp[ParameterFileSymbolTableEntry::TYPE_LEN + 1];
    if (PARAMETER_STRCMP(type, ModuleData::GetType(temp, "demosaic36_bps")) == 0)
    {
        name = "demosaic36_bps";
    }
    if (PARAMETER_STRCMP(type, ModuleData::GetType(temp, "demosaic36_ife")) == 0)
    {
        name = "demosaic36_ife";
    }
    if (PARAMETER_STRCMP(type, ModuleData::GetType(temp, "demosaic36_ope")) == 0)
    {
        name = "demosaic36_ope";
    }
    return name;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load demosaic36_rgn_dataType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool demosaic36_rgn_dataType::Load(
    ParameterFileSymbolTableEntry* const entry,
    BYTE const alignment)
{
    bool result = true;

    PARAMETER_INITIALIZE(edge_det_weight);
    PARAMETER_INITIALIZE(edge_det_noise_offset);
    PARAMETER_INITIALIZE(dis_directional_g);
    PARAMETER_INITIALIZE(dis_directional_rb);
    PARAMETER_INITIALIZE(lambda_g);
    PARAMETER_INITIALIZE(lambda_rb);
    PARAMETER_INITIALIZE(en_dyna_clamp_g);
    PARAMETER_INITIALIZE(en_dyna_clamp_rb);

    SYMBOL_TABLE_ENTRY_READ(entry, result, edge_det_weight, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, edge_det_noise_offset, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, dis_directional_g, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, dis_directional_rb, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, lambda_g, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, lambda_rb, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, en_dyna_clamp_g, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, en_dyna_clamp_rb, alignment)

    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load mod_demosaic36_aec_dataType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool mod_demosaic36_aec_dataType::Load(
    ParameterFileSymbolTableEntry* const entry,
    BYTE const alignment)
{
    bool result = true;

    PARAMETER_INITIALIZE(aec_trigger);
    PARAMETER_INITIALIZE(demosaic36_rgn_data);

    result = aec_trigger.Load(entry, alignment);
    if (result)
    {
        result = demosaic36_rgn_data.Load(entry, alignment);
    }

    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load mod_demosaic36_hdr_aec_dataType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool mod_demosaic36_hdr_aec_dataType::Load(
    ParameterFileSymbolTableEntry* const entry,
    BYTE const alignment)
{
    bool result = true;

    PARAMETER_INITIALIZE(hdr_aec_trigger);
    PARAMETER_INITIALIZE(hdr_aec_data);

    result = hdr_aec_trigger.Load(entry, alignment);
    if (result)
    {
        result = hdr_aec_data.Load(entry, alignment);
    }

    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load mod_demosaic36_hdr_aec_dataType_hdr_aec_dataStruct
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool mod_demosaic36_hdr_aec_dataType::hdr_aec_dataStruct::Load(
    ParameterFileSymbolTableEntry* const entry,
    BYTE const alignment)
{
    bool result = true;

    PARAMETER_INITIALIZE(mod_demosaic36_aec_data);


    // Reading Array mod_demosaic36_aec_data from symbol table
    // Do not check result value here because the count value needs to be initialized in this block
    {
        mod_demosaic36_aec_dataCount = 0;
        SYMBOL_TABLE_ENTRY_READ(entry, result, mod_demosaic36_aec_dataCount, alignment)
        constexpr const CHAR* const file {__FILE__};
        constexpr INT32 line {LINE_CONST};
        ParameterFileSymbolTableEntry  pointerEntryCls;
        ParameterFileSymbolTableEntry* const pointerEntry = &pointerEntryCls;
        if (result)
        {
            result = entry->Table->ReadPointerEntry(pointerEntryCls, entry, alignment);
        }

        if (result)
        {
            mod_demosaic36_aec_dataID = pointerEntry->ID;
            DupObjInfo* mod_demosaic36_aec_dataDupInfo = pointerEntry->GetDupObject(mod_demosaic36_aec_dataCount, file, line);
            if (mod_demosaic36_aec_dataDupInfo != nullptr && mod_demosaic36_aec_dataDupInfo->Object != nullptr)
            {
                mod_demosaic36_aec_data = (mod_demosaic36_aec_dataType*)mod_demosaic36_aec_dataDupInfo->Object;
                if (mod_demosaic36_aec_data == nullptr)
                {
                    if (mod_demosaic36_aec_dataDupInfo->File != nullptr)
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "mod_demosaic36_aec_data duplicate found but object is nullptr: %s:%d, RefCount: %d\n",
                            mod_demosaic36_aec_dataDupInfo->File, mod_demosaic36_aec_dataDupInfo->Line, mod_demosaic36_aec_dataDupInfo->RefCount);
                    }
                    else
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "mod_demosaic36_aec_data duplicate found but Object is nullptr: <nullptr file ptr>:%d, RefCount: %d\n",
                            mod_demosaic36_aec_dataDupInfo->Line, mod_demosaic36_aec_dataDupInfo->RefCount);
                    }
                }
            }

            if (mod_demosaic36_aec_data == nullptr)
            {
                if (result && mod_demosaic36_aec_dataCount > 0)
                {
                    mod_demosaic36_aec_data = PARAMETER_NEW mod_demosaic36_aec_dataType[mod_demosaic36_aec_dataCount];
                    (void)pointerEntry->SetDupObject(mod_demosaic36_aec_data, mod_demosaic36_aec_dataCount, file, line);
                }
                if (!result || mod_demosaic36_aec_data == nullptr)
                {
                    if (mod_demosaic36_aec_dataCount > 0)
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "Failed to allocate mod_demosaic36_aec_data\n");
                    }
                    mod_demosaic36_aec_dataCount = 0;
                }
                for (UINT32 i = 0; result && i < mod_demosaic36_aec_dataCount; i++)
                {
                    result = mod_demosaic36_aec_data[i].Load(pointerEntry, alignment);
                }
            }
        }
        if (mod_demosaic36_aec_data == nullptr)
        {
            mod_demosaic36_aec_dataCount = 0;
        }
    }

    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load mod_demosaic36_drc_gain_dataType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool mod_demosaic36_drc_gain_dataType::Load(
    ParameterFileSymbolTableEntry* const entry,
    BYTE const alignment)
{
    bool result = true;

    PARAMETER_INITIALIZE(drc_gain_trigger);
    PARAMETER_INITIALIZE(drc_gain_data);

    result = drc_gain_trigger.Load(entry, alignment);
    if (result)
    {
        result = drc_gain_data.Load(entry, alignment);
    }

    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load mod_demosaic36_drc_gain_dataType_drc_gain_dataStruct
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool mod_demosaic36_drc_gain_dataType::drc_gain_dataStruct::Load(
    ParameterFileSymbolTableEntry* const entry,
    BYTE const alignment)
{
    bool result = true;

    PARAMETER_INITIALIZE(mod_demosaic36_hdr_aec_data);


    // Reading Array mod_demosaic36_hdr_aec_data from symbol table
    // Do not check result value here because the count value needs to be initialized in this block
    {
        mod_demosaic36_hdr_aec_dataCount = 0;
        SYMBOL_TABLE_ENTRY_READ(entry, result, mod_demosaic36_hdr_aec_dataCount, alignment)
        constexpr const CHAR* const file {__FILE__};
        constexpr INT32 line {LINE_CONST};
        ParameterFileSymbolTableEntry  pointerEntryCls;
        ParameterFileSymbolTableEntry* const pointerEntry = &pointerEntryCls;
        if (result)
        {
            result = entry->Table->ReadPointerEntry(pointerEntryCls, entry, alignment);
        }

        if (result)
        {
            mod_demosaic36_hdr_aec_dataID = pointerEntry->ID;
            DupObjInfo* mod_demosaic36_hdr_aec_dataDupInfo = pointerEntry->GetDupObject(mod_demosaic36_hdr_aec_dataCount, file, line);
            if (mod_demosaic36_hdr_aec_dataDupInfo != nullptr && mod_demosaic36_hdr_aec_dataDupInfo->Object != nullptr)
            {
                mod_demosaic36_hdr_aec_data = (mod_demosaic36_hdr_aec_dataType*)mod_demosaic36_hdr_aec_dataDupInfo->Object;
                if (mod_demosaic36_hdr_aec_data == nullptr)
                {
                    if (mod_demosaic36_hdr_aec_dataDupInfo->File != nullptr)
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "mod_demosaic36_hdr_aec_data duplicate found but object is nullptr: %s:%d, RefCount: %d\n",
                            mod_demosaic36_hdr_aec_dataDupInfo->File, mod_demosaic36_hdr_aec_dataDupInfo->Line, mod_demosaic36_hdr_aec_dataDupInfo->RefCount);
                    }
                    else
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "mod_demosaic36_hdr_aec_data duplicate found but Object is nullptr: <nullptr file ptr>:%d, RefCount: %d\n",
                            mod_demosaic36_hdr_aec_dataDupInfo->Line, mod_demosaic36_hdr_aec_dataDupInfo->RefCount);
                    }
                }
            }

            if (mod_demosaic36_hdr_aec_data == nullptr)
            {
                if (result && mod_demosaic36_hdr_aec_dataCount > 0)
                {
                    mod_demosaic36_hdr_aec_data = PARAMETER_NEW mod_demosaic36_hdr_aec_dataType[mod_demosaic36_hdr_aec_dataCount];
                    (void)pointerEntry->SetDupObject(mod_demosaic36_hdr_aec_data, mod_demosaic36_hdr_aec_dataCount, file, line);
                }
                if (!result || mod_demosaic36_hdr_aec_data == nullptr)
                {
                    if (mod_demosaic36_hdr_aec_dataCount > 0)
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "Failed to allocate mod_demosaic36_hdr_aec_data\n");
                    }
                    mod_demosaic36_hdr_aec_dataCount = 0;
                }
                for (UINT32 i = 0; result && i < mod_demosaic36_hdr_aec_dataCount; i++)
                {
                    result = mod_demosaic36_hdr_aec_data[i].Load(pointerEntry, alignment);
                }
            }
        }
        if (mod_demosaic36_hdr_aec_data == nullptr)
        {
            mod_demosaic36_hdr_aec_dataCount = 0;
        }
    }

    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load chromatix_demosaic36_coreType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool chromatix_demosaic36_coreType::Load(
    ParameterFileSymbolTableEntry* const entry,
    BYTE const alignment)
{
    bool result = true;

    PARAMETER_INITIALIZE(mod_demosaic36_drc_gain_data);


    // Reading Array mod_demosaic36_drc_gain_data from symbol table
    // Do not check result value here because the count value needs to be initialized in this block
    {
        mod_demosaic36_drc_gain_dataCount = 0;
        SYMBOL_TABLE_ENTRY_READ(entry, result, mod_demosaic36_drc_gain_dataCount, alignment)
        constexpr const CHAR* const file {__FILE__};
        constexpr INT32 line {LINE_CONST};
        ParameterFileSymbolTableEntry  pointerEntryCls;
        ParameterFileSymbolTableEntry* const pointerEntry = &pointerEntryCls;
        if (result)
        {
            result = entry->Table->ReadPointerEntry(pointerEntryCls, entry, alignment);
        }

        if (result)
        {
            mod_demosaic36_drc_gain_dataID = pointerEntry->ID;
            DupObjInfo* mod_demosaic36_drc_gain_dataDupInfo = pointerEntry->GetDupObject(mod_demosaic36_drc_gain_dataCount, file, line);
            if (mod_demosaic36_drc_gain_dataDupInfo != nullptr && mod_demosaic36_drc_gain_dataDupInfo->Object != nullptr)
            {
                mod_demosaic36_drc_gain_data = (mod_demosaic36_drc_gain_dataType*)mod_demosaic36_drc_gain_dataDupInfo->Object;
                if (mod_demosaic36_drc_gain_data == nullptr)
                {
                    if (mod_demosaic36_drc_gain_dataDupInfo->File != nullptr)
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "mod_demosaic36_drc_gain_data duplicate found but object is nullptr: %s:%d, RefCount: %d\n",
                            mod_demosaic36_drc_gain_dataDupInfo->File, mod_demosaic36_drc_gain_dataDupInfo->Line, mod_demosaic36_drc_gain_dataDupInfo->RefCount);
                    }
                    else
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "mod_demosaic36_drc_gain_data duplicate found but Object is nullptr: <nullptr file ptr>:%d, RefCount: %d\n",
                            mod_demosaic36_drc_gain_dataDupInfo->Line, mod_demosaic36_drc_gain_dataDupInfo->RefCount);
                    }
                }
            }

            if (mod_demosaic36_drc_gain_data == nullptr)
            {
                if (result && mod_demosaic36_drc_gain_dataCount > 0)
                {
                    mod_demosaic36_drc_gain_data = PARAMETER_NEW mod_demosaic36_drc_gain_dataType[mod_demosaic36_drc_gain_dataCount];
                    (void)pointerEntry->SetDupObject(mod_demosaic36_drc_gain_data, mod_demosaic36_drc_gain_dataCount, file, line);
                }
                if (!result || mod_demosaic36_drc_gain_data == nullptr)
                {
                    if (mod_demosaic36_drc_gain_dataCount > 0)
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "Failed to allocate mod_demosaic36_drc_gain_data\n");
                    }
                    mod_demosaic36_drc_gain_dataCount = 0;
                }
                for (UINT32 i = 0; result && i < mod_demosaic36_drc_gain_dataCount; i++)
                {
                    result = mod_demosaic36_drc_gain_data[i].Load(pointerEntry, alignment);
                }
            }
        }
        if (mod_demosaic36_drc_gain_data == nullptr)
        {
            mod_demosaic36_drc_gain_dataCount = 0;
        }
    }

    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load chromatix_demosaic36Type
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool chromatix_demosaic36Type::Load(
    ParameterFileSymbolTableEntry* const entry,
    BYTE const alignment)
{
    bool result = true;

    PARAMETER_INITIALIZE(enable_section);
    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(parameter_version);
    PARAMETER_INITIALIZE(control_variables);
    PARAMETER_INITIALIZE(control_method);
    PARAMETER_INITIALIZE(chromatix_demosaic36_core);

    result = enable_section.Load(entry, alignment);
    if (result)
    {
        result = module_version.Load(entry, alignment);
    }
    if (result)
    {
        result = parameter_version.Load(entry, alignment);
    }
    if (result)
    {
        result = control_variables.Load(entry, alignment);
    }
    if (result)
    {
        result = control_method.Load(entry, alignment);
    }
    if (result)
    {
        result = chromatix_demosaic36_core.Load(entry, alignment);
    }

    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load enable_sectionStruct
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool chromatix_demosaic36Type::enable_sectionStruct::Load(
    ParameterFileSymbolTableEntry* const entry,
    BYTE const alignment)
{
    bool result = true;

    PARAMETER_INITIALIZE(demosaic_enable);

    SYMBOL_TABLE_ENTRY_READ(entry, result, demosaic_enable, alignment)

    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load module_versionStruct
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool chromatix_demosaic36Type::module_versionStruct::Load(
    ParameterFileSymbolTableEntry* const entry,
    BYTE const alignment)
{
    bool result = true;

    PARAMETER_INITIALIZE(major_revision);
    PARAMETER_INITIALIZE(minor_revision);
    PARAMETER_INITIALIZE(incr_revision);

    SYMBOL_TABLE_ENTRY_READ(entry, result, major_revision, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, minor_revision, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, incr_revision, alignment)

    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load parameter_versionStruct
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool chromatix_demosaic36Type::parameter_versionStruct::Load(
    ParameterFileSymbolTableEntry* const entry,
    BYTE const alignment)
{
    bool result = true;

    PARAMETER_INITIALIZE(revision);


    // Reading String revision from symbol table
    {
        UINT32 count = 0;
        SYMBOL_TABLE_ENTRY_READ(entry, result, count, alignment)
        ParameterFileSymbolTableEntry stringPointerEntryCls;
        ParameterFileSymbolTableEntry* const stringPointerEntry = &stringPointerEntryCls;
        if (result)
        {
            result = entry->Table->ReadPointerEntry(stringPointerEntryCls, entry, alignment);
        }
        SYMBOL_TABLE_ENTRY_READ_STRING(stringPointerEntry, result, revision, count, alignment)
    }

    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load control_variablesStruct
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool chromatix_demosaic36Type::control_variablesStruct::Load(
    ParameterFileSymbolTableEntry* const entry,
    BYTE const alignment)
{
    bool result = true;

    PARAMETER_INITIALIZE(control_var_type);

    for (UINT32 i = 0; result && i < 3; i++)
    {
        result = chromatix_demosaic36Type::control_variablesStruct::ReadEnum_control_var_typeEnum(entry, control_var_type[i], alignment);
    }

    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load control_methodStruct
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool chromatix_demosaic36Type::control_methodStruct::Load(
    ParameterFileSymbolTableEntry* const entry,
    BYTE const alignment)
{
    bool result = true;

    PARAMETER_INITIALIZE(aec_exp_control);
    PARAMETER_INITIALIZE(aec_hdr_control);

    result = ispglobalelements::ReadEnum_tuning_control_aec_type(entry, aec_exp_control, alignment);
    if (result)
    {
        result = ispglobalelements::ReadEnum_tuning_control_aec_hdr_type(entry, aec_hdr_control, alignment);
    }

    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload mod_demosaic36_hdr_aec_dataType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void mod_demosaic36_hdr_aec_dataType::Unload(ParameterFileSymbolTable* const __table)
{
    hdr_aec_data.Unload(__table);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload mod_demosaic36_hdr_aec_dataType_hdr_aec_dataStruct
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void mod_demosaic36_hdr_aec_dataType::hdr_aec_dataStruct::Unload(ParameterFileSymbolTable* const __table)
{
    if (__table != nullptr && __table->ReleaseDupObject(mod_demosaic36_aec_data))
    {
        PARAMETER_DELETE[] mod_demosaic36_aec_data;
    }
    mod_demosaic36_aec_data = nullptr;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload mod_demosaic36_drc_gain_dataType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void mod_demosaic36_drc_gain_dataType::Unload(ParameterFileSymbolTable* const __table)
{
    drc_gain_data.Unload(__table);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload mod_demosaic36_drc_gain_dataType_drc_gain_dataStruct
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void mod_demosaic36_drc_gain_dataType::drc_gain_dataStruct::Unload(ParameterFileSymbolTable* const __table)
{
    for (UINT32 i = 0; i < mod_demosaic36_hdr_aec_dataCount; i++)
    {
        mod_demosaic36_hdr_aec_data[i].Unload(__table);
    }
    if (__table != nullptr && __table->ReleaseDupObject(mod_demosaic36_hdr_aec_data))
    {
        PARAMETER_DELETE[] mod_demosaic36_hdr_aec_data;
    }
    mod_demosaic36_hdr_aec_data = nullptr;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload chromatix_demosaic36_coreType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void chromatix_demosaic36_coreType::Unload(ParameterFileSymbolTable* const __table)
{
    for (UINT32 i = 0; i < mod_demosaic36_drc_gain_dataCount; i++)
    {
        mod_demosaic36_drc_gain_data[i].Unload(__table);
    }
    if (__table != nullptr && __table->ReleaseDupObject(mod_demosaic36_drc_gain_data))
    {
        PARAMETER_DELETE[] mod_demosaic36_drc_gain_data;
    }
    mod_demosaic36_drc_gain_data = nullptr;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload chromatix_demosaic36Type
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void chromatix_demosaic36Type::Unload(ParameterFileSymbolTable* const __table)
{
    parameter_version.Unload(__table);
    chromatix_demosaic36_core.Unload(__table);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload parameter_versionStruct
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void chromatix_demosaic36Type::parameter_versionStruct::Unload(ParameterFileSymbolTable* const __table)
{
    if (__table != nullptr && __table->ReleaseDupObject(revision))
    {
        PARAMETER_DELETE[] revision;
    }
    revision = nullptr;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Release the ParameterModule object
/// Requires that this object was created via a ParameterSetManager::GetModule call
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void chromatix_demosaic36Type::Release()
{
    ((chromatix_demosaic36TypeClass*)this)->Release();
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Returns the ParameterModule::Modified value
/// The Modified value is incremented when the module's data or pointer values change
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
UINT32 chromatix_demosaic36Type::GetModified()
{
    return ((chromatix_demosaic36TypeClass*)this)->Modified;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Create module, and return a new object
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
ParameterModule* chromatix_demosaic36TypeClass::Create(
    ModuleData*    moduleData,
    DefaultModule* const defModule) const
{
    chromatix_demosaic36TypeClass* cls = nullptr;

    if (PARAMETER_STRCMP(Type, moduleData->Type) == 0 && Version.Value == moduleData->Version.Value)
    {
        const UINT32 id = moduleData->DuplicateID > 0 ? moduleData->DuplicateID : moduleData->ID;

        ParameterModule* const module = defModule->Find(id);
        if (module != nullptr)
        {
            cls = (chromatix_demosaic36TypeClass*)module;
        }
        else
        {
            cls = PARAMETER_NEW chromatix_demosaic36TypeClass(GetName(moduleData->Type), moduleData);
            cls->SymbolTableID = id;
            defModule->AddModule((ParameterModule*)cls);
        }
    }
    else if (Version.Value != moduleData->Version.Value)
    {
        PARAMETER_LOG_ERROR(moduleData->SetManager, "Unable to create chromatix_demosaic36TypeClass, binary version (%lld) does not match source version (%lld)\n",
            moduleData->Version.Value, Version.Value);
    }
    else
    {
        PARAMETER_LOG_ERROR(moduleData->SetManager, "Unable to create chromatix_demosaic36TypeClass, binary name (%s) does not match source name (%s)\n",
            moduleData->Type, Type);
    }

    return (ParameterModule*)cls;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load module data, return true is successful
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool chromatix_demosaic36TypeClass::LoadModule(
    ParameterFileSymbolTable* const table)
{
    bool result = true;

    if (!Loaded)
    {
        BYTE const alignment = table->Alignment;
        chromatix_demosaic36TypeClass* const cls = this;

        ParameterFileSymbolTableEntry  entryObj;
        ParameterFileSymbolTableEntry* const entry = &entryObj;
        // With EzTune enabled, the unused upper byte of SymbolTableID value can change, so clear it
        result = table->Find(entryObj, SymbolTableID & 0x00ffffff);

        if (!result)
        {
            PARAMETER_LOG_ERROR(entry->SetManager, "chromatix_demosaic36TypeClass::LoadModule Failed to find module ID (%d) in Symbol Table\n", SymbolTableID);
        }

        if (result)
        {
            result = cls->Load(entry, alignment);
        }
        Modified++;
        Loaded = true;
    }

    if (!result)
    {
        /// Module failed to fully load, unload it
        UnloadModule();
    }

    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload module data
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void chromatix_demosaic36TypeClass::UnloadModule()
{
    if (Loaded)
    {
        if (Data != nullptr && Data->SymbolTable != nullptr)
        {
            Unload(Data->SymbolTable);
        }
        else
        {
            PARAMETER_LOG_ERROR(Data != nullptr ? Data->SetManager : nullptr, "UnloadModule %s called with nullptr "
                "Data->SymbolTable object\n", Name);
            Unload(nullptr);
        }
        Loaded = false;
    }
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// /// Release the ParameterModule object
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void chromatix_demosaic36TypeClass::Release()
{
    ParameterModule::Release();
}

DEMOSAIC_3_6_0_NAMESPACE_END
