/*
 * this code is auto generated. do not edit. change the sources in tools/introspection/ instead.
 *
 * the parse tree:
 *
 * typedef
 *   struct dt_iop_colorchecker_params_t
 *     float
 *     source_L [MAX_PATCHES]
 *       default: 0.0
 *       range: -G_MAXFLOAT .. G_MAXFLOAT
 * 
 *     float
 *     source_a [MAX_PATCHES]
 *       default: 0.0
 *       range: -G_MAXFLOAT .. G_MAXFLOAT
 * 
 *     float
 *     source_b [MAX_PATCHES]
 *       default: 0.0
 *       range: -G_MAXFLOAT .. G_MAXFLOAT
 * 
 *     float
 *     target_L [MAX_PATCHES]
 *       default: 0.0
 *       range: -G_MAXFLOAT .. G_MAXFLOAT
 * 
 *     float
 *     target_a [MAX_PATCHES]
 *       default: 0.0
 *       range: -G_MAXFLOAT .. G_MAXFLOAT
 * 
 *     float
 *     target_b [MAX_PATCHES]
 *       default: 0.0
 *       range: -G_MAXFLOAT .. G_MAXFLOAT
 * 
 *     int
 *     num_patches 
 *       default: 0
 *       range: G_MININT .. G_MAXINT
 * 
 * dt_iop_colorchecker_params_t
 *
 */

