/*
 * this code is auto generated. do not edit. change the sources in tools/introspection/ instead.
 *
 * the parse tree:
 *
 * typedef
 *   struct dt_iop_lowpass_params_t
 *     enum dt_gaussian_order_t
 *       DT_IOP_GAUSSIAN_ZERO : order 0
 *       DT_IOP_GAUSSIAN_ONE : order 1
 *       DT_IOP_GAUSSIAN_TWO : order 2
 *     order 
 *       default: 0
 * 
 *     float
 *     radius 
 *       default: 10.0
 *       range: 0.1 .. 500.0
 * 
 *     float
 *     contrast 
 *       default: 1.0
 *       range: -3.0 .. 3.0
 * 
 *     float
 *     brightness 
 *       default: 0.0
 *       range: -3.0 .. 3.0
 * 
 *     float
 *     saturation 
 *       default: 1.0
 *       range: -3.0 .. 3.0
 * 
 *     enum dt_iop_lowpass_algo_t
 *       LOWPASS_ALGO_GAUSSIAN : gaussian
 *       LOWPASS_ALGO_BILATERAL : bilateral filter
 *     lowpass_algo 
 *       description: soften with
 *       default: LOWPASS_ALGO_GAUSSIAN
 * 
 *     int
 *     unbound 
 *       default: 1
 *       range: G_MININT .. G_MAXINT
 * 
 * dt_iop_lowpass_params_t
 *
 */

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

#ifdef __cplusplus
extern "C"
{
#endif

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

static dt_introspection_field_t introspection_linear[8+1]
#if !( defined(__cplusplus) && !defined(__clang__) && defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) <= 406) )
= {
{
  .Enum = {
    { DT_INTROSPECTION_TYPE_ENUM, (char*)"dt_gaussian_order_t", (char*)"order", (char*)"order", (char*)"", sizeof(((dt_iop_lowpass_params_t*)NULL)->order), G_STRUCT_OFFSET(dt_iop_lowpass_params_t, order), NULL },
    /*entries*/ 3, /*values*/ NULL, /*Default*/ 0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"radius", (char*)"radius", (char*)"", sizeof(((dt_iop_lowpass_params_t*)NULL)->radius), G_STRUCT_OFFSET(dt_iop_lowpass_params_t, radius), NULL },
    /*Min*/ 0.1, /*Max*/ 500.0, /*Default*/ 10.0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"contrast", (char*)"contrast", (char*)"", sizeof(((dt_iop_lowpass_params_t*)NULL)->contrast), G_STRUCT_OFFSET(dt_iop_lowpass_params_t, contrast), NULL },
    /*Min*/ -3.0, /*Max*/ 3.0, /*Default*/ 1.0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"brightness", (char*)"brightness", (char*)"", sizeof(((dt_iop_lowpass_params_t*)NULL)->brightness), G_STRUCT_OFFSET(dt_iop_lowpass_params_t, brightness), NULL },
    /*Min*/ -3.0, /*Max*/ 3.0, /*Default*/ 0.0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"saturation", (char*)"saturation", (char*)"", sizeof(((dt_iop_lowpass_params_t*)NULL)->saturation), G_STRUCT_OFFSET(dt_iop_lowpass_params_t, saturation), NULL },
    /*Min*/ -3.0, /*Max*/ 3.0, /*Default*/ 1.0
  }
},
{
  .Enum = {
    { DT_INTROSPECTION_TYPE_ENUM, (char*)"dt_iop_lowpass_algo_t", (char*)"lowpass_algo", (char*)"lowpass_algo", N_((char*)"soften with"), sizeof(((dt_iop_lowpass_params_t*)NULL)->lowpass_algo), G_STRUCT_OFFSET(dt_iop_lowpass_params_t, lowpass_algo), NULL },
    /*entries*/ 2, /*values*/ NULL, /*Default*/ LOWPASS_ALGO_GAUSSIAN
  }
},
{
  .Int = {
    { DT_INTROSPECTION_TYPE_INT, (char*)"int", (char*)"unbound", (char*)"unbound", (char*)"", sizeof(((dt_iop_lowpass_params_t*)NULL)->unbound), G_STRUCT_OFFSET(dt_iop_lowpass_params_t, unbound), NULL },
    /*Min*/ G_MININT, /*Max*/ G_MAXINT, /*Default*/ 1
  }
},
{
  .Struct = {
    { DT_INTROSPECTION_TYPE_STRUCT, (char*)"dt_iop_lowpass_params_t", (char*)"", (char*)"", (char*)"", sizeof(dt_iop_lowpass_params_t), 0, NULL },
    /*entries*/ 7, /*fields*/ NULL
  }
},
  { .header = {DT_INTROSPECTION_TYPE_NONE, NULL, NULL, NULL, NULL, 0, 0, NULL} }
}
#endif
;

