2 * Image Library -- Configuration
4 * (c) 2006 Pavel Charvat <pchar@ucw.cz>
11 #include <images/images.h>
12 #include <images/error.h>
13 #if defined(CONFIG_IMAGES_SIM) || defined(CONFIG_IMAGES_DUP)
14 #include <images/signature.h>
19 /* ImageLib section */
21 uint image_max_dim = 0xffff;
22 uint image_max_bytes = ~0U;
24 #if defined(CONFIG_IMAGES_SIM) || defined(CONFIG_IMAGES_DUP)
25 /* ImageSig section */
26 uint image_sig_min_width;
27 uint image_sig_min_height;
28 uint *image_sig_prequant_thresholds;
29 uint image_sig_postquant_min_steps;
30 uint image_sig_postquant_max_steps;
31 uint image_sig_postquant_threshold;
32 double image_sig_border_size;
33 int image_sig_border_bonus;
34 double image_sig_inertia_scale[3];
35 double image_sig_textured_threshold;
36 int image_sig_compare_method;
37 uint image_sig_cmp_features_weights[IMAGE_REG_F + IMAGE_REG_H];
40 static struct cf_section image_lib_config = {
42 CF_UINT("Trace", &image_trace),
43 CF_UINT("ImageMaxDim", &image_max_dim),
44 CF_UINT("ImageMaxBytes", &image_max_bytes),
49 #if defined(CONFIG_IMAGES_SIM) || defined(CONFIG_IMAGES_DUP)
50 static struct cf_section image_sig_config = {
52 CF_UINT("MinWidth", &image_sig_min_width),
53 CF_UINT("MinHeight", &image_sig_min_height),
54 CF_UINT_DYN("PreQuantThresholds", &image_sig_prequant_thresholds, CF_ANY_NUM),
55 CF_UINT("PostQuantMinSteps", &image_sig_postquant_min_steps),
56 CF_UINT("PostQuantMaxSteps", &image_sig_postquant_max_steps),
57 CF_UINT("PostQuantThreshold", &image_sig_postquant_threshold),
58 CF_DOUBLE("BorderSize", &image_sig_border_size),
59 CF_INT("BorderBonus", &image_sig_border_bonus),
60 CF_DOUBLE_ARY("InertiaScale", image_sig_inertia_scale, 3),
61 CF_DOUBLE("TexturedThreshold", &image_sig_textured_threshold),
62 CF_LOOKUP("CompareMethod", &image_sig_compare_method, ((const char * const []){"integrated", "fuzzy", "average", NULL})),
63 CF_UINT_ARY("CompareFeaturesWeights", image_sig_cmp_features_weights, IMAGE_REG_F + IMAGE_REG_H),
69 static void CONSTRUCTOR
70 images_init_config(void)
72 cf_declare_section("ImageLib", &image_lib_config, 0);
73 #if defined(CONFIG_IMAGES_SIM) || defined(CONFIG_IMAGES_DUP)
74 cf_declare_section("ImageSig", &image_sig_config, 0);