/*
 * this code is auto generated. do not edit. change the sources in tools/introspection/ instead.
 *
 * the parse tree:
 *
 * typedef
 *   struct dt_iop_colorharmonizer_params_t
 *     enum dt_iop_colorharmonizer_rule_t
 *       DT_COLORHARMONIZER_MONOCHROMATIC : monochromatic
 *       DT_COLORHARMONIZER_ANALOGOUS : analogous
 *       DT_COLORHARMONIZER_ANALOGOUS_COMPLEMENTARY : analogous complementary
 *       DT_COLORHARMONIZER_COMPLEMENTARY : complementary
 *       DT_COLORHARMONIZER_SPLIT_COMPLEMENTARY : split complementary
 *       DT_COLORHARMONIZER_DYAD : dyad
 *       DT_COLORHARMONIZER_TRIAD : triad
 *       DT_COLORHARMONIZER_TETRAD : tetrad
 *       DT_COLORHARMONIZER_SQUARE : square
 *       DT_COLORHARMONIZER_CUSTOM : custom
 *     rule 
 *       description: harmony rule
 *       default: DT_COLORHARMONIZER_COMPLEMENTARY
 * 
 *     float
 *     anchor_hue 
 *       description: anchor hue
 *       default: 0.1
 *       range: 0.0 .. 1.0
 * 
 *     float
 *     pull_strength 
 *       description: pull strength
 *       default: 0.0
 *       range: 0.0 .. 1.0
 * 
 *     float
 *     neutral_protection 
 *       description: neutral color protection
 *       default: 0.5
 *       range: 0.0 .. 1.0
 * 
 *     float
 *     pull_width 
 *       description: pull width
 *       default: 1.0
 *       range: 0.25 .. 4.0
 * 
 *     float
 *     custom_hue [4]
 *       description: custom node hue
 *       default: 0.0
 *       range: 0.0 .. 1.0
 * 
 *     int
 *     num_custom_nodes 
 *       description: nodes
 *       default: 4
 *       range: 2 .. 4
 * 
 *     float
 *     node_saturation [4]
 *       description: node saturation
 *       default: 1.0
 *       range: 0.0 .. 2.0
 * 
 *     float
 *     smoothing 
 *       description: smoothing
 *       default: 0.0
 *       range: 0.0 .. 2.0
 * 
 * dt_iop_colorharmonizer_params_t
 *
 */

#include "/build/darktable/src/darktable-5.6.0/src/iop/colorharmonizer.c"

