/*
 * this code is auto generated. do not edit. change the sources in tools/introspection/ instead.
 *
 * the parse tree:
 *
 * typedef
 *   struct dt_iop_diffuse_params_t
 *     int
 *     iterations 
 *       description: iterations
 *       default: 1
 *       range: 0 .. 500
 * 
 *     float
 *     sharpness 
 *       description: sharpness
 *       default: 0.
 *       range: -1. .. 1.
 * 
 *     int
 *     radius 
 *       description: radius span
 *       default: 8
 *       range: 0 .. 2048
 * 
 *     float
 *     regularization 
 *       description: edge sensitivity
 *       default: 0.
 *       range: 0. .. 4.
 * 
 *     float
 *     variance_threshold 
 *       description: edge threshold
 *       default: 0.
 *       range: -2. .. 2.
 * 
 *     float
 *     anisotropy_first 
 *       description: 1st order anisotropy
 *       default: 0.
 *       range: -10. .. 10.
 * 
 *     float
 *     anisotropy_second 
 *       description: 2nd order anisotropy
 *       default: 0.
 *       range: -10. .. 10.
 * 
 *     float
 *     anisotropy_third 
 *       description: 3rd order anisotropy
 *       default: 0.
 *       range: -10. .. 10.
 * 
 *     float
 *     anisotropy_fourth 
 *       description: 4th order anisotropy
 *       default: 0.
 *       range: -10. .. 10.
 * 
 *     float
 *     threshold 
 *       description: luminance masking threshold
 *       default: 0.
 *       range: 0. .. 8.
 * 
 *     float
 *     first 
 *       description: 1st order speed
 *       default: 0.
 *       range: -1. .. 1.
 * 
 *     float
 *     second 
 *       description: 2nd order speed
 *       default: 0.
 *       range: -1. .. 1.
 * 
 *     float
 *     third 
 *       description: 3rd order speed
 *       default: 0.
 *       range: -1. .. 1.
 * 
 *     float
 *     fourth 
 *       description: 4th order speed
 *       default: 0.
 *       range: -1. .. 1.
 * 
 *     int
 *     radius_center 
 *       description: central radius
 *       default: 0
 *       range: 0 .. 1024
 * 
 * dt_iop_diffuse_params_t
 *
 */

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

