/*
 * this code is auto generated. do not edit. change the sources in tools/introspection/ instead.
 *
 * the parse tree:
 *
 * typedef
 *   struct dt_iop_cacorrectrgb_params_t
 *     enum dt_iop_cacorrectrgb_guide_channel_t
 *       DT_CACORRECT_RGB_R : red
 *       DT_CACORRECT_RGB_G : green
 *       DT_CACORRECT_RGB_B : blue
 *     guide_channel 
 *       description: guide
 *       default: DT_CACORRECT_RGB_G
 * 
 *     float
 *     radius 
 *       description: radius
 *       default: 5
 *       range: 1 .. 500
 * 
 *     float
 *     strength 
 *       description: strength
 *       default: 0.5
 *       range: 0 .. 4
 * 
 *     enum dt_iop_cacorrectrgb_mode_t
 *       DT_CACORRECT_MODE_STANDARD : standard
 *       DT_CACORRECT_MODE_DARKEN : darken only
 *       DT_CACORRECT_MODE_BRIGHTEN : brighten only
 *     mode 
 *       description: correction mode
 *       default: DT_CACORRECT_MODE_STANDARD
 * 
 *     boolean
 *     refine_manifolds 
 *       description: very large chromatic aberration
 *       default: FALSE
 *       range: FALSE .. TRUE
 * 
 * dt_iop_cacorrectrgb_params_t
 *
 */

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

#ifdef __cplusplus
extern "C"
{
#endif

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

static dt_introspection_field_t introspection_linear[6+1]
#if !( defined(__cplusplus) && !defined(__clang__) && defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) <= 406) )
= {
{
  .Enum = {
    { DT_INTROSPECTION_TYPE_ENUM, (char*)"dt_iop_cacorrectrgb_guide_channel_t", (char*)"guide_channel", (char*)"guide_channel", N_((char*)"guide"), sizeof(((dt_iop_cacorrectrgb_params_t*)NULL)->guide_channel), G_STRUCT_OFFSET(dt_iop_cacorrectrgb_params_t, guide_channel), NULL },
    /*entries*/ 3, /*values*/ NULL, /*Default*/ DT_CACORRECT_RGB_G
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"radius", (char*)"radius", N_((char*)"radius"), sizeof(((dt_iop_cacorrectrgb_params_t*)NULL)->radius), G_STRUCT_OFFSET(dt_iop_cacorrectrgb_params_t, radius), NULL },
    /*Min*/ 1, /*Max*/ 500, /*Default*/ 5
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"strength", (char*)"strength", N_((char*)"strength"), sizeof(((dt_iop_cacorrectrgb_params_t*)NULL)->strength), G_STRUCT_OFFSET(dt_iop_cacorrectrgb_params_t, strength), NULL },
    /*Min*/ 0, /*Max*/ 4, /*Default*/ 0.5
  }
},
{
  .Enum = {
    { DT_INTROSPECTION_TYPE_ENUM, (char*)"dt_iop_cacorrectrgb_mode_t", (char*)"mode", (char*)"mode", N_((char*)"correction mode"), sizeof(((dt_iop_cacorrectrgb_params_t*)NULL)->mode), G_STRUCT_OFFSET(dt_iop_cacorrectrgb_params_t, mode), NULL },
    /*entries*/ 3, /*values*/ NULL, /*Default*/ DT_CACORRECT_MODE_STANDARD
  }
},
{
  .Bool = {
    { DT_INTROSPECTION_TYPE_BOOL, (char*)"bool", (char*)"refine_manifolds", (char*)"refine_manifolds", N_((char*)"very large chromatic aberration"), sizeof(((dt_iop_cacorrectrgb_params_t*)NULL)->refine_manifolds), G_STRUCT_OFFSET(dt_iop_cacorrectrgb_params_t, refine_manifolds), NULL },
    /*Default*/ FALSE
  }
},
{
  .Struct = {
    { DT_INTROSPECTION_TYPE_STRUCT, (char*)"dt_iop_cacorrectrgb_params_t", (char*)"", (char*)"", (char*)"", sizeof(dt_iop_cacorrectrgb_params_t), 0, NULL },
    /*entries*/ 5, /*fields*/ NULL
  }
},
  { .header = {DT_INTROSPECTION_TYPE_NONE, NULL, NULL, NULL, NULL, 0, 0, NULL} }
}
#endif
;

