]> mj.ucw.cz Git - libucw.git/blobdiff - images/signature.h
reverted invalid usage of GET*/PUT* macros
[libucw.git] / images / signature.h
index 8c332cf3ab31c513cddd99898862dcbe8f1bdbaf..e84c7f3164fbb01784fb9c527af634756f39b2d7 100644 (file)
@@ -6,6 +6,7 @@ extern uns image_sig_min_width, image_sig_min_height;
 extern uns *image_sig_prequant_thresholds;
 extern uns image_sig_postquant_min_steps, image_sig_postquant_max_steps, image_sig_postquant_threshold;
 extern double image_sig_textured_threshold;
+extern uns image_sig_compare_method;
 
 #define IMAGE_VEC_F    6
 #define IMAGE_REG_F    IMAGE_VEC_F
@@ -27,7 +28,7 @@ struct image_region {
 
 #define IMAGE_SIG_TEXTURED     0x1
 
-/* Image signature (10 + len * 16 bytes) */
+/* Image signature (11 + len * 16 bytes) */
 struct image_signature {
   byte len;                    /* Number of regions */
   byte flags;                  /* IMAGE_SIG_xxx */
@@ -37,10 +38,22 @@ struct image_signature {
   struct image_region reg[IMAGE_REG_MAX];/* Feature vector for every region */
 } PACKED;
 
+struct image_cluster {
+  union {
+    struct {
+      s32 dot;                 /* Dot product of the splitting plane */
+      s8 vec[IMAGE_VEC_F];     /* Normal vector of the splitting plane */
+    } PACKED;
+    struct {
+      u64 pos;                 /* Cluster size in bytes */
+    } PACKED;
+  } PACKED;
+} PACKED;
+
 static inline uns
 image_signature_size(uns len)
 {
-  return 4 + sizeof(struct image_vector) + len * sizeof(struct image_region);
+  return 5 + sizeof(struct image_vector) + len * sizeof(struct image_region);
 }
 
 /* sig-dump.c */
@@ -104,9 +117,8 @@ void image_sig_detect_textured(struct image_sig_data *data);
 
 /* sig-cmp.c */
 
-#define IMAGE_SIG_DIST_SCALE (3 + 3 + 8 + 16)
-
 uns image_signatures_dist(struct image_signature *sig1, struct image_signature *sig2);
+uns image_signatures_dist_explain(struct image_signature *sig1, struct image_signature *sig2, void (*msg)(byte *text, void *param), void *param);
 
 #endif