/*
 * this code is auto generated. do not edit. change the sources in tools/introspection/ instead.
 *
 * the parse tree:
 *
 * typedef
 *   struct dt_iop_shadhi_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: DT_IOP_GAUSSIAN_ZERO
 * 
 *     float
 *     radius 
 *       default: 100.0
 *       range: 0.1 .. 500.0
 * 
 *     float
 *     shadows 
 *       default: 50.0
 *       range: -100.0 .. 100.0
 * 
 *     float
 *     whitepoint 
 *       description: white point adjustment
 *       default: 0.0
 *       range: -10.0 .. 10.0
 * 
 *     float
 *     highlights 
 *       default: -50.0
 *       range: -100.0 .. 100.0
 * 
 *     float
 *     reserved2 
 *       default: 0.0
 *       range: -G_MAXFLOAT .. G_MAXFLOAT
 * 
 *     float
 *     compress 
 *       default: 50.0
 *       range: 0.0 .. 100.0
 * 
 *     float
 *     shadows_ccorrect 
 *       description: shadows color adjustment
 *       default: 100.0
 *       range: 0.0 .. 100.0
 * 
 *     float
 *     highlights_ccorrect 
 *       description: highlights color adjustment
 *       default: 50.0
 *       range: 0.0 .. 100.0
 * 
 *     unsigned int
 *     flags 
 *       default: UNBOUND_DEFAULT
 *       range: 0 .. G_MAXUINT
 * 
 *     float
 *     low_approximation 
 *       default: 0.000001
 *       range: -G_MAXFLOAT .. G_MAXFLOAT
 * 
 *     enum dt_iop_shadhi_algo_t
 *       SHADHI_ALGO_GAUSSIAN : gaussian
 *       SHADHI_ALGO_BILATERAL : bilateral filter
 *     shadhi_algo 
 *       description: soften with
 *       default: SHADHI_ALGO_GAUSSIAN
 * 
 * dt_iop_shadhi_params_t
 *
 */

#include "/build/darktable/src/darktable-4.0.1/src/iop/shadhi.c"

