/*
 * this code is auto generated. do not edit. change the sources in tools/introspection/ instead.
 *
 * the parse tree:
 *
 * typedef
 *   struct dt_iop_highlights_params_t
 *     enum dt_iop_highlights_mode_t
 *       DT_IOP_HIGHLIGHTS_CLIP : clip highlights
 *       DT_IOP_HIGHLIGHTS_LCH : reconstruct in LCh
 *       DT_IOP_HIGHLIGHTS_INPAINT : reconstruct color
 *       DT_IOP_HIGHLIGHTS_LAPLACIAN : guided laplacians
 *     mode 
 *       description: method
 *       default: DT_IOP_HIGHLIGHTS_CLIP
 * 
 *     float
 *     blendL 
 *       default: 1.0
 *       range: -G_MAXFLOAT .. G_MAXFLOAT
 * 
 *     float
 *     blendC 
 *       default: 0.0
 *       range: -G_MAXFLOAT .. G_MAXFLOAT
 * 
 *     float
 *     blendh 
 *       default: 0.0
 *       range: -G_MAXFLOAT .. G_MAXFLOAT
 * 
 *     float
 *     clip 
 *       description: clipping threshold
 *       default: 1.0
 *       range: 0.0 .. 2.0
 * 
 *     float
 *     noise_level 
 *       description: noise level
 *       default: 0.00
 *       range: 0. .. 0.5
 * 
 *     int
 *     iterations 
 *       description: iterations
 *       default: 1
 *       range: 1 .. 64
 * 
 *     enum dt_atrous_wavelets_scales_t
 *       WAVELETS_1_SCALE : 4 px
 *       WAVELETS_2_SCALE : 8 px
 *       WAVELETS_3_SCALE : 16 px
 *       WAVELETS_4_SCALE : 32 px
 *       WAVELETS_5_SCALE : 64 px
 *       WAVELETS_6_SCALE : 128 px
 *       WAVELETS_7_SCALE : 256 px (slow)
 *       WAVELETS_8_SCALE : 512 px (slow)
 *       WAVELETS_9_SCALE : 1024 px (very slow)
 *       WAVELETS_10_SCALE : 2048 px (insanely slow)
 *     scales 
 *       description: diameter of reconstruction
 *       default: 5
 * 
 *     float
 *     reconstructing 
 *       description: cast balance
 *       default: 0.4
 *       range: 0.0 .. 1.0
 * 
 *     float
 *     combine 
 *       description: combine segments
 *       default: 2.0
 *       range: 0.0 .. 10.0
 * 
 *     int
 *     debugmode 
 *       default: 0
 *       range: G_MININT .. G_MAXINT
 * 
 *     float
 *     solid_color 
 *       description: inpaint a flat color
 *       default: 0.0
 *       range: 0.0 .. 1.0
 * 
 * dt_iop_highlights_params_t
 *
 */

