/*
 * this code is auto generated. do not edit. change the sources in tools/introspection/ instead.
 *
 * the parse tree:
 *
 * typedef
 *   struct dt_iop_sigmoid_params_t
 *     float
 *     middle_grey_contrast 
 *       description: contrast
 *       default: 1.5
 *       range: 0.1 .. 10.0
 * 
 *     float
 *     contrast_skewness 
 *       description: skew
 *       default: 0.0
 *       range: -1.0 .. 1.0
 * 
 *     float
 *     display_white_target 
 *       description: target white
 *       default: 100.0
 *       range: 20.0 .. 1600.0
 * 
 *     float
 *     display_black_target 
 *       description: target black
 *       default: 0.0152
 *       range: 0.0 .. 15.0
 * 
 *     enum dt_iop_sigmoid_methods_type_t
 *       DT_SIGMOID_METHOD_PER_CHANNEL : per channel
 *       DT_SIGMOID_METHOD_RGB_RATIO : RGB ratio
 *     color_processing 
 *       description: color processing
 *       default: DT_SIGMOID_METHOD_PER_CHANNEL
 * 
 *     float
 *     hue_preservation 
 *       description: preserve hue
 *       default: 100.0
 *       range: 0.0 .. 100.0
 * 
 *     float
 *     red_inset 
 *       description: red attenuation
 *       default: 0.0
 *       range: 0.0 .. 0.99
 * 
 *     float
 *     red_rotation 
 *       description: red rotation
 *       default: 0.0
 *       range: -0.4 .. 0.4
 * 
 *     float
 *     green_inset 
 *       description: green attenuation
 *       default: 0.0
 *       range: 0.0 .. 0.99
 * 
 *     float
 *     green_rotation 
 *       description: green rotation
 *       default: 0.0
 *       range: -0.4 .. 0.4
 * 
 *     float
 *     blue_inset 
 *       description: blue attenuation
 *       default: 0.0
 *       range: 0.0 .. 0.99
 * 
 *     float
 *     blue_rotation 
 *       description: blue rotation
 *       default: 0.0
 *       range: -0.4 .. 0.4
 * 
 *     float
 *     purity 
 *       description: recover purity
 *       default: 0.0
 *       range: 0.0 .. 1.0
 * 
 *     enum dt_iop_sigmoid_base_primaries_t
 *       DT_SIGMOID_WORK_PROFILE : working profile
 *       DT_SIGMOID_REC2020 : Rec2020
 *       DT_SIGMOID_DISPLAY_P3 : Display P3
 *       DT_SIGMOID_ADOBE_RGB : Adobe RGB (compatible)
 *       DT_SIGMOID_SRGB : sRGB
 *     base_primaries 
 *       description: base primaries
 *       default: DT_SIGMOID_WORK_PROFILE
 * 
 * dt_iop_sigmoid_params_t
 *
 */

#include "/build/darktable/src/darktable-5.6.0/src/iop/sigmoid.c"

