/*
 * this code is auto generated. do not edit. change the sources in tools/introspection/ instead.
 *
 * the parse tree:
 *
 * typedef
 *   struct dt_iop_vignette_params_t
 *     float
 *     scale 
 *       description: fall-off start
 *       default: 80.0
 *       range: 0.0 .. 200.0
 * 
 *     float
 *     falloff_scale 
 *       description: fall-off radius
 *       default: 50.0
 *       range: 0.0 .. 200.0
 * 
 *     float
 *     brightness 
 *       default: -0.5
 *       range: -1.0 .. 1.0
 * 
 *     float
 *     saturation 
 *       default: -0.5
 *       range: -1.0 .. 1.0
 * 
 *     struct dt_iop_fvector_2d_t
 *       float
 *       x 
 *         description: horizontal center
 *         default: 0.0
 *         range: -1.0 .. 1.0
 * 
 *       float
 *       y 
 *         description: vertical center
 *         default: 0.0
 *         range: -1.0 .. 1.0
 * 
 *     center 
 * 
 *     boolean
 *     autoratio 
 *       description: automatic ratio
 *       default: FALSE
 * 
 *     float
 *     whratio 
 *       description: width/height ratio
 *       default: 1.0
 *       range: 0.0 .. 2.0
 * 
 *     float
 *     shape 
 *       description: shape
 *       default: 1.0
 *       range: 0.0 .. 5.0
 * 
 *     enum dt_iop_dither_t
 *       DITHER_OFF : off
 *       DITHER_8BIT : 8-bit output
 *       DITHER_16BIT : 16-bit output
 *     dithering 
 *       default: DITHER_OFF
 * 
 *     boolean
 *     unbound 
 *       default: TRUE
 * 
 * dt_iop_vignette_params_t
 *
 */

#include "/build/darktable/src/darktable-5.6.0/src/iop/vignette.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) )
= {
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"scale", (char*)"scale", N_((char*)"fall-off start"), sizeof(((dt_iop_vignette_params_t*)NULL)->scale), G_STRUCT_OFFSET(dt_iop_vignette_params_t, scale), NULL },
    /*Min*/ 0.0, /*Max*/ 200.0, /*Default*/ 80.0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"falloff_scale", (char*)"falloff_scale", N_((char*)"fall-off radius"), sizeof(((dt_iop_vignette_params_t*)NULL)->falloff_scale), G_STRUCT_OFFSET(dt_iop_vignette_params_t, falloff_scale), NULL },
    /*Min*/ 0.0, /*Max*/ 200.0, /*Default*/ 50.0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"brightness", (char*)"brightness", (char*)"", sizeof(((dt_iop_vignette_params_t*)NULL)->brightness), G_STRUCT_OFFSET(dt_iop_vignette_params_t, brightness), NULL },
    /*Min*/ -1.0, /*Max*/ 1.0, /*Default*/ -0.5
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"saturation", (char*)"saturation", (char*)"", sizeof(((dt_iop_vignette_params_t*)NULL)->saturation), G_STRUCT_OFFSET(dt_iop_vignette_params_t, saturation), NULL },
    /*Min*/ -1.0, /*Max*/ 1.0, /*Default*/ -0.5
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"center.x", (char*)"x", N_((char*)"horizontal center"), sizeof(((dt_iop_vignette_params_t*)NULL)->center.x), G_STRUCT_OFFSET(dt_iop_vignette_params_t, center.x), NULL },
    /*Min*/ -1.0, /*Max*/ 1.0, /*Default*/ 0.0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"center.y", (char*)"y", N_((char*)"vertical center"), sizeof(((dt_iop_vignette_params_t*)NULL)->center.y), G_STRUCT_OFFSET(dt_iop_vignette_params_t, center.y), NULL },
    /*Min*/ -1.0, /*Max*/ 1.0, /*Default*/ 0.0
  }
},
{
  .Struct = {
    { DT_INTROSPECTION_TYPE_STRUCT, (char*)"dt_iop_fvector_2d_t", (char*)"center", (char*)"center", (char*)"", sizeof(((dt_iop_vignette_params_t*)NULL)->center), G_STRUCT_OFFSET(dt_iop_vignette_params_t, center), NULL },
    /*entries*/ 2, /*fields*/ NULL
  }
},
{
  .Bool = {
    { DT_INTROSPECTION_TYPE_BOOL, (char*)"bool", (char*)"autoratio", (char*)"autoratio", N_((char*)"automatic ratio"), sizeof(((dt_iop_vignette_params_t*)NULL)->autoratio), G_STRUCT_OFFSET(dt_iop_vignette_params_t, autoratio), NULL },
    /*Default*/ FALSE
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"whratio", (char*)"whratio", N_((char*)"width/height ratio"), sizeof(((dt_iop_vignette_params_t*)NULL)->whratio), G_STRUCT_OFFSET(dt_iop_vignette_params_t, whratio), NULL },
    /*Min*/ 0.0, /*Max*/ 2.0, /*Default*/ 1.0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"shape", (char*)"shape", N_((char*)"shape"), sizeof(((dt_iop_vignette_params_t*)NULL)->shape), G_STRUCT_OFFSET(dt_iop_vignette_params_t, shape), NULL },
    /*Min*/ 0.0, /*Max*/ 5.0, /*Default*/ 1.0
  }
},
{
  .Enum = {
    { DT_INTROSPECTION_TYPE_ENUM, (char*)"dt_iop_dither_t", (char*)"dithering", (char*)"dithering", (char*)"", sizeof(((dt_iop_vignette_params_t*)NULL)->dithering), G_STRUCT_OFFSET(dt_iop_vignette_params_t, dithering), NULL },
    /*entries*/ 3, /*values*/ NULL, /*Default*/ DITHER_OFF
  }
},
{
  .Bool = {
    { DT_INTROSPECTION_TYPE_BOOL, (char*)"bool", (char*)"unbound", (char*)"unbound", (char*)"", sizeof(((dt_iop_vignette_params_t*)NULL)->unbound), G_STRUCT_OFFSET(dt_iop_vignette_params_t, unbound), NULL },
    /*Default*/ TRUE
  }
},
{
  .Struct = {
    { DT_INTROSPECTION_TYPE_STRUCT, (char*)"dt_iop_vignette_params_t", (char*)"", (char*)"", (char*)"", sizeof(dt_iop_vignette_params_t), 0, NULL },
    /*entries*/ 10, /*fields*/ NULL
  }
},
  { .header = {DT_INTROSPECTION_TYPE_NONE, NULL, NULL, NULL, NULL, 0, 0, NULL} }
}
#endif
;

