]> mj.ucw.cz Git - libucw.git/blob - images/images.h
2399c4f4fe7c4016a2d9136ab8cf619de5691d3b
[libucw.git] / images / images.h
1 #ifndef _IMAGES_H
2 #define _IMAGES_H
3
4 #include <stdio.h>
5 #include <magick/api.h>
6
7 #define IMAGE_VEC_K             6
8 #define IMAGE_VEC_LOG_K         3
9
10 typedef u32 image_vector[IMAGE_VEC_K];
11 typedef u32 image_box[2][IMAGE_VEC_K];
12
13 struct image_signature {
14   image_vector vec; 
15 };
16
17 struct image_tree {
18   uns count;
19   uns depth;
20   image_box box;
21   struct image_node *nodes;
22   struct image_entry *entries;
23 };
24
25 #define IMAGE_NODE_LEAF         0x80000000
26 #define IMAGE_NODE_DIM          ((1 << IMAGE_VEC_LOG_K) - 1)
27
28 struct image_node {
29   u32 value;
30 };
31
32 #define IMAGE_ENTRY_LAST        (1 << (sizeof(oid_t) * 8 - 1))
33
34 struct image_entry {
35   oid_t oid;
36 };
37
38 int compute_image_signature(void *data, uns len, struct image_signature *sig);
39
40 #endif