#ifdef __cplusplus
extern "C"
{
#endif

#include <string.h>
#include "common/introspection.h"

static dt_introspection_field_t introspection_linear[15+1]
#if !( defined(__cplusplus) && !defined(__clang__) && defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) <= 406) )
= {
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"middle_grey_contrast", (char*)"middle_grey_contrast", N_((char*)"contrast"), sizeof(((dt_iop_sigmoid_params_t*)NULL)->middle_grey_contrast), G_STRUCT_OFFSET(dt_iop_sigmoid_params_t, middle_grey_contrast), NULL },
    /*Min*/ 0.1, /*Max*/ 10.0, /*Default*/ 1.5
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"contrast_skewness", (char*)"contrast_skewness", N_((char*)"skew"), sizeof(((dt_iop_sigmoid_params_t*)NULL)->contrast_skewness), G_STRUCT_OFFSET(dt_iop_sigmoid_params_t, contrast_skewness), NULL },
    /*Min*/ -1.0, /*Max*/ 1.0, /*Default*/ 0.0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"display_white_target", (char*)"display_white_target", N_((char*)"target white"), sizeof(((dt_iop_sigmoid_params_t*)NULL)->display_white_target), G_STRUCT_OFFSET(dt_iop_sigmoid_params_t, display_white_target), NULL },
    /*Min*/ 20.0, /*Max*/ 1600.0, /*Default*/ 100.0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"display_black_target", (char*)"display_black_target", N_((char*)"target black"), sizeof(((dt_iop_sigmoid_params_t*)NULL)->display_black_target), G_STRUCT_OFFSET(dt_iop_sigmoid_params_t, display_black_target), NULL },
    /*Min*/ 0.0, /*Max*/ 15.0, /*Default*/ 0.0152
  }
},
{
  .Enum = {
    { DT_INTROSPECTION_TYPE_ENUM, (char*)"dt_iop_sigmoid_methods_type_t", (char*)"color_processing", (char*)"color_processing", N_((char*)"color processing"), sizeof(((dt_iop_sigmoid_params_t*)NULL)->color_processing), G_STRUCT_OFFSET(dt_iop_sigmoid_params_t, color_processing), NULL },
    /*entries*/ 2, /*values*/ NULL, /*Default*/ DT_SIGMOID_METHOD_PER_CHANNEL
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"hue_preservation", (char*)"hue_preservation", N_((char*)"preserve hue"), sizeof(((dt_iop_sigmoid_params_t*)NULL)->hue_preservation), G_STRUCT_OFFSET(dt_iop_sigmoid_params_t, hue_preservation), NULL },
    /*Min*/ 0.0, /*Max*/ 100.0, /*Default*/ 100.0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"red_inset", (char*)"red_inset", N_((char*)"red attenuation"), sizeof(((dt_iop_sigmoid_params_t*)NULL)->red_inset), G_STRUCT_OFFSET(dt_iop_sigmoid_params_t, red_inset), NULL },
    /*Min*/ 0.0, /*Max*/ 0.99, /*Default*/ 0.0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"red_rotation", (char*)"red_rotation", N_((char*)"red rotation"), sizeof(((dt_iop_sigmoid_params_t*)NULL)->red_rotation), G_STRUCT_OFFSET(dt_iop_sigmoid_params_t, red_rotation), NULL },
    /*Min*/ -0.4, /*Max*/ 0.4, /*Default*/ 0.0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"green_inset", (char*)"green_inset", N_((char*)"green attenuation"), sizeof(((dt_iop_sigmoid_params_t*)NULL)->green_inset), G_STRUCT_OFFSET(dt_iop_sigmoid_params_t, green_inset), NULL },
    /*Min*/ 0.0, /*Max*/ 0.99, /*Default*/ 0.0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"green_rotation", (char*)"green_rotation", N_((char*)"green rotation"), sizeof(((dt_iop_sigmoid_params_t*)NULL)->green_rotation), G_STRUCT_OFFSET(dt_iop_sigmoid_params_t, green_rotation), NULL },
    /*Min*/ -0.4, /*Max*/ 0.4, /*Default*/ 0.0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"blue_inset", (char*)"blue_inset", N_((char*)"blue attenuation"), sizeof(((dt_iop_sigmoid_params_t*)NULL)->blue_inset), G_STRUCT_OFFSET(dt_iop_sigmoid_params_t, blue_inset), NULL },
    /*Min*/ 0.0, /*Max*/ 0.99, /*Default*/ 0.0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"blue_rotation", (char*)"blue_rotation", N_((char*)"blue rotation"), sizeof(((dt_iop_sigmoid_params_t*)NULL)->blue_rotation), G_STRUCT_OFFSET(dt_iop_sigmoid_params_t, blue_rotation), NULL },
    /*Min*/ -0.4, /*Max*/ 0.4, /*Default*/ 0.0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"purity", (char*)"purity", N_((char*)"recover purity"), sizeof(((dt_iop_sigmoid_params_t*)NULL)->purity), G_STRUCT_OFFSET(dt_iop_sigmoid_params_t, purity), NULL },
    /*Min*/ 0.0, /*Max*/ 1.0, /*Default*/ 0.0
  }
},
{
  .Enum = {
    { DT_INTROSPECTION_TYPE_ENUM, (char*)"dt_iop_sigmoid_base_primaries_t", (char*)"base_primaries", (char*)"base_primaries", N_((char*)"base primaries"), sizeof(((dt_iop_sigmoid_params_t*)NULL)->base_primaries), G_STRUCT_OFFSET(dt_iop_sigmoid_params_t, base_primaries), NULL },
    /*entries*/ 5, /*values*/ NULL, /*Default*/ DT_SIGMOID_WORK_PROFILE
  }
},
{
  .Struct = {
    { DT_INTROSPECTION_TYPE_STRUCT, (char*)"dt_iop_sigmoid_params_t", (char*)"", (char*)"", (char*)"", sizeof(dt_iop_sigmoid_params_t), 0, NULL },
    /*entries*/ 14, /*fields*/ NULL
  }
},
  { .header = {DT_INTROSPECTION_TYPE_NONE, NULL, NULL, NULL, NULL, 0, 0, NULL} }
}
#endif
;

