/*
 * this code is auto generated. do not edit. change the sources in tools/introspection/ instead.
 *
 * the parse tree:
 *
 * typedef
 *   struct dt_iop_negadoctor_params_t
 *     enum dt_iop_negadoctor_filmstock_t
 *       DT_FILMSTOCK_NB : black and white film
 *       DT_FILMSTOCK_COLOR : color film
 *     film_stock 
 *       description: film stock
 *       default: DT_FILMSTOCK_COLOR
 * 
 *     float
 *     Dmin [4]
 *       default: 1.0
 *       range: 0.00001 .. 1.5
 * 
 *     float
 *     wb_high [4]
 *       default: 1.0
 *       range: 0.25 .. 2
 * 
 *     float
 *     wb_low [4]
 *       default: 1.0
 *       range: 0.25 .. 2
 * 
 *     float
 *     D_max 
 *       default: 2.046
 *       range: 0.1 .. 6
 * 
 *     float
 *     offset 
 *       description: scan exposure bias
 *       default: -0.05
 *       range: -1.0 .. 1.0
 * 
 *     float
 *     black 
 *       description: paper black (density correction)
 *       default: 0.0755
 *       range: -0.5 .. 0.5
 * 
 *     float
 *     gamma 
 *       description: paper grade (gamma)
 *       default: 4.0
 *       range: 1.0 .. 8.0
 * 
 *     float
 *     soft_clip 
 *       description: paper gloss (specular highlights)
 *       default: 0.75
 *       range: 0.0001 .. 1.0
 * 
 *     float
 *     exposure 
 *       description: print exposure adjustment
 *       default: 0.9245
 *       range: 0.5 .. 2.0
 * 
 * dt_iop_negadoctor_params_t
 *
 */

#include "/build/darktable/src/darktable-4.0.0/src/iop/negadoctor.c"

