/*
 * this code is auto generated. do not edit. change the sources in tools/introspection/ instead.
 *
 * the parse tree:
 *
 * typedef
 *   struct dt_iop_colorzones_params_t
 *     enum dt_iop_colorzones_channel_t
 *       DT_IOP_COLORZONES_L : lightness
 *       DT_IOP_COLORZONES_C : chroma
 *       DT_IOP_COLORZONES_h : hue
 *       DT_IOP_COLORZONES_MAX_CHANNELS
 *     channel 
 *       description: select by
 *       default: DT_IOP_COLORZONES_h
 * 
 *     struct dt_iop_colorzones_node_t
 *       float
 *       x 
 *         default: 0.0
 *         range: -G_MAXFLOAT .. G_MAXFLOAT
 * 
 *       float
 *       y 
 *         default: 0.0
 *         range: -G_MAXFLOAT .. G_MAXFLOAT
 * 
 *     curve [DT_IOP_COLORZONES_MAX_CHANNELS][DT_IOP_COLORZONES_MAXNODES]
 * 
 *     int
 *     curve_num_nodes [DT_IOP_COLORZONES_MAX_CHANNELS]
 *       default: 0
 *       range: G_MININT .. G_MAXINT
 * 
 *     int
 *     curve_type [DT_IOP_COLORZONES_MAX_CHANNELS]
 *       default: 0
 *       range: G_MININT .. G_MAXINT
 * 
 *     float
 *     strength 
 *       description: mix
 *       default: 0.0
 *       range: -200.0 .. 200.0
 * 
 *     enum dt_iop_colorzones_modes_t
 *       DT_IOP_COLORZONES_MODE_SMOOTH : smooth
 *       DT_IOP_COLORZONES_MODE_STRONG : strong
 *     mode 
 *       description: process mode
 *       default: DT_IOP_COLORZONES_MODE_SMOOTH
 *       range: 0 .. 1
 * 
 *     int
 *     splines_version 
 *       default: 0
 *       range: G_MININT .. G_MAXINT
 * 
 * dt_iop_colorzones_params_t
 *
 */

