/*
 * this code is auto generated. do not edit. change the sources in tools/introspection/ instead.
 *
 * the parse tree:
 *
 * typedef
 *   struct dt_iop_colortransfer_params_t
 *     enum dt_iop_colortransfer_flag_t
 *       ACQUIRE
 *       ACQUIRE2
 *       ACQUIRE3
 *       ACQUIRED
 *       APPLY
 *       NEUTRAL
 *     flag 
 *       default: NEUTRAL
 * 
 *     float
 *     hist [HISTN]
 *       default: 0.0
 *       range: -G_MAXFLOAT .. G_MAXFLOAT
 * 
 *     float2
 *     mean [MAXN]
 * 
 *     float2
 *     var [MAXN]
 * 
 *     int
 *     n 
 *       default: 3
 *       range: G_MININT .. G_MAXINT
 * 
 * dt_iop_colortransfer_params_t
 *
 */

#include "/build/darktable/src/darktable-4.0.1/src/iop/colortransfer.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) )
= {
{
  .Enum = {
    { DT_INTROSPECTION_TYPE_ENUM, (char*)"dt_iop_colortransfer_flag_t", (char*)"flag", (char*)"flag", (char*)"", sizeof(((dt_iop_colortransfer_params_t*)NULL)->flag), G_STRUCT_OFFSET(dt_iop_colortransfer_params_t, flag), NULL },
    /*entries*/ 6, /*values*/ NULL, /*Default*/ NEUTRAL
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"hist[0]", (char*)"hist[0]", (char*)"", sizeof(((dt_iop_colortransfer_params_t*)NULL)->hist[0]), G_STRUCT_OFFSET(dt_iop_colortransfer_params_t, hist), NULL },
    /*Min*/ -G_MAXFLOAT, /*Max*/ G_MAXFLOAT, /*Default*/ 0.0
  }
},
{
  .Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"float[]", (char*)"hist", (char*)"hist", (char*)"", sizeof(((dt_iop_colortransfer_params_t*)NULL)->hist), G_STRUCT_OFFSET(dt_iop_colortransfer_params_t, hist), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_colortransfer_params_t*)NULL)->hist), /*type*/ DT_INTROSPECTION_TYPE_FLOAT, /*field*/ &introspection_linear[1]
  }
},
{
  .Opaque = {
    { DT_INTROSPECTION_TYPE_OPAQUE, (char*)"float2", (char*)"mean[0]", (char*)"mean[0]", (char*)"", sizeof(((dt_iop_colortransfer_params_t*)NULL)->mean[0]), G_STRUCT_OFFSET(dt_iop_colortransfer_params_t, mean), NULL },
    /* no data for this type */
  }
},
{
  .Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"float2[]", (char*)"mean", (char*)"mean", (char*)"", sizeof(((dt_iop_colortransfer_params_t*)NULL)->mean), G_STRUCT_OFFSET(dt_iop_colortransfer_params_t, mean), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_colortransfer_params_t*)NULL)->mean), /*type*/ DT_INTROSPECTION_TYPE_OPAQUE, /*field*/ &introspection_linear[3]
  }
},
{
  .Opaque = {
    { DT_INTROSPECTION_TYPE_OPAQUE, (char*)"float2", (char*)"var[0]", (char*)"var[0]", (char*)"", sizeof(((dt_iop_colortransfer_params_t*)NULL)->var[0]), G_STRUCT_OFFSET(dt_iop_colortransfer_params_t, var), NULL },
    /* no data for this type */
  }
},
{
  .Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"float2[]", (char*)"var", (char*)"var", (char*)"", sizeof(((dt_iop_colortransfer_params_t*)NULL)->var), G_STRUCT_OFFSET(dt_iop_colortransfer_params_t, var), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_colortransfer_params_t*)NULL)->var), /*type*/ DT_INTROSPECTION_TYPE_OPAQUE, /*field*/ &introspection_linear[5]
  }
},
{
  .Int = {
    { DT_INTROSPECTION_TYPE_INT, (char*)"int", (char*)"n", (char*)"n", (char*)"", sizeof(((dt_iop_colortransfer_params_t*)NULL)->n), G_STRUCT_OFFSET(dt_iop_colortransfer_params_t, n), NULL },
    /*Min*/ G_MININT, /*Max*/ G_MAXINT, /*Default*/ 3
  }
},
{
  .Struct = {
    { DT_INTROSPECTION_TYPE_STRUCT, (char*)"dt_iop_colortransfer_params_t", (char*)"", (char*)"", (char*)"", sizeof(dt_iop_colortransfer_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_colortransfer_params_t",
  sizeof(dt_iop_colortransfer_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].Enum = {
    { DT_INTROSPECTION_TYPE_ENUM, (char*)"dt_iop_colortransfer_flag_t", (char*)"flag", (char*)"flag", (char*)"", sizeof(((dt_iop_colortransfer_params_t*)NULL)->flag), G_STRUCT_OFFSET(dt_iop_colortransfer_params_t, flag), NULL },
    /*entries*/ 6, /*values*/ NULL, /*Default*/ NEUTRAL
  };
  introspection_linear[1].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"hist[0]", (char*)"hist[0]", (char*)"", sizeof(((dt_iop_colortransfer_params_t*)NULL)->hist[0]), G_STRUCT_OFFSET(dt_iop_colortransfer_params_t, hist), NULL },
    /*Min*/ -G_MAXFLOAT, /*Max*/ G_MAXFLOAT, /*Default*/ 0.0
  };
  introspection_linear[2].Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"float[]", (char*)"hist", (char*)"hist", (char*)"", sizeof(((dt_iop_colortransfer_params_t*)NULL)->hist), G_STRUCT_OFFSET(dt_iop_colortransfer_params_t, hist), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_colortransfer_params_t*)NULL)->hist), /*type*/ DT_INTROSPECTION_TYPE_FLOAT, /*field*/ &introspection_linear[1]
  };
  introspection_linear[3].Opaque = {
    { DT_INTROSPECTION_TYPE_OPAQUE, (char*)"float2", (char*)"mean[0]", (char*)"mean[0]", (char*)"", sizeof(((dt_iop_colortransfer_params_t*)NULL)->mean[0]), G_STRUCT_OFFSET(dt_iop_colortransfer_params_t, mean), NULL },
    /* no data for this type */
  };
  introspection_linear[4].Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"float2[]", (char*)"mean", (char*)"mean", (char*)"", sizeof(((dt_iop_colortransfer_params_t*)NULL)->mean), G_STRUCT_OFFSET(dt_iop_colortransfer_params_t, mean), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_colortransfer_params_t*)NULL)->mean), /*type*/ DT_INTROSPECTION_TYPE_OPAQUE, /*field*/ &introspection_linear[3]
  };
  introspection_linear[5].Opaque = {
    { DT_INTROSPECTION_TYPE_OPAQUE, (char*)"float2", (char*)"var[0]", (char*)"var[0]", (char*)"", sizeof(((dt_iop_colortransfer_params_t*)NULL)->var[0]), G_STRUCT_OFFSET(dt_iop_colortransfer_params_t, var), NULL },
    /* no data for this type */
  };
  introspection_linear[6].Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"float2[]", (char*)"var", (char*)"var", (char*)"", sizeof(((dt_iop_colortransfer_params_t*)NULL)->var), G_STRUCT_OFFSET(dt_iop_colortransfer_params_t, var), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_colortransfer_params_t*)NULL)->var), /*type*/ DT_INTROSPECTION_TYPE_OPAQUE, /*field*/ &introspection_linear[5]
  };
  introspection_linear[7].Int = {
    { DT_INTROSPECTION_TYPE_INT, (char*)"int", (char*)"n", (char*)"n", (char*)"", sizeof(((dt_iop_colortransfer_params_t*)NULL)->n), G_STRUCT_OFFSET(dt_iop_colortransfer_params_t, n), NULL },
    /*Min*/ G_MININT, /*Max*/ G_MAXINT, /*Default*/ 3
  };
  introspection_linear[8].Struct = {
    { DT_INTROSPECTION_TYPE_STRUCT, (char*)"dt_iop_colortransfer_params_t", (char*)"", (char*)"", (char*)"", sizeof(dt_iop_colortransfer_params_t), 0, NULL },
    /*entries*/ 5, /*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_type_enum_tuple_t f0[] = { 
    { "ACQUIRE", ACQUIRE, (char*)"" },
    { "ACQUIRE2", ACQUIRE2, (char*)"" },
    { "ACQUIRE3", ACQUIRE3, (char*)"" },
    { "ACQUIRED", ACQUIRED, (char*)"" },
    { "APPLY", APPLY, (char*)"" },
    { "NEUTRAL", NEUTRAL, (char*)"" },
    { NULL, 0 },
  };
  static dt_introspection_field_t *f8[] = {
    &introspection_linear[0],
    &introspection_linear[2],
    &introspection_linear[4],
    &introspection_linear[6],
    &introspection_linear[7],
    NULL
  };

  introspection_linear[0].Enum.values = f0;
  introspection_linear[8].Struct.fields = f8;

  return 0;
}

void * get_p(const void * param, const char * name)
{
  dt_iop_colortransfer_params_t * p = (dt_iop_colortransfer_params_t*)param;
  if(!strcmp(name, "flag"))
    return &(p->flag);
  else if(!strcmp(name, "hist[0]"))
    return &(p->hist[0]);
  else if(!strcmp(name, "hist"))
    return &(p->hist);
  else if(!strcmp(name, "mean[0]"))
    return &(p->mean[0]);
  else if(!strcmp(name, "mean"))
    return &(p->mean);
  else if(!strcmp(name, "var[0]"))
    return &(p->var[0]);
  else if(!strcmp(name, "var"))
    return &(p->var);
  else if(!strcmp(name, "n"))
    return &(p->n);
  else
    return NULL;
}

dt_introspection_field_t * get_f(const char * name)
{
  if(!strcmp(name, "flag"))
    return &(introspection_linear[0]);
  else if(!strcmp(name, "hist[0]"))
    return &(introspection_linear[1]);
  else if(!strcmp(name, "hist"))
    return &(introspection_linear[2]);
  else if(!strcmp(name, "mean[0]"))
    return &(introspection_linear[3]);
  else if(!strcmp(name, "mean"))
    return &(introspection_linear[4]);
  else if(!strcmp(name, "var[0]"))
    return &(introspection_linear[5]);
  else if(!strcmp(name, "var"))
    return &(introspection_linear[6]);
  else if(!strcmp(name, "n"))
    return &(introspection_linear[7]);
  else
    return NULL;
}

#ifdef __cplusplus
}
#endif