#ifdef __cplusplus
extern "C"
{
#endif

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

static dt_introspection_field_t introspection_linear[12+1]
#if !( defined(__cplusplus) && !defined(__clang__) && defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) <= 406) )
= {
{
  .Enum = {
    { DT_INTROSPECTION_TYPE_ENUM, (char*)"dt_iop_colorharmonizer_rule_t", (char*)"rule", (char*)"rule", N_((char*)"harmony rule"), sizeof(((dt_iop_colorharmonizer_params_t*)NULL)->rule), G_STRUCT_OFFSET(dt_iop_colorharmonizer_params_t, rule), NULL },
    /*entries*/ 10, /*values*/ NULL, /*Default*/ DT_COLORHARMONIZER_COMPLEMENTARY
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"anchor_hue", (char*)"anchor_hue", N_((char*)"anchor hue"), sizeof(((dt_iop_colorharmonizer_params_t*)NULL)->anchor_hue), G_STRUCT_OFFSET(dt_iop_colorharmonizer_params_t, anchor_hue), NULL },
    /*Min*/ 0.0, /*Max*/ 1.0, /*Default*/ 0.1
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"pull_strength", (char*)"pull_strength", N_((char*)"pull strength"), sizeof(((dt_iop_colorharmonizer_params_t*)NULL)->pull_strength), G_STRUCT_OFFSET(dt_iop_colorharmonizer_params_t, pull_strength), NULL },
    /*Min*/ 0.0, /*Max*/ 1.0, /*Default*/ 0.0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"neutral_protection", (char*)"neutral_protection", N_((char*)"neutral color protection"), sizeof(((dt_iop_colorharmonizer_params_t*)NULL)->neutral_protection), G_STRUCT_OFFSET(dt_iop_colorharmonizer_params_t, neutral_protection), NULL },
    /*Min*/ 0.0, /*Max*/ 1.0, /*Default*/ 0.5
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"pull_width", (char*)"pull_width", N_((char*)"pull width"), sizeof(((dt_iop_colorharmonizer_params_t*)NULL)->pull_width), G_STRUCT_OFFSET(dt_iop_colorharmonizer_params_t, pull_width), NULL },
    /*Min*/ 0.25, /*Max*/ 4.0, /*Default*/ 1.0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"custom_hue[0]", (char*)"custom_hue[0]", N_((char*)"custom node hue"), sizeof(((dt_iop_colorharmonizer_params_t*)NULL)->custom_hue[0]), G_STRUCT_OFFSET(dt_iop_colorharmonizer_params_t, custom_hue), NULL },
    /*Min*/ 0.0, /*Max*/ 1.0, /*Default*/ 0.0
  }
},
{
  .Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"float[]", (char*)"custom_hue", (char*)"custom_hue", N_((char*)"custom node hue"), sizeof(((dt_iop_colorharmonizer_params_t*)NULL)->custom_hue), G_STRUCT_OFFSET(dt_iop_colorharmonizer_params_t, custom_hue), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_colorharmonizer_params_t*)NULL)->custom_hue), /*type*/ DT_INTROSPECTION_TYPE_FLOAT, /*field*/ &introspection_linear[5]
  }
},
{
  .Int = {
    { DT_INTROSPECTION_TYPE_INT, (char*)"int", (char*)"num_custom_nodes", (char*)"num_custom_nodes", N_((char*)"nodes"), sizeof(((dt_iop_colorharmonizer_params_t*)NULL)->num_custom_nodes), G_STRUCT_OFFSET(dt_iop_colorharmonizer_params_t, num_custom_nodes), NULL },
    /*Min*/ 2, /*Max*/ 4, /*Default*/ 4
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"node_saturation[0]", (char*)"node_saturation[0]", N_((char*)"node saturation"), sizeof(((dt_iop_colorharmonizer_params_t*)NULL)->node_saturation[0]), G_STRUCT_OFFSET(dt_iop_colorharmonizer_params_t, node_saturation), NULL },
    /*Min*/ 0.0, /*Max*/ 2.0, /*Default*/ 1.0
  }
},
{
  .Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"float[]", (char*)"node_saturation", (char*)"node_saturation", N_((char*)"node saturation"), sizeof(((dt_iop_colorharmonizer_params_t*)NULL)->node_saturation), G_STRUCT_OFFSET(dt_iop_colorharmonizer_params_t, node_saturation), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_colorharmonizer_params_t*)NULL)->node_saturation), /*type*/ DT_INTROSPECTION_TYPE_FLOAT, /*field*/ &introspection_linear[8]
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"smoothing", (char*)"smoothing", N_((char*)"smoothing"), sizeof(((dt_iop_colorharmonizer_params_t*)NULL)->smoothing), G_STRUCT_OFFSET(dt_iop_colorharmonizer_params_t, smoothing), NULL },
    /*Min*/ 0.0, /*Max*/ 2.0, /*Default*/ 0.0
  }
},
{
  .Struct = {
    { DT_INTROSPECTION_TYPE_STRUCT, (char*)"dt_iop_colorharmonizer_params_t", (char*)"", (char*)"", (char*)"", sizeof(dt_iop_colorharmonizer_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_colorharmonizer_params_t",
  sizeof(dt_iop_colorharmonizer_params_t),
  &introspection_linear[12-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_colorharmonizer_rule_t", (char*)"rule", (char*)"rule", N_((char*)"harmony rule"), sizeof(((dt_iop_colorharmonizer_params_t*)NULL)->rule), G_STRUCT_OFFSET(dt_iop_colorharmonizer_params_t, rule), NULL },
    /*entries*/ 10, /*values*/ NULL, /*Default*/ DT_COLORHARMONIZER_COMPLEMENTARY
  };
  introspection_linear[1].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"anchor_hue", (char*)"anchor_hue", N_((char*)"anchor hue"), sizeof(((dt_iop_colorharmonizer_params_t*)NULL)->anchor_hue), G_STRUCT_OFFSET(dt_iop_colorharmonizer_params_t, anchor_hue), NULL },
    /*Min*/ 0.0, /*Max*/ 1.0, /*Default*/ 0.1
  };
  introspection_linear[2].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"pull_strength", (char*)"pull_strength", N_((char*)"pull strength"), sizeof(((dt_iop_colorharmonizer_params_t*)NULL)->pull_strength), G_STRUCT_OFFSET(dt_iop_colorharmonizer_params_t, pull_strength), NULL },
    /*Min*/ 0.0, /*Max*/ 1.0, /*Default*/ 0.0
  };
  introspection_linear[3].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"neutral_protection", (char*)"neutral_protection", N_((char*)"neutral color protection"), sizeof(((dt_iop_colorharmonizer_params_t*)NULL)->neutral_protection), G_STRUCT_OFFSET(dt_iop_colorharmonizer_params_t, neutral_protection), NULL },
    /*Min*/ 0.0, /*Max*/ 1.0, /*Default*/ 0.5
  };
  introspection_linear[4].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"pull_width", (char*)"pull_width", N_((char*)"pull width"), sizeof(((dt_iop_colorharmonizer_params_t*)NULL)->pull_width), G_STRUCT_OFFSET(dt_iop_colorharmonizer_params_t, pull_width), NULL },
    /*Min*/ 0.25, /*Max*/ 4.0, /*Default*/ 1.0
  };
  introspection_linear[5].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"custom_hue[0]", (char*)"custom_hue[0]", N_((char*)"custom node hue"), sizeof(((dt_iop_colorharmonizer_params_t*)NULL)->custom_hue[0]), G_STRUCT_OFFSET(dt_iop_colorharmonizer_params_t, custom_hue), NULL },
    /*Min*/ 0.0, /*Max*/ 1.0, /*Default*/ 0.0
  };
  introspection_linear[6].Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"float[]", (char*)"custom_hue", (char*)"custom_hue", N_((char*)"custom node hue"), sizeof(((dt_iop_colorharmonizer_params_t*)NULL)->custom_hue), G_STRUCT_OFFSET(dt_iop_colorharmonizer_params_t, custom_hue), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_colorharmonizer_params_t*)NULL)->custom_hue), /*type*/ DT_INTROSPECTION_TYPE_FLOAT, /*field*/ &introspection_linear[5]
  };
  introspection_linear[7].Int = {
    { DT_INTROSPECTION_TYPE_INT, (char*)"int", (char*)"num_custom_nodes", (char*)"num_custom_nodes", N_((char*)"nodes"), sizeof(((dt_iop_colorharmonizer_params_t*)NULL)->num_custom_nodes), G_STRUCT_OFFSET(dt_iop_colorharmonizer_params_t, num_custom_nodes), NULL },
    /*Min*/ 2, /*Max*/ 4, /*Default*/ 4
  };
  introspection_linear[8].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"node_saturation[0]", (char*)"node_saturation[0]", N_((char*)"node saturation"), sizeof(((dt_iop_colorharmonizer_params_t*)NULL)->node_saturation[0]), G_STRUCT_OFFSET(dt_iop_colorharmonizer_params_t, node_saturation), NULL },
    /*Min*/ 0.0, /*Max*/ 2.0, /*Default*/ 1.0
  };
  introspection_linear[9].Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"float[]", (char*)"node_saturation", (char*)"node_saturation", N_((char*)"node saturation"), sizeof(((dt_iop_colorharmonizer_params_t*)NULL)->node_saturation), G_STRUCT_OFFSET(dt_iop_colorharmonizer_params_t, node_saturation), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_colorharmonizer_params_t*)NULL)->node_saturation), /*type*/ DT_INTROSPECTION_TYPE_FLOAT, /*field*/ &introspection_linear[8]
  };
  introspection_linear[10].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"smoothing", (char*)"smoothing", N_((char*)"smoothing"), sizeof(((dt_iop_colorharmonizer_params_t*)NULL)->smoothing), G_STRUCT_OFFSET(dt_iop_colorharmonizer_params_t, smoothing), NULL },
    /*Min*/ 0.0, /*Max*/ 2.0, /*Default*/ 0.0
  };
  introspection_linear[11].Struct = {
    { DT_INTROSPECTION_TYPE_STRUCT, (char*)"dt_iop_colorharmonizer_params_t", (char*)"", (char*)"", (char*)"", sizeof(dt_iop_colorharmonizer_params_t), 0, NULL },
    /*entries*/ 9, /*fields*/ NULL
  };
  introspection_linear[12].header = {DT_INTROSPECTION_TYPE_NONE, NULL, NULL, NULL, NULL, 0, 0, NULL};