#include "/build/darktable/src/darktable-5.6.0/src/iop/colorzones.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_colorzones_channel_t", (char*)"channel", (char*)"channel", N_((char*)"select by"), sizeof(((dt_iop_colorzones_params_t*)NULL)->channel), G_STRUCT_OFFSET(dt_iop_colorzones_params_t, channel), NULL },
    /*entries*/ 4, /*values*/ NULL, /*Default*/ DT_IOP_COLORZONES_h
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"curve[0][0].x", (char*)"x", (char*)"", sizeof(((dt_iop_colorzones_params_t*)NULL)->curve[0][0].x), G_STRUCT_OFFSET(dt_iop_colorzones_params_t, curve[0][0].x), NULL },
    /*Min*/ -G_MAXFLOAT, /*Max*/ G_MAXFLOAT, /*Default*/ 0.0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"curve[0][0].y", (char*)"y", (char*)"", sizeof(((dt_iop_colorzones_params_t*)NULL)->curve[0][0].y), G_STRUCT_OFFSET(dt_iop_colorzones_params_t, curve[0][0].y), NULL },
    /*Min*/ -G_MAXFLOAT, /*Max*/ G_MAXFLOAT, /*Default*/ 0.0
  }
},
{
  .Struct = {
    { DT_INTROSPECTION_TYPE_STRUCT, (char*)"dt_iop_colorzones_node_t", (char*)"curve[0][0]", (char*)"curve[0][0]", (char*)"", sizeof(((dt_iop_colorzones_params_t*)NULL)->curve[0][0]), G_STRUCT_OFFSET(dt_iop_colorzones_params_t, curve), NULL },
    /*entries*/ 2, /*fields*/ NULL
  }
},
{
  .Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"dt_iop_colorzones_node_t[]", (char*)"curve[0]", (char*)"curve[0]", (char*)"", sizeof(((dt_iop_colorzones_params_t*)NULL)->curve[0]), G_STRUCT_OFFSET(dt_iop_colorzones_params_t, curve), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_colorzones_params_t*)NULL)->curve[0]), /*type*/ DT_INTROSPECTION_TYPE_STRUCT, /*field*/ &introspection_linear[3]
  }
},
{
  .Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"dt_iop_colorzones_node_t[][]", (char*)"curve", (char*)"curve", (char*)"", sizeof(((dt_iop_colorzones_params_t*)NULL)->curve), G_STRUCT_OFFSET(dt_iop_colorzones_params_t, curve), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_colorzones_params_t*)NULL)->curve), /*type*/ DT_INTROSPECTION_TYPE_ARRAY, /*field*/ &introspection_linear[4]
  }
},
{
  .Int = {
    { DT_INTROSPECTION_TYPE_INT, (char*)"int", (char*)"curve_num_nodes[0]", (char*)"curve_num_nodes[0]", (char*)"", sizeof(((dt_iop_colorzones_params_t*)NULL)->curve_num_nodes[0]), G_STRUCT_OFFSET(dt_iop_colorzones_params_t, curve_num_nodes), NULL },
    /*Min*/ G_MININT, /*Max*/ G_MAXINT, /*Default*/ 0
  }
},
{
  .Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"int[]", (char*)"curve_num_nodes", (char*)"curve_num_nodes", (char*)"", sizeof(((dt_iop_colorzones_params_t*)NULL)->curve_num_nodes), G_STRUCT_OFFSET(dt_iop_colorzones_params_t, curve_num_nodes), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_colorzones_params_t*)NULL)->curve_num_nodes), /*type*/ DT_INTROSPECTION_TYPE_INT, /*field*/ &introspection_linear[6]
  }
},
{
  .Int = {
    { DT_INTROSPECTION_TYPE_INT, (char*)"int", (char*)"curve_type[0]", (char*)"curve_type[0]", (char*)"", sizeof(((dt_iop_colorzones_params_t*)NULL)->curve_type[0]), G_STRUCT_OFFSET(dt_iop_colorzones_params_t, curve_type), NULL },
    /*Min*/ G_MININT, /*Max*/ G_MAXINT, /*Default*/ 0
  }
},
{
  .Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"int[]", (char*)"curve_type", (char*)"curve_type", (char*)"", sizeof(((dt_iop_colorzones_params_t*)NULL)->curve_type), G_STRUCT_OFFSET(dt_iop_colorzones_params_t, curve_type), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_colorzones_params_t*)NULL)->curve_type), /*type*/ DT_INTROSPECTION_TYPE_INT, /*field*/ &introspection_linear[8]
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"strength", (char*)"strength", N_((char*)"mix"), sizeof(((dt_iop_colorzones_params_t*)NULL)->strength), G_STRUCT_OFFSET(dt_iop_colorzones_params_t, strength), NULL },
    /*Min*/ -200.0, /*Max*/ 200.0, /*Default*/ 0.0
  }
},
{
  .Enum = {
    { DT_INTROSPECTION_TYPE_ENUM, (char*)"dt_iop_colorzones_modes_t", (char*)"mode", (char*)"mode", N_((char*)"process mode"), sizeof(((dt_iop_colorzones_params_t*)NULL)->mode), G_STRUCT_OFFSET(dt_iop_colorzones_params_t, mode), NULL },
    /*entries*/ 2, /*values*/ NULL, /*Default*/ DT_IOP_COLORZONES_MODE_SMOOTH
  }
},
{
  .Int = {
    { DT_INTROSPECTION_TYPE_INT, (char*)"int", (char*)"splines_version", (char*)"splines_version", (char*)"", sizeof(((dt_iop_colorzones_params_t*)NULL)->splines_version), G_STRUCT_OFFSET(dt_iop_colorzones_params_t, splines_version), NULL },
    /*Min*/ G_MININT, /*Max*/ G_MAXINT, /*Default*/ 0
  }
},
{
  .Struct = {
    { DT_INTROSPECTION_TYPE_STRUCT, (char*)"dt_iop_colorzones_params_t", (char*)"", (char*)"", (char*)"", sizeof(dt_iop_colorzones_params_t), 0, NULL },
    /*entries*/ 7, /*fields*/ NULL
  }
},
  { .header = {DT_INTROSPECTION_TYPE_NONE, NULL, NULL, NULL, NULL, 0, 0, NULL} }
}
#endif
;