static dt_introspection_t introspection = {
  8,
  4,
  "dt_iop_vignette_params_t",
  sizeof(dt_iop_vignette_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].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"scale", (char*)"scale", N_((char*)"fall-off start"), sizeof(((dt_iop_vignette_params_t*)NULL)->scale), G_STRUCT_OFFSET(dt_iop_vignette_params_t, scale), NULL },
    /*Min*/ 0.0, /*Max*/ 200.0, /*Default*/ 80.0
  };
  introspection_linear[1].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"falloff_scale", (char*)"falloff_scale", N_((char*)"fall-off radius"), sizeof(((dt_iop_vignette_params_t*)NULL)->falloff_scale), G_STRUCT_OFFSET(dt_iop_vignette_params_t, falloff_scale), NULL },
    /*Min*/ 0.0, /*Max*/ 200.0, /*Default*/ 50.0
  };
  introspection_linear[2].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"brightness", (char*)"brightness", (char*)"", sizeof(((dt_iop_vignette_params_t*)NULL)->brightness), G_STRUCT_OFFSET(dt_iop_vignette_params_t, brightness), NULL },
    /*Min*/ -1.0, /*Max*/ 1.0, /*Default*/ -0.5
  };
  introspection_linear[3].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"saturation", (char*)"saturation", (char*)"", sizeof(((dt_iop_vignette_params_t*)NULL)->saturation), G_STRUCT_OFFSET(dt_iop_vignette_params_t, saturation), NULL },
    /*Min*/ -1.0, /*Max*/ 1.0, /*Default*/ -0.5
  };
  introspection_linear[4].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"center.x", (char*)"x", N_((char*)"horizontal center"), sizeof(((dt_iop_vignette_params_t*)NULL)->center.x), G_STRUCT_OFFSET(dt_iop_vignette_params_t, center.x), NULL },
    /*Min*/ -1.0, /*Max*/ 1.0, /*Default*/ 0.0
  };
  introspection_linear[5].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"center.y", (char*)"y", N_((char*)"vertical center"), sizeof(((dt_iop_vignette_params_t*)NULL)->center.y), G_STRUCT_OFFSET(dt_iop_vignette_params_t, center.y), NULL },
    /*Min*/ -1.0, /*Max*/ 1.0, /*Default*/ 0.0
  };
  introspection_linear[6].Struct = {
    { DT_INTROSPECTION_TYPE_STRUCT, (char*)"dt_iop_fvector_2d_t", (char*)"center", (char*)"center", (char*)"", sizeof(((dt_iop_vignette_params_t*)NULL)->center), G_STRUCT_OFFSET(dt_iop_vignette_params_t, center), NULL },
    /*entries*/ 2, /*fields*/ NULL
  };
  introspection_linear[7].Bool = {
    { DT_INTROSPECTION_TYPE_BOOL, (char*)"bool", (char*)"autoratio", (char*)"autoratio", N_((char*)"automatic ratio"), sizeof(((dt_iop_vignette_params_t*)NULL)->autoratio), G_STRUCT_OFFSET(dt_iop_vignette_params_t, autoratio), NULL },
    /*Default*/ FALSE
  };
  introspection_linear[8].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"whratio", (char*)"whratio", N_((char*)"width/height ratio"), sizeof(((dt_iop_vignette_params_t*)NULL)->whratio), G_STRUCT_OFFSET(dt_iop_vignette_params_t, whratio), NULL },
    /*Min*/ 0.0, /*Max*/ 2.0, /*Default*/ 1.0
  };
  introspection_linear[9].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"shape", (char*)"shape", N_((char*)"shape"), sizeof(((dt_iop_vignette_params_t*)NULL)->shape), G_STRUCT_OFFSET(dt_iop_vignette_params_t, shape), NULL },
    /*Min*/ 0.0, /*Max*/ 5.0, /*Default*/ 1.0
  };
  introspection_linear[10].Enum = {
    { DT_INTROSPECTION_TYPE_ENUM, (char*)"dt_iop_dither_t", (char*)"dithering", (char*)"dithering", (char*)"", sizeof(((dt_iop_vignette_params_t*)NULL)->dithering), G_STRUCT_OFFSET(dt_iop_vignette_params_t, dithering), NULL },
    /*entries*/ 3, /*values*/ NULL, /*Default*/ DITHER_OFF
  };
  introspection_linear[11].Bool = {
    { DT_INTROSPECTION_TYPE_BOOL, (char*)"bool", (char*)"unbound", (char*)"unbound", (char*)"", sizeof(((dt_iop_vignette_params_t*)NULL)->unbound), G_STRUCT_OFFSET(dt_iop_vignette_params_t, unbound), NULL },
    /*Default*/ TRUE
  };
  introspection_linear[12].Struct = {
    { DT_INTROSPECTION_TYPE_STRUCT, (char*)"dt_iop_vignette_params_t", (char*)"", (char*)"", (char*)"", sizeof(dt_iop_vignette_params_t), 0, NULL },
    /*entries*/ 10, /*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_field_t *f6[] = {
    &introspection_linear[4],
    &introspection_linear[5],
    NULL
  };
  static dt_introspection_type_enum_tuple_t f10[] = { 
    { "DITHER_OFF", DITHER_OFF, N_((char*)"off") },
    { "DITHER_8BIT", DITHER_8BIT, N_((char*)"8-bit output") },
    { "DITHER_16BIT", DITHER_16BIT, N_((char*)"16-bit output") },
    { NULL, 0 },
  };
  static dt_introspection_field_t *f12[] = {
    &introspection_linear[0],
    &introspection_linear[1],
    &introspection_linear[2],
    &introspection_linear[3],
    &introspection_linear[6],
    &introspection_linear[7],
    &introspection_linear[8],
    &introspection_linear[9],
    &introspection_linear[10],
    &introspection_linear[11],
    NULL
  };

  introspection_linear[6].Struct.fields = f6;
  introspection_linear[10].Enum.values = f10;
  introspection_linear[12].Struct.fields = f12;

  return 0;
}

void * get_p(const void * param, const char * name)
{
  dt_iop_vignette_params_t * p = (dt_iop_vignette_params_t*)param;
  if(!strcmp(name, "scale"))
    return &(p->scale);
  else if(!strcmp(name, "falloff_scale"))
    return &(p->falloff_scale);
  else if(!strcmp(name, "brightness"))
    return &(p->brightness);
  else if(!strcmp(name, "saturation"))
    return &(p->saturation);
  else if(!strcmp(name, "center.x"))
    return &(p->center.x);
  else if(!strcmp(name, "center.y"))
    return &(p->center.y);
  else if(!strcmp(name, "center"))
    return &(p->center);
  else if(!strcmp(name, "autoratio"))
    return &(p->autoratio);
  else if(!strcmp(name, "whratio"))
    return &(p->whratio);
  else if(!strcmp(name, "shape"))
    return &(p->shape);
  else if(!strcmp(name, "dithering"))
    return &(p->dithering);
  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, "scale"))
    return &(introspection_linear[0]);
  else if(!g_ascii_strcasecmp(name, "falloff_scale"))
    return &(introspection_linear[1]);
  else if(!g_ascii_strcasecmp(name, "brightness"))
    return &(introspection_linear[2]);
  else if(!g_ascii_strcasecmp(name, "saturation"))
    return &(introspection_linear[3]);
  else if(!g_ascii_strcasecmp(name, "center.x"))
    return &(introspection_linear[4]);
  else if(!g_ascii_strcasecmp(name, "center.y"))
    return &(introspection_linear[5]);
  else if(!g_ascii_strcasecmp(name, "center"))
    return &(introspection_linear[6]);
  else if(!g_ascii_strcasecmp(name, "autoratio"))
    return &(introspection_linear[7]);
  else if(!g_ascii_strcasecmp(name, "whratio"))
    return &(introspection_linear[8]);
  else if(!g_ascii_strcasecmp(name, "shape"))
    return &(introspection_linear[9]);
  else if(!g_ascii_strcasecmp(name, "dithering"))
    return &(introspection_linear[10]);
  else if(!g_ascii_strcasecmp(name, "unbound"))
    return &(introspection_linear[11]);
  else
    return NULL;
}

#ifdef __cplusplus
}
#endif

