]> mj.ucw.cz Git - libucw.git/blob - images/kd-tree.h
Merge with git+ssh://cvs.ucw.cz/projects/sherlock/GIT/sherlock.git
[libucw.git] / images / kd-tree.h
1 #ifndef _IMAGES_KD_TREE_H
2 #define _IMAGES_KD_TREE_H
3
4 #define IMAGE_SEARCH_DIST_UNLIMITED     (~0U)
5
6 /* FIXME: support full length of oid_t, currently must be <2^31 */
7 #define IMAGE_SEARCH_ITEM_TYPE          0x80000000U
8 struct image_search_item {
9   u32 dist;
10   u32 index;
11   struct image_bbox bbox;
12 };
13
14 struct image_search {
15   struct image_tree *tree;
16   struct image_node *nodes;
17   struct image_leaf *leaves;
18   struct image_vector query;
19   struct image_search_item *buf;
20   u32 *heap;
21   uns count, visited, size, max_dist;
22 };
23
24 void image_search_init(struct image_search *is, struct image_tree *tree, struct image_vector *query, uns max_dist);
25 void image_search_done(struct image_search *is);
26 int image_search_next(struct image_search *is, oid_t *oid, uns *dist);
27
28 #endif