#ifdef __cplusplus
extern "C"
{
#endif

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

static dt_introspection_field_t introspection_linear[13+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_shadhi_params_t*)NULL)->order), G_STRUCT_OFFSET(dt_iop_shadhi_params_t, order), NULL },
    /*entries*/ 3, /*values*/ NULL, /*Default*/ DT_IOP_GAUSSIAN_ZERO
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"radius", (char*)"radius", (char*)"", sizeof(((dt_iop_shadhi_params_t*)NULL)->radius), G_STRUCT_OFFSET(dt_iop_shadhi_params_t, radius), NULL },
    /*Min*/ 0.1, /*Max*/ 500.0, /*Default*/ 100.0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"shadows", (char*)"shadows", (char*)"", sizeof(((dt_iop_shadhi_params_t*)NULL)->shadows), G_STRUCT_OFFSET(dt_iop_shadhi_params_t, shadows), NULL },
    /*Min*/ -100.0, /*Max*/ 100.0, /*Default*/ 50.0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"whitepoint", (char*)"whitepoint", N_((char*)"white point adjustment"), sizeof(((dt_iop_shadhi_params_t*)NULL)->whitepoint), G_STRUCT_OFFSET(dt_iop_shadhi_params_t, whitepoint), NULL },
    /*Min*/ -10.0, /*Max*/ 10.0, /*Default*/ 0.0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"highlights", (char*)"highlights", (char*)"", sizeof(((dt_iop_shadhi_params_t*)NULL)->highlights), G_STRUCT_OFFSET(dt_iop_shadhi_params_t, highlights), NULL },
    /*Min*/ -100.0, /*Max*/ 100.0, /*Default*/ -50.0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"reserved2", (char*)"reserved2", (char*)"", sizeof(((dt_iop_shadhi_params_t*)NULL)->reserved2), G_STRUCT_OFFSET(dt_iop_shadhi_params_t, reserved2), NULL },
    /*Min*/ -G_MAXFLOAT, /*Max*/ G_MAXFLOAT, /*Default*/ 0.0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"compress", (char*)"compress", (char*)"", sizeof(((dt_iop_shadhi_params_t*)NULL)->compress), G_STRUCT_OFFSET(dt_iop_shadhi_params_t, compress), NULL },
    /*Min*/ 0.0, /*Max*/ 100.0, /*Default*/ 50.0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"shadows_ccorrect", (char*)"shadows_ccorrect", N_((char*)"shadows color adjustment"), sizeof(((dt_iop_shadhi_params_t*)NULL)->shadows_ccorrect), G_STRUCT_OFFSET(dt_iop_shadhi_params_t, shadows_ccorrect), NULL },
    /*Min*/ 0.0, /*Max*/ 100.0, /*Default*/ 100.0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"highlights_ccorrect", (char*)"highlights_ccorrect", N_((char*)"highlights color adjustment"), sizeof(((dt_iop_shadhi_params_t*)NULL)->highlights_ccorrect), G_STRUCT_OFFSET(dt_iop_shadhi_params_t, highlights_ccorrect), NULL },
    /*Min*/ 0.0, /*Max*/ 100.0, /*Default*/ 50.0
  }
},
{
  .UInt = {
    { DT_INTROSPECTION_TYPE_UINT, (char*)"uint", (char*)"flags", (char*)"flags", (char*)"", sizeof(((dt_iop_shadhi_params_t*)NULL)->flags), G_STRUCT_OFFSET(dt_iop_shadhi_params_t, flags), NULL },
    /*Min*/ 0, /*Max*/ G_MAXUINT, /*Default*/ UNBOUND_DEFAULT
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"low_approximation", (char*)"low_approximation", (char*)"", sizeof(((dt_iop_shadhi_params_t*)NULL)->low_approximation), G_STRUCT_OFFSET(dt_iop_shadhi_params_t, low_approximation), NULL },
    /*Min*/ -G_MAXFLOAT, /*Max*/ G_MAXFLOAT, /*Default*/ 0.000001
  }
},
{
  .Enum = {
    { DT_INTROSPECTION_TYPE_ENUM, (char*)"dt_iop_shadhi_algo_t", (char*)"shadhi_algo", (char*)"shadhi_algo", N_((char*)"soften with"), sizeof(((dt_iop_shadhi_params_t*)NULL)->shadhi_algo), G_STRUCT_OFFSET(dt_iop_shadhi_params_t, shadhi_algo), NULL },
    /*entries*/ 2, /*values*/ NULL, /*Default*/ SHADHI_ALGO_GAUSSIAN
  }
},
{
  .Struct = {
    { DT_INTROSPECTION_TYPE_STRUCT, (char*)"dt_iop_shadhi_params_t", (char*)"", (char*)"", (char*)"", sizeof(dt_iop_shadhi_params_t), 0, NULL },
    /*entries*/ 12, /*fields*/ NULL
  }
},
  { .header = {DT_INTROSPECTION_TYPE_NONE, NULL, NULL, NULL, NULL, 0, 0, NULL} }
}
#endif
;

