/*
 * this code is auto generated. do not edit. change the sources in tools/introspection/ instead.
 *
 * the parse tree:
 *
 * typedef
 *   struct dt_iop_primaries_params_t
 *     float
 *     achromatic_tint_hue 
 *       description: tint hue
 *       default: 0.0
 *       range: -M_PI .. M_PI
 * 
 *     float
 *     achromatic_tint_purity 
 *       description: tint purity
 *       default: 0.0
 *       range: 0.0 .. 0.99
 * 
 *     float
 *     red_hue 
 *       description: red hue
 *       default: 0.0
 *       range: -M_PI .. M_PI
 * 
 *     float
 *     red_purity 
 *       description: red purity
 *       default: 1.0
 *       range: 0.01 .. 5.0
 * 
 *     float
 *     green_hue 
 *       description: green hue
 *       default: 0.0
 *       range: -M_PI .. M_PI
 * 
 *     float
 *     green_purity 
 *       description: green purity
 *       default: 1.0
 *       range: 0.01 .. 5.0
 * 
 *     float
 *     blue_hue 
 *       description: blue hue
 *       default: 0.0
 *       range: -M_PI .. M_PI
 * 
 *     float
 *     blue_purity 
 *       description: blue purity
 *       default: 1.0
 *       range: 0.01 .. 5.0
 * 
 * dt_iop_primaries_params_t
 *
 */

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

#ifdef __cplusplus
extern "C"
{
#endif

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

static dt_introspection_field_t introspection_linear[9+1]
#if !( defined(__cplusplus) && !defined(__clang__) && defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) <= 406) )
= {
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"achromatic_tint_hue", (char*)"achromatic_tint_hue", N_((char*)"tint hue"), sizeof(((dt_iop_primaries_params_t*)NULL)->achromatic_tint_hue), G_STRUCT_OFFSET(dt_iop_primaries_params_t, achromatic_tint_hue), NULL },
    /*Min*/ -M_PI, /*Max*/ M_PI, /*Default*/ 0.0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"achromatic_tint_purity", (char*)"achromatic_tint_purity", N_((char*)"tint purity"), sizeof(((dt_iop_primaries_params_t*)NULL)->achromatic_tint_purity), G_STRUCT_OFFSET(dt_iop_primaries_params_t, achromatic_tint_purity), NULL },
    /*Min*/ 0.0, /*Max*/ 0.99, /*Default*/ 0.0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"red_hue", (char*)"red_hue", N_((char*)"red hue"), sizeof(((dt_iop_primaries_params_t*)NULL)->red_hue), G_STRUCT_OFFSET(dt_iop_primaries_params_t, red_hue), NULL },
    /*Min*/ -M_PI, /*Max*/ M_PI, /*Default*/ 0.0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"red_purity", (char*)"red_purity", N_((char*)"red purity"), sizeof(((dt_iop_primaries_params_t*)NULL)->red_purity), G_STRUCT_OFFSET(dt_iop_primaries_params_t, red_purity), NULL },
    /*Min*/ 0.01, /*Max*/ 5.0, /*Default*/ 1.0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"green_hue", (char*)"green_hue", N_((char*)"green hue"), sizeof(((dt_iop_primaries_params_t*)NULL)->green_hue), G_STRUCT_OFFSET(dt_iop_primaries_params_t, green_hue), NULL },
    /*Min*/ -M_PI, /*Max*/ M_PI, /*Default*/ 0.0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"green_purity", (char*)"green_purity", N_((char*)"green purity"), sizeof(((dt_iop_primaries_params_t*)NULL)->green_purity), G_STRUCT_OFFSET(dt_iop_primaries_params_t, green_purity), NULL },
    /*Min*/ 0.01, /*Max*/ 5.0, /*Default*/ 1.0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"blue_hue", (char*)"blue_hue", N_((char*)"blue hue"), sizeof(((dt_iop_primaries_params_t*)NULL)->blue_hue), G_STRUCT_OFFSET(dt_iop_primaries_params_t, blue_hue), NULL },
    /*Min*/ -M_PI, /*Max*/ M_PI, /*Default*/ 0.0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"blue_purity", (char*)"blue_purity", N_((char*)"blue purity"), sizeof(((dt_iop_primaries_params_t*)NULL)->blue_purity), G_STRUCT_OFFSET(dt_iop_primaries_params_t, blue_purity), NULL },
    /*Min*/ 0.01, /*Max*/ 5.0, /*Default*/ 1.0
  }
},
{
  .Struct = {
    { DT_INTROSPECTION_TYPE_STRUCT, (char*)"dt_iop_primaries_params_t", (char*)"", (char*)"", (char*)"", sizeof(dt_iop_primaries_params_t), 0, NULL },
    /*entries*/ 8, /*fields*/ NULL
  }
},
  { .header = {DT_INTROSPECTION_TYPE_NONE, NULL, NULL, NULL, NULL, 0, 0, NULL} }
}
#endif
;