#ifdef __cplusplus
extern "C"
{
#endif

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

static dt_introspection_field_t introspection_linear[14+1]
#if !( defined(__cplusplus) && !defined(__clang__) && defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) <= 406) )
= {
{
  .Enum = {
    { DT_INTROSPECTION_TYPE_ENUM, (char*)"dt_iop_negadoctor_filmstock_t", (char*)"film_stock", (char*)"film_stock", N_((char*)"film stock"), sizeof(((dt_iop_negadoctor_params_t*)NULL)->film_stock), G_STRUCT_OFFSET(dt_iop_negadoctor_params_t, film_stock), NULL },
    /*entries*/ 2, /*values*/ NULL, /*Default*/ DT_FILMSTOCK_COLOR
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"Dmin[0]", (char*)"Dmin[0]", (char*)"", sizeof(((dt_iop_negadoctor_params_t*)NULL)->Dmin[0]), G_STRUCT_OFFSET(dt_iop_negadoctor_params_t, Dmin), NULL },
    /*Min*/ 0.00001, /*Max*/ 1.5, /*Default*/ 1.0
  }
},
{
  .Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"float[]", (char*)"Dmin", (char*)"Dmin", (char*)"", sizeof(((dt_iop_negadoctor_params_t*)NULL)->Dmin), G_STRUCT_OFFSET(dt_iop_negadoctor_params_t, Dmin), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_negadoctor_params_t*)NULL)->Dmin), /*type*/ DT_INTROSPECTION_TYPE_FLOAT, /*field*/ &introspection_linear[1]
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"wb_high[0]", (char*)"wb_high[0]", (char*)"", sizeof(((dt_iop_negadoctor_params_t*)NULL)->wb_high[0]), G_STRUCT_OFFSET(dt_iop_negadoctor_params_t, wb_high), NULL },
    /*Min*/ 0.25, /*Max*/ 2, /*Default*/ 1.0
  }
},
{
  .Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"float[]", (char*)"wb_high", (char*)"wb_high", (char*)"", sizeof(((dt_iop_negadoctor_params_t*)NULL)->wb_high), G_STRUCT_OFFSET(dt_iop_negadoctor_params_t, wb_high), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_negadoctor_params_t*)NULL)->wb_high), /*type*/ DT_INTROSPECTION_TYPE_FLOAT, /*field*/ &introspection_linear[3]
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"wb_low[0]", (char*)"wb_low[0]", (char*)"", sizeof(((dt_iop_negadoctor_params_t*)NULL)->wb_low[0]), G_STRUCT_OFFSET(dt_iop_negadoctor_params_t, wb_low), NULL },
    /*Min*/ 0.25, /*Max*/ 2, /*Default*/ 1.0
  }
},
{
  .Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"float[]", (char*)"wb_low", (char*)"wb_low", (char*)"", sizeof(((dt_iop_negadoctor_params_t*)NULL)->wb_low), G_STRUCT_OFFSET(dt_iop_negadoctor_params_t, wb_low), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_negadoctor_params_t*)NULL)->wb_low), /*type*/ DT_INTROSPECTION_TYPE_FLOAT, /*field*/ &introspection_linear[5]
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"D_max", (char*)"D_max", (char*)"", sizeof(((dt_iop_negadoctor_params_t*)NULL)->D_max), G_STRUCT_OFFSET(dt_iop_negadoctor_params_t, D_max), NULL },
    /*Min*/ 0.1, /*Max*/ 6, /*Default*/ 2.046
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"offset", (char*)"offset", N_((char*)"scan exposure bias"), sizeof(((dt_iop_negadoctor_params_t*)NULL)->offset), G_STRUCT_OFFSET(dt_iop_negadoctor_params_t, offset), NULL },
    /*Min*/ -1.0, /*Max*/ 1.0, /*Default*/ -0.05
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"black", (char*)"black", N_((char*)"paper black (density correction)"), sizeof(((dt_iop_negadoctor_params_t*)NULL)->black), G_STRUCT_OFFSET(dt_iop_negadoctor_params_t, black), NULL },
    /*Min*/ -0.5, /*Max*/ 0.5, /*Default*/ 0.0755
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"gamma", (char*)"gamma", N_((char*)"paper grade (gamma)"), sizeof(((dt_iop_negadoctor_params_t*)NULL)->gamma), G_STRUCT_OFFSET(dt_iop_negadoctor_params_t, gamma), NULL },
    /*Min*/ 1.0, /*Max*/ 8.0, /*Default*/ 4.0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"soft_clip", (char*)"soft_clip", N_((char*)"paper gloss (specular highlights)"), sizeof(((dt_iop_negadoctor_params_t*)NULL)->soft_clip), G_STRUCT_OFFSET(dt_iop_negadoctor_params_t, soft_clip), NULL },
    /*Min*/ 0.0001, /*Max*/ 1.0, /*Default*/ 0.75
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"exposure", (char*)"exposure", N_((char*)"print exposure adjustment"), sizeof(((dt_iop_negadoctor_params_t*)NULL)->exposure), G_STRUCT_OFFSET(dt_iop_negadoctor_params_t, exposure), NULL },
    /*Min*/ 0.5, /*Max*/ 2.0, /*Default*/ 0.9245
  }
},
{
  .Struct = {
    { DT_INTROSPECTION_TYPE_STRUCT, (char*)"dt_iop_negadoctor_params_t", (char*)"", (char*)"", (char*)"", sizeof(dt_iop_negadoctor_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,
  2,
  "dt_iop_negadoctor_params_t",
  sizeof(dt_iop_negadoctor_params_t),
  &introspection_linear[14-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_negadoctor_filmstock_t", (char*)"film_stock", (char*)"film_stock", N_((char*)"film stock"), sizeof(((dt_iop_negadoctor_params_t*)NULL)->film_stock), G_STRUCT_OFFSET(dt_iop_negadoctor_params_t, film_stock), NULL },
    /*entries*/ 2, /*values*/ NULL, /*Default*/ DT_FILMSTOCK_COLOR
  };
  introspection_linear[1].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"Dmin[0]", (char*)"Dmin[0]", (char*)"", sizeof(((dt_iop_negadoctor_params_t*)NULL)->Dmin[0]), G_STRUCT_OFFSET(dt_iop_negadoctor_params_t, Dmin), NULL },
    /*Min*/ 0.00001, /*Max*/ 1.5, /*Default*/ 1.0
  };
  introspection_linear[2].Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"float[]", (char*)"Dmin", (char*)"Dmin", (char*)"", sizeof(((dt_iop_negadoctor_params_t*)NULL)->Dmin), G_STRUCT_OFFSET(dt_iop_negadoctor_params_t, Dmin), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_negadoctor_params_t*)NULL)->Dmin), /*type*/ DT_INTROSPECTION_TYPE_FLOAT, /*field*/ &introspection_linear[1]
  };
  introspection_linear[3].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"wb_high[0]", (char*)"wb_high[0]", (char*)"", sizeof(((dt_iop_negadoctor_params_t*)NULL)->wb_high[0]), G_STRUCT_OFFSET(dt_iop_negadoctor_params_t, wb_high), NULL },
    /*Min*/ 0.25, /*Max*/ 2, /*Default*/ 1.0
  };
  introspection_linear[4].Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"float[]", (char*)"wb_high", (char*)"wb_high", (char*)"", sizeof(((dt_iop_negadoctor_params_t*)NULL)->wb_high), G_STRUCT_OFFSET(dt_iop_negadoctor_params_t, wb_high), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_negadoctor_params_t*)NULL)->wb_high), /*type*/ DT_INTROSPECTION_TYPE_FLOAT, /*field*/ &introspection_linear[3]
  };
  introspection_linear[5].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"wb_low[0]", (char*)"wb_low[0]", (char*)"", sizeof(((dt_iop_negadoctor_params_t*)NULL)->wb_low[0]), G_STRUCT_OFFSET(dt_iop_negadoctor_params_t, wb_low), NULL },
    /*Min*/ 0.25, /*Max*/ 2, /*Default*/ 1.0
  };
  introspection_linear[6].Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"float[]", (char*)"wb_low", (char*)"wb_low", (char*)"", sizeof(((dt_iop_negadoctor_params_t*)NULL)->wb_low), G_STRUCT_OFFSET(dt_iop_negadoctor_params_t, wb_low), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_negadoctor_params_t*)NULL)->wb_low), /*type*/ DT_INTROSPECTION_TYPE_FLOAT, /*field*/ &introspection_linear[5]
  };
  introspection_linear[7].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"D_max", (char*)"D_max", (char*)"", sizeof(((dt_iop_negadoctor_params_t*)NULL)->D_max), G_STRUCT_OFFSET(dt_iop_negadoctor_params_t, D_max), NULL },
    /*Min*/ 0.1, /*Max*/ 6, /*Default*/ 2.046
  };
  introspection_linear[8].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"offset", (char*)"offset", N_((char*)"scan exposure bias"), sizeof(((dt_iop_negadoctor_params_t*)NULL)->offset), G_STRUCT_OFFSET(dt_iop_negadoctor_params_t, offset), NULL },
    /*Min*/ -1.0, /*Max*/ 1.0, /*Default*/ -0.05
  };
  introspection_linear[9].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"black", (char*)"black", N_((char*)"paper black (density correction)"), sizeof(((dt_iop_negadoctor_params_t*)NULL)->black), G_STRUCT_OFFSET(dt_iop_negadoctor_params_t, black), NULL },
    /*Min*/ -0.5, /*Max*/ 0.5, /*Default*/ 0.0755
  };
  introspection_linear[10].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"gamma", (char*)"gamma", N_((char*)"paper grade (gamma)"), sizeof(((dt_iop_negadoctor_params_t*)NULL)->gamma), G_STRUCT_OFFSET(dt_iop_negadoctor_params_t, gamma), NULL },
    /*Min*/ 1.0, /*Max*/ 8.0, /*Default*/ 4.0
  };
  introspection_linear[11].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"soft_clip", (char*)"soft_clip", N_((char*)"paper gloss (specular highlights)"), sizeof(((dt_iop_negadoctor_params_t*)NULL)->soft_clip), G_STRUCT_OFFSET(dt_iop_negadoctor_params_t, soft_clip), NULL },
    /*Min*/ 0.0001, /*Max*/ 1.0, /*Default*/ 0.75
  };
  introspection_linear[12].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"exposure", (char*)"exposure", N_((char*)"print exposure adjustment"), sizeof(((dt_iop_negadoctor_params_t*)NULL)->exposure), G_STRUCT_OFFSET(dt_iop_negadoctor_params_t, exposure), NULL },
    /*Min*/ 0.5, /*Max*/ 2.0, /*Default*/ 0.9245
  };
  introspection_linear[13].Struct = {
    { DT_INTROSPECTION_TYPE_STRUCT, (char*)"dt_iop_negadoctor_params_t", (char*)"", (char*)"", (char*)"", sizeof(dt_iop_negadoctor_params_t), 0, NULL },
    /*entries*/ 10, /*fields*/ NULL
  };
  introspection_linear[14].header = {DT_INTROSPECTION_TYPE_NONE, NULL, NULL, NULL, NULL, 0, 0, NULL};
