Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
801079e2
Commit
801079e2
authored
Jul 13, 2011
by
Andrey Pavlenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
partial implementation of complex out args in Java wrappers
parent
066039fd
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
421 additions
and
366 deletions
+421
-366
gen_java.py
modules/java/gen_java.py
+0
-0
Point.java
modules/java/src/java/Point.java
+58
-50
Point3.java
modules/java/src/java/Point3.java
+60
-51
Rect.java
modules/java/src/java/Rect.java
+88
-78
RotatedRect.java
modules/java/src/java/RotatedRect.java
+93
-82
Scalar.java
modules/java/src/java/Scalar.java
+71
-62
Size.java
modules/java/src/java/Size.java
+51
-43
No files found.
modules/java/gen_java.py
View file @
801079e2
This diff is collapsed.
Click to expand it.
modules/java/src/java/Point.java
View file @
801079e2
...
@@ -2,54 +2,62 @@ package org.opencv;
...
@@ -2,54 +2,62 @@ package org.opencv;
//javadoc:Point_
//javadoc:Point_
public
class
Point
{
public
class
Point
{
public
double
x
,
y
;
public
double
x
,
y
;
public
Point
(
double
x
,
double
y
)
{
public
Point
(
double
x
,
double
y
)
{
this
.
x
=
x
;
this
.
x
=
x
;
this
.
y
=
y
;
this
.
y
=
y
;
}
}
public
Point
()
{
public
Point
()
{
this
(
0
,
0
);
this
(
0
,
0
);
}
}
public
Point
clone
()
{
public
Point
(
double
[]
vals
)
{
return
new
Point
(
x
,
y
);
this
();
}
if
(
vals
!=
null
)
{
x
=
vals
.
length
>
0
?
vals
[
0
]
:
0
;
public
double
dot
(
Point
p
)
{
y
=
vals
.
length
>
1
?
vals
[
1
]
:
0
;
return
x
*
p
.
x
+
y
*
p
.
y
;
}
}
}
@Override
public
Point
clone
()
{
public
int
hashCode
()
{
return
new
Point
(
x
,
y
);
final
int
prime
=
31
;
}
int
result
=
1
;
long
temp
;
public
double
dot
(
Point
p
)
{
temp
=
Double
.
doubleToLongBits
(
x
);
return
x
*
p
.
x
+
y
*
p
.
y
;
result
=
prime
*
result
+
(
int
)
(
temp
^
(
temp
>>>
32
));
}
temp
=
Double
.
doubleToLongBits
(
y
);
result
=
prime
*
result
+
(
int
)
(
temp
^
(
temp
>>>
32
));
@Override
return
result
;
public
int
hashCode
()
{
}
final
int
prime
=
31
;
int
result
=
1
;
@Override
long
temp
;
public
boolean
equals
(
Object
obj
)
{
temp
=
Double
.
doubleToLongBits
(
x
);
if
(
this
==
obj
)
return
true
;
result
=
prime
*
result
+
(
int
)
(
temp
^
(
temp
>>>
32
));
if
(
!
(
obj
instanceof
Point
)
)
return
false
;
temp
=
Double
.
doubleToLongBits
(
y
);
Point
it
=
(
Point
)
obj
;
result
=
prime
*
result
+
(
int
)
(
temp
^
(
temp
>>>
32
));
return
x
==
it
.
x
&&
y
==
it
.
y
;
return
result
;
}
}
public
boolean
inside
(
Rect
r
)
{
@Override
return
r
.
contains
(
this
);
public
boolean
equals
(
Object
obj
)
{
}
if
(
this
==
obj
)
return
true
;
if
(
!
(
obj
instanceof
Point
)
)
return
false
;
Point
it
=
(
Point
)
obj
;
@Override
return
x
==
it
.
x
&&
y
==
it
.
y
;
public
String
toString
()
{
}
if
(
this
==
null
)
return
"null"
;
return
"{"
+
x
+
", "
+
y
+
"}"
;
public
boolean
inside
(
Rect
r
)
{
}
return
r
.
contains
(
this
);
}
@Override
public
String
toString
()
{
if
(
this
==
null
)
return
"null"
;
return
"{"
+
x
+
", "
+
y
+
"}"
;
}
}
}
modules/java/src/java/Point3.java
View file @
801079e2
...
@@ -3,55 +3,64 @@ package org.opencv;
...
@@ -3,55 +3,64 @@ package org.opencv;
//javadoc:Point3_
//javadoc:Point3_
public
class
Point3
{
public
class
Point3
{
public
double
x
,
y
,
z
;
public
double
x
,
y
,
z
;
public
Point3
(
double
x
,
double
y
,
double
z
)
{
public
Point3
(
double
x
,
double
y
,
double
z
)
{
this
.
x
=
x
;
this
.
x
=
x
;
this
.
y
=
y
;
this
.
y
=
y
;
this
.
z
=
z
;
this
.
z
=
z
;
}
}
public
Point3
()
{
public
Point3
()
{
this
(
0
,
0
,
0
);
this
(
0
,
0
,
0
);
}
}
public
Point3
(
Point
p
)
{
public
Point3
(
Point
p
)
{
x
=
p
.
x
;
x
=
p
.
x
;
y
=
p
.
y
;
y
=
p
.
y
;
z
=
0
;
z
=
0
;
}
}
public
Point3
clone
()
{
public
Point3
(
double
[]
vals
)
{
return
new
Point3
(
x
,
y
,
z
);
this
();
}
if
(
vals
!=
null
)
{
x
=
vals
.
length
>
0
?
vals
[
0
]
:
0
;
public
double
dot
(
Point3
p
)
{
y
=
vals
.
length
>
1
?
vals
[
1
]
:
0
;
return
x
*
p
.
x
+
y
*
p
.
y
+
z
*
p
.
z
;
z
=
vals
.
length
>
2
?
vals
[
2
]
:
0
;
}
}
}
public
Point3
cross
(
Point3
p
)
{
return
new
Point3
(
y
*
p
.
z
-
z
*
p
.
y
,
z
*
p
.
x
-
x
*
p
.
z
,
x
*
p
.
y
-
y
*
p
.
x
);
public
Point3
clone
()
{
}
return
new
Point3
(
x
,
y
,
z
);
}
@Override
public
int
hashCode
()
{
public
double
dot
(
Point3
p
)
{
final
int
prime
=
31
;
return
x
*
p
.
x
+
y
*
p
.
y
+
z
*
p
.
z
;
int
result
=
1
;
}
long
temp
;
temp
=
Double
.
doubleToLongBits
(
x
);
public
Point3
cross
(
Point3
p
)
{
result
=
prime
*
result
+
(
int
)
(
temp
^
(
temp
>>>
32
));
return
new
Point3
(
y
*
p
.
z
-
z
*
p
.
y
,
z
*
p
.
x
-
x
*
p
.
z
,
x
*
p
.
y
-
y
*
p
.
x
);
temp
=
Double
.
doubleToLongBits
(
y
);
}
result
=
prime
*
result
+
(
int
)
(
temp
^
(
temp
>>>
32
));
temp
=
Double
.
doubleToLongBits
(
z
);
@Override
result
=
prime
*
result
+
(
int
)
(
temp
^
(
temp
>>>
32
));
public
int
hashCode
()
{
return
result
;
final
int
prime
=
31
;
}
int
result
=
1
;
long
temp
;
@Override
temp
=
Double
.
doubleToLongBits
(
x
);
public
boolean
equals
(
Object
obj
)
{
result
=
prime
*
result
+
(
int
)
(
temp
^
(
temp
>>>
32
));
if
(
this
==
obj
)
return
true
;
temp
=
Double
.
doubleToLongBits
(
y
);
if
(!(
obj
instanceof
Point3
))
return
false
;
result
=
prime
*
result
+
(
int
)
(
temp
^
(
temp
>>>
32
));
Point3
it
=
(
Point3
)
obj
;
temp
=
Double
.
doubleToLongBits
(
z
);
return
x
==
it
.
x
&&
y
==
it
.
y
&&
z
==
it
.
z
;
result
=
prime
*
result
+
(
int
)
(
temp
^
(
temp
>>>
32
));
}
return
result
;
}
@Override
public
boolean
equals
(
Object
obj
)
{
if
(
this
==
obj
)
return
true
;
if
(!(
obj
instanceof
Point3
))
return
false
;
Point3
it
=
(
Point3
)
obj
;
return
x
==
it
.
x
&&
y
==
it
.
y
&&
z
==
it
.
z
;
}
}
}
modules/java/src/java/Rect.java
View file @
801079e2
...
@@ -2,82 +2,92 @@ package org.opencv;
...
@@ -2,82 +2,92 @@ package org.opencv;
//javadoc:Rect_
//javadoc:Rect_
public
class
Rect
{
public
class
Rect
{
public
int
x
,
y
,
width
,
height
;
public
int
x
,
y
,
width
,
height
;
public
Rect
(
int
x
,
int
y
,
int
width
,
int
height
)
{
public
Rect
(
int
x
,
int
y
,
int
width
,
int
height
)
{
this
.
x
=
x
;
this
.
x
=
x
;
this
.
y
=
y
;
this
.
y
=
y
;
this
.
width
=
width
;
this
.
width
=
width
;
this
.
height
=
height
;
this
.
height
=
height
;
}
}
public
Rect
()
{
public
Rect
()
{
this
(
0
,
0
,
0
,
0
);
this
(
0
,
0
,
0
,
0
);
}
}
public
Rect
(
Point
p1
,
Point
p2
)
{
public
Rect
(
Point
p1
,
Point
p2
)
{
x
=
(
int
)
(
p1
.
x
<
p2
.
x
?
p1
.
x
:
p2
.
x
);
x
=
(
int
)
(
p1
.
x
<
p2
.
x
?
p1
.
x
:
p2
.
x
);
y
=
(
int
)
(
p1
.
y
<
p2
.
y
?
p1
.
y
:
p2
.
y
);
y
=
(
int
)
(
p1
.
y
<
p2
.
y
?
p1
.
y
:
p2
.
y
);
width
=
(
int
)
(
p1
.
x
>
p2
.
x
?
p1
.
x
:
p2
.
x
)
-
x
;
width
=
(
int
)
(
p1
.
x
>
p2
.
x
?
p1
.
x
:
p2
.
x
)
-
x
;
height
=
(
int
)
(
p1
.
y
>
p2
.
y
?
p1
.
y
:
p2
.
y
)
-
y
;
height
=
(
int
)
(
p1
.
y
>
p2
.
y
?
p1
.
y
:
p2
.
y
)
-
y
;
}
}
public
Rect
(
Point
p
,
Size
s
)
{
public
Rect
(
Point
p
,
Size
s
)
{
this
((
int
)
p
.
x
,
(
int
)
p
.
y
,
(
int
)
s
.
width
,
(
int
)
s
.
height
);
this
((
int
)
p
.
x
,
(
int
)
p
.
y
,
(
int
)
s
.
width
,
(
int
)
s
.
height
);
}
}
public
Rect
clone
()
{
public
Rect
(
double
[]
vals
)
{
return
new
Rect
(
x
,
y
,
width
,
height
);
this
();
}
if
(
vals
!=
null
)
{
x
=
vals
.
length
>
0
?
(
int
)
vals
[
0
]
:
0
;
public
Point
tl
()
{
y
=
vals
.
length
>
1
?
(
int
)
vals
[
1
]
:
0
;
return
new
Point
(
x
,
y
);
width
=
vals
.
length
>
2
?
(
int
)
vals
[
2
]
:
0
;
}
height
=
vals
.
length
>
3
?
(
int
)
vals
[
3
]
:
0
;
}
public
Point
br
()
{
}
return
new
Point
(
x
+
width
,
y
+
height
);
}
public
Rect
clone
()
{
return
new
Rect
(
x
,
y
,
width
,
height
);
public
Size
size
()
{
}
return
new
Size
(
width
,
height
);
}
public
Point
tl
()
{
return
new
Point
(
x
,
y
);
public
double
area
()
{
}
return
width
*
height
;
}
public
Point
br
()
{
return
new
Point
(
x
+
width
,
y
+
height
);
public
boolean
contains
(
Point
p
)
{
}
return
x
<=
p
.
x
&&
p
.
x
<
x
+
width
&&
y
<=
p
.
y
&&
p
.
y
<
y
+
height
;
}
public
Size
size
()
{
return
new
Size
(
width
,
height
);
@Override
}
public
int
hashCode
()
{
final
int
prime
=
31
;
public
double
area
()
{
int
result
=
1
;
return
width
*
height
;
long
temp
;
}
temp
=
Double
.
doubleToLongBits
(
height
);
result
=
prime
*
result
+
(
int
)
(
temp
^
(
temp
>>>
32
));
public
boolean
contains
(
Point
p
)
{
temp
=
Double
.
doubleToLongBits
(
width
);
return
x
<=
p
.
x
&&
p
.
x
<
x
+
width
&&
y
<=
p
.
y
&&
p
.
y
<
y
+
height
;
result
=
prime
*
result
+
(
int
)
(
temp
^
(
temp
>>>
32
));
}
temp
=
Double
.
doubleToLongBits
(
x
);
result
=
prime
*
result
+
(
int
)
(
temp
^
(
temp
>>>
32
));
@Override
temp
=
Double
.
doubleToLongBits
(
y
);
public
int
hashCode
()
{
result
=
prime
*
result
+
(
int
)
(
temp
^
(
temp
>>>
32
));
final
int
prime
=
31
;
return
result
;
int
result
=
1
;
}
long
temp
;
temp
=
Double
.
doubleToLongBits
(
height
);
@Override
result
=
prime
*
result
+
(
int
)
(
temp
^
(
temp
>>>
32
));
public
boolean
equals
(
Object
obj
)
{
temp
=
Double
.
doubleToLongBits
(
width
);
if
(
this
==
obj
)
return
true
;
result
=
prime
*
result
+
(
int
)
(
temp
^
(
temp
>>>
32
));
if
(!(
obj
instanceof
Rect
))
return
false
;
temp
=
Double
.
doubleToLongBits
(
x
);
Rect
it
=
(
Rect
)
obj
;
result
=
prime
*
result
+
(
int
)
(
temp
^
(
temp
>>>
32
));
return
x
==
it
.
x
&&
y
==
it
.
y
&&
width
==
it
.
width
&&
height
==
it
.
height
;
temp
=
Double
.
doubleToLongBits
(
y
);
}
result
=
prime
*
result
+
(
int
)
(
temp
^
(
temp
>>>
32
));
return
result
;
@Override
}
public
String
toString
()
{
if
(
this
==
null
)
return
"null"
;
@Override
return
"{"
+
x
+
", "
+
y
+
", "
+
width
+
"x"
+
height
+
"}"
;
public
boolean
equals
(
Object
obj
)
{
}
if
(
this
==
obj
)
return
true
;
if
(!(
obj
instanceof
Rect
))
return
false
;
Rect
it
=
(
Rect
)
obj
;
return
x
==
it
.
x
&&
y
==
it
.
y
&&
width
==
it
.
width
&&
height
==
it
.
height
;
}
@Override
public
String
toString
()
{
if
(
this
==
null
)
return
"null"
;
return
"{"
+
x
+
", "
+
y
+
", "
+
width
+
"x"
+
height
+
"}"
;
}
}
}
modules/java/src/java/RotatedRect.java
View file @
801079e2
...
@@ -2,86 +2,97 @@ package org.opencv;
...
@@ -2,86 +2,97 @@ package org.opencv;
//javadoc:RotatedRect_
//javadoc:RotatedRect_
public
class
RotatedRect
{
public
class
RotatedRect
{
public
Point
center
;
public
Point
center
;
public
Size
size
;
public
Size
size
;
public
double
angle
;
public
double
angle
;
public
RotatedRect
()
{
public
RotatedRect
()
{
this
.
angle
=
0
;
this
.
angle
=
0
;
}
}
public
RotatedRect
(
Point
c
,
Size
s
,
double
a
)
{
public
RotatedRect
(
Point
c
,
Size
s
,
double
a
)
{
this
.
center
=
c
.
clone
();
this
.
center
=
c
.
clone
();
this
.
size
=
s
.
clone
();
this
.
size
=
s
.
clone
();
this
.
angle
=
a
;
this
.
angle
=
a
;
}
}
public
void
points
(
Point
pt
[])
public
RotatedRect
(
double
[]
vals
)
{
{
this
();
double
_angle
=
angle
*
Math
.
PI
/
180.0
;
if
(
vals
!=
null
)
{
double
b
=
(
double
)
Math
.
cos
(
_angle
)*
0.5f
;
center
.
x
=
vals
.
length
>
0
?
(
int
)
vals
[
0
]
:
0
;
double
a
=
(
double
)
Math
.
sin
(
_angle
)*
0.5f
;
center
.
x
=
vals
.
length
>
1
?
(
int
)
vals
[
1
]
:
0
;
size
.
width
=
vals
.
length
>
2
?
(
int
)
vals
[
2
]
:
0
;
pt
[
0
]
=
new
Point
(
size
.
height
=
vals
.
length
>
3
?
(
int
)
vals
[
3
]
:
0
;
center
.
x
-
a
*
size
.
height
-
b
*
size
.
width
,
angle
=
vals
.
length
>
4
?
(
int
)
vals
[
4
]
:
0
;
center
.
y
+
b
*
size
.
height
-
a
*
size
.
width
);
}
}
pt
[
1
]
=
new
Point
(
center
.
x
+
a
*
size
.
height
-
b
*
size
.
width
,
public
void
points
(
Point
pt
[])
center
.
y
-
b
*
size
.
height
-
a
*
size
.
width
);
{
double
_angle
=
angle
*
Math
.
PI
/
180.0
;
pt
[
2
]
=
new
Point
(
double
b
=
(
double
)
Math
.
cos
(
_angle
)*
0.5f
;
2
*
center
.
x
-
pt
[
0
].
x
,
double
a
=
(
double
)
Math
.
sin
(
_angle
)*
0.5f
;
2
*
center
.
y
-
pt
[
0
].
y
);
pt
[
0
]
=
new
Point
(
pt
[
3
]
=
new
Point
(
center
.
x
-
a
*
size
.
height
-
b
*
size
.
width
,
2
*
center
.
x
-
pt
[
1
].
x
,
center
.
y
+
b
*
size
.
height
-
a
*
size
.
width
);
2
*
center
.
y
-
pt
[
1
].
y
);
}
pt
[
1
]
=
new
Point
(
center
.
x
+
a
*
size
.
height
-
b
*
size
.
width
,
public
Rect
boundingRect
()
center
.
y
-
b
*
size
.
height
-
a
*
size
.
width
);
{
Point
pt
[]
=
new
Point
[
4
];
pt
[
2
]
=
new
Point
(
points
(
pt
);
2
*
center
.
x
-
pt
[
0
].
x
,
Rect
r
=
new
Rect
((
int
)
Math
.
floor
(
Math
.
min
(
Math
.
min
(
Math
.
min
(
pt
[
0
].
x
,
pt
[
1
].
x
),
pt
[
2
].
x
),
pt
[
3
].
x
)),
2
*
center
.
y
-
pt
[
0
].
y
);
(
int
)
Math
.
floor
(
Math
.
min
(
Math
.
min
(
Math
.
min
(
pt
[
0
].
y
,
pt
[
1
].
y
),
pt
[
2
].
y
),
pt
[
3
].
y
)),
(
int
)
Math
.
ceil
(
Math
.
max
(
Math
.
max
(
Math
.
max
(
pt
[
0
].
x
,
pt
[
1
].
x
),
pt
[
2
].
x
),
pt
[
3
].
x
)),
pt
[
3
]
=
new
Point
(
(
int
)
Math
.
ceil
(
Math
.
max
(
Math
.
max
(
Math
.
max
(
pt
[
0
].
y
,
pt
[
1
].
y
),
pt
[
2
].
y
),
pt
[
3
].
y
)));
2
*
center
.
x
-
pt
[
1
].
x
,
r
.
width
-=
r
.
x
-
1
;
2
*
center
.
y
-
pt
[
1
].
y
);
r
.
height
-=
r
.
y
-
1
;
}
return
r
;
}
public
Rect
boundingRect
()
{
Point
pt
[]
=
new
Point
[
4
];
public
RotatedRect
clone
()
{
points
(
pt
);
return
new
RotatedRect
(
center
,
size
,
angle
);
Rect
r
=
new
Rect
((
int
)
Math
.
floor
(
Math
.
min
(
Math
.
min
(
Math
.
min
(
pt
[
0
].
x
,
pt
[
1
].
x
),
pt
[
2
].
x
),
pt
[
3
].
x
)),
}
(
int
)
Math
.
floor
(
Math
.
min
(
Math
.
min
(
Math
.
min
(
pt
[
0
].
y
,
pt
[
1
].
y
),
pt
[
2
].
y
),
pt
[
3
].
y
)),
(
int
)
Math
.
ceil
(
Math
.
max
(
Math
.
max
(
Math
.
max
(
pt
[
0
].
x
,
pt
[
1
].
x
),
pt
[
2
].
x
),
pt
[
3
].
x
)),
(
int
)
Math
.
ceil
(
Math
.
max
(
Math
.
max
(
Math
.
max
(
pt
[
0
].
y
,
pt
[
1
].
y
),
pt
[
2
].
y
),
pt
[
3
].
y
)));
@Override
r
.
width
-=
r
.
x
-
1
;
public
int
hashCode
()
{
r
.
height
-=
r
.
y
-
1
;
final
int
prime
=
31
;
return
r
;
int
result
=
1
;
}
long
temp
;
temp
=
Double
.
doubleToLongBits
(
center
.
x
);
result
=
prime
*
result
+
(
int
)
(
temp
^
(
temp
>>>
32
));
public
RotatedRect
clone
()
{
temp
=
Double
.
doubleToLongBits
(
center
.
y
);
return
new
RotatedRect
(
center
,
size
,
angle
);
result
=
prime
*
result
+
(
int
)
(
temp
^
(
temp
>>>
32
));
}
temp
=
Double
.
doubleToLongBits
(
size
.
width
);
result
=
prime
*
result
+
(
int
)
(
temp
^
(
temp
>>>
32
));
temp
=
Double
.
doubleToLongBits
(
size
.
height
);
@Override
result
=
prime
*
result
+
(
int
)
(
temp
^
(
temp
>>>
32
));
public
int
hashCode
()
{
temp
=
Double
.
doubleToLongBits
(
angle
);
final
int
prime
=
31
;
result
=
prime
*
result
+
(
int
)
(
temp
^
(
temp
>>>
32
));
int
result
=
1
;
return
result
;
long
temp
;
}
temp
=
Double
.
doubleToLongBits
(
center
.
x
);
result
=
prime
*
result
+
(
int
)
(
temp
^
(
temp
>>>
32
));
@Override
temp
=
Double
.
doubleToLongBits
(
center
.
y
);
public
boolean
equals
(
Object
obj
)
{
result
=
prime
*
result
+
(
int
)
(
temp
^
(
temp
>>>
32
));
if
(
this
==
obj
)
return
true
;
temp
=
Double
.
doubleToLongBits
(
size
.
width
);
if
(!(
obj
instanceof
RotatedRect
))
return
false
;
result
=
prime
*
result
+
(
int
)
(
temp
^
(
temp
>>>
32
));
RotatedRect
it
=
(
RotatedRect
)
obj
;
temp
=
Double
.
doubleToLongBits
(
size
.
height
);
return
center
.
equals
(
it
.
center
)
&&
size
.
equals
(
it
.
size
)
&&
angle
==
it
.
angle
;
result
=
prime
*
result
+
(
int
)
(
temp
^
(
temp
>>>
32
));
}
temp
=
Double
.
doubleToLongBits
(
angle
);
result
=
prime
*
result
+
(
int
)
(
temp
^
(
temp
>>>
32
));
return
result
;
}
@Override
public
boolean
equals
(
Object
obj
)
{
if
(
this
==
obj
)
return
true
;
if
(!(
obj
instanceof
RotatedRect
))
return
false
;
RotatedRect
it
=
(
RotatedRect
)
obj
;
return
center
.
equals
(
it
.
center
)
&&
size
.
equals
(
it
.
size
)
&&
angle
==
it
.
angle
;
}
}
}
modules/java/src/java/Scalar.java
View file @
801079e2
...
@@ -2,73 +2,82 @@ package org.opencv;
...
@@ -2,73 +2,82 @@ package org.opencv;
//javadoc:Scalar_
//javadoc:Scalar_
public
class
Scalar
{
public
class
Scalar
{
public
double
v0
,
v1
,
v2
,
v3
;
public
Scalar
(
double
v0
,
double
v1
,
double
v2
,
double
v3
)
{
public
double
v0
,
v1
,
v2
,
v3
;
this
.
v0
=
v0
;
this
.
v1
=
v1
;
this
.
v2
=
v2
;
this
.
v3
=
v3
;
}
public
Scalar
(
double
v0
,
double
v1
,
double
v2
)
{
public
Scalar
(
double
v0
,
double
v1
,
double
v2
,
double
v3
)
{
this
(
v0
,
v1
,
v2
,
0
);
this
.
v0
=
v0
;
}
this
.
v1
=
v1
;
this
.
v2
=
v2
;
public
Scalar
(
double
v0
,
double
v1
)
{
this
.
v3
=
v3
;
this
(
v0
,
v1
,
0
,
0
);
}
}
public
Scalar
(
double
v0
)
{
this
(
v0
,
0
,
0
,
0
);
}
public
static
Scalar
all
(
double
v
)
{
return
new
Scalar
(
v
,
v
,
v
,
v
);
}
public
Scalar
clone
()
{
return
new
Scalar
(
v0
,
v1
,
v2
,
v3
);
}
public
Scalar
mul
(
Scalar
it
,
double
scale
)
{
public
Scalar
(
double
v0
,
double
v1
,
double
v2
)
{
return
new
Scalar
(
v0
*
it
.
v0
*
scale
,
v1
*
it
.
v1
*
scale
,
this
(
v0
,
v1
,
v2
,
0
);
v2
*
it
.
v2
*
scale
,
v3
*
it
.
v3
*
scale
);
}
}
public
Scalar
mul
(
Scalar
it
)
{
public
Scalar
(
double
v0
,
double
v1
)
{
return
mul
(
it
,
1
);
this
(
v0
,
v1
,
0
,
0
);
}
}
public
Scalar
conj
()
{
return
new
Scalar
(
v0
,
-
v1
,
-
v2
,
-
v3
);
}
public
boolean
isReal
(
)
{
public
Scalar
(
double
v0
)
{
return
v1
==
0
&&
v2
==
0
&&
v3
==
0
;
this
(
v0
,
0
,
0
,
0
)
;
}
}
@Override
public
Scalar
(
double
[]
vals
)
{
public
int
hashCode
()
{
if
(
vals
!=
null
)
{
final
int
prime
=
31
;
v0
=
vals
.
length
>
0
?
(
int
)
vals
[
0
]
:
0
;
int
result
=
1
;
v1
=
vals
.
length
>
1
?
(
int
)
vals
[
1
]
:
0
;
long
temp
;
v2
=
vals
.
length
>
2
?
(
int
)
vals
[
2
]
:
0
;
temp
=
Double
.
doubleToLongBits
(
v0
);
v3
=
vals
.
length
>
3
?
(
int
)
vals
[
3
]
:
0
;
result
=
prime
*
result
+
(
int
)
(
temp
^
(
temp
>>>
32
));
}
temp
=
Double
.
doubleToLongBits
(
v1
);
}
result
=
prime
*
result
+
(
int
)
(
temp
^
(
temp
>>>
32
));
temp
=
Double
.
doubleToLongBits
(
v2
);
result
=
prime
*
result
+
(
int
)
(
temp
^
(
temp
>>>
32
));
temp
=
Double
.
doubleToLongBits
(
v3
);
result
=
prime
*
result
+
(
int
)
(
temp
^
(
temp
>>>
32
));
return
result
;
}
@Override
public
static
Scalar
all
(
double
v
)
{
public
boolean
equals
(
Object
obj
)
{
return
new
Scalar
(
v
,
v
,
v
,
v
);
if
(
this
==
obj
)
return
true
;
}
if
(!(
obj
instanceof
Scalar
))
return
false
;
Scalar
it
=
(
Scalar
)
obj
;
public
Scalar
clone
()
{
return
v0
==
it
.
v0
&&
v1
==
it
.
v1
&&
v2
==
it
.
v2
&&
v3
==
it
.
v3
;
return
new
Scalar
(
v0
,
v1
,
v2
,
v3
);
}
}
public
Scalar
mul
(
Scalar
it
,
double
scale
)
{
return
new
Scalar
(
v0
*
it
.
v0
*
scale
,
v1
*
it
.
v1
*
scale
,
v2
*
it
.
v2
*
scale
,
v3
*
it
.
v3
*
scale
);
}
public
Scalar
mul
(
Scalar
it
)
{
return
mul
(
it
,
1
);
}
public
Scalar
conj
()
{
return
new
Scalar
(
v0
,
-
v1
,
-
v2
,
-
v3
);
}
public
boolean
isReal
()
{
return
v1
==
0
&&
v2
==
0
&&
v3
==
0
;
}
@Override
public
int
hashCode
()
{
final
int
prime
=
31
;
int
result
=
1
;
long
temp
;
temp
=
Double
.
doubleToLongBits
(
v0
);
result
=
prime
*
result
+
(
int
)
(
temp
^
(
temp
>>>
32
));
temp
=
Double
.
doubleToLongBits
(
v1
);
result
=
prime
*
result
+
(
int
)
(
temp
^
(
temp
>>>
32
));
temp
=
Double
.
doubleToLongBits
(
v2
);
result
=
prime
*
result
+
(
int
)
(
temp
^
(
temp
>>>
32
));
temp
=
Double
.
doubleToLongBits
(
v3
);
result
=
prime
*
result
+
(
int
)
(
temp
^
(
temp
>>>
32
));
return
result
;
}
@Override
public
boolean
equals
(
Object
obj
)
{
if
(
this
==
obj
)
return
true
;
if
(!(
obj
instanceof
Scalar
))
return
false
;
Scalar
it
=
(
Scalar
)
obj
;
return
v0
==
it
.
v0
&&
v1
==
it
.
v1
&&
v2
==
it
.
v2
&&
v3
==
it
.
v3
;
}
}
}
modules/java/src/java/Size.java
View file @
801079e2
...
@@ -3,48 +3,56 @@ package org.opencv;
...
@@ -3,48 +3,56 @@ package org.opencv;
//javadoc:Size_
//javadoc:Size_
public
class
Size
{
public
class
Size
{
public
double
width
,
height
;
public
double
width
,
height
;
public
Size
(
double
width
,
double
height
)
{
public
Size
(
double
width
,
double
height
)
{
this
.
width
=
width
;
this
.
width
=
width
;
this
.
height
=
height
;
this
.
height
=
height
;
}
}
public
Size
()
{
public
Size
()
{
this
(
0
,
0
);
this
(
0
,
0
);
}
}
public
Size
(
Point
p
)
{
public
Size
(
Point
p
)
{
width
=
(
double
)
p
.
x
;
width
=
(
double
)
p
.
x
;
height
=
(
double
)
p
.
y
;
height
=
(
double
)
p
.
y
;
}
}
public
double
area
()
{
public
Size
(
double
[]
vals
)
{
return
width
*
height
;
this
();
}
if
(
vals
!=
null
)
{
width
=
vals
.
length
>
0
?
vals
[
0
]
:
0
;
public
Size
clone
()
{
height
=
vals
.
length
>
1
?
vals
[
1
]
:
0
;
return
new
Size
(
width
,
height
);
}
}
}
@Override
public
double
area
()
{
public
int
hashCode
()
{
return
width
*
height
;
final
int
prime
=
31
;
}
int
result
=
1
;
long
temp
;
public
Size
clone
()
{
temp
=
Double
.
doubleToLongBits
(
height
);
return
new
Size
(
width
,
height
);
result
=
prime
*
result
+
(
int
)
(
temp
^
(
temp
>>>
32
));
}
temp
=
Double
.
doubleToLongBits
(
width
);
result
=
prime
*
result
+
(
int
)
(
temp
^
(
temp
>>>
32
));
@Override
return
result
;
public
int
hashCode
()
{
}
final
int
prime
=
31
;
int
result
=
1
;
@Override
long
temp
;
public
boolean
equals
(
Object
obj
)
{
temp
=
Double
.
doubleToLongBits
(
height
);
if
(
this
==
obj
)
return
true
;
result
=
prime
*
result
+
(
int
)
(
temp
^
(
temp
>>>
32
));
if
(!(
obj
instanceof
Size
))
return
false
;
temp
=
Double
.
doubleToLongBits
(
width
);
Size
it
=
(
Size
)
obj
;
result
=
prime
*
result
+
(
int
)
(
temp
^
(
temp
>>>
32
));
return
width
==
it
.
width
&&
height
==
it
.
height
;
return
result
;
}
}
@Override
public
boolean
equals
(
Object
obj
)
{
if
(
this
==
obj
)
return
true
;
if
(!(
obj
instanceof
Size
))
return
false
;
Size
it
=
(
Size
)
obj
;
return
width
==
it
.
width
&&
height
==
it
.
height
;
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment