/*
 * this code is auto generated. do not edit. change the sources in tools/introspection/ instead.
 *
 * the parse tree:
 *
 * typedef
 *   struct dt_iop_blurs_params_t
 *     enum dt_iop_blur_type_t
 *       DT_BLUR_LENS : lens
 *       DT_BLUR_MOTION : motion
 *       DT_BLUR_GAUSSIAN : gaussian
 *     type 
 *       description: blur type
 *       default: DT_BLUR_LENS
 * 
 *     int
 *     radius 
 *       description: blur radius
 *       default: 8
 *       range: 4 .. 128
 * 
 *     int
 *     blades 
 *       description: diaphragm blades
 *       default: 5
 *       range: 3 .. 11
 * 
 *     float
 *     concavity 
 *       description: concavity
 *       default: 1.
 *       range: 1. .. 9.
 * 
 *     float
 *     linearity 
 *       description: linearity
 *       default: 1.
 *       range: 0. .. 1.
 * 
 *     float
 *     rotation 
 *       description: rotation
 *       default: 0.
 *       range: -1.57 .. 1.57
 * 
 *     float
 *     angle 
 *       description: direction
 *       default: 0.
 *       range: -3.14 .. 3.14
 * 
 *     float
 *     curvature 
 *       description: curvature
 *       default: 0.
 *       range: -2. .. 2.
 * 
 *     float
 *     offset 
 *       description: offset
 *       default: 0
 *       range: -1. .. 1.
 * 
 * dt_iop_blurs_params_t
 *
 */

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

#ifdef __cplusplus
extern "C"
{
#endif

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

static dt_introspection_field_t introspection_linear[10+1]
#if !( defined(__cplusplus) && !defined(__clang__) && defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) <= 406) )
= {
{
  .Enum = {
    { DT_INTROSPECTION_TYPE_ENUM, (char*)"dt_iop_blur_type_t", (char*)"type", (char*)"type", N_((char*)"blur type"), sizeof(((dt_iop_blurs_params_t*)NULL)->type), G_STRUCT_OFFSET(dt_iop_blurs_params_t, type), NULL },
    /*entries*/ 3, /*values*/ NULL, /*Default*/ DT_BLUR_LENS
  }
},
{
  .Int = {
    { DT_INTROSPECTION_TYPE_INT, (char*)"int", (char*)"radius", (char*)"radius", N_((char*)"blur radius"), sizeof(((dt_iop_blurs_params_t*)NULL)->radius), G_STRUCT_OFFSET(dt_iop_blurs_params_t, radius), NULL },
    /*Min*/ 4, /*Max*/ 128, /*Default*/ 8
  }
},
{
  .Int = {
    { DT_INTROSPECTION_TYPE_INT, (char*)"int", (char*)"blades", (char*)"blades", N_((char*)"diaphragm blades"), sizeof(((dt_iop_blurs_params_t*)NULL)->blades), G_STRUCT_OFFSET(dt_iop_blurs_params_t, blades), NULL },
    /*Min*/ 3, /*Max*/ 11, /*Default*/ 5
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"concavity", (char*)"concavity", N_((char*)"concavity"), sizeof(((dt_iop_blurs_params_t*)NULL)->concavity), G_STRUCT_OFFSET(dt_iop_blurs_params_t, concavity), NULL },
    /*Min*/ 1., /*Max*/ 9., /*Default*/ 1.
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"linearity", (char*)"linearity", N_((char*)"linearity"), sizeof(((dt_iop_blurs_params_t*)NULL)->linearity), G_STRUCT_OFFSET(dt_iop_blurs_params_t, linearity), NULL },
    /*Min*/ 0., /*Max*/ 1., /*Default*/ 1.
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"rotation", (char*)"rotation", N_((char*)"rotation"), sizeof(((dt_iop_blurs_params_t*)NULL)->rotation), G_STRUCT_OFFSET(dt_iop_blurs_params_t, rotation), NULL },
    /*Min*/ -1.57, /*Max*/ 1.57, /*Default*/ 0.
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"angle", (char*)"angle", N_((char*)"direction"), sizeof(((dt_iop_blurs_params_t*)NULL)->angle), G_STRUCT_OFFSET(dt_iop_blurs_params_t, angle), NULL },
    /*Min*/ -3.14, /*Max*/ 3.14, /*Default*/ 0.
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"curvature", (char*)"curvature", N_((char*)"curvature"), sizeof(((dt_iop_blurs_params_t*)NULL)->curvature), G_STRUCT_OFFSET(dt_iop_blurs_params_t, curvature), NULL },
    /*Min*/ -2., /*Max*/ 2., /*Default*/ 0.
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"offset", (char*)"offset", N_((char*)"offset"), sizeof(((dt_iop_blurs_params_t*)NULL)->offset), G_STRUCT_OFFSET(dt_iop_blurs_params_t, offset), NULL },
    /*Min*/ -1., /*Max*/ 1., /*Default*/ 0
  }
},
{
  .Struct = {
    { DT_INTROSPECTION_TYPE_STRUCT, (char*)"dt_iop_blurs_params_t", (char*)"", (char*)"", (char*)"", sizeof(dt_iop_blurs_params_t), 0, NULL },
    /*entries*/ 9, /*fields*/ NULL
  }
},
  { .header = {DT_INTROSPECTION_TYPE_NONE, NULL, NULL, NULL, NULL, 0, 0, NULL} }
}
#endif
;

static dt_introspection_t introspection = {
  8,
  1,
  "dt_iop_blurs_params_t",
  sizeof(dt_iop_blurs_params_t),
  &introspection_linear[10-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_iop_blur_type_t", (char*)"type", (char*)"type", N_((char*)"blur type"), sizeof(((dt_iop_blurs_params_t*)NULL)->type), G_STRUCT_OFFSET(dt_iop_blurs_params_t, type), NULL },
    /*entries*/ 3, /*values*/ NULL, /*Default*/ DT_BLUR_LENS
  };
  introspection_linear[1].Int = {
    { DT_INTROSPECTION_TYPE_INT, (char*)"int", (char*)"radius", (char*)"radius", N_((char*)"blur radius"), sizeof(((dt_iop_blurs_params_t*)NULL)->radius), G_STRUCT_OFFSET(dt_iop_blurs_params_t, radius), NULL },
    /*Min*/ 4, /*Max*/ 128, /*Default*/ 8
  };
  introspection_linear[2].Int = {
    { DT_INTROSPECTION_TYPE_INT, (char*)"int", (char*)"blades", (char*)"blades", N_((char*)"diaphragm blades"), sizeof(((dt_iop_blurs_params_t*)NULL)->blades), G_STRUCT_OFFSET(dt_iop_blurs_params_t, blades), NULL },
    /*Min*/ 3, /*Max*/ 11, /*Default*/ 5
  };
  introspection_linear[3].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"concavity", (char*)"concavity", N_((char*)"concavity"), sizeof(((dt_iop_blurs_params_t*)NULL)->concavity), G_STRUCT_OFFSET(dt_iop_blurs_params_t, concavity), NULL },
    /*Min*/ 1., /*Max*/ 9., /*Default*/ 1.
  };
  introspection_linear[4].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"linearity", (char*)"linearity", N_((char*)"linearity"), sizeof(((dt_iop_blurs_params_t*)NULL)->linearity), G_STRUCT_OFFSET(dt_iop_blurs_params_t, linearity), NULL },
    /*Min*/ 0., /*Max*/ 1., /*Default*/ 1.
  };
  introspection_linear[5].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"rotation", (char*)"rotation", N_((char*)"rotation"), sizeof(((dt_iop_blurs_params_t*)NULL)->rotation), G_STRUCT_OFFSET(dt_iop_blurs_params_t, rotation), NULL },
    /*Min*/ -1.57, /*Max*/ 1.57, /*Default*/ 0.
  };
  introspection_linear[6].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"angle", (char*)"angle", N_((char*)"direction"), sizeof(((dt_iop_blurs_params_t*)NULL)->angle), G_STRUCT_OFFSET(dt_iop_blurs_params_t, angle), NULL },
    /*Min*/ -3.14, /*Max*/ 3.14, /*Default*/ 0.
  };
  introspection_linear[7].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"curvature", (char*)"curvature", N_((char*)"curvature"), sizeof(((dt_iop_blurs_params_t*)NULL)->curvature), G_STRUCT_OFFSET(dt_iop_blurs_params_t, curvature), NULL },
    /*Min*/ -2., /*Max*/ 2., /*Default*/ 0.
  };
  introspection_linear[8].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"offset", (char*)"offset", N_((char*)"offset"), sizeof(((dt_iop_blurs_params_t*)NULL)->offset), G_STRUCT_OFFSET(dt_iop_blurs_params_t, offset), NULL },
    /*Min*/ -1., /*Max*/ 1., /*Default*/ 0
  };
  introspection_linear[9].Struct = {
    { DT_INTROSPECTION_TYPE_STRUCT, (char*)"dt_iop_blurs_params_t", (char*)"", (char*)"", (char*)"", sizeof(dt_iop_blurs_params_t), 0, NULL },
    /*entries*/ 9, /*fields*/ NULL
  };
  introspection_linear[10].header = {DT_INTROSPECTION_TYPE_NONE, NULL, NULL, NULL, NULL, 0, 0, NULL};
#endif

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

  static dt_introspection_type_enum_tuple_t f0[] = { 
    { "DT_BLUR_LENS", DT_BLUR_LENS, N_((char*)"lens") },
    { "DT_BLUR_MOTION", DT_BLUR_MOTION, N_((char*)"motion") },
    { "DT_BLUR_GAUSSIAN", DT_BLUR_GAUSSIAN, N_((char*)"gaussian") },
    { NULL, 0 },
  };
  static dt_introspection_field_t *f9[] = {
    &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],
    NULL
  };

  introspection_linear[0].Enum.values = f0;
  introspection_linear[9].Struct.fields = f9;

  return 0;
}

void * get_p(const void * param, const char * name)
{
  dt_iop_blurs_params_t * p = (dt_iop_blurs_params_t*)param;
  if(!strcmp(name, "type"))
    return &(p->type);
  else if(!strcmp(name, "radius"))
    return &(p->radius);
  else if(!strcmp(name, "blades"))
    return &(p->blades);
  else if(!strcmp(name, "concavity"))
    return &(p->concavity);
  else if(!strcmp(name, "linearity"))
    return &(p->linearity);
  else if(!strcmp(name, "rotation"))
    return &(p->rotation);
  else if(!strcmp(name, "angle"))
    return &(p->angle);
  else if(!strcmp(name, "curvature"))
    return &(p->curvature);
  else if(!strcmp(name, "offset"))
    return &(p->offset);
  else
    return NULL;
}

dt_introspection_field_t * get_f(const char * name)
{
  if(!strcmp(name, "type"))
    return &(introspection_linear[0]);
  else if(!strcmp(name, "radius"))
    return &(introspection_linear[1]);
  else if(!strcmp(name, "blades"))
    return &(introspection_linear[2]);
  else if(!strcmp(name, "concavity"))
    return &(introspection_linear[3]);
  else if(!strcmp(name, "linearity"))
    return &(introspection_linear[4]);
  else if(!strcmp(name, "rotation"))
    return &(introspection_linear[5]);
  else if(!strcmp(name, "angle"))
    return &(introspection_linear[6]);
  else if(!strcmp(name, "curvature"))
    return &(introspection_linear[7]);
  else if(!strcmp(name, "offset"))
    return &(introspection_linear[8]);
  else
    return NULL;
}

#ifdef __cplusplus
}
#endif

