OpenCV 4.5.3(日本語機械翻訳)
t_hash_int.hpp
[詳解]
1 //
2 // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
3 //
4 // By downloading, copying, installing or using the software you agree to this license.
5 // If you do not agree to this license, do not download, install,
6 // copy or use the software.
7 //
8 //
9 // License Agreement
10 // For Open Source Computer Vision Library
11 //
12 // Copyright (C) 2014, OpenCV Foundation, all rights reserved.
13 // Third party copyrights are property of their respective owners.
14 //
15 // Redistribution and use in source and binary forms, with or without modification,
16 // are permitted provided that the following conditions are met:
17 //
18 // * Redistribution's of source code must retain the above copyright notice,
19 // this list of conditions and the following disclaimer.
20 //
21 // * Redistribution's in binary form must reproduce the above copyright notice,
22 // this list of conditions and the following disclaimer in the documentation
23 // and/or other materials provided with the distribution.
24 //
25 // * The name of the copyright holders may not be used to endorse or promote products
26 // derived from this software without specific prior written permission.
27 //
28 // This software is provided by the copyright holders and contributors "as is" and
29 // any express or implied warranties, including, but not limited to, the implied
30 // warranties of merchantability and fitness for a particular purpose are disclaimed.
31 // In no event shall the Intel Corporation or contributors be liable for any direct,
32 // indirect, incidental, special, exemplary, or consequential damages
33 // (including, but not limited to, procurement of substitute goods or services;
34 // loss of use, data, or profits; or business interruption) however caused
35 // and on any theory of liability, whether in contract, strict liability,
36 // or tort (including negligence or otherwise) arising in any way out of
37 // the use of this software, even if advised of the possibility of such damage.
38 //
39
44 #ifndef __OPENCV_SURFACE_MATCHING_T_HASH_INT_HPP__
45 #define __OPENCV_SURFACE_MATCHING_T_HASH_INT_HPP__
46
47 #include <stdio.h>
48 #include <stdlib.h>
49
50 namespace cv
51{
52 namespace ppf_match_3d
53{
54
57
58 typedef uint KeyType;
59
60 typedef struct hashnode_i
61{
62 KeyType key;
63 void *data;
64 struct hashnode_i *next;
65} hashnode_i ;
66
67 typedef struct HSHTBL_i
68{
69 size_t size;
70 struct hashnode_i **nodes;
71 size_t (*hashfunc)(uint);
73
74
79 inline static uint next_power_of_two(uint value)
80{
81
82 --value;
83 value |= value >> 1;
84 value |= value >> 2;
85 value |= value >> 4;
86 value |= value >> 8;
87 value |= value >> 16;
88 ++value;
89
90 return value;
91}
92
93hashtable_int *hashtableCreate(size_t size, size_t (*hashfunc)(uint));
94 void hashtableDestroy(hashtable_int *hashtbl);
95 int hashtableInsert(hashtable_int *hashtbl, KeyType key, void *data);
96 int hashtableInsertHashed(hashtable_int *hashtbl, KeyType key, void *data);
97 int hashtableRemove(hashtable_int *hashtbl, KeyType key);
98 void *hashtableGet(hashtable_int *hashtbl, KeyType key);
99hashnode_i* hashtableGetBucketHashed(hashtable_int *hashtbl, KeyType key);
100 int hashtableResize(hashtable_int *hashtbl, size_t size);
101hashtable_int *hashtable_int_clone(hashtable_int *hashtbl);
102hashtable_int *hashtableRead(FILE* f);
103 int hashtableWrite(const hashtable_int * hashtbl, const size_t dataSize, FILE* f);
104 void hashtablePrint(hashtable_int *hashtbl);
105
107
108} // namespace ppf_match_3d
109
110} // namespace cv
111 #endif
112
113
static uint next_power_of_two(uint value)
Round up to the next highest power of 2
Definition: t_hash_int.hpp:79
cv
"black box" representation of the file storage associated with a file on disk.
Definition: aruco.hpp:75
Definition: t_hash_int.hpp:68
Definition: t_hash_int.hpp:61