#ifdef __cplusplus
extern "C"
{
#endif

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

static dt_introspection_field_t introspection_linear[16+1]
#if !( defined(__cplusplus) && !defined(__clang__) && defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) <= 406) )
= {
{
  .Int = {
    { DT_INTROSPECTION_TYPE_INT, (char*)"int", (char*)"iterations", (char*)"iterations", N_((char*)"iterations"), sizeof(((dt_iop_diffuse_params_t*)NULL)->iterations), G_STRUCT_OFFSET(dt_iop_diffuse_params_t, iterations), NULL },
    /*Min*/ 0, /*Max*/ 500, /*Default*/ 1
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"sharpness", (char*)"sharpness", N_((char*)"sharpness"), sizeof(((dt_iop_diffuse_params_t*)NULL)->sharpness), G_STRUCT_OFFSET(dt_iop_diffuse_params_t, sharpness), NULL },
    /*Min*/ -1., /*Max*/ 1., /*Default*/ 0.
  }
},
{
  .Int = {
    { DT_INTROSPECTION_TYPE_INT, (char*)"int", (char*)"radius", (char*)"radius", N_((char*)"radius span"), sizeof(((dt_iop_diffuse_params_t*)NULL)->radius), G_STRUCT_OFFSET(dt_iop_diffuse_params_t, radius), NULL },
    /*Min*/ 0, /*Max*/ 2048, /*Default*/ 8
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"regularization", (char*)"regularization", N_((char*)"edge sensitivity"), sizeof(((dt_iop_diffuse_params_t*)NULL)->regularization), G_STRUCT_OFFSET(dt_iop_diffuse_params_t, regularization), NULL },
    /*Min*/ 0., /*Max*/ 4., /*Default*/ 0.
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"variance_threshold", (char*)"variance_threshold", N_((char*)"edge threshold"), sizeof(((dt_iop_diffuse_params_t*)NULL)->variance_threshold), G_STRUCT_OFFSET(dt_iop_diffuse_params_t, variance_threshold), NULL },
    /*Min*/ -2., /*Max*/ 2., /*Default*/ 0.
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"anisotropy_first", (char*)"anisotropy_first", N_((char*)"1st order anisotropy"), sizeof(((dt_iop_diffuse_params_t*)NULL)->anisotropy_first), G_STRUCT_OFFSET(dt_iop_diffuse_params_t, anisotropy_first), NULL },
    /*Min*/ -10., /*Max*/ 10., /*Default*/ 0.
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"anisotropy_second", (char*)"anisotropy_second", N_((char*)"2nd order anisotropy"), sizeof(((dt_iop_diffuse_params_t*)NULL)->anisotropy_second), G_STRUCT_OFFSET(dt_iop_diffuse_params_t, anisotropy_second), NULL },
    /*Min*/ -10., /*Max*/ 10., /*Default*/ 0.
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"anisotropy_third", (char*)"anisotropy_third", N_((char*)"3rd order anisotropy"), sizeof(((dt_iop_diffuse_params_t*)NULL)->anisotropy_third), G_STRUCT_OFFSET(dt_iop_diffuse_params_t, anisotropy_third), NULL },
    /*Min*/ -10., /*Max*/ 10., /*Default*/ 0.
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"anisotropy_fourth", (char*)"anisotropy_fourth", N_((char*)"4th order anisotropy"), sizeof(((dt_iop_diffuse_params_t*)NULL)->anisotropy_fourth), G_STRUCT_OFFSET(dt_iop_diffuse_params_t, anisotropy_fourth), NULL },
    /*Min*/ -10., /*Max*/ 10., /*Default*/ 0.
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"threshold", (char*)"threshold", N_((char*)"luminance masking threshold"), sizeof(((dt_iop_diffuse_params_t*)NULL)->threshold), G_STRUCT_OFFSET(dt_iop_diffuse_params_t, threshold), NULL },
    /*Min*/ 0., /*Max*/ 8., /*Default*/ 0.
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"first", (char*)"first", N_((char*)"1st order speed"), sizeof(((dt_iop_diffuse_params_t*)NULL)->first), G_STRUCT_OFFSET(dt_iop_diffuse_params_t, first), NULL },
    /*Min*/ -1., /*Max*/ 1., /*Default*/ 0.
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"second", (char*)"second", N_((char*)"2nd order speed"), sizeof(((dt_iop_diffuse_params_t*)NULL)->second), G_STRUCT_OFFSET(dt_iop_diffuse_params_t, second), NULL },
    /*Min*/ -1., /*Max*/ 1., /*Default*/ 0.
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"third", (char*)"third", N_((char*)"3rd order speed"), sizeof(((dt_iop_diffuse_params_t*)NULL)->third), G_STRUCT_OFFSET(dt_iop_diffuse_params_t, third), NULL },
    /*Min*/ -1., /*Max*/ 1., /*Default*/ 0.
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"fourth", (char*)"fourth", N_((char*)"4th order speed"), sizeof(((dt_iop_diffuse_params_t*)NULL)->fourth), G_STRUCT_OFFSET(dt_iop_diffuse_params_t, fourth), NULL },
    /*Min*/ -1., /*Max*/ 1., /*Default*/ 0.
  }
},
{
  .Int = {
    { DT_INTROSPECTION_TYPE_INT, (char*)"int", (char*)"radius_center", (char*)"radius_center", N_((char*)"central radius"), sizeof(((dt_iop_diffuse_params_t*)NULL)->radius_center), G_STRUCT_OFFSET(dt_iop_diffuse_params_t, radius_center), NULL },
    /*Min*/ 0, /*Max*/ 1024, /*Default*/ 0
  }
},
{
  .Struct = {
    { DT_INTROSPECTION_TYPE_STRUCT, (char*)"dt_iop_diffuse_params_t", (char*)"", (char*)"", (char*)"", sizeof(dt_iop_diffuse_params_t), 0, NULL },
    /*entries*/ 15, /*fields*/ NULL
  }
},
  { .header = {DT_INTROSPECTION_TYPE_NONE, NULL, NULL, NULL, NULL, 0, 0, NULL} }
}
#endif
;