#include "/build/darktable/src/darktable-5.4.1/src/iop/colorchecker.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) )
= {
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"source_L[0]", (char*)"source_L[0]", (char*)"", sizeof(((dt_iop_colorchecker_params_t*)NULL)->source_L[0]), G_STRUCT_OFFSET(dt_iop_colorchecker_params_t, source_L), NULL },
    /*Min*/ -G_MAXFLOAT, /*Max*/ G_MAXFLOAT, /*Default*/ 0.0
  }
},
{
  .Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"float[]", (char*)"source_L", (char*)"source_L", (char*)"", sizeof(((dt_iop_colorchecker_params_t*)NULL)->source_L), G_STRUCT_OFFSET(dt_iop_colorchecker_params_t, source_L), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_colorchecker_params_t*)NULL)->source_L), /*type*/ DT_INTROSPECTION_TYPE_FLOAT, /*field*/ &introspection_linear[0]
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"source_a[0]", (char*)"source_a[0]", (char*)"", sizeof(((dt_iop_colorchecker_params_t*)NULL)->source_a[0]), G_STRUCT_OFFSET(dt_iop_colorchecker_params_t, source_a), NULL },
    /*Min*/ -G_MAXFLOAT, /*Max*/ G_MAXFLOAT, /*Default*/ 0.0
  }
},
{
  .Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"float[]", (char*)"source_a", (char*)"source_a", (char*)"", sizeof(((dt_iop_colorchecker_params_t*)NULL)->source_a), G_STRUCT_OFFSET(dt_iop_colorchecker_params_t, source_a), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_colorchecker_params_t*)NULL)->source_a), /*type*/ DT_INTROSPECTION_TYPE_FLOAT, /*field*/ &introspection_linear[2]
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"source_b[0]", (char*)"source_b[0]", (char*)"", sizeof(((dt_iop_colorchecker_params_t*)NULL)->source_b[0]), G_STRUCT_OFFSET(dt_iop_colorchecker_params_t, source_b), NULL },
    /*Min*/ -G_MAXFLOAT, /*Max*/ G_MAXFLOAT, /*Default*/ 0.0
  }
},
{
  .Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"float[]", (char*)"source_b", (char*)"source_b", (char*)"", sizeof(((dt_iop_colorchecker_params_t*)NULL)->source_b), G_STRUCT_OFFSET(dt_iop_colorchecker_params_t, source_b), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_colorchecker_params_t*)NULL)->source_b), /*type*/ DT_INTROSPECTION_TYPE_FLOAT, /*field*/ &introspection_linear[4]
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"target_L[0]", (char*)"target_L[0]", (char*)"", sizeof(((dt_iop_colorchecker_params_t*)NULL)->target_L[0]), G_STRUCT_OFFSET(dt_iop_colorchecker_params_t, target_L), NULL },
    /*Min*/ -G_MAXFLOAT, /*Max*/ G_MAXFLOAT, /*Default*/ 0.0
  }
},
{
  .Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"float[]", (char*)"target_L", (char*)"target_L", (char*)"", sizeof(((dt_iop_colorchecker_params_t*)NULL)->target_L), G_STRUCT_OFFSET(dt_iop_colorchecker_params_t, target_L), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_colorchecker_params_t*)NULL)->target_L), /*type*/ DT_INTROSPECTION_TYPE_FLOAT, /*field*/ &introspection_linear[6]
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"target_a[0]", (char*)"target_a[0]", (char*)"", sizeof(((dt_iop_colorchecker_params_t*)NULL)->target_a[0]), G_STRUCT_OFFSET(dt_iop_colorchecker_params_t, target_a), NULL },
    /*Min*/ -G_MAXFLOAT, /*Max*/ G_MAXFLOAT, /*Default*/ 0.0
  }
},
{
  .Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"float[]", (char*)"target_a", (char*)"target_a", (char*)"", sizeof(((dt_iop_colorchecker_params_t*)NULL)->target_a), G_STRUCT_OFFSET(dt_iop_colorchecker_params_t, target_a), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_colorchecker_params_t*)NULL)->target_a), /*type*/ DT_INTROSPECTION_TYPE_FLOAT, /*field*/ &introspection_linear[8]
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"target_b[0]", (char*)"target_b[0]", (char*)"", sizeof(((dt_iop_colorchecker_params_t*)NULL)->target_b[0]), G_STRUCT_OFFSET(dt_iop_colorchecker_params_t, target_b), NULL },
    /*Min*/ -G_MAXFLOAT, /*Max*/ G_MAXFLOAT, /*Default*/ 0.0
  }
},
{
  .Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"float[]", (char*)"target_b", (char*)"target_b", (char*)"", sizeof(((dt_iop_colorchecker_params_t*)NULL)->target_b), G_STRUCT_OFFSET(dt_iop_colorchecker_params_t, target_b), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_colorchecker_params_t*)NULL)->target_b), /*type*/ DT_INTROSPECTION_TYPE_FLOAT, /*field*/ &introspection_linear[10]
  }
},
{
  .Int = {
    { DT_INTROSPECTION_TYPE_INT, (char*)"int", (char*)"num_patches", (char*)"num_patches", (char*)"", sizeof(((dt_iop_colorchecker_params_t*)NULL)->num_patches), G_STRUCT_OFFSET(dt_iop_colorchecker_params_t, num_patches), NULL },
    /*Min*/ G_MININT, /*Max*/ G_MAXINT, /*Default*/ 0
  }
},
{
  .Struct = {
    { DT_INTROSPECTION_TYPE_STRUCT, (char*)"dt_iop_colorchecker_params_t", (char*)"", (char*)"", (char*)"", sizeof(dt_iop_colorchecker_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,
  2,
  "dt_iop_colorchecker_params_t",
  sizeof(dt_iop_colorchecker_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].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"source_L[0]", (char*)"source_L[0]", (char*)"", sizeof(((dt_iop_colorchecker_params_t*)NULL)->source_L[0]), G_STRUCT_OFFSET(dt_iop_colorchecker_params_t, source_L), NULL },
    /*Min*/ -G_MAXFLOAT, /*Max*/ G_MAXFLOAT, /*Default*/ 0.0
  };
  introspection_linear[1].Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"float[]", (char*)"source_L", (char*)"source_L", (char*)"", sizeof(((dt_iop_colorchecker_params_t*)NULL)->source_L), G_STRUCT_OFFSET(dt_iop_colorchecker_params_t, source_L), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_colorchecker_params_t*)NULL)->source_L), /*type*/ DT_INTROSPECTION_TYPE_FLOAT, /*field*/ &introspection_linear[0]
  };
  introspection_linear[2].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"source_a[0]", (char*)"source_a[0]", (char*)"", sizeof(((dt_iop_colorchecker_params_t*)NULL)->source_a[0]), G_STRUCT_OFFSET(dt_iop_colorchecker_params_t, source_a), NULL },
    /*Min*/ -G_MAXFLOAT, /*Max*/ G_MAXFLOAT, /*Default*/ 0.0
  };
  introspection_linear[3].Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"float[]", (char*)"source_a", (char*)"source_a", (char*)"", sizeof(((dt_iop_colorchecker_params_t*)NULL)->source_a), G_STRUCT_OFFSET(dt_iop_colorchecker_params_t, source_a), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_colorchecker_params_t*)NULL)->source_a), /*type*/ DT_INTROSPECTION_TYPE_FLOAT, /*field*/ &introspection_linear[2]
  };
  introspection_linear[4].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"source_b[0]", (char*)"source_b[0]", (char*)"", sizeof(((dt_iop_colorchecker_params_t*)NULL)->source_b[0]), G_STRUCT_OFFSET(dt_iop_colorchecker_params_t, source_b), NULL },
    /*Min*/ -G_MAXFLOAT, /*Max*/ G_MAXFLOAT, /*Default*/ 0.0
  };
  introspection_linear[5].Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"float[]", (char*)"source_b", (char*)"source_b", (char*)"", sizeof(((dt_iop_colorchecker_params_t*)NULL)->source_b), G_STRUCT_OFFSET(dt_iop_colorchecker_params_t, source_b), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_colorchecker_params_t*)NULL)->source_b), /*type*/ DT_INTROSPECTION_TYPE_FLOAT, /*field*/ &introspection_linear[4]
  };
  introspection_linear[6].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"target_L[0]", (char*)"target_L[0]", (char*)"", sizeof(((dt_iop_colorchecker_params_t*)NULL)->target_L[0]), G_STRUCT_OFFSET(dt_iop_colorchecker_params_t, target_L), NULL },
    /*Min*/ -G_MAXFLOAT, /*Max*/ G_MAXFLOAT, /*Default*/ 0.0
  };
  introspection_linear[7].Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"float[]", (char*)"target_L", (char*)"target_L", (char*)"", sizeof(((dt_iop_colorchecker_params_t*)NULL)->target_L), G_STRUCT_OFFSET(dt_iop_colorchecker_params_t, target_L), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_colorchecker_params_t*)NULL)->target_L), /*type*/ DT_INTROSPECTION_TYPE_FLOAT, /*field*/ &introspection_linear[6]
  };
  introspection_linear[8].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"target_a[0]", (char*)"target_a[0]", (char*)"", sizeof(((dt_iop_colorchecker_params_t*)NULL)->target_a[0]), G_STRUCT_OFFSET(dt_iop_colorchecker_params_t, target_a), NULL },
    /*Min*/ -G_MAXFLOAT, /*Max*/ G_MAXFLOAT, /*Default*/ 0.0
  };
  introspection_linear[9].Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"float[]", (char*)"target_a", (char*)"target_a", (char*)"", sizeof(((dt_iop_colorchecker_params_t*)NULL)->target_a), G_STRUCT_OFFSET(dt_iop_colorchecker_params_t, target_a), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_colorchecker_params_t*)NULL)->target_a), /*type*/ DT_INTROSPECTION_TYPE_FLOAT, /*field*/ &introspection_linear[8]
  };
  introspection_linear[10].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"target_b[0]", (char*)"target_b[0]", (char*)"", sizeof(((dt_iop_colorchecker_params_t*)NULL)->target_b[0]), G_STRUCT_OFFSET(dt_iop_colorchecker_params_t, target_b), NULL },
    /*Min*/ -G_MAXFLOAT, /*Max*/ G_MAXFLOAT, /*Default*/ 0.0
  };
  introspection_linear[11].Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"float[]", (char*)"target_b", (char*)"target_b", (char*)"", sizeof(((dt_iop_colorchecker_params_t*)NULL)->target_b), G_STRUCT_OFFSET(dt_iop_colorchecker_params_t, target_b), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_colorchecker_params_t*)NULL)->target_b), /*type*/ DT_INTROSPECTION_TYPE_FLOAT, /*field*/ &introspection_linear[10]
  };
  introspection_linear[12].Int = {
    { DT_INTROSPECTION_TYPE_INT, (char*)"int", (char*)"num_patches", (char*)"num_patches", (char*)"", sizeof(((dt_iop_colorchecker_params_t*)NULL)->num_patches), G_STRUCT_OFFSET(dt_iop_colorchecker_params_t, num_patches), NULL },
    /*Min*/ G_MININT, /*Max*/ G_MAXINT, /*Default*/ 0
  };
  introspection_linear[13].Struct = {
    { DT_INTROSPECTION_TYPE_STRUCT, (char*)"dt_iop_colorchecker_params_t", (char*)"", (char*)"", (char*)"", sizeof(dt_iop_colorchecker_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_field_t *f13[] = {
    &introspection_linear[1],
    &introspection_linear[3],
    &introspection_linear[5],
    &introspection_linear[7],
    &introspection_linear[9],
    &introspection_linear[11],
    &introspection_linear[12],
    NULL
  };

  introspection_linear[13].Struct.fields = f13;

  return 0;
}

void * get_p(const void * param, const char * name)
{
  dt_iop_colorchecker_params_t * p = (dt_iop_colorchecker_params_t*)param;
  if(!strcmp(name, "source_L[0]"))
    return &(p->source_L[0]);
  else if(!strcmp(name, "source_L"))
    return &(p->source_L);
  else if(!strcmp(name, "source_a[0]"))
    return &(p->source_a[0]);
  else if(!strcmp(name, "source_a"))
    return &(p->source_a);
  else if(!strcmp(name, "source_b[0]"))
    return &(p->source_b[0]);
  else if(!strcmp(name, "source_b"))
    return &(p->source_b);
  else if(!strcmp(name, "target_L[0]"))
    return &(p->target_L[0]);
  else if(!strcmp(name, "target_L"))
    return &(p->target_L);
  else if(!strcmp(name, "target_a[0]"))
    return &(p->target_a[0]);
  else if(!strcmp(name, "target_a"))
    return &(p->target_a);
  else if(!strcmp(name, "target_b[0]"))
    return &(p->target_b[0]);
  else if(!strcmp(name, "target_b"))
    return &(p->target_b);
  else if(!strcmp(name, "num_patches"))
    return &(p->num_patches);
  else
    return NULL;
}

dt_introspection_field_t * get_f(const char * name)
{
  if(!g_ascii_strcasecmp(name, "source_L[0]"))
    return &(introspection_linear[0]);
  else if(!g_ascii_strcasecmp(name, "source_L"))
    return &(introspection_linear[1]);
  else if(!g_ascii_strcasecmp(name, "source_a[0]"))
    return &(introspection_linear[2]);
  else if(!g_ascii_strcasecmp(name, "source_a"))
    return &(introspection_linear[3]);
  else if(!g_ascii_strcasecmp(name, "source_b[0]"))
    return &(introspection_linear[4]);
  else if(!g_ascii_strcasecmp(name, "source_b"))
    return &(introspection_linear[5]);
  else if(!g_ascii_strcasecmp(name, "target_L[0]"))
    return &(introspection_linear[6]);
  else if(!g_ascii_strcasecmp(name, "target_L"))
    return &(introspection_linear[7]);
  else if(!g_ascii_strcasecmp(name, "target_a[0]"))
    return &(introspection_linear[8]);
  else if(!g_ascii_strcasecmp(name, "target_a"))
    return &(introspection_linear[9]);
  else if(!g_ascii_strcasecmp(name, "target_b[0]"))
    return &(introspection_linear[10]);
  else if(!g_ascii_strcasecmp(name, "target_b"))
    return &(introspection_linear[11]);
  else if(!g_ascii_strcasecmp(name, "num_patches"))
    return &(introspection_linear[12]);
  else
    return NULL;
}

#ifdef __cplusplus
}
#endif