static dt_introspection_t introspection = {
  8,
  3,
  "dt_iop_sigmoid_params_t",
  sizeof(dt_iop_sigmoid_params_t),
  &introspection_linear[15-1],
  sizeof(dt_iop_module_t),
  G_STRUCT_OFFSET(dt_iop_module_t, default_params)
};

dt_introspection_field_t* get_introspection_linear()
{
  return introspection_linear;
}

dt_introspection_t* get_introspection()
{
  return &introspection;
}

int introspection_init(struct dt_iop_module_so_t *self, int api_version)
{
  // here we check that the generated code matches the api at compile time and also at runtime
  if(introspection.api_version != DT_INTROSPECTION_VERSION || api_version != DT_INTROSPECTION_VERSION)
    return 1;

#if defined(__cplusplus) && !defined(__clang__) && defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) <= 406)
  introspection_linear[0].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"middle_grey_contrast", (char*)"middle_grey_contrast", N_((char*)"contrast"), sizeof(((dt_iop_sigmoid_params_t*)NULL)->middle_grey_contrast), G_STRUCT_OFFSET(dt_iop_sigmoid_params_t, middle_grey_contrast), NULL },
    /*Min*/ 0.1, /*Max*/ 10.0, /*Default*/ 1.5
  };
  introspection_linear[1].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"contrast_skewness", (char*)"contrast_skewness", N_((char*)"skew"), sizeof(((dt_iop_sigmoid_params_t*)NULL)->contrast_skewness), G_STRUCT_OFFSET(dt_iop_sigmoid_params_t, contrast_skewness), NULL },
    /*Min*/ -1.0, /*Max*/ 1.0, /*Default*/ 0.0
  };
  introspection_linear[2].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"display_white_target", (char*)"display_white_target", N_((char*)"target white"), sizeof(((dt_iop_sigmoid_params_t*)NULL)->display_white_target), G_STRUCT_OFFSET(dt_iop_sigmoid_params_t, display_white_target), NULL },
    /*Min*/ 20.0, /*Max*/ 1600.0, /*Default*/ 100.0
  };
  introspection_linear[3].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"display_black_target", (char*)"display_black_target", N_((char*)"target black"), sizeof(((dt_iop_sigmoid_params_t*)NULL)->display_black_target), G_STRUCT_OFFSET(dt_iop_sigmoid_params_t, display_black_target), NULL },
    /*Min*/ 0.0, /*Max*/ 15.0, /*Default*/ 0.0152
  };
  introspection_linear[4].Enum = {
    { DT_INTROSPECTION_TYPE_ENUM, (char*)"dt_iop_sigmoid_methods_type_t", (char*)"color_processing", (char*)"color_processing", N_((char*)"color processing"), sizeof(((dt_iop_sigmoid_params_t*)NULL)->color_processing), G_STRUCT_OFFSET(dt_iop_sigmoid_params_t, color_processing), NULL },
    /*entries*/ 2, /*values*/ NULL, /*Default*/ DT_SIGMOID_METHOD_PER_CHANNEL
  };
  introspection_linear[5].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"hue_preservation", (char*)"hue_preservation", N_((char*)"preserve hue"), sizeof(((dt_iop_sigmoid_params_t*)NULL)->hue_preservation), G_STRUCT_OFFSET(dt_iop_sigmoid_params_t, hue_preservation), NULL },
    /*Min*/ 0.0, /*Max*/ 100.0, /*Default*/ 100.0
  };
  introspection_linear[6].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"red_inset", (char*)"red_inset", N_((char*)"red attenuation"), sizeof(((dt_iop_sigmoid_params_t*)NULL)->red_inset), G_STRUCT_OFFSET(dt_iop_sigmoid_params_t, red_inset), NULL },
    /*Min*/ 0.0, /*Max*/ 0.99, /*Default*/ 0.0
  };
  introspection_linear[7].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"red_rotation", (char*)"red_rotation", N_((char*)"red rotation"), sizeof(((dt_iop_sigmoid_params_t*)NULL)->red_rotation), G_STRUCT_OFFSET(dt_iop_sigmoid_params_t, red_rotation), NULL },
    /*Min*/ -0.4, /*Max*/ 0.4, /*Default*/ 0.0
  };
  introspection_linear[8].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"green_inset", (char*)"green_inset", N_((char*)"green attenuation"), sizeof(((dt_iop_sigmoid_params_t*)NULL)->green_inset), G_STRUCT_OFFSET(dt_iop_sigmoid_params_t, green_inset), NULL },
    /*Min*/ 0.0, /*Max*/ 0.99, /*Default*/ 0.0
  };
  introspection_linear[9].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"green_rotation", (char*)"green_rotation", N_((char*)"green rotation"), sizeof(((dt_iop_sigmoid_params_t*)NULL)->green_rotation), G_STRUCT_OFFSET(dt_iop_sigmoid_params_t, green_rotation), NULL },
    /*Min*/ -0.4, /*Max*/ 0.4, /*Default*/ 0.0
  };
  introspection_linear[10].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"blue_inset", (char*)"blue_inset", N_((char*)"blue attenuation"), sizeof(((dt_iop_sigmoid_params_t*)NULL)->blue_inset), G_STRUCT_OFFSET(dt_iop_sigmoid_params_t, blue_inset), NULL },
    /*Min*/ 0.0, /*Max*/ 0.99, /*Default*/ 0.0
  };
  introspection_linear[11].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"blue_rotation", (char*)"blue_rotation", N_((char*)"blue rotation"), sizeof(((dt_iop_sigmoid_params_t*)NULL)->blue_rotation), G_STRUCT_OFFSET(dt_iop_sigmoid_params_t, blue_rotation), NULL },
    /*Min*/ -0.4, /*Max*/ 0.4, /*Default*/ 0.0
  };
  introspection_linear[12].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"purity", (char*)"purity", N_((char*)"recover purity"), sizeof(((dt_iop_sigmoid_params_t*)NULL)->purity), G_STRUCT_OFFSET(dt_iop_sigmoid_params_t, purity), NULL },
    /*Min*/ 0.0, /*Max*/ 1.0, /*Default*/ 0.0
  };
  introspection_linear[13].Enum = {
    { DT_INTROSPECTION_TYPE_ENUM, (char*)"dt_iop_sigmoid_base_primaries_t", (char*)"base_primaries", (char*)"base_primaries", N_((char*)"base primaries"), sizeof(((dt_iop_sigmoid_params_t*)NULL)->base_primaries), G_STRUCT_OFFSET(dt_iop_sigmoid_params_t, base_primaries), NULL },
    /*entries*/ 5, /*values*/ NULL, /*Default*/ DT_SIGMOID_WORK_PROFILE
  };
  introspection_linear[14].Struct = {
    { DT_INTROSPECTION_TYPE_STRUCT, (char*)"dt_iop_sigmoid_params_t", (char*)"", (char*)"", (char*)"", sizeof(dt_iop_sigmoid_params_t), 0, NULL },
    /*entries*/ 14, /*fields*/ NULL
  };
  introspection_linear[15].header = {DT_INTROSPECTION_TYPE_NONE, NULL, NULL, NULL, NULL, 0, 0, NULL};
