Skip to content

Commit af9ee90

Browse files
authored
Merge pull request opencv#17818 from komakai:documentation-improvements
Documentation fixes/improvements * Documentation fixes/improvements * Remove HASH_UTILS defines
1 parent cb2e276 commit af9ee90

File tree

17 files changed

+64
-33
lines changed

17 files changed

+64
-33
lines changed

modules/core/misc/objc/common/CVObjcUtil.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@
66

77
#pragma once
88

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-
159
#ifndef CV_EXPORTS
1610
#ifdef __cplusplus
1711
#define CV_EXPORTS __attribute__ ((visibility ("default")))

modules/core/misc/objc/common/DMatch.mm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
//
66

77
#import "DMatch.h"
8-
#import "CVObjcUtil.h"
98

109
@implementation DMatch {
1110
cv::DMatch native;
@@ -90,6 +89,8 @@ - (BOOL)isEqual:(id)other {
9089
}
9190
}
9291

92+
#define FLOAT_TO_BITS(x) ((Cv32suf){ .f = x }).i
93+
9394
- (NSUInteger)hash {
9495
int prime = 31;
9596
uint32_t result = 1;

modules/core/misc/objc/common/KeyPoint.mm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
#import "KeyPoint.h"
88
#import "Point2f.h"
9-
#import "CVObjcUtil.h"
109

1110
@implementation KeyPoint {
1211
cv::KeyPoint native;
@@ -75,6 +74,8 @@ - (BOOL)isEqual:(id)other {
7574
}
7675
}
7776

77+
#define FLOAT_TO_BITS(x) ((Cv32suf){ .f = x }).i
78+
7879
- (NSUInteger)hash {
7980
int prime = 31;
8081
uint32_t result = 1;

modules/core/misc/objc/common/Point2d.mm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
#import "Point2d.h"
88
#import "Rect2d.h"
9-
#import "CVObjcUtil.h"
109

1110
@implementation Point2d {
1211
cv::Point2d native;
@@ -90,6 +89,8 @@ - (BOOL)inside:(Rect2d*)rect {
9089
return [rect contains:self];
9190
}
9291

92+
#define DOUBLE_TO_BITS(x) ((Cv64suf){ .f = x }).i
93+
9394
- (NSUInteger)hash {
9495
int prime = 31;
9596
uint32_t result = 1;

modules/core/misc/objc/common/Point2f.mm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
#import "Point2f.h"
88
#import "Rect2f.h"
9-
#import "CVObjcUtil.h"
109

1110
@implementation Point2f {
1211
cv::Point2f native;
@@ -90,6 +89,8 @@ - (BOOL)inside:(Rect2f *)rect {
9089
return [rect contains:self];
9190
}
9291

92+
#define FLOAT_TO_BITS(x) ((Cv32suf){ .f = x }).i
93+
9394
- (NSUInteger)hash {
9495
int prime = 31;
9596
uint32_t result = 1;

modules/core/misc/objc/common/Point3d.mm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
#import "Point3d.h"
88
#import "Point2d.h"
9-
#import "CVObjcUtil.h"
109

1110
@implementation Point3d {
1211
cv::Point3d native;
@@ -95,6 +94,8 @@ - (BOOL)isEqual:(id)other {
9594
}
9695
}
9796

97+
#define DOUBLE_TO_BITS(x) ((Cv64suf){ .f = x }).i
98+
9899
- (NSUInteger)hash {
99100
int prime = 31;
100101
uint32_t result = 1;

modules/core/misc/objc/common/Point3f.mm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
#import "Point3f.h"
88
#import "Point2f.h"
9-
#import "CVObjcUtil.h"
109

1110
@implementation Point3f {
1211
cv::Point3f native;
@@ -95,6 +94,8 @@ - (BOOL)isEqual:(id)other {
9594
}
9695
}
9796

97+
#define FLOAT_TO_BITS(x) ((Cv32suf){ .f = x }).i
98+
9899
- (NSUInteger)hash {
99100
int prime = 31;
100101
uint32_t result = 1;

modules/core/misc/objc/common/Rect2d.mm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#import "Rect2d.h"
88
#import "Point2d.h"
99
#import "Size2d.h"
10-
#import "CVObjcUtil.h"
1110

1211
@implementation Rect2d {
1312
cv::Rect2d native;
@@ -134,6 +133,8 @@ - (BOOL)isEqual:(id)other{
134133
}
135134
}
136135

136+
#define DOUBLE_TO_BITS(x) ((Cv64suf){ .f = x }).i
137+
137138
- (NSUInteger)hash {
138139
int prime = 31;
139140
uint32_t result = 1;

modules/core/misc/objc/common/Rect2f.mm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#import "Rect2f.h"
88
#import "Point2f.h"
99
#import "Size2f.h"
10-
#import "CVObjcUtil.h"
1110

1211
@implementation Rect2f {
1312
cv::Rect2f native;
@@ -134,6 +133,8 @@ - (BOOL)isEqual:(id)other{
134133
}
135134
}
136135

136+
#define FLOAT_TO_BITS(x) ((Cv32suf){ .f = x }).i
137+
137138
- (NSUInteger)hash {
138139
int prime = 31;
139140
uint32_t result = 1;

modules/core/misc/objc/common/RotatedRect.mm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#import "Point2f.h"
99
#import "Size2f.h"
1010
#import "Rect2f.h"
11-
#import "CVObjcUtil.h"
1211

1312
#include <math.h>
1413

@@ -94,6 +93,9 @@ - (BOOL)isEqual:(id)other {
9493
}
9594
}
9695

96+
#define FLOAT_TO_BITS(x) ((Cv32suf){ .f = x }).i
97+
#define DOUBLE_TO_BITS(x) ((Cv64suf){ .f = x }).i
98+
9799
- (NSUInteger)hash {
98100
int prime = 31;
99101
uint32_t result = 1;

0 commit comments

Comments
 (0)