#include "/build/darktable/src/darktable-4.0.1/src/iop/highlights.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_iop_highlights_mode_t", (char*)"mode", (char*)"mode", N_((char*)"method"), sizeof(((dt_iop_highlights_params_t*)NULL)->mode), G_STRUCT_OFFSET(dt_iop_highlights_params_t, mode), NULL },
    /*entries*/ 4, /*values*/ NULL, /*Default*/ DT_IOP_HIGHLIGHTS_CLIP
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"blendL", (char*)"blendL", (char*)"", sizeof(((dt_iop_highlights_params_t*)NULL)->blendL), G_STRUCT_OFFSET(dt_iop_highlights_params_t, blendL), NULL },
    /*Min*/ -G_MAXFLOAT, /*Max*/ G_MAXFLOAT, /*Default*/ 1.0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"blendC", (char*)"blendC", (char*)"", sizeof(((dt_iop_highlights_params_t*)NULL)->blendC), G_STRUCT_OFFSET(dt_iop_highlights_params_t, blendC), NULL },
    /*Min*/ -G_MAXFLOAT, /*Max*/ G_MAXFLOAT, /*Default*/ 0.0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"blendh", (char*)"blendh", (char*)"", sizeof(((dt_iop_highlights_params_t*)NULL)->blendh), G_STRUCT_OFFSET(dt_iop_highlights_params_t, blendh), NULL },
    /*Min*/ -G_MAXFLOAT, /*Max*/ G_MAXFLOAT, /*Default*/ 0.0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"clip", (char*)"clip", N_((char*)"clipping threshold"), sizeof(((dt_iop_highlights_params_t*)NULL)->clip), G_STRUCT_OFFSET(dt_iop_highlights_params_t, clip), NULL },
    /*Min*/ 0.0, /*Max*/ 2.0, /*Default*/ 1.0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"noise_level", (char*)"noise_level", N_((char*)"noise level"), sizeof(((dt_iop_highlights_params_t*)NULL)->noise_level), G_STRUCT_OFFSET(dt_iop_highlights_params_t, noise_level), NULL },
    /*Min*/ 0., /*Max*/ 0.5, /*Default*/ 0.00
  }
},
{
  .Int = {
    { DT_INTROSPECTION_TYPE_INT, (char*)"int", (char*)"iterations", (char*)"iterations", N_((char*)"iterations"), sizeof(((dt_iop_highlights_params_t*)NULL)->iterations), G_STRUCT_OFFSET(dt_iop_highlights_params_t, iterations), NULL },
    /*Min*/ 1, /*Max*/ 64, /*Default*/ 1
  }
},
{
  .Enum = {
    { DT_INTROSPECTION_TYPE_ENUM, (char*)"dt_atrous_wavelets_scales_t", (char*)"scales", (char*)"scales", N_((char*)"diameter of reconstruction"), sizeof(((dt_iop_highlights_params_t*)NULL)->scales), G_STRUCT_OFFSET(dt_iop_highlights_params_t, scales), NULL },
    /*entries*/ 10, /*values*/ NULL, /*Default*/ 5
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"reconstructing", (char*)"reconstructing", N_((char*)"cast balance"), sizeof(((dt_iop_highlights_params_t*)NULL)->reconstructing), G_STRUCT_OFFSET(dt_iop_highlights_params_t, reconstructing), NULL },
    /*Min*/ 0.0, /*Max*/ 1.0, /*Default*/ 0.4
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"combine", (char*)"combine", N_((char*)"combine segments"), sizeof(((dt_iop_highlights_params_t*)NULL)->combine), G_STRUCT_OFFSET(dt_iop_highlights_params_t, combine), NULL },
    /*Min*/ 0.0, /*Max*/ 10.0, /*Default*/ 2.0
  }
},
{
  .Int = {
    { DT_INTROSPECTION_TYPE_INT, (char*)"int", (char*)"debugmode", (char*)"debugmode", (char*)"", sizeof(((dt_iop_highlights_params_t*)NULL)->debugmode), G_STRUCT_OFFSET(dt_iop_highlights_params_t, debugmode), NULL },
    /*Min*/ G_MININT, /*Max*/ G_MAXINT, /*Default*/ 0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"solid_color", (char*)"solid_color", N_((char*)"inpaint a flat color"), sizeof(((dt_iop_highlights_params_t*)NULL)->solid_color), G_STRUCT_OFFSET(dt_iop_highlights_params_t, solid_color), NULL },
    /*Min*/ 0.0, /*Max*/ 1.0, /*Default*/ 0.0
  }
},
{
  .Struct = {
    { DT_INTROSPECTION_TYPE_STRUCT, (char*)"dt_iop_highlights_params_t", (char*)"", (char*)"", (char*)"", sizeof(dt_iop_highlights_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,
  4,
  "dt_iop_highlights_params_t",
  sizeof(dt_iop_highlights_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_iop_highlights_mode_t", (char*)"mode", (char*)"mode", N_((char*)"method"), sizeof(((dt_iop_highlights_params_t*)NULL)->mode), G_STRUCT_OFFSET(dt_iop_highlights_params_t, mode), NULL },
    /*entries*/ 4, /*values*/ NULL, /*Default*/ DT_IOP_HIGHLIGHTS_CLIP
  };
  introspection_linear[1].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"blendL", (char*)"blendL", (char*)"", sizeof(((dt_iop_highlights_params_t*)NULL)->blendL), G_STRUCT_OFFSET(dt_iop_highlights_params_t, blendL), NULL },
    /*Min*/ -G_MAXFLOAT, /*Max*/ G_MAXFLOAT, /*Default*/ 1.0
  };
  introspection_linear[2].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"blendC", (char*)"blendC", (char*)"", sizeof(((dt_iop_highlights_params_t*)NULL)->blendC), G_STRUCT_OFFSET(dt_iop_highlights_params_t, blendC), NULL },
    /*Min*/ -G_MAXFLOAT, /*Max*/ G_MAXFLOAT, /*Default*/ 0.0
  };
  introspection_linear[3].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"blendh", (char*)"blendh", (char*)"", sizeof(((dt_iop_highlights_params_t*)NULL)->blendh), G_STRUCT_OFFSET(dt_iop_highlights_params_t, blendh), NULL },
    /*Min*/ -G_MAXFLOAT, /*Max*/ G_MAXFLOAT, /*Default*/ 0.0
  };
  introspection_linear[4].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"clip", (char*)"clip", N_((char*)"clipping threshold"), sizeof(((dt_iop_highlights_params_t*)NULL)->clip), G_STRUCT_OFFSET(dt_iop_highlights_params_t, clip), NULL },
    /*Min*/ 0.0, /*Max*/ 2.0, /*Default*/ 1.0
  };
  introspection_linear[5].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"noise_level", (char*)"noise_level", N_((char*)"noise level"), sizeof(((dt_iop_highlights_params_t*)NULL)->noise_level), G_STRUCT_OFFSET(dt_iop_highlights_params_t, noise_level), NULL },
    /*Min*/ 0., /*Max*/ 0.5, /*Default*/ 0.00
  };
  introspection_linear[6].Int = {
    { DT_INTROSPECTION_TYPE_INT, (char*)"int", (char*)"iterations", (char*)"iterations", N_((char*)"iterations"), sizeof(((dt_iop_highlights_params_t*)NULL)->iterations), G_STRUCT_OFFSET(dt_iop_highlights_params_t, iterations), NULL },
    /*Min*/ 1, /*Max*/ 64, /*Default*/ 1
  };
  introspection_linear[7].Enum = {
    { DT_INTROSPECTION_TYPE_ENUM, (char*)"dt_atrous_wavelets_scales_t", (char*)"scales", (char*)"scales", N_((char*)"diameter of reconstruction"), sizeof(((dt_iop_highlights_params_t*)NULL)->scales), G_STRUCT_OFFSET(dt_iop_highlights_params_t, scales), NULL },
    /*entries*/ 10, /*values*/ NULL, /*Default*/ 5
  };
  introspection_linear[8].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"reconstructing", (char*)"reconstructing", N_((char*)"cast balance"), sizeof(((dt_iop_highlights_params_t*)NULL)->reconstructing), G_STRUCT_OFFSET(dt_iop_highlights_params_t, reconstructing), NULL },
    /*Min*/ 0.0, /*Max*/ 1.0, /*Default*/ 0.4
  };
  introspection_linear[9].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"combine", (char*)"combine", N_((char*)"combine segments"), sizeof(((dt_iop_highlights_params_t*)NULL)->combine), G_STRUCT_OFFSET(dt_iop_highlights_params_t, combine), NULL },
    /*Min*/ 0.0, /*Max*/ 10.0, /*Default*/ 2.0
  };
  introspection_linear[10].Int = {
    { DT_INTROSPECTION_TYPE_INT, (char*)"int", (char*)"debugmode", (char*)"debugmode", (char*)"", sizeof(((dt_iop_highlights_params_t*)NULL)->debugmode), G_STRUCT_OFFSET(dt_iop_highlights_params_t, debugmode), NULL },
    /*Min*/ G_MININT, /*Max*/ G_MAXINT, /*Default*/ 0
  };
  introspection_linear[11].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"solid_color", (char*)"solid_color", N_((char*)"inpaint a flat color"), sizeof(((dt_iop_highlights_params_t*)NULL)->solid_color), G_STRUCT_OFFSET(dt_iop_highlights_params_t, solid_color), NULL },
    /*Min*/ 0.0, /*Max*/ 1.0, /*Default*/ 0.0
  };
  introspection_linear[12].Struct = {
    { DT_INTROSPECTION_TYPE_STRUCT, (char*)"dt_iop_highlights_params_t", (char*)"", (char*)"", (char*)"", sizeof(dt_iop_highlights_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_HIGHLIGHTS_CLIP", DT_IOP_HIGHLIGHTS_CLIP, N_((char*)"clip highlights") },
    { "DT_IOP_HIGHLIGHTS_LCH", DT_IOP_HIGHLIGHTS_LCH, N_((char*)"reconstruct in LCh") },
    { "DT_IOP_HIGHLIGHTS_INPAINT", DT_IOP_HIGHLIGHTS_INPAINT, N_((char*)"reconstruct color") },
    { "DT_IOP_HIGHLIGHTS_LAPLACIAN", DT_IOP_HIGHLIGHTS_LAPLACIAN, N_((char*)"guided laplacians") },
    { NULL, 0 },
  };
  static dt_introspection_type_enum_tuple_t f7[] = { 
    { "WAVELETS_1_SCALE", WAVELETS_1_SCALE, N_((char*)"4 px") },
    { "WAVELETS_2_SCALE", WAVELETS_2_SCALE, N_((char*)"8 px") },
    { "WAVELETS_3_SCALE", WAVELETS_3_SCALE, N_((char*)"16 px") },
    { "WAVELETS_4_SCALE", WAVELETS_4_SCALE, N_((char*)"32 px") },
    { "WAVELETS_5_SCALE", WAVELETS_5_SCALE, N_((char*)"64 px") },
    { "WAVELETS_6_SCALE", WAVELETS_6_SCALE, N_((char*)"128 px") },
    { "WAVELETS_7_SCALE", WAVELETS_7_SCALE, N_((char*)"256 px (slow)") },
    { "WAVELETS_8_SCALE", WAVELETS_8_SCALE, N_((char*)"512 px (slow)") },
    { "WAVELETS_9_SCALE", WAVELETS_9_SCALE, N_((char*)"1024 px (very slow)") },
    { "WAVELETS_10_SCALE", WAVELETS_10_SCALE, N_((char*)"2048 px (insanely slow)") },
    { 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[7].Enum.values = f7;
  introspection_linear[12].Struct.fields = f12;

  return 0;
}

void * get_p(const void * param, const char * name)
{
  dt_iop_highlights_params_t * p = (dt_iop_highlights_params_t*)param;
  if(!strcmp(name, "mode"))
    return &(p->mode);
  else if(!strcmp(name, "blendL"))
    return &(p->blendL);
  else if(!strcmp(name, "blendC"))
    return &(p->blendC);
  else if(!strcmp(name, "blendh"))
    return &(p->blendh);
  else if(!strcmp(name, "clip"))
    return &(p->clip);
  else if(!strcmp(name, "noise_level"))
    return &(p->noise_level);
  else if(!strcmp(name, "iterations"))
    return &(p->iterations);
  else if(!strcmp(name, "scales"))
    return &(p->scales);
  else if(!strcmp(name, "reconstructing"))
    return &(p->reconstructing);
  else if(!strcmp(name, "combine"))
    return &(p->combine);
  else if(!strcmp(name, "debugmode"))
    return &(p->debugmode);
  else if(!strcmp(name, "solid_color"))
    return &(p->solid_color);
  else
    return NULL;
}

dt_introspection_field_t * get_f(const char * name)
{
  if(!strcmp(name, "mode"))
    return &(introspection_linear[0]);
  else if(!strcmp(name, "blendL"))
    return &(introspection_linear[1]);
  else if(!strcmp(name, "blendC"))
    return &(introspection_linear[2]);
  else if(!strcmp(name, "blendh"))
    return &(introspection_linear[3]);
  else if(!strcmp(name, "clip"))
    return &(introspection_linear[4]);
  else if(!strcmp(name, "noise_level"))
    return &(introspection_linear[5]);
  else if(!strcmp(name, "iterations"))
    return &(introspection_linear[6]);
  else if(!strcmp(name, "scales"))
    return &(introspection_linear[7]);
  else if(!strcmp(name, "reconstructing"))
    return &(introspection_linear[8]);
  else if(!strcmp(name, "combine"))
    return &(introspection_linear[9]);
  else if(!strcmp(name, "debugmode"))
    return &(introspection_linear[10]);
  else if(!strcmp(name, "solid_color"))
    return &(introspection_linear[11]);
  else
    return NULL;
}

#ifdef __cplusplus
}
#endif