#endif

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

  static dt_introspection_type_enum_tuple_t f0[] = { 
    { "DT_COLORHARMONIZER_MONOCHROMATIC", DT_COLORHARMONIZER_MONOCHROMATIC, N_((char*)"monochromatic") },
    { "DT_COLORHARMONIZER_ANALOGOUS", DT_COLORHARMONIZER_ANALOGOUS, N_((char*)"analogous") },
    { "DT_COLORHARMONIZER_ANALOGOUS_COMPLEMENTARY", DT_COLORHARMONIZER_ANALOGOUS_COMPLEMENTARY, N_((char*)"analogous complementary") },
    { "DT_COLORHARMONIZER_COMPLEMENTARY", DT_COLORHARMONIZER_COMPLEMENTARY, N_((char*)"complementary") },
    { "DT_COLORHARMONIZER_SPLIT_COMPLEMENTARY", DT_COLORHARMONIZER_SPLIT_COMPLEMENTARY, N_((char*)"split complementary") },
    { "DT_COLORHARMONIZER_DYAD", DT_COLORHARMONIZER_DYAD, N_((char*)"dyad") },
    { "DT_COLORHARMONIZER_TRIAD", DT_COLORHARMONIZER_TRIAD, N_((char*)"triad") },
    { "DT_COLORHARMONIZER_TETRAD", DT_COLORHARMONIZER_TETRAD, N_((char*)"tetrad") },
    { "DT_COLORHARMONIZER_SQUARE", DT_COLORHARMONIZER_SQUARE, N_((char*)"square") },
    { "DT_COLORHARMONIZER_CUSTOM", DT_COLORHARMONIZER_CUSTOM, N_((char*)"custom") },
    { NULL, 0 },
  };
  static dt_introspection_field_t *f11[] = {
    &introspection_linear[0],
    &introspection_linear[1],
    &introspection_linear[2],
    &introspection_linear[3],
    &introspection_linear[4],
    &introspection_linear[6],
    &introspection_linear[7],
    &introspection_linear[9],
    &introspection_linear[10],
    NULL
  };

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

  return 0;
}