#endif

  for(int i = 0; i <= 15; i++)
    introspection_linear[i].header.so = self;

  static dt_introspection_type_enum_tuple_t f4[] = { 
    { "DT_SIGMOID_METHOD_PER_CHANNEL", DT_SIGMOID_METHOD_PER_CHANNEL, N_((char*)"per channel") },
    { "DT_SIGMOID_METHOD_RGB_RATIO", DT_SIGMOID_METHOD_RGB_RATIO, N_((char*)"RGB ratio") },
    { NULL, 0 },
  };
  static dt_introspection_type_enum_tuple_t f13[] = { 
    { "DT_SIGMOID_WORK_PROFILE", DT_SIGMOID_WORK_PROFILE, N_((char*)"working profile") },
    { "DT_SIGMOID_REC2020", DT_SIGMOID_REC2020, N_((char*)"Rec2020") },
    { "DT_SIGMOID_DISPLAY_P3", DT_SIGMOID_DISPLAY_P3, N_((char*)"Display P3") },
    { "DT_SIGMOID_ADOBE_RGB", DT_SIGMOID_ADOBE_RGB, N_((char*)"Adobe RGB (compatible)") },
    { "DT_SIGMOID_SRGB", DT_SIGMOID_SRGB, N_((char*)"sRGB") },
    { NULL, 0 },
  };
  static dt_introspection_field_t *f14[] = {
    &introspection_linear[0],
    &introspection_linear[1],
    &introspection_linear[2],
    &introspection_linear[3],
    &introspection_linear[4],
    &introspection_linear[5],
    &introspection_linear[6],
    &introspection_linear[7],
    &introspection_linear[8],
    &introspection_linear[9],
    &introspection_linear[10],
    &introspection_linear[11],
    &introspection_linear[12],
    &introspection_linear[13],
    NULL
  };

  introspection_linear[4].Enum.values = f4;
  introspection_linear[13].Enum.values = f13;
  introspection_linear[14].Struct.fields = f14;

  return 0;
}