#endif

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

  static dt_introspection_type_enum_tuple_t f0[] = { 
    { "DT_FILMSTOCK_NB", DT_FILMSTOCK_NB, N_((char*)"black and white film") },
    { "DT_FILMSTOCK_COLOR", DT_FILMSTOCK_COLOR, N_((char*)"color film") },
    { NULL, 0 },
  };
  static dt_introspection_field_t *f13[] = {
    &introspection_linear[0],
    &introspection_linear[2],
    &introspection_linear[4],
    &introspection_linear[6],
    &introspection_linear[7],
    &introspection_linear[8],
    &introspection_linear[9],
    &introspection_linear[10],
    &introspection_linear[11],
    &introspection_linear[12],
    NULL
  };

  introspection_linear[0].Enum.values = f0;
  introspection_linear[13].Struct.fields = f13;

  return 0;
}

void * get_p(const void * param, const char * name)
{
  dt_iop_negadoctor_params_t * p = (dt_iop_negadoctor_params_t*)param;
  if(!strcmp(name, "film_stock"))
    return &(p->film_stock);
  else if(!strcmp(name, "Dmin[0]"))
    return &(p->Dmin[0]);
  else if(!strcmp(name, "Dmin"))
    return &(p->Dmin);
  else if(!strcmp(name, "wb_high[0]"))
    return &(p->wb_high[0]);
  else if(!strcmp(name, "wb_high"))
    return &(p->wb_high);
  else if(!strcmp(name, "wb_low[0]"))
    return &(p->wb_low[0]);
  else if(!strcmp(name, "wb_low"))
    return &(p->wb_low);
  else if(!strcmp(name, "D_max"))
    return &(p->D_max);
  else if(!strcmp(name, "offset"))
    return &(p->offset);
  else if(!strcmp(name, "black"))
    return &(p->black);
  else if(!strcmp(name, "gamma"))
    return &(p->gamma);
  else if(!strcmp(name, "soft_clip"))
    return &(p->soft_clip);
  else if(!strcmp(name, "exposure"))
    return &(p->exposure);
  else
    return NULL;
}

dt_introspection_field_t * get_f(const char * name)
{
  if(!strcmp(name, "film_stock"))
    return &(introspection_linear[0]);
  else if(!strcmp(name, "Dmin[0]"))
    return &(introspection_linear[1]);
  else if(!strcmp(name, "Dmin"))
    return &(introspection_linear[2]);
  else if(!strcmp(name, "wb_high[0]"))
    return &(introspection_linear[3]);
  else if(!strcmp(name, "wb_high"))
    return &(introspection_linear[4]);
  else if(!strcmp(name, "wb_low[0]"))
    return &(introspection_linear[5]);
  else if(!strcmp(name, "wb_low"))
    return &(introspection_linear[6]);
  else if(!strcmp(name, "D_max"))
    return &(introspection_linear[7]);
  else if(!strcmp(name, "offset"))
    return &(introspection_linear[8]);
  else if(!strcmp(name, "black"))
    return &(introspection_linear[9]);
  else if(!strcmp(name, "gamma"))
    return &(introspection_linear[10]);
  else if(!strcmp(name, "soft_clip"))
    return &(introspection_linear[11]);
  else if(!strcmp(name, "exposure"))
    return &(introspection_linear[12]);
  else
    return NULL;
}

#ifdef __cplusplus
}
#endif