static dt_introspection_t introspection = {
  8,
  1,
  "dt_iop_primaries_params_t",
  sizeof(dt_iop_primaries_params_t),
  &introspection_linear[9-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].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"achromatic_tint_hue", (char*)"achromatic_tint_hue", N_((char*)"tint hue"), sizeof(((dt_iop_primaries_params_t*)NULL)->achromatic_tint_hue), G_STRUCT_OFFSET(dt_iop_primaries_params_t, achromatic_tint_hue), NULL },
    /*Min*/ -M_PI, /*Max*/ M_PI, /*Default*/ 0.0
  };
  introspection_linear[1].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"achromatic_tint_purity", (char*)"achromatic_tint_purity", N_((char*)"tint purity"), sizeof(((dt_iop_primaries_params_t*)NULL)->achromatic_tint_purity), G_STRUCT_OFFSET(dt_iop_primaries_params_t, achromatic_tint_purity), NULL },
    /*Min*/ 0.0, /*Max*/ 0.99, /*Default*/ 0.0
  };
  introspection_linear[2].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"red_hue", (char*)"red_hue", N_((char*)"red hue"), sizeof(((dt_iop_primaries_params_t*)NULL)->red_hue), G_STRUCT_OFFSET(dt_iop_primaries_params_t, red_hue), NULL },
    /*Min*/ -M_PI, /*Max*/ M_PI, /*Default*/ 0.0
  };
  introspection_linear[3].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"red_purity", (char*)"red_purity", N_((char*)"red purity"), sizeof(((dt_iop_primaries_params_t*)NULL)->red_purity), G_STRUCT_OFFSET(dt_iop_primaries_params_t, red_purity), NULL },
    /*Min*/ 0.01, /*Max*/ 5.0, /*Default*/ 1.0
  };
  introspection_linear[4].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"green_hue", (char*)"green_hue", N_((char*)"green hue"), sizeof(((dt_iop_primaries_params_t*)NULL)->green_hue), G_STRUCT_OFFSET(dt_iop_primaries_params_t, green_hue), NULL },
    /*Min*/ -M_PI, /*Max*/ M_PI, /*Default*/ 0.0
  };
  introspection_linear[5].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"green_purity", (char*)"green_purity", N_((char*)"green purity"), sizeof(((dt_iop_primaries_params_t*)NULL)->green_purity), G_STRUCT_OFFSET(dt_iop_primaries_params_t, green_purity), NULL },
    /*Min*/ 0.01, /*Max*/ 5.0, /*Default*/ 1.0
  };
  introspection_linear[6].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"blue_hue", (char*)"blue_hue", N_((char*)"blue hue"), sizeof(((dt_iop_primaries_params_t*)NULL)->blue_hue), G_STRUCT_OFFSET(dt_iop_primaries_params_t, blue_hue), NULL },
    /*Min*/ -M_PI, /*Max*/ M_PI, /*Default*/ 0.0
  };
  introspection_linear[7].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"blue_purity", (char*)"blue_purity", N_((char*)"blue purity"), sizeof(((dt_iop_primaries_params_t*)NULL)->blue_purity), G_STRUCT_OFFSET(dt_iop_primaries_params_t, blue_purity), NULL },
    /*Min*/ 0.01, /*Max*/ 5.0, /*Default*/ 1.0
  };
  introspection_linear[8].Struct = {
    { DT_INTROSPECTION_TYPE_STRUCT, (char*)"dt_iop_primaries_params_t", (char*)"", (char*)"", (char*)"", sizeof(dt_iop_primaries_params_t), 0, NULL },
    /*entries*/ 8, /*fields*/ NULL
  };
  introspection_linear[9].header = {DT_INTROSPECTION_TYPE_NONE, NULL, NULL, NULL, NULL, 0, 0, NULL};
#endif

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

  static dt_introspection_field_t *f8[] = {
    &introspection_linear[0],
    &introspection_linear[1],
    &introspection_linear[2],
    &introspection_linear[3],
    &introspection_linear[4],
    &introspection_linear[5],
    &introspection_linear[6],
    &introspection_linear[7],
    NULL
  };

  introspection_linear[8].Struct.fields = f8;

  return 0;
}

void * get_p(const void * param, const char * name)
{
  dt_iop_primaries_params_t * p = (dt_iop_primaries_params_t*)param;
  if(!strcmp(name, "achromatic_tint_hue"))
    return &(p->achromatic_tint_hue);
  else if(!strcmp(name, "achromatic_tint_purity"))
    return &(p->achromatic_tint_purity);
  else if(!strcmp(name, "red_hue"))
    return &(p->red_hue);
  else if(!strcmp(name, "red_purity"))
    return &(p->red_purity);
  else if(!strcmp(name, "green_hue"))
    return &(p->green_hue);
  else if(!strcmp(name, "green_purity"))
    return &(p->green_purity);
  else if(!strcmp(name, "blue_hue"))
    return &(p->blue_hue);
  else if(!strcmp(name, "blue_purity"))
    return &(p->blue_purity);
  else
    return NULL;
}

dt_introspection_field_t * get_f(const char * name)
{
  if(!g_ascii_strcasecmp(name, "achromatic_tint_hue"))
    return &(introspection_linear[0]);
  else if(!g_ascii_strcasecmp(name, "achromatic_tint_purity"))
    return &(introspection_linear[1]);
  else if(!g_ascii_strcasecmp(name, "red_hue"))
    return &(introspection_linear[2]);
  else if(!g_ascii_strcasecmp(name, "red_purity"))
    return &(introspection_linear[3]);
  else if(!g_ascii_strcasecmp(name, "green_hue"))
    return &(introspection_linear[4]);
  else if(!g_ascii_strcasecmp(name, "green_purity"))
    return &(introspection_linear[5]);
  else if(!g_ascii_strcasecmp(name, "blue_hue"))
    return &(introspection_linear[6]);
  else if(!g_ascii_strcasecmp(name, "blue_purity"))
    return &(introspection_linear[7]);
  else
    return NULL;
}

#ifdef __cplusplus
}
#endif