void * get_p(const void * param, const char * name)
{
  dt_iop_sigmoid_params_t * p = (dt_iop_sigmoid_params_t*)param;
  if(!strcmp(name, "middle_grey_contrast"))
    return &(p->middle_grey_contrast);
  else if(!strcmp(name, "contrast_skewness"))
    return &(p->contrast_skewness);
  else if(!strcmp(name, "display_white_target"))
    return &(p->display_white_target);
  else if(!strcmp(name, "display_black_target"))
    return &(p->display_black_target);
  else if(!strcmp(name, "color_processing"))
    return &(p->color_processing);
  else if(!strcmp(name, "hue_preservation"))
    return &(p->hue_preservation);
  else if(!strcmp(name, "red_inset"))
    return &(p->red_inset);
  else if(!strcmp(name, "red_rotation"))
    return &(p->red_rotation);
  else if(!strcmp(name, "green_inset"))
    return &(p->green_inset);
  else if(!strcmp(name, "green_rotation"))
    return &(p->green_rotation);
  else if(!strcmp(name, "blue_inset"))
    return &(p->blue_inset);
  else if(!strcmp(name, "blue_rotation"))
    return &(p->blue_rotation);
  else if(!strcmp(name, "purity"))
    return &(p->purity);
  else if(!strcmp(name, "base_primaries"))
    return &(p->base_primaries);
  else
    return NULL;
}

dt_introspection_field_t * get_f(const char * name)
{
  if(!g_ascii_strcasecmp(name, "middle_grey_contrast"))
    return &(introspection_linear[0]);
  else if(!g_ascii_strcasecmp(name, "contrast_skewness"))
    return &(introspection_linear[1]);
  else if(!g_ascii_strcasecmp(name, "display_white_target"))
    return &(introspection_linear[2]);
  else if(!g_ascii_strcasecmp(name, "display_black_target"))
    return &(introspection_linear[3]);
  else if(!g_ascii_strcasecmp(name, "color_processing"))
    return &(introspection_linear[4]);
  else if(!g_ascii_strcasecmp(name, "hue_preservation"))
    return &(introspection_linear[5]);
  else if(!g_ascii_strcasecmp(name, "red_inset"))
    return &(introspection_linear[6]);
  else if(!g_ascii_strcasecmp(name, "red_rotation"))
    return &(introspection_linear[7]);
  else if(!g_ascii_strcasecmp(name, "green_inset"))
    return &(introspection_linear[8]);
  else if(!g_ascii_strcasecmp(name, "green_rotation"))
    return &(introspection_linear[9]);
  else if(!g_ascii_strcasecmp(name, "blue_inset"))
    return &(introspection_linear[10]);
  else if(!g_ascii_strcasecmp(name, "blue_rotation"))
    return &(introspection_linear[11]);
  else if(!g_ascii_strcasecmp(name, "purity"))
    return &(introspection_linear[12]);
  else if(!g_ascii_strcasecmp(name, "base_primaries"))
    return &(introspection_linear[13]);
  else
    return NULL;
}

#ifdef __cplusplus
}
#endif