static dt_introspection_t introspection = {
  8,
  2,
  "dt_iop_diffuse_params_t",
  sizeof(dt_iop_diffuse_params_t),
  &introspection_linear[16-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].Int = {
    { DT_INTROSPECTION_TYPE_INT, (char*)"int", (char*)"iterations", (char*)"iterations", N_((char*)"iterations"), sizeof(((dt_iop_diffuse_params_t*)NULL)->iterations), G_STRUCT_OFFSET(dt_iop_diffuse_params_t, iterations), NULL },
    /*Min*/ 0, /*Max*/ 500, /*Default*/ 1
  };
  introspection_linear[1].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"sharpness", (char*)"sharpness", N_((char*)"sharpness"), sizeof(((dt_iop_diffuse_params_t*)NULL)->sharpness), G_STRUCT_OFFSET(dt_iop_diffuse_params_t, sharpness), NULL },
    /*Min*/ -1., /*Max*/ 1., /*Default*/ 0.
  };
  introspection_linear[2].Int = {
    { DT_INTROSPECTION_TYPE_INT, (char*)"int", (char*)"radius", (char*)"radius", N_((char*)"radius span"), sizeof(((dt_iop_diffuse_params_t*)NULL)->radius), G_STRUCT_OFFSET(dt_iop_diffuse_params_t, radius), NULL },
    /*Min*/ 0, /*Max*/ 2048, /*Default*/ 8
  };
  introspection_linear[3].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"regularization", (char*)"regularization", N_((char*)"edge sensitivity"), sizeof(((dt_iop_diffuse_params_t*)NULL)->regularization), G_STRUCT_OFFSET(dt_iop_diffuse_params_t, regularization), NULL },
    /*Min*/ 0., /*Max*/ 4., /*Default*/ 0.
  };
  introspection_linear[4].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"variance_threshold", (char*)"variance_threshold", N_((char*)"edge threshold"), sizeof(((dt_iop_diffuse_params_t*)NULL)->variance_threshold), G_STRUCT_OFFSET(dt_iop_diffuse_params_t, variance_threshold), NULL },
    /*Min*/ -2., /*Max*/ 2., /*Default*/ 0.
  };
  introspection_linear[5].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"anisotropy_first", (char*)"anisotropy_first", N_((char*)"1st order anisotropy"), sizeof(((dt_iop_diffuse_params_t*)NULL)->anisotropy_first), G_STRUCT_OFFSET(dt_iop_diffuse_params_t, anisotropy_first), NULL },
    /*Min*/ -10., /*Max*/ 10., /*Default*/ 0.
  };
  introspection_linear[6].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"anisotropy_second", (char*)"anisotropy_second", N_((char*)"2nd order anisotropy"), sizeof(((dt_iop_diffuse_params_t*)NULL)->anisotropy_second), G_STRUCT_OFFSET(dt_iop_diffuse_params_t, anisotropy_second), NULL },
    /*Min*/ -10., /*Max*/ 10., /*Default*/ 0.
  };
  introspection_linear[7].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"anisotropy_third", (char*)"anisotropy_third", N_((char*)"3rd order anisotropy"), sizeof(((dt_iop_diffuse_params_t*)NULL)->anisotropy_third), G_STRUCT_OFFSET(dt_iop_diffuse_params_t, anisotropy_third), NULL },
    /*Min*/ -10., /*Max*/ 10., /*Default*/ 0.
  };
  introspection_linear[8].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"anisotropy_fourth", (char*)"anisotropy_fourth", N_((char*)"4th order anisotropy"), sizeof(((dt_iop_diffuse_params_t*)NULL)->anisotropy_fourth), G_STRUCT_OFFSET(dt_iop_diffuse_params_t, anisotropy_fourth), NULL },
    /*Min*/ -10., /*Max*/ 10., /*Default*/ 0.
  };
  introspection_linear[9].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"threshold", (char*)"threshold", N_((char*)"luminance masking threshold"), sizeof(((dt_iop_diffuse_params_t*)NULL)->threshold), G_STRUCT_OFFSET(dt_iop_diffuse_params_t, threshold), NULL },
    /*Min*/ 0., /*Max*/ 8., /*Default*/ 0.
  };
  introspection_linear[10].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"first", (char*)"first", N_((char*)"1st order speed"), sizeof(((dt_iop_diffuse_params_t*)NULL)->first), G_STRUCT_OFFSET(dt_iop_diffuse_params_t, first), NULL },
    /*Min*/ -1., /*Max*/ 1., /*Default*/ 0.
  };
  introspection_linear[11].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"second", (char*)"second", N_((char*)"2nd order speed"), sizeof(((dt_iop_diffuse_params_t*)NULL)->second), G_STRUCT_OFFSET(dt_iop_diffuse_params_t, second), NULL },
    /*Min*/ -1., /*Max*/ 1., /*Default*/ 0.
  };
  introspection_linear[12].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"third", (char*)"third", N_((char*)"3rd order speed"), sizeof(((dt_iop_diffuse_params_t*)NULL)->third), G_STRUCT_OFFSET(dt_iop_diffuse_params_t, third), NULL },
    /*Min*/ -1., /*Max*/ 1., /*Default*/ 0.
  };
  introspection_linear[13].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"fourth", (char*)"fourth", N_((char*)"4th order speed"), sizeof(((dt_iop_diffuse_params_t*)NULL)->fourth), G_STRUCT_OFFSET(dt_iop_diffuse_params_t, fourth), NULL },
    /*Min*/ -1., /*Max*/ 1., /*Default*/ 0.
  };
  introspection_linear[14].Int = {
    { DT_INTROSPECTION_TYPE_INT, (char*)"int", (char*)"radius_center", (char*)"radius_center", N_((char*)"central radius"), sizeof(((dt_iop_diffuse_params_t*)NULL)->radius_center), G_STRUCT_OFFSET(dt_iop_diffuse_params_t, radius_center), NULL },
    /*Min*/ 0, /*Max*/ 1024, /*Default*/ 0
  };
  introspection_linear[15].Struct = {
    { DT_INTROSPECTION_TYPE_STRUCT, (char*)"dt_iop_diffuse_params_t", (char*)"", (char*)"", (char*)"", sizeof(dt_iop_diffuse_params_t), 0, NULL },
    /*entries*/ 15, /*fields*/ NULL
  };
  introspection_linear[16].header = {DT_INTROSPECTION_TYPE_NONE, NULL, NULL, NULL, NULL, 0, 0, NULL};
