X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=images%2Fconfig.c;h=286097e8880185108a3b885939eba1cbad35b88c;hb=1bc3bb66e47ec02003658fb3040aef0ffd7b7540;hp=1c29e6784ad161716cf797bc03dda82bf9f4c1c3;hpb=dc4188d47a7e1ac0df29797dcb452b0c2460b634;p=libucw.git diff --git a/images/config.c b/images/config.c index 1c29e678..286097e8 100644 --- a/images/config.c +++ b/images/config.c @@ -6,44 +6,71 @@ #undef LOCAL_DEBUG -#include "lib/lib.h" -#include "lib/conf.h" -#include "images/images.h" -#include "images/signature.h" +#include +#include +#include +#include +#if defined(CONFIG_IMAGES_SIM) || defined(CONFIG_IMAGES_DUP) +#include +#endif #include -uns image_sig_min_width; -uns image_sig_min_height; -uns *image_sig_prequant_thresholds; -uns image_sig_postquant_min_steps; -uns image_sig_postquant_max_steps; -uns image_sig_postquant_threshold; +/* ImageLib section */ +uint image_trace; +uint image_max_dim = 0xffff; +uint image_max_bytes = ~0U; + +#if defined(CONFIG_IMAGES_SIM) || defined(CONFIG_IMAGES_DUP) +/* ImageSig section */ +uint image_sig_min_width; +uint image_sig_min_height; +uint *image_sig_prequant_thresholds; +uint image_sig_postquant_min_steps; +uint image_sig_postquant_max_steps; +uint image_sig_postquant_threshold; double image_sig_border_size; int image_sig_border_bonus; +double image_sig_inertia_scale[3]; double image_sig_textured_threshold; int image_sig_compare_method; -uns image_sig_cmp_features_weights[IMAGE_VEC_F + IMAGE_REG_H]; +uint image_sig_cmp_features_weights[IMAGE_REG_F + IMAGE_REG_H]; +#endif + +static struct cf_section image_lib_config = { + CF_ITEMS{ + CF_UINT("Trace", &image_trace), + CF_UINT("ImageMaxDim", &image_max_dim), + CF_UINT("ImageMaxBytes", &image_max_bytes), + CF_END + } +}; -static struct cf_section sig_config = { +#if defined(CONFIG_IMAGES_SIM) || defined(CONFIG_IMAGES_DUP) +static struct cf_section image_sig_config = { CF_ITEMS{ - CF_UNS("MinWidth", &image_sig_min_width), - CF_UNS("MinHeight", &image_sig_min_height), - CF_UNS_DYN("PreQuantThresholds", &image_sig_prequant_thresholds, CF_ANY_NUM), - CF_UNS("PostQuantMinSteps", &image_sig_postquant_min_steps), - CF_UNS("PostQuantMaxSteps", &image_sig_postquant_max_steps), - CF_UNS("PostQuantThreshold", &image_sig_postquant_threshold), + CF_UINT("MinWidth", &image_sig_min_width), + CF_UINT("MinHeight", &image_sig_min_height), + CF_UINT_DYN("PreQuantThresholds", &image_sig_prequant_thresholds, CF_ANY_NUM), + CF_UINT("PostQuantMinSteps", &image_sig_postquant_min_steps), + CF_UINT("PostQuantMaxSteps", &image_sig_postquant_max_steps), + CF_UINT("PostQuantThreshold", &image_sig_postquant_threshold), CF_DOUBLE("BorderSize", &image_sig_border_size), CF_INT("BorderBonus", &image_sig_border_bonus), + CF_DOUBLE_ARY("InertiaScale", image_sig_inertia_scale, 3), CF_DOUBLE("TexturedThreshold", &image_sig_textured_threshold), - CF_LOOKUP("CompareMethod", &image_sig_compare_method, ((byte *[]){"integrated", "fuzzy", "average", NULL})), - CF_UNS_ARY("CompareFeaturesWeights", image_sig_cmp_features_weights, IMAGE_VEC_F + IMAGE_REG_H), + CF_LOOKUP("CompareMethod", &image_sig_compare_method, ((const char * const []){"integrated", "fuzzy", "average", NULL})), + CF_UINT_ARY("CompareFeaturesWeights", image_sig_cmp_features_weights, IMAGE_REG_F + IMAGE_REG_H), CF_END } }; +#endif static void CONSTRUCTOR images_init_config(void) { - cf_declare_section("ImageSig", &sig_config, 0); + cf_declare_section("ImageLib", &image_lib_config, 0); +#if defined(CONFIG_IMAGES_SIM) || defined(CONFIG_IMAGES_DUP) + cf_declare_section("ImageSig", &image_sig_config, 0); +#endif }