]> mj.ucw.cz Git - libucw.git/blob - images/duplicates.h
safe signatures aligning
[libucw.git] / images / duplicates.h
1 #ifndef _IMAGES_DUP_CMP_H
2 #define _IMAGES_DUP_CMP_H
3
4 struct image_dup {
5   struct image *image;
6   byte *tab_pixels;
7   u32 tab_cols;
8   u32 tab_rows;
9   u32 tab_row_size;
10   u32 tab_size;
11 };
12
13 #define IMAGE_DUP_TRANS_ID      0x01
14 #define IMAGE_DUP_FLIP_X        0x02
15 #define IMAGE_DUP_FLIP_Y        0x04
16 #define IMAGE_DUP_ROT_180       0x08
17 #define IMAGE_DUP_FLIP_BACK     0x10
18 #define IMAGE_DUP_ROT_CCW       0x20
19 #define IMAGE_DUP_ROT_CW        0x40
20 #define IMAGE_DUP_FLIP_SLASH    0x80
21 #define IMAGE_DUP_TRANS_ALL     0xff
22 #define IMAGE_DUP_SCALE         0x100
23 #define IMAGE_DUP_WANT_ALL      0x200
24
25 /* dup-init.c */
26
27 uns image_dup_init(struct image_thread *thread, struct image_dup *dup, struct image *image, struct mempool *pool);
28 uns image_dup_estimate_size(uns cols, uns rows);
29
30 /* dup-cmp.c */
31
32 uns image_dup_compare(struct image_dup *dup1, struct image_dup *dup2, uns flags);
33
34 /* internals */
35
36 static inline byte *
37 image_dup_block(struct image_dup *dup, uns tab_col, uns tab_row)
38 {
39   return dup->tab_pixels + (dup->tab_row_size << tab_row) + (3 << (tab_row + tab_col));
40 }
41
42
43 #endif