#endif

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

  static dt_introspection_field_t *f15[] = {
    &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],
    &introspection_linear[14],
    NULL
  };

  introspection_linear[15].Struct.fields = f15;

  return 0;
}

void * get_p(const void * param, const char * name)
{
  dt_iop_diffuse_params_t * p = (dt_iop_diffuse_params_t*)param;
  if(!strcmp(name, "iterations"))
    return &(p->iterations);
  else if(!strcmp(name, "sharpness"))
    return &(p->sharpness);
  else if(!strcmp(name, "radius"))
    return &(p->radius);
  else if(!strcmp(name, "regularization"))
    return &(p->regularization);
  else if(!strcmp(name, "variance_threshold"))
    return &(p->variance_threshold);
  else if(!strcmp(name, "anisotropy_first"))
    return &(p->anisotropy_first);
  else if(!strcmp(name, "anisotropy_second"))
    return &(p->anisotropy_second);
  else if(!strcmp(name, "anisotropy_third"))
    return &(p->anisotropy_third);
  else if(!strcmp(name, "anisotropy_fourth"))
    return &(p->anisotropy_fourth);
  else if(!strcmp(name, "threshold"))
    return &(p->threshold);
  else if(!strcmp(name, "first"))
    return &(p->first);
  else if(!strcmp(name, "second"))
    return &(p->second);
  else if(!strcmp(name, "third"))
    return &(p->third);
  else if(!strcmp(name, "fourth"))
    return &(p->fourth);
  else if(!strcmp(name, "radius_center"))
    return &(p->radius_center);
  else
    return NULL;
}

dt_introspection_field_t * get_f(const char * name)
{
  if(!g_ascii_strcasecmp(name, "iterations"))
    return &(introspection_linear[0]);
  else if(!g_ascii_strcasecmp(name, "sharpness"))
    return &(introspection_linear[1]);
  else if(!g_ascii_strcasecmp(name, "radius"))
    return &(introspection_linear[2]);
  else if(!g_ascii_strcasecmp(name, "regularization"))
    return &(introspection_linear[3]);
  else if(!g_ascii_strcasecmp(name, "variance_threshold"))
    return &(introspection_linear[4]);
  else if(!g_ascii_strcasecmp(name, "anisotropy_first"))
    return &(introspection_linear[5]);
  else if(!g_ascii_strcasecmp(name, "anisotropy_second"))
    return &(introspection_linear[6]);
  else if(!g_ascii_strcasecmp(name, "anisotropy_third"))
    return &(introspection_linear[7]);
  else if(!g_ascii_strcasecmp(name, "anisotropy_fourth"))
    return &(introspection_linear[8]);
  else if(!g_ascii_strcasecmp(name, "threshold"))
    return &(introspection_linear[9]);
  else if(!g_ascii_strcasecmp(name, "first"))
    return &(introspection_linear[10]);
  else if(!g_ascii_strcasecmp(name, "second"))
    return &(introspection_linear[11]);
  else if(!g_ascii_strcasecmp(name, "third"))
    return &(introspection_linear[12]);
  else if(!g_ascii_strcasecmp(name, "fourth"))
    return &(introspection_linear[13]);
  else if(!g_ascii_strcasecmp(name, "radius_center"))
    return &(introspection_linear[14]);
  else
    return NULL;
}

#ifdef __cplusplus
}
#endif