static dt_introspection_t introspection = {
  8,
  5,
  "dt_iop_shadhi_params_t",
  sizeof(dt_iop_shadhi_params_t),
  &introspection_linear[13-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_shadhi_params_t*)NULL)->order), G_STRUCT_OFFSET(dt_iop_shadhi_params_t, order), NULL },
    /*entries*/ 3, /*values*/ NULL, /*Default*/ DT_IOP_GAUSSIAN_ZERO
  };
  introspection_linear[1].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"radius", (char*)"radius", (char*)"", sizeof(((dt_iop_shadhi_params_t*)NULL)->radius), G_STRUCT_OFFSET(dt_iop_shadhi_params_t, radius), NULL },
    /*Min*/ 0.1, /*Max*/ 500.0, /*Default*/ 100.0
  };
  introspection_linear[2].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"shadows", (char*)"shadows", (char*)"", sizeof(((dt_iop_shadhi_params_t*)NULL)->shadows), G_STRUCT_OFFSET(dt_iop_shadhi_params_t, shadows), NULL },
    /*Min*/ -100.0, /*Max*/ 100.0, /*Default*/ 50.0
  };
  introspection_linear[3].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"whitepoint", (char*)"whitepoint", N_((char*)"white point adjustment"), sizeof(((dt_iop_shadhi_params_t*)NULL)->whitepoint), G_STRUCT_OFFSET(dt_iop_shadhi_params_t, whitepoint), NULL },
    /*Min*/ -10.0, /*Max*/ 10.0, /*Default*/ 0.0
  };
  introspection_linear[4].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"highlights", (char*)"highlights", (char*)"", sizeof(((dt_iop_shadhi_params_t*)NULL)->highlights), G_STRUCT_OFFSET(dt_iop_shadhi_params_t, highlights), NULL },
    /*Min*/ -100.0, /*Max*/ 100.0, /*Default*/ -50.0
  };
  introspection_linear[5].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"reserved2", (char*)"reserved2", (char*)"", sizeof(((dt_iop_shadhi_params_t*)NULL)->reserved2), G_STRUCT_OFFSET(dt_iop_shadhi_params_t, reserved2), NULL },
    /*Min*/ -G_MAXFLOAT, /*Max*/ G_MAXFLOAT, /*Default*/ 0.0
  };
  introspection_linear[6].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"compress", (char*)"compress", (char*)"", sizeof(((dt_iop_shadhi_params_t*)NULL)->compress), G_STRUCT_OFFSET(dt_iop_shadhi_params_t, compress), NULL },
    /*Min*/ 0.0, /*Max*/ 100.0, /*Default*/ 50.0
  };
  introspection_linear[7].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"shadows_ccorrect", (char*)"shadows_ccorrect", N_((char*)"shadows color adjustment"), sizeof(((dt_iop_shadhi_params_t*)NULL)->shadows_ccorrect), G_STRUCT_OFFSET(dt_iop_shadhi_params_t, shadows_ccorrect), NULL },
    /*Min*/ 0.0, /*Max*/ 100.0, /*Default*/ 100.0
  };
  introspection_linear[8].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"highlights_ccorrect", (char*)"highlights_ccorrect", N_((char*)"highlights color adjustment"), sizeof(((dt_iop_shadhi_params_t*)NULL)->highlights_ccorrect), G_STRUCT_OFFSET(dt_iop_shadhi_params_t, highlights_ccorrect), NULL },
    /*Min*/ 0.0, /*Max*/ 100.0, /*Default*/ 50.0
  };
  introspection_linear[9].UInt = {
    { DT_INTROSPECTION_TYPE_UINT, (char*)"uint", (char*)"flags", (char*)"flags", (char*)"", sizeof(((dt_iop_shadhi_params_t*)NULL)->flags), G_STRUCT_OFFSET(dt_iop_shadhi_params_t, flags), NULL },
    /*Min*/ 0, /*Max*/ G_MAXUINT, /*Default*/ UNBOUND_DEFAULT
  };
  introspection_linear[10].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"low_approximation", (char*)"low_approximation", (char*)"", sizeof(((dt_iop_shadhi_params_t*)NULL)->low_approximation), G_STRUCT_OFFSET(dt_iop_shadhi_params_t, low_approximation), NULL },
    /*Min*/ -G_MAXFLOAT, /*Max*/ G_MAXFLOAT, /*Default*/ 0.000001
  };
  introspection_linear[11].Enum = {
    { DT_INTROSPECTION_TYPE_ENUM, (char*)"dt_iop_shadhi_algo_t", (char*)"shadhi_algo", (char*)"shadhi_algo", N_((char*)"soften with"), sizeof(((dt_iop_shadhi_params_t*)NULL)->shadhi_algo), G_STRUCT_OFFSET(dt_iop_shadhi_params_t, shadhi_algo), NULL },
    /*entries*/ 2, /*values*/ NULL, /*Default*/ SHADHI_ALGO_GAUSSIAN
  };
  introspection_linear[12].Struct = {
    { DT_INTROSPECTION_TYPE_STRUCT, (char*)"dt_iop_shadhi_params_t", (char*)"", (char*)"", (char*)"", sizeof(dt_iop_shadhi_params_t), 0, NULL },
    /*entries*/ 12, /*fields*/ NULL
  };
  introspection_linear[13].header = {DT_INTROSPECTION_TYPE_NONE, NULL, NULL, NULL, NULL, 0, 0, NULL};