static dt_introspection_t introspection = {
  8,
  5,
  "dt_iop_colorzones_params_t",
  sizeof(dt_iop_colorzones_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_colorzones_channel_t", (char*)"channel", (char*)"channel", N_((char*)"select by"), sizeof(((dt_iop_colorzones_params_t*)NULL)->channel), G_STRUCT_OFFSET(dt_iop_colorzones_params_t, channel), NULL },
    /*entries*/ 4, /*values*/ NULL, /*Default*/ DT_IOP_COLORZONES_h
  };
  introspection_linear[1].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"curve[0][0].x", (char*)"x", (char*)"", sizeof(((dt_iop_colorzones_params_t*)NULL)->curve[0][0].x), G_STRUCT_OFFSET(dt_iop_colorzones_params_t, curve[0][0].x), NULL },
    /*Min*/ -G_MAXFLOAT, /*Max*/ G_MAXFLOAT, /*Default*/ 0.0
  };
  introspection_linear[2].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"curve[0][0].y", (char*)"y", (char*)"", sizeof(((dt_iop_colorzones_params_t*)NULL)->curve[0][0].y), G_STRUCT_OFFSET(dt_iop_colorzones_params_t, curve[0][0].y), NULL },
    /*Min*/ -G_MAXFLOAT, /*Max*/ G_MAXFLOAT, /*Default*/ 0.0
  };
  introspection_linear[3].Struct = {
    { DT_INTROSPECTION_TYPE_STRUCT, (char*)"dt_iop_colorzones_node_t", (char*)"curve[0][0]", (char*)"curve[0][0]", (char*)"", sizeof(((dt_iop_colorzones_params_t*)NULL)->curve[0][0]), G_STRUCT_OFFSET(dt_iop_colorzones_params_t, curve), NULL },
    /*entries*/ 2, /*fields*/ NULL
  };
  introspection_linear[4].Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"dt_iop_colorzones_node_t[]", (char*)"curve[0]", (char*)"curve[0]", (char*)"", sizeof(((dt_iop_colorzones_params_t*)NULL)->curve[0]), G_STRUCT_OFFSET(dt_iop_colorzones_params_t, curve), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_colorzones_params_t*)NULL)->curve[0]), /*type*/ DT_INTROSPECTION_TYPE_STRUCT, /*field*/ &introspection_linear[3]
  };
  introspection_linear[5].Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"dt_iop_colorzones_node_t[][]", (char*)"curve", (char*)"curve", (char*)"", sizeof(((dt_iop_colorzones_params_t*)NULL)->curve), G_STRUCT_OFFSET(dt_iop_colorzones_params_t, curve), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_colorzones_params_t*)NULL)->curve), /*type*/ DT_INTROSPECTION_TYPE_ARRAY, /*field*/ &introspection_linear[4]
  };
  introspection_linear[6].Int = {
    { DT_INTROSPECTION_TYPE_INT, (char*)"int", (char*)"curve_num_nodes[0]", (char*)"curve_num_nodes[0]", (char*)"", sizeof(((dt_iop_colorzones_params_t*)NULL)->curve_num_nodes[0]), G_STRUCT_OFFSET(dt_iop_colorzones_params_t, curve_num_nodes), NULL },
    /*Min*/ G_MININT, /*Max*/ G_MAXINT, /*Default*/ 0
  };
  introspection_linear[7].Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"int[]", (char*)"curve_num_nodes", (char*)"curve_num_nodes", (char*)"", sizeof(((dt_iop_colorzones_params_t*)NULL)->curve_num_nodes), G_STRUCT_OFFSET(dt_iop_colorzones_params_t, curve_num_nodes), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_colorzones_params_t*)NULL)->curve_num_nodes), /*type*/ DT_INTROSPECTION_TYPE_INT, /*field*/ &introspection_linear[6]
  };
  introspection_linear[8].Int = {
    { DT_INTROSPECTION_TYPE_INT, (char*)"int", (char*)"curve_type[0]", (char*)"curve_type[0]", (char*)"", sizeof(((dt_iop_colorzones_params_t*)NULL)->curve_type[0]), G_STRUCT_OFFSET(dt_iop_colorzones_params_t, curve_type), NULL },
    /*Min*/ G_MININT, /*Max*/ G_MAXINT, /*Default*/ 0
  };
  introspection_linear[9].Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"int[]", (char*)"curve_type", (char*)"curve_type", (char*)"", sizeof(((dt_iop_colorzones_params_t*)NULL)->curve_type), G_STRUCT_OFFSET(dt_iop_colorzones_params_t, curve_type), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_colorzones_params_t*)NULL)->curve_type), /*type*/ DT_INTROSPECTION_TYPE_INT, /*field*/ &introspection_linear[8]
  };
  introspection_linear[10].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"strength", (char*)"strength", N_((char*)"mix"), sizeof(((dt_iop_colorzones_params_t*)NULL)->strength), G_STRUCT_OFFSET(dt_iop_colorzones_params_t, strength), NULL },
    /*Min*/ -200.0, /*Max*/ 200.0, /*Default*/ 0.0
  };
  introspection_linear[11].Enum = {
    { DT_INTROSPECTION_TYPE_ENUM, (char*)"dt_iop_colorzones_modes_t", (char*)"mode", (char*)"mode", N_((char*)"process mode"), sizeof(((dt_iop_colorzones_params_t*)NULL)->mode), G_STRUCT_OFFSET(dt_iop_colorzones_params_t, mode), NULL },
    /*entries*/ 2, /*values*/ NULL, /*Default*/ DT_IOP_COLORZONES_MODE_SMOOTH
  };
  introspection_linear[12].Int = {
    { DT_INTROSPECTION_TYPE_INT, (char*)"int", (char*)"splines_version", (char*)"splines_version", (char*)"", sizeof(((dt_iop_colorzones_params_t*)NULL)->splines_version), G_STRUCT_OFFSET(dt_iop_colorzones_params_t, splines_version), NULL },
    /*Min*/ G_MININT, /*Max*/ G_MAXINT, /*Default*/ 0
  };
  introspection_linear[13].Struct = {
    { DT_INTROSPECTION_TYPE_STRUCT, (char*)"dt_iop_colorzones_params_t", (char*)"", (char*)"", (char*)"", sizeof(dt_iop_colorzones_params_t), 0, NULL },
    /*entries*/ 7, /*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_IOP_COLORZONES_L", DT_IOP_COLORZONES_L, N_((char*)"lightness") },
    { "DT_IOP_COLORZONES_C", DT_IOP_COLORZONES_C, N_((char*)"chroma") },
    { "DT_IOP_COLORZONES_h", DT_IOP_COLORZONES_h, N_((char*)"hue") },
    { "DT_IOP_COLORZONES_MAX_CHANNELS", DT_IOP_COLORZONES_MAX_CHANNELS, (char*)"" },
    { NULL, 0 },
  };
  static dt_introspection_field_t *f3[] = {
    &introspection_linear[1],
    &introspection_linear[2],
    NULL
  };
  static dt_introspection_type_enum_tuple_t f11[] = { 
    { "DT_IOP_COLORZONES_MODE_SMOOTH", DT_IOP_COLORZONES_MODE_SMOOTH, N_((char*)"smooth") },
    { "DT_IOP_COLORZONES_MODE_STRONG", DT_IOP_COLORZONES_MODE_STRONG, N_((char*)"strong") },
    { NULL, 0 },
  };
  static dt_introspection_field_t *f13[] = {
    &introspection_linear[0],
    &introspection_linear[5],
    &introspection_linear[7],
    &introspection_linear[9],
    &introspection_linear[10],
    &introspection_linear[11],
    &introspection_linear[12],
    NULL
  };

  introspection_linear[0].Enum.values = f0;
  introspection_linear[3].Struct.fields = f3;
  introspection_linear[11].Enum.values = f11;
  introspection_linear[13].Struct.fields = f13;

  return 0;
}

void * get_p(const void * param, const char * name)
{
  dt_iop_colorzones_params_t * p = (dt_iop_colorzones_params_t*)param;
  if(!strcmp(name, "channel"))
    return &(p->channel);
  else if(!strcmp(name, "curve[0][0].x"))
    return &(p->curve[0][0].x);
  else if(!strcmp(name, "curve[0][0].y"))
    return &(p->curve[0][0].y);
  else if(!strcmp(name, "curve[0][0]"))
    return &(p->curve[0][0]);
  else if(!strcmp(name, "curve[0]"))
    return &(p->curve[0]);
  else if(!strcmp(name, "curve"))
    return &(p->curve);
  else if(!strcmp(name, "curve_num_nodes[0]"))
    return &(p->curve_num_nodes[0]);
  else if(!strcmp(name, "curve_num_nodes"))
    return &(p->curve_num_nodes);
  else if(!strcmp(name, "curve_type[0]"))
    return &(p->curve_type[0]);
  else if(!strcmp(name, "curve_type"))
    return &(p->curve_type);
  else if(!strcmp(name, "strength"))
    return &(p->strength);
  else if(!strcmp(name, "mode"))
    return &(p->mode);
  else if(!strcmp(name, "splines_version"))
    return &(p->splines_version);
  else
    return NULL;
}

dt_introspection_field_t * get_f(const char * name)
{
  if(!g_ascii_strcasecmp(name, "channel"))
    return &(introspection_linear[0]);
  else if(!g_ascii_strcasecmp(name, "curve[0][0].x"))
    return &(introspection_linear[1]);
  else if(!g_ascii_strcasecmp(name, "curve[0][0].y"))
    return &(introspection_linear[2]);
  else if(!g_ascii_strcasecmp(name, "curve[0][0]"))
    return &(introspection_linear[3]);
  else if(!g_ascii_strcasecmp(name, "curve[0]"))
    return &(introspection_linear[4]);
  else if(!g_ascii_strcasecmp(name, "curve"))
    return &(introspection_linear[5]);
  else if(!g_ascii_strcasecmp(name, "curve_num_nodes[0]"))
    return &(introspection_linear[6]);
  else if(!g_ascii_strcasecmp(name, "curve_num_nodes"))
    return &(introspection_linear[7]);
  else if(!g_ascii_strcasecmp(name, "curve_type[0]"))
    return &(introspection_linear[8]);
  else if(!g_ascii_strcasecmp(name, "curve_type"))
    return &(introspection_linear[9]);
  else if(!g_ascii_strcasecmp(name, "strength"))
    return &(introspection_linear[10]);
  else if(!g_ascii_strcasecmp(name, "mode"))
    return &(introspection_linear[11]);
  else if(!g_ascii_strcasecmp(name, "splines_version"))
    return &(introspection_linear[12]);
  else
    return NULL;
}

#ifdef __cplusplus
}
#endif