static dt_introspection_t introspection = {
  8,
  1,
  "dt_iop_cacorrectrgb_params_t",
  sizeof(dt_iop_cacorrectrgb_params_t),
  &introspection_linear[6-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_cacorrectrgb_guide_channel_t", (char*)"guide_channel", (char*)"guide_channel", N_((char*)"guide"), sizeof(((dt_iop_cacorrectrgb_params_t*)NULL)->guide_channel), G_STRUCT_OFFSET(dt_iop_cacorrectrgb_params_t, guide_channel), NULL },
    /*entries*/ 3, /*values*/ NULL, /*Default*/ DT_CACORRECT_RGB_G
  };
  introspection_linear[1].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"radius", (char*)"radius", N_((char*)"radius"), sizeof(((dt_iop_cacorrectrgb_params_t*)NULL)->radius), G_STRUCT_OFFSET(dt_iop_cacorrectrgb_params_t, radius), NULL },
    /*Min*/ 1, /*Max*/ 500, /*Default*/ 5
  };
  introspection_linear[2].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"strength", (char*)"strength", N_((char*)"strength"), sizeof(((dt_iop_cacorrectrgb_params_t*)NULL)->strength), G_STRUCT_OFFSET(dt_iop_cacorrectrgb_params_t, strength), NULL },
    /*Min*/ 0, /*Max*/ 4, /*Default*/ 0.5
  };
  introspection_linear[3].Enum = {
    { DT_INTROSPECTION_TYPE_ENUM, (char*)"dt_iop_cacorrectrgb_mode_t", (char*)"mode", (char*)"mode", N_((char*)"correction mode"), sizeof(((dt_iop_cacorrectrgb_params_t*)NULL)->mode), G_STRUCT_OFFSET(dt_iop_cacorrectrgb_params_t, mode), NULL },
    /*entries*/ 3, /*values*/ NULL, /*Default*/ DT_CACORRECT_MODE_STANDARD
  };
  introspection_linear[4].Bool = {
    { DT_INTROSPECTION_TYPE_BOOL, (char*)"bool", (char*)"refine_manifolds", (char*)"refine_manifolds", N_((char*)"very large chromatic aberration"), sizeof(((dt_iop_cacorrectrgb_params_t*)NULL)->refine_manifolds), G_STRUCT_OFFSET(dt_iop_cacorrectrgb_params_t, refine_manifolds), NULL },
    /*Default*/ FALSE
  };
  introspection_linear[5].Struct = {
    { DT_INTROSPECTION_TYPE_STRUCT, (char*)"dt_iop_cacorrectrgb_params_t", (char*)"", (char*)"", (char*)"", sizeof(dt_iop_cacorrectrgb_params_t), 0, NULL },
    /*entries*/ 5, /*fields*/ NULL
  };
  introspection_linear[6].header = {DT_INTROSPECTION_TYPE_NONE, NULL, NULL, NULL, NULL, 0, 0, NULL};
#endif

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

  static dt_introspection_type_enum_tuple_t f0[] = { 
    { "DT_CACORRECT_RGB_R", DT_CACORRECT_RGB_R, N_((char*)"red") },
    { "DT_CACORRECT_RGB_G", DT_CACORRECT_RGB_G, N_((char*)"green") },
    { "DT_CACORRECT_RGB_B", DT_CACORRECT_RGB_B, N_((char*)"blue") },
    { NULL, 0 },
  };
  static dt_introspection_type_enum_tuple_t f3[] = { 
    { "DT_CACORRECT_MODE_STANDARD", DT_CACORRECT_MODE_STANDARD, N_((char*)"standard") },
    { "DT_CACORRECT_MODE_DARKEN", DT_CACORRECT_MODE_DARKEN, N_((char*)"darken only") },
    { "DT_CACORRECT_MODE_BRIGHTEN", DT_CACORRECT_MODE_BRIGHTEN, N_((char*)"brighten only") },
    { NULL, 0 },
  };
  static dt_introspection_field_t *f5[] = {
    &introspection_linear[0],
    &introspection_linear[1],
    &introspection_linear[2],
    &introspection_linear[3],
    &introspection_linear[4],
    NULL
  };

  introspection_linear[0].Enum.values = f0;
  introspection_linear[3].Enum.values = f3;
  introspection_linear[5].Struct.fields = f5;

  return 0;
}

void * get_p(const void * param, const char * name)
{
  dt_iop_cacorrectrgb_params_t * p = (dt_iop_cacorrectrgb_params_t*)param;
  if(!strcmp(name, "guide_channel"))
    return &(p->guide_channel);
  else if(!strcmp(name, "radius"))
    return &(p->radius);
  else if(!strcmp(name, "strength"))
    return &(p->strength);
  else if(!strcmp(name, "mode"))
    return &(p->mode);
  else if(!strcmp(name, "refine_manifolds"))
    return &(p->refine_manifolds);
  else
    return NULL;
}

dt_introspection_field_t * get_f(const char * name)
{
  if(!g_ascii_strcasecmp(name, "guide_channel"))
    return &(introspection_linear[0]);
  else if(!g_ascii_strcasecmp(name, "radius"))
    return &(introspection_linear[1]);
  else if(!g_ascii_strcasecmp(name, "strength"))
    return &(introspection_linear[2]);
  else if(!g_ascii_strcasecmp(name, "mode"))
    return &(introspection_linear[3]);
  else if(!g_ascii_strcasecmp(name, "refine_manifolds"))
    return &(introspection_linear[4]);
  else
    return NULL;
}

#ifdef __cplusplus
}
#endif

