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
fa5a6bfa
Commit
fa5a6bfa
authored
Apr 09, 2018
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11251 from mshabunin:add-runtime-version
parents
0d9c6374
d2cff38d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
8 deletions
+50
-8
utility.hpp
modules/core/include/opencv2/core/utility.hpp
+17
-0
core+Core.jcode.in
modules/core/misc/java/src/java/core+Core.jcode.in
+8
-8
CoreTest.java
modules/core/misc/java/test/CoreTest.java
+7
-0
system.cpp
modules/core/src/system.cpp
+8
-0
test_misc.cpp
modules/core/test/test_misc.cpp
+10
-0
No files found.
modules/core/include/opencv2/core/utility.hpp
View file @
fa5a6bfa
...
...
@@ -247,6 +247,23 @@ architecture.
*/
CV_EXPORTS_W
const
String
&
getBuildInformation
();
/** @brief Returns library version string
For example "3.4.1-dev".
@sa getMajorVersion, getMinorVersion, getRevisionVersion
*/
CV_EXPORTS_W
String
getVersionString
();
/** @brief Returns major library version */
CV_EXPORTS_W
int
getVersionMajor
();
/** @brief Returns minor library version */
CV_EXPORTS_W
int
getVersionMinor
();
/** @brief Returns revision field of the library version */
CV_EXPORTS_W
int
getVersionRevision
();
/** @brief Returns the number of ticks.
The function returns the number of ticks after the certain event (for example, when the machine was
...
...
modules/core/misc/java/src/java/core+Core.jcode.in
View file @
fa5a6bfa
// these constants are wrapped inside functions to prevent inlining
private static String getVersion() { return "@OPENCV_VERSION@"; }
private static String getNativeLibraryName() { return "opencv_java@OPENCV_VERSION_MAJOR@@OPENCV_VERSION_MINOR@@OPENCV_VERSION_PATCH@"; }
private static int getVersionMajor() { return @OPENCV_VERSION_MAJOR@; }
private static int getVersionMinor() { return @OPENCV_VERSION_MINOR@; }
private static int getVersionRevision() { return @OPENCV_VERSION_PATCH@; }
private static String getVersionStatus() { return "@OPENCV_VERSION_STATUS@"; }
private static int getVersionMajor
J
() { return @OPENCV_VERSION_MAJOR@; }
private static int getVersionMinor
J
() { return @OPENCV_VERSION_MINOR@; }
private static int getVersionRevision
J
() { return @OPENCV_VERSION_PATCH@; }
private static String getVersionStatus
J
() { return "@OPENCV_VERSION_STATUS@"; }
public static final String VERSION = getVersion();
public static final String NATIVE_LIBRARY_NAME = getNativeLibraryName();
public static final int VERSION_MAJOR = getVersionMajor();
public static final int VERSION_MINOR = getVersionMinor();
public static final int VERSION_REVISION = getVersionRevision();
public static final String VERSION_STATUS = getVersionStatus();
public static final int VERSION_MAJOR = getVersionMajor
J
();
public static final int VERSION_MINOR = getVersionMinor
J
();
public static final int VERSION_REVISION = getVersionRevision
J
();
public static final String VERSION_STATUS = getVersionStatus
J
();
modules/core/misc/java/test/CoreTest.java
View file @
fa5a6bfa
...
...
@@ -2048,4 +2048,11 @@ public class CoreTest extends OpenCVTestCase {
assertEquals
(
5
f
,
val2
);
}
public
void
testVersion
()
{
assertEquals
(
Core
.
VERSION_MAJOR
,
Core
.
getVersionMajor
());
assertEquals
(
Core
.
VERSION_MINOR
,
Core
.
getVersionMinor
());
assertEquals
(
Core
.
VERSION_REVISION
,
Core
.
getVersionRevision
());
assertEquals
(
Core
.
VERSION
,
Core
.
getVersionString
());
}
}
modules/core/src/system.cpp
View file @
fa5a6bfa
...
...
@@ -745,6 +745,14 @@ const String& getBuildInformation()
return
build_info
;
}
String
getVersionString
()
{
return
String
(
CV_VERSION
);
}
int
getVersionMajor
()
{
return
CV_VERSION_MAJOR
;
}
int
getVersionMinor
()
{
return
CV_VERSION_MINOR
;
}
int
getVersionRevision
()
{
return
CV_VERSION_REVISION
;
}
String
format
(
const
char
*
fmt
,
...
)
{
AutoBuffer
<
char
,
1024
>
buf
;
...
...
modules/core/test/test_misc.cpp
View file @
fa5a6bfa
...
...
@@ -189,4 +189,14 @@ TEST(Core_Parallel, propagate_exceptions)
},
cv
::
Exception
);
}
TEST
(
Core_Version
,
consistency
)
{
// this test verifies that OpenCV version loaded in runtime
// is the same this test has been built with
EXPECT_EQ
(
CV_VERSION_MAJOR
,
cv
::
getVersionMajor
());
EXPECT_EQ
(
CV_VERSION_MINOR
,
cv
::
getVersionMinor
());
EXPECT_EQ
(
CV_VERSION_REVISION
,
cv
::
getVersionRevision
());
EXPECT_EQ
(
String
(
CV_VERSION
),
cv
::
getVersionString
());
}
}}
// namespace
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