static dt_introspection_t introspection = {
  8,
  4,
  "dt_iop_lowpass_params_t",
  sizeof(dt_iop_lowpass_params_t),
  &introspection_linear[8-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].Enum = {
    { DT_INTROSPECTION_TYPE_ENUM, (char*)"dt_gaussian_order_t", (char*)"order", (char*)"order", (char*)"", sizeof(((dt_iop_lowpass_params_t*)NULL)->order), G_STRUCT_OFFSET(dt_iop_lowpass_params_t, order), NULL },
    /*entries*/ 3, /*values*/ NULL, /*Default*/ 0
  };
  introspection_linear[1].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"radius", (char*)"radius", (char*)"", sizeof(((dt_iop_lowpass_params_t*)NULL)->radius), G_STRUCT_OFFSET(dt_iop_lowpass_params_t, radius), NULL },
    /*Min*/ 0.1, /*Max*/ 500.0, /*Default*/ 10.0
  };
  introspection_linear[2].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"contrast", (char*)"contrast", (char*)"", sizeof(((dt_iop_lowpass_params_t*)NULL)->contrast), G_STRUCT_OFFSET(dt_iop_lowpass_params_t, contrast), NULL },
    /*Min*/ -3.0, /*Max*/ 3.0, /*Default*/ 1.0
  };
  introspection_linear[3].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"brightness", (char*)"brightness", (char*)"", sizeof(((dt_iop_lowpass_params_t*)NULL)->brightness), G_STRUCT_OFFSET(dt_iop_lowpass_params_t, brightness), NULL },
    /*Min*/ -3.0, /*Max*/ 3.0, /*Default*/ 0.0
  };
  introspection_linear[4].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"saturation", (char*)"saturation", (char*)"", sizeof(((dt_iop_lowpass_params_t*)NULL)->saturation), G_STRUCT_OFFSET(dt_iop_lowpass_params_t, saturation), NULL },
    /*Min*/ -3.0, /*Max*/ 3.0, /*Default*/ 1.0
  };
  introspection_linear[5].Enum = {
    { DT_INTROSPECTION_TYPE_ENUM, (char*)"dt_iop_lowpass_algo_t", (char*)"lowpass_algo", (char*)"lowpass_algo", N_((char*)"soften with"), sizeof(((dt_iop_lowpass_params_t*)NULL)->lowpass_algo), G_STRUCT_OFFSET(dt_iop_lowpass_params_t, lowpass_algo), NULL },
    /*entries*/ 2, /*values*/ NULL, /*Default*/ LOWPASS_ALGO_GAUSSIAN
  };
  introspection_linear[6].Int = {
    { DT_INTROSPECTION_TYPE_INT, (char*)"int", (char*)"unbound", (char*)"unbound", (char*)"", sizeof(((dt_iop_lowpass_params_t*)NULL)->unbound), G_STRUCT_OFFSET(dt_iop_lowpass_params_t, unbound), NULL },
    /*Min*/ G_MININT, /*Max*/ G_MAXINT, /*Default*/ 1
  };
  introspection_linear[7].Struct = {
    { DT_INTROSPECTION_TYPE_STRUCT, (char*)"dt_iop_lowpass_params_t", (char*)"", (char*)"", (char*)"", sizeof(dt_iop_lowpass_params_t), 0, NULL },
    /*entries*/ 7, /*fields*/ NULL
  };
  introspection_linear[8].header = {DT_INTROSPECTION_TYPE_NONE, NULL, NULL, NULL, NULL, 0, 0, NULL};
#endif

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

  static dt_introspection_type_enum_tuple_t f0[] = { 
    { "DT_IOP_GAUSSIAN_ZERO", DT_IOP_GAUSSIAN_ZERO, N_((char*)"order 0") },
    { "DT_IOP_GAUSSIAN_ONE", DT_IOP_GAUSSIAN_ONE, N_((char*)"order 1") },
    { "DT_IOP_GAUSSIAN_TWO", DT_IOP_GAUSSIAN_TWO, N_((char*)"order 2") },
    { NULL, 0 },
  };
  static dt_introspection_type_enum_tuple_t f5[] = { 
    { "LOWPASS_ALGO_GAUSSIAN", LOWPASS_ALGO_GAUSSIAN, N_((char*)"gaussian") },
    { "LOWPASS_ALGO_BILATERAL", LOWPASS_ALGO_BILATERAL, N_((char*)"bilateral filter") },
    { NULL, 0 },
  };
  static dt_introspection_field_t *f7[] = {
    &introspection_linear[0],
    &introspection_linear[1],
    &introspection_linear[2],
    &introspection_linear[3],
    &introspection_linear[4],
    &introspection_linear[5],
    &introspection_linear[6],
    NULL
  };

  introspection_linear[0].Enum.values = f0;
  introspection_linear[5].Enum.values = f5;
  introspection_linear[7].Struct.fields = f7;

  return 0;
}

void * get_p(const void * param, const char * name)
{
  dt_iop_lowpass_params_t * p = (dt_iop_lowpass_params_t*)param;
  if(!strcmp(name, "order"))
    return &(p->order);
  else if(!strcmp(name, "radius"))
    return &(p->radius);
  else if(!strcmp(name, "contrast"))
    return &(p->contrast);
  else if(!strcmp(name, "brightness"))
    return &(p->brightness);
  else if(!strcmp(name, "saturation"))
    return &(p->saturation);
  else if(!strcmp(name, "lowpass_algo"))
    return &(p->lowpass_algo);
  else if(!strcmp(name, "unbound"))
    return &(p->unbound);
  else
    return NULL;
}

dt_introspection_field_t * get_f(const char * name)
{
  if(!g_ascii_strcasecmp(name, "order"))
    return &(introspection_linear[0]);
  else if(!g_ascii_strcasecmp(name, "radius"))
    return &(introspection_linear[1]);
  else if(!g_ascii_strcasecmp(name, "contrast"))
    return &(introspection_linear[2]);
  else if(!g_ascii_strcasecmp(name, "brightness"))
    return &(introspection_linear[3]);
  else if(!g_ascii_strcasecmp(name, "saturation"))
    return &(introspection_linear[4]);
  else if(!g_ascii_strcasecmp(name, "lowpass_algo"))
    return &(introspection_linear[5]);
  else if(!g_ascii_strcasecmp(name, "unbound"))
    return &(introspection_linear[6]);
  else
    return NULL;
}

#ifdef __cplusplus
}
#endif

