]> mj.ucw.cz Git - libucw.git/blobdiff - images/duplicates.h
make regex and asciidoc work on Darwin without hacking
[libucw.git] / images / duplicates.h
index 07db2afe70911ef6e608100d8020d06994b482df..ddeddd5c65f8e317ce402b15c976f15ef1792908 100644 (file)
@@ -1,8 +1,33 @@
-#ifndef _IMAGES_DUP_CMP_H
-#define _IMAGES_DUP_CMP_H
+#ifndef _IMAGES_DUPLICATES_H
+#define _IMAGES_DUPLICATES_H
+
+enum image_dup_flags {
+  IMAGE_DUP_TRANS_ID =         0x0001,
+  IMAGE_DUP_FLIP_X =           0x0002,
+  IMAGE_DUP_FLIP_Y =           0x0004,
+  IMAGE_DUP_ROT_180 =          0x0008,
+  IMAGE_DUP_FLIP_BACK =                0x0010,
+  IMAGE_DUP_ROT_CCW =          0x0020,
+  IMAGE_DUP_ROT_CW =           0x0040,
+  IMAGE_DUP_FLIP_SLASH =       0x0080,
+  IMAGE_DUP_TRANS_ALL =                0x00ff,
+  IMAGE_DUP_SCALE =            0x0100,
+  IMAGE_DUP_WANT_ALL =         0x0200,
+};
+
+struct image_dup_context {
+  struct image_context *ic;
+  uns flags;
+  uns ratio_threshold;
+  uns error_threshold;
+  uns qtree_limit;
+  u64 sum_depth;
+  u64 sum_pixels;
+  uns error;
+};
 
 struct image_dup {
 
 struct image_dup {
-  struct image *image;
+  struct image image;
   byte *tab_pixels;
   u32 tab_cols;
   u32 tab_rows;
   byte *tab_pixels;
   u32 tab_cols;
   u32 tab_rows;
@@ -10,26 +35,17 @@ struct image_dup {
   u32 tab_size;
 };
 
   u32 tab_size;
 };
 
-#define IMAGE_DUP_TRANS_ID     0x01
-#define IMAGE_DUP_FLIP_X       0x02
-#define IMAGE_DUP_FLIP_Y       0x04
-#define IMAGE_DUP_ROT_180      0x08
-#define IMAGE_DUP_FLIP_BACK    0x10
-#define IMAGE_DUP_ROT_CCW      0x20
-#define IMAGE_DUP_ROT_CW       0x40
-#define IMAGE_DUP_FLIP_SLASH   0x80
-#define IMAGE_DUP_TRANS_ALL    0xff
-#define IMAGE_DUP_SCALE                0x100
-#define IMAGE_DUP_WANT_ALL     0x200
-
 /* dup-init.c */
 
 /* dup-init.c */
 
-uns image_dup_init(struct image_thread *thread, struct image_dup *dup, struct image *image, struct mempool *pool);
-uns image_dup_estimate_size(uns cols, uns rows);
+void image_dup_context_init(struct image_context *ic, struct image_dup_context *ctx);
+void image_dup_context_cleanup(struct image_dup_context *ctx);
+
+uns image_dup_estimate_size(uns cols, uns rows, uns same_size_compare, uns qtree_limit);
+uns image_dup_new(struct image_dup_context *ctx, struct image *image, void *buffer, uns same_size_compare);
 
 /* dup-cmp.c */
 
 
 /* dup-cmp.c */
 
-uns image_dup_compare(struct image_dup *dup1, struct image_dup *dup2, uns flags);
+uns image_dup_compare(struct image_dup_context *ctx, struct image_dup *dup1, struct image_dup *dup2);
 
 /* internals */
 
 
 /* internals */