File tree Expand file tree Collapse file tree 17 files changed +64
-33
lines changed Expand file tree Collapse file tree 17 files changed +64
-33
lines changed Original file line number Diff line number Diff line change 6
6
7
7
#pragma once
8
8
9
- typedef union { double d; int64_t l; } V64;
10
- typedef union { float f; int32_t i; } V32;
11
-
12
- #define DOUBLE_TO_BITS (x ) ((V64){ .d = x }).l
13
- #define FLOAT_TO_BITS (x ) ((V32){ .f = x }).i
14
-
15
9
#ifndef CV_EXPORTS
16
10
#ifdef __cplusplus
17
11
#define CV_EXPORTS __attribute__ ((visibility (" default" )))
Original file line number Diff line number Diff line change 5
5
//
6
6
7
7
#import " DMatch.h"
8
- #import " CVObjcUtil.h"
9
8
10
9
@implementation DMatch {
11
10
cv::DMatch native;
@@ -90,6 +89,8 @@ - (BOOL)isEqual:(id)other {
90
89
}
91
90
}
92
91
92
+ #define FLOAT_TO_BITS (x ) ((Cv32suf){ .f = x }).i
93
+
93
94
- (NSUInteger )hash {
94
95
int prime = 31 ;
95
96
uint32_t result = 1 ;
Original file line number Diff line number Diff line change 6
6
7
7
#import " KeyPoint.h"
8
8
#import " Point2f.h"
9
- #import " CVObjcUtil.h"
10
9
11
10
@implementation KeyPoint {
12
11
cv::KeyPoint native;
@@ -75,6 +74,8 @@ - (BOOL)isEqual:(id)other {
75
74
}
76
75
}
77
76
77
+ #define FLOAT_TO_BITS (x ) ((Cv32suf){ .f = x }).i
78
+
78
79
- (NSUInteger )hash {
79
80
int prime = 31 ;
80
81
uint32_t result = 1 ;
Original file line number Diff line number Diff line change 6
6
7
7
#import " Point2d.h"
8
8
#import " Rect2d.h"
9
- #import " CVObjcUtil.h"
10
9
11
10
@implementation Point2d {
12
11
cv::Point2d native;
@@ -90,6 +89,8 @@ - (BOOL)inside:(Rect2d*)rect {
90
89
return [rect contains: self ];
91
90
}
92
91
92
+ #define DOUBLE_TO_BITS (x ) ((Cv64suf){ .f = x }).i
93
+
93
94
- (NSUInteger )hash {
94
95
int prime = 31 ;
95
96
uint32_t result = 1 ;
Original file line number Diff line number Diff line change 6
6
7
7
#import " Point2f.h"
8
8
#import " Rect2f.h"
9
- #import " CVObjcUtil.h"
10
9
11
10
@implementation Point2f {
12
11
cv::Point2f native;
@@ -90,6 +89,8 @@ - (BOOL)inside:(Rect2f *)rect {
90
89
return [rect contains: self ];
91
90
}
92
91
92
+ #define FLOAT_TO_BITS (x ) ((Cv32suf){ .f = x }).i
93
+
93
94
- (NSUInteger )hash {
94
95
int prime = 31 ;
95
96
uint32_t result = 1 ;
Original file line number Diff line number Diff line change 6
6
7
7
#import " Point3d.h"
8
8
#import " Point2d.h"
9
- #import " CVObjcUtil.h"
10
9
11
10
@implementation Point3d {
12
11
cv::Point3d native;
@@ -95,6 +94,8 @@ - (BOOL)isEqual:(id)other {
95
94
}
96
95
}
97
96
97
+ #define DOUBLE_TO_BITS (x ) ((Cv64suf){ .f = x }).i
98
+
98
99
- (NSUInteger )hash {
99
100
int prime = 31 ;
100
101
uint32_t result = 1 ;
Original file line number Diff line number Diff line change 6
6
7
7
#import " Point3f.h"
8
8
#import " Point2f.h"
9
- #import " CVObjcUtil.h"
10
9
11
10
@implementation Point3f {
12
11
cv::Point3f native;
@@ -95,6 +94,8 @@ - (BOOL)isEqual:(id)other {
95
94
}
96
95
}
97
96
97
+ #define FLOAT_TO_BITS (x ) ((Cv32suf){ .f = x }).i
98
+
98
99
- (NSUInteger )hash {
99
100
int prime = 31 ;
100
101
uint32_t result = 1 ;
Original file line number Diff line number Diff line change 7
7
#import " Rect2d.h"
8
8
#import " Point2d.h"
9
9
#import " Size2d.h"
10
- #import " CVObjcUtil.h"
11
10
12
11
@implementation Rect2d {
13
12
cv::Rect2d native;
@@ -134,6 +133,8 @@ - (BOOL)isEqual:(id)other{
134
133
}
135
134
}
136
135
136
+ #define DOUBLE_TO_BITS (x ) ((Cv64suf){ .f = x }).i
137
+
137
138
- (NSUInteger )hash {
138
139
int prime = 31 ;
139
140
uint32_t result = 1 ;
Original file line number Diff line number Diff line change 7
7
#import " Rect2f.h"
8
8
#import " Point2f.h"
9
9
#import " Size2f.h"
10
- #import " CVObjcUtil.h"
11
10
12
11
@implementation Rect2f {
13
12
cv::Rect2f native;
@@ -134,6 +133,8 @@ - (BOOL)isEqual:(id)other{
134
133
}
135
134
}
136
135
136
+ #define FLOAT_TO_BITS (x ) ((Cv32suf){ .f = x }).i
137
+
137
138
- (NSUInteger )hash {
138
139
int prime = 31 ;
139
140
uint32_t result = 1 ;
Original file line number Diff line number Diff line change 8
8
#import " Point2f.h"
9
9
#import " Size2f.h"
10
10
#import " Rect2f.h"
11
- #import " CVObjcUtil.h"
12
11
13
12
#include < math.h>
14
13
@@ -94,6 +93,9 @@ - (BOOL)isEqual:(id)other {
94
93
}
95
94
}
96
95
96
+ #define FLOAT_TO_BITS (x ) ((Cv32suf){ .f = x }).i
97
+ #define DOUBLE_TO_BITS (x ) ((Cv64suf){ .f = x }).i
98
+
97
99
- (NSUInteger )hash {
98
100
int prime = 31 ;
99
101
uint32_t result = 1 ;
You can’t perform that action at this time.
0 commit comments