#endif

  for(int i = 0; i <= 13; 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 f11[] = { 
    { "SHADHI_ALGO_GAUSSIAN", SHADHI_ALGO_GAUSSIAN, N_((char*)"gaussian") },
    { "SHADHI_ALGO_BILATERAL", SHADHI_ALGO_BILATERAL, N_((char*)"bilateral filter") },
    { NULL, 0 },
  };
  static dt_introspection_field_t *f12[] = {
    &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],
    NULL
  };

  introspection_linear[0].Enum.values = f0;
  introspection_linear[11].Enum.values = f11;
  introspection_linear[12].Struct.fields = f12;

  return 0;
}

void * get_p(const void * param, const char * name)
{
  dt_iop_shadhi_params_t * p = (dt_iop_shadhi_params_t*)param;
  if(!strcmp(name, "order"))
    return &(p->order);
  else if(!strcmp(name, "radius"))
    return &(p->radius);
  else if(!strcmp(name, "shadows"))
    return &(p->shadows);
  else if(!strcmp(name, "whitepoint"))
    return &(p->whitepoint);
  else if(!strcmp(name, "highlights"))
    return &(p->highlights);
  else if(!strcmp(name, "reserved2"))
    return &(p->reserved2);
  else if(!strcmp(name, "compress"))
    return &(p->compress);
  else if(!strcmp(name, "shadows_ccorrect"))
    return &(p->shadows_ccorrect);
  else if(!strcmp(name, "highlights_ccorrect"))
    return &(p->highlights_ccorrect);
  else if(!strcmp(name, "flags"))
    return &(p->flags);
  else if(!strcmp(name, "low_approximation"))
    return &(p->low_approximation);
  else if(!strcmp(name, "shadhi_algo"))
    return &(p->shadhi_algo);
  else
    return NULL;
}

dt_introspection_field_t * get_f(const char * name)
{
  if(!strcmp(name, "order"))
    return &(introspection_linear[0]);
  else if(!strcmp(name, "radius"))
    return &(introspection_linear[1]);
  else if(!strcmp(name, "shadows"))
    return &(introspection_linear[2]);
  else if(!strcmp(name, "whitepoint"))
    return &(introspection_linear[3]);
  else if(!strcmp(name, "highlights"))
    return &(introspection_linear[4]);
  else if(!strcmp(name, "reserved2"))
    return &(introspection_linear[5]);
  else if(!strcmp(name, "compress"))
    return &(introspection_linear[6]);
  else if(!strcmp(name, "shadows_ccorrect"))
    return &(introspection_linear[7]);
  else if(!strcmp(name, "highlights_ccorrect"))
    return &(introspection_linear[8]);
  else if(!strcmp(name, "flags"))
    return &(introspection_linear[9]);
  else if(!strcmp(name, "low_approximation"))
    return &(introspection_linear[10]);
  else if(!strcmp(name, "shadhi_algo"))
    return &(introspection_linear[11]);
  else
    return NULL;
}

#ifdef __cplusplus
}
#endif