void * get_p(const void * param, const char * name)
{
  dt_iop_colorharmonizer_params_t * p = (dt_iop_colorharmonizer_params_t*)param;
  if(!strcmp(name, "rule"))
    return &(p->rule);
  else if(!strcmp(name, "anchor_hue"))
    return &(p->anchor_hue);
  else if(!strcmp(name, "pull_strength"))
    return &(p->pull_strength);
  else if(!strcmp(name, "neutral_protection"))
    return &(p->neutral_protection);
  else if(!strcmp(name, "pull_width"))
    return &(p->pull_width);
  else if(!strcmp(name, "custom_hue[0]"))
    return &(p->custom_hue[0]);
  else if(!strcmp(name, "custom_hue"))
    return &(p->custom_hue);
  else if(!strcmp(name, "num_custom_nodes"))
    return &(p->num_custom_nodes);
  else if(!strcmp(name, "node_saturation[0]"))
    return &(p->node_saturation[0]);
  else if(!strcmp(name, "node_saturation"))
    return &(p->node_saturation);
  else if(!strcmp(name, "smoothing"))
    return &(p->smoothing);
  else
    return NULL;
}

dt_introspection_field_t * get_f(const char * name)
{
  if(!g_ascii_strcasecmp(name, "rule"))
    return &(introspection_linear[0]);
  else if(!g_ascii_strcasecmp(name, "anchor_hue"))
    return &(introspection_linear[1]);
  else if(!g_ascii_strcasecmp(name, "pull_strength"))
    return &(introspection_linear[2]);
  else if(!g_ascii_strcasecmp(name, "neutral_protection"))
    return &(introspection_linear[3]);
  else if(!g_ascii_strcasecmp(name, "pull_width"))
    return &(introspection_linear[4]);
  else if(!g_ascii_strcasecmp(name, "custom_hue[0]"))
    return &(introspection_linear[5]);
  else if(!g_ascii_strcasecmp(name, "custom_hue"))
    return &(introspection_linear[6]);
  else if(!g_ascii_strcasecmp(name, "num_custom_nodes"))
    return &(introspection_linear[7]);
  else if(!g_ascii_strcasecmp(name, "node_saturation[0]"))
    return &(introspection_linear[8]);
  else if(!g_ascii_strcasecmp(name, "node_saturation"))
    return &(introspection_linear[9]);
  else if(!g_ascii_strcasecmp(name, "smoothing"))
    return &(introspection_linear[10]);
  else
    return NULL;
}

#ifdef __cplusplus
}
#endif

