From 6f1b4840624ee11e13a1f362f00f174d1c3f8614 Mon Sep 17 00:00:00 2001 From: Samuel Audet Date: Mon, 4 Mar 2019 00:47:00 +0900 Subject: [PATCH 1/4] Update README.md file for after modularization --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index ae120708699..62f0df68980 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ JavaCPP Presets Introduction ------------ -The JavaCPP Presets module contains Java configuration and interface classes for widely used C/C++ libraries. The configuration files in the `org.bytedeco.javacpp.presets` package are used by the `Parser` to create from C/C++ header files the Java interface files targeting the `org.bytedeco.javacpp` package, which is turn are used by the `Generator` and the native C++ compiler to produce the required JNI libraries. Moreover, helper classes make their functionality easier to use on the Java platform, including Android. +The JavaCPP Presets modules contain Java configuration and interface classes for widely used C/C++ libraries. The configuration files in the `org.bytedeco..presets` packages are used by the `Parser` to create from C/C++ header files the Java interface files targeting the `org.bytedeco.` packages, which is turn are used by the `Generator` and the native C++ compiler to produce the required JNI libraries. Moreover, helper classes make their functionality easier to use on the Java platform, including Android. Please refer to the wiki page for more information about how to [create new presets](https://github.com/bytedeco/javacpp-presets/wiki/Create-New-Presets). Since additional documentation is currently lacking, please also feel free to ask questions on [the mailing list](http://groups.google.com/group/javacpp-project). @@ -22,7 +22,7 @@ We can also have everything downloaded and installed automatically with: * Maven (inside the `pom.xml` file) ```xml - org.bytedeco.javacpp-presets + org.bytedeco ${moduleName}-platform ${moduleVersion}-1.4.4 @@ -31,20 +31,20 @@ We can also have everything downloaded and installed automatically with: * Gradle (inside the `build.gradle` file) ```groovy dependencies { - compile group: 'org.bytedeco.javacpp-presets', name: moduleName + '-platform', version: moduleVersion + '-1.4.4' + compile group: 'org.bytedeco', name: moduleName + '-platform', version: moduleVersion + '-1.4.4' } ``` * Leiningen (inside the `project.clj` file) ```clojure :dependencies [ - [~(symbol (str "org.bytedeco.javacpp-presets/" moduleName "-platform")) ~(str moduleVersion "-1.4.4")] + [~(symbol (str "org.bytedeco/" moduleName "-platform")) ~(str moduleVersion "-1.4.4")] ] ``` * sbt (inside the `build.sbt` file) ```scala - libraryDependencies += "org.bytedeco.javacpp-presets" % moduleName + "-platform" % moduleVersion + "-1.4.4" + libraryDependencies += "org.bytedeco" % moduleName + "-platform" % moduleVersion + "-1.4.4" ``` where the `moduleName` and `moduleVersion` variables correspond to the desired module. This downloads binaries for all platforms, but to get binaries for only one platform we can set the `javacpp.platform` system property (via the `-D` command line option) to something like `android-arm`, `linux-x86_64`, `macosx-x86_64`, `windows-x86_64`, etc. Another option available for Scala users is [sbt-javacpp](https://github.com/bytedeco/sbt-javacpp). @@ -61,7 +61,7 @@ To use the JavaCPP Presets, you will need to download and install the following Further, in the case of Android, the JavaCPP Presets also rely on: - * Android SDK API 14 or newer http://developer.android.com/sdk/ + * Android SDK API 21 or newer http://developer.android.com/sdk/ Manual Installation @@ -78,14 +78,14 @@ Eclipse (Java SE 7 or newer): 1. Navigate to Project > Properties > Java Build Path > Libraries and click "Add External JARs...". 2. Locate the JAR files, select them, and click OK. -IntelliJ IDEA (Android 4.0 or newer): +IntelliJ IDEA (Android 5.0 or newer): 1. Follow the instructions on this page: http://developer.android.com/training/basics/firstapp/ 2. Copy all the JAR files into the `app/libs` subdirectory. 3. Navigate to File > Project Structure > app > Dependencies, click `+`, and select "2 File dependency". 4. Select all the JAR files from the `libs` subdirectory. -After that, we can access almost transparently the corresponding C/C++ APIs through the interface classes found in the `org.bytedeco.javacpp` package. Indeed, the `Parser` translates the code comments from the C/C++ header files into the Java interface files, (almost) ready to be consumed by Javadoc. However, since their translation still leaves to be desired, one may wish to refer to the original documentation pages. For instance, the ones for OpenCV and FFmpeg can be found online at: +After that, we can access almost transparently the corresponding C/C++ APIs through the interface classes found in the `org.bytedeco.` packages. Indeed, the `Parser` translates the code comments from the C/C++ header files into the Java interface files, (almost) ready to be consumed by Javadoc. However, since their translation still leaves to be desired, one may wish to refer to the original documentation pages. For instance, the ones for OpenCV and FFmpeg can be found online at: * [OpenCV documentation](http://docs.opencv.org/master/) * [FFmpeg documentation](http://ffmpeg.org/doxygen/trunk/) @@ -165,7 +165,7 @@ $ mvn install --projects ../opencv/platform,../ffmpeg/platform,etc. -Djavacpp.pl Running the scripts allows us to install easily the native libraries on multiple platforms, but additional software is required: * A recent version of Linux, Mac OS X, or Windows with MSYS and Visual Studio - * Android NDK r7 or newer http://developer.android.com/ndk/downloads/ (required only for Android builds) + * Android NDK r18 or newer http://developer.android.com/ndk/downloads/ (required only for Android builds) With the above in working order, the scripts get launched automatically as part of the Maven build lifecycle, but we can also manually execute ```bash From f442c104f49fc4e1d499ab3bb6f4cd6f1798bf83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Guillemet?= Date: Mon, 11 Mar 2019 18:51:27 +0100 Subject: [PATCH 2/4] Upgrade some int to long to allow Mat > 2^31 --- .../gen/java/org/bytedeco/opencv/opencv_core/Mat.java | 2 +- .../gen/java/org/bytedeco/opencv/opencv_core/UMat.java | 2 +- .../org/bytedeco/opencv/opencv_core/AbstractArray.java | 8 ++++---- .../org/bytedeco/opencv/opencv_core/AbstractCvMat.java | 4 ++-- .../bytedeco/opencv/opencv_core/AbstractIplImage.java | 4 ++-- .../org/bytedeco/opencv/opencv_core/AbstractMat.java | 10 +++++----- .../java/org/bytedeco/opencv/opencv_core/CvArr.java | 4 ++-- .../java/org/bytedeco/opencv/presets/opencv_core.java | 4 ++-- 8 files changed, 19 insertions(+), 19 deletions(-) diff --git a/opencv/src/gen/java/org/bytedeco/opencv/opencv_core/Mat.java b/opencv/src/gen/java/org/bytedeco/opencv/opencv_core/Mat.java index 54e230f2bb3..221f862a5d9 100644 --- a/opencv/src/gen/java/org/bytedeco/opencv/opencv_core/Mat.java +++ b/opencv/src/gen/java/org/bytedeco/opencv/opencv_core/Mat.java @@ -1597,5 +1597,5 @@ void operator ()(Pixel &pixel, const int * position) { public native @ByVal Size size(); @MemberGetter public native int size(int i); @MemberGetter public native long step(); - @MemberGetter public native int step(int i); + @MemberGetter public native long step(int i); } diff --git a/opencv/src/gen/java/org/bytedeco/opencv/opencv_core/UMat.java b/opencv/src/gen/java/org/bytedeco/opencv/opencv_core/UMat.java index dc6ca0de87e..ac46b14e3b1 100644 --- a/opencv/src/gen/java/org/bytedeco/opencv/opencv_core/UMat.java +++ b/opencv/src/gen/java/org/bytedeco/opencv/opencv_core/UMat.java @@ -298,5 +298,5 @@ public class UMat extends Pointer { public native @ByVal Size size(); @MemberGetter public native int size(int i); @MemberGetter public native long step(); - @MemberGetter public native int step(int i); + @MemberGetter public native long step(int i); } diff --git a/opencv/src/main/java/org/bytedeco/opencv/opencv_core/AbstractArray.java b/opencv/src/main/java/org/bytedeco/opencv/opencv_core/AbstractArray.java index 25142f9fe3c..75062cbdae1 100644 --- a/opencv/src/main/java/org/bytedeco/opencv/opencv_core/AbstractArray.java +++ b/opencv/src/main/java/org/bytedeco/opencv/opencv_core/AbstractArray.java @@ -25,9 +25,9 @@ public abstract class AbstractArray extends Pointer implements Indexable { public abstract int arrayWidth(); public abstract int arrayHeight(); public abstract IplROI arrayROI(); - public abstract int arraySize(); + public abstract long arraySize(); public abstract BytePointer arrayData(); - public abstract int arrayStep(); + public abstract long arrayStep(); /** @return {@code createBuffer(0)} */ public B createBuffer() { @@ -36,7 +36,7 @@ public B createBuffer() { /** @return {@link #arrayData()} wrapped in a {@link Buffer} of appropriate type starting at given index */ public B createBuffer(int index) { BytePointer ptr = arrayData(); - int size = arraySize(); + long size = arraySize(); switch (arrayDepth()) { case IPL_DEPTH_8U: case IPL_DEPTH_8S: return (B)ptr.position(index).capacity(size).asBuffer(); @@ -57,7 +57,7 @@ public I createIndexer() { } @Override public I createIndexer(boolean direct) { BytePointer ptr = arrayData(); - int size = arraySize(); + long size = arraySize(); long[] sizes = { arrayHeight(), arrayWidth(), arrayChannels() }; long[] strides = { arrayStep(), arrayChannels(), 1 }; switch (arrayDepth()) { diff --git a/opencv/src/main/java/org/bytedeco/opencv/opencv_core/AbstractCvMat.java b/opencv/src/main/java/org/bytedeco/opencv/opencv_core/AbstractCvMat.java index c75e240c82e..8db9efed9e8 100644 --- a/opencv/src/main/java/org/bytedeco/opencv/opencv_core/AbstractCvMat.java +++ b/opencv/src/main/java/org/bytedeco/opencv/opencv_core/AbstractCvMat.java @@ -203,9 +203,9 @@ public int size() { @Override public int arrayWidth() { return cols(); } @Override public int arrayHeight() { return rows(); } @Override public IplROI arrayROI() { return null; } - @Override public int arraySize() { return size(); } + @Override public long arraySize() { return size(); } @Override public BytePointer arrayData() { return data_ptr(); } - @Override public int arrayStep() { return step(); } + @Override public long arrayStep() { return step(); } /** @see #createBuffer() */ @Deprecated public void reset() { diff --git a/opencv/src/main/java/org/bytedeco/opencv/opencv_core/AbstractIplImage.java b/opencv/src/main/java/org/bytedeco/opencv/opencv_core/AbstractIplImage.java index 891bcd78047..9d16682dec7 100644 --- a/opencv/src/main/java/org/bytedeco/opencv/opencv_core/AbstractIplImage.java +++ b/opencv/src/main/java/org/bytedeco/opencv/opencv_core/AbstractIplImage.java @@ -168,9 +168,9 @@ protected static class HeaderReleaseDeallocator extends IplImage implements Deal @Override public int arrayWidth() { return width(); } @Override public int arrayHeight() { return height(); } @Override public IplROI arrayROI() { return roi(); } - @Override public int arraySize() { return imageSize(); } + @Override public long arraySize() { return imageSize(); } @Override public BytePointer arrayData() { return imageData(); } - @Override public int arrayStep() { return widthStep(); } + @Override public long arrayStep() { return widthStep(); } public CvMat asCvMat() { CvMat mat = new CvMat(); diff --git a/opencv/src/main/java/org/bytedeco/opencv/opencv_core/AbstractMat.java b/opencv/src/main/java/org/bytedeco/opencv/opencv_core/AbstractMat.java index 94dc28262ae..e9080376bd7 100644 --- a/opencv/src/main/java/org/bytedeco/opencv/opencv_core/AbstractMat.java +++ b/opencv/src/main/java/org/bytedeco/opencv/opencv_core/AbstractMat.java @@ -19,7 +19,7 @@ public abstract class AbstractMat extends AbstractArray { public abstract int cols(); public abstract BytePointer data(); public abstract int size(int i); - public abstract int step(int i); + public abstract long step(int i); public abstract int dims(); public abstract long elemSize1(); @@ -42,15 +42,15 @@ public abstract class AbstractMat extends AbstractArray { @Override public int arrayWidth() { return cols(); } @Override public int arrayHeight() { return rows(); } @Override public IplROI arrayROI() { return null; } - @Override public int arraySize() { return step(0)*size(0); } + @Override public long arraySize() { return step(0)*size(0); } @Override public BytePointer arrayData() { return data(); } - @Override public int arrayStep() { return step(0); } + @Override public long arrayStep() { return step(0); } public static final Mat EMPTY = null; @Override public I createIndexer(boolean direct) { BytePointer ptr = arrayData(); - int size = arraySize(); + long size = arraySize(); int dims = dims(); int depth = depth(); long elemSize = elemSize1(); @@ -60,7 +60,7 @@ public abstract class AbstractMat extends AbstractArray { for (int i=0; i").pointerTypes("CvMatDefaultDeleter")) .put(new Info("std::initializer_list", "_InputArray::KindFlag").skip()) From 35e270932488d7d1b9a30522d837a9f316028a80 Mon Sep 17 00:00:00 2001 From: Samuel Audet Date: Tue, 12 Mar 2019 13:29:06 +0900 Subject: [PATCH 3/4] Revert "Update README.md file for after modularization" --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 62f0df68980..ae120708699 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ JavaCPP Presets Introduction ------------ -The JavaCPP Presets modules contain Java configuration and interface classes for widely used C/C++ libraries. The configuration files in the `org.bytedeco..presets` packages are used by the `Parser` to create from C/C++ header files the Java interface files targeting the `org.bytedeco.` packages, which is turn are used by the `Generator` and the native C++ compiler to produce the required JNI libraries. Moreover, helper classes make their functionality easier to use on the Java platform, including Android. +The JavaCPP Presets module contains Java configuration and interface classes for widely used C/C++ libraries. The configuration files in the `org.bytedeco.javacpp.presets` package are used by the `Parser` to create from C/C++ header files the Java interface files targeting the `org.bytedeco.javacpp` package, which is turn are used by the `Generator` and the native C++ compiler to produce the required JNI libraries. Moreover, helper classes make their functionality easier to use on the Java platform, including Android. Please refer to the wiki page for more information about how to [create new presets](https://github.com/bytedeco/javacpp-presets/wiki/Create-New-Presets). Since additional documentation is currently lacking, please also feel free to ask questions on [the mailing list](http://groups.google.com/group/javacpp-project). @@ -22,7 +22,7 @@ We can also have everything downloaded and installed automatically with: * Maven (inside the `pom.xml` file) ```xml - org.bytedeco + org.bytedeco.javacpp-presets ${moduleName}-platform ${moduleVersion}-1.4.4 @@ -31,20 +31,20 @@ We can also have everything downloaded and installed automatically with: * Gradle (inside the `build.gradle` file) ```groovy dependencies { - compile group: 'org.bytedeco', name: moduleName + '-platform', version: moduleVersion + '-1.4.4' + compile group: 'org.bytedeco.javacpp-presets', name: moduleName + '-platform', version: moduleVersion + '-1.4.4' } ``` * Leiningen (inside the `project.clj` file) ```clojure :dependencies [ - [~(symbol (str "org.bytedeco/" moduleName "-platform")) ~(str moduleVersion "-1.4.4")] + [~(symbol (str "org.bytedeco.javacpp-presets/" moduleName "-platform")) ~(str moduleVersion "-1.4.4")] ] ``` * sbt (inside the `build.sbt` file) ```scala - libraryDependencies += "org.bytedeco" % moduleName + "-platform" % moduleVersion + "-1.4.4" + libraryDependencies += "org.bytedeco.javacpp-presets" % moduleName + "-platform" % moduleVersion + "-1.4.4" ``` where the `moduleName` and `moduleVersion` variables correspond to the desired module. This downloads binaries for all platforms, but to get binaries for only one platform we can set the `javacpp.platform` system property (via the `-D` command line option) to something like `android-arm`, `linux-x86_64`, `macosx-x86_64`, `windows-x86_64`, etc. Another option available for Scala users is [sbt-javacpp](https://github.com/bytedeco/sbt-javacpp). @@ -61,7 +61,7 @@ To use the JavaCPP Presets, you will need to download and install the following Further, in the case of Android, the JavaCPP Presets also rely on: - * Android SDK API 21 or newer http://developer.android.com/sdk/ + * Android SDK API 14 or newer http://developer.android.com/sdk/ Manual Installation @@ -78,14 +78,14 @@ Eclipse (Java SE 7 or newer): 1. Navigate to Project > Properties > Java Build Path > Libraries and click "Add External JARs...". 2. Locate the JAR files, select them, and click OK. -IntelliJ IDEA (Android 5.0 or newer): +IntelliJ IDEA (Android 4.0 or newer): 1. Follow the instructions on this page: http://developer.android.com/training/basics/firstapp/ 2. Copy all the JAR files into the `app/libs` subdirectory. 3. Navigate to File > Project Structure > app > Dependencies, click `+`, and select "2 File dependency". 4. Select all the JAR files from the `libs` subdirectory. -After that, we can access almost transparently the corresponding C/C++ APIs through the interface classes found in the `org.bytedeco.` packages. Indeed, the `Parser` translates the code comments from the C/C++ header files into the Java interface files, (almost) ready to be consumed by Javadoc. However, since their translation still leaves to be desired, one may wish to refer to the original documentation pages. For instance, the ones for OpenCV and FFmpeg can be found online at: +After that, we can access almost transparently the corresponding C/C++ APIs through the interface classes found in the `org.bytedeco.javacpp` package. Indeed, the `Parser` translates the code comments from the C/C++ header files into the Java interface files, (almost) ready to be consumed by Javadoc. However, since their translation still leaves to be desired, one may wish to refer to the original documentation pages. For instance, the ones for OpenCV and FFmpeg can be found online at: * [OpenCV documentation](http://docs.opencv.org/master/) * [FFmpeg documentation](http://ffmpeg.org/doxygen/trunk/) @@ -165,7 +165,7 @@ $ mvn install --projects ../opencv/platform,../ffmpeg/platform,etc. -Djavacpp.pl Running the scripts allows us to install easily the native libraries on multiple platforms, but additional software is required: * A recent version of Linux, Mac OS X, or Windows with MSYS and Visual Studio - * Android NDK r18 or newer http://developer.android.com/ndk/downloads/ (required only for Android builds) + * Android NDK r7 or newer http://developer.android.com/ndk/downloads/ (required only for Android builds) With the above in working order, the scripts get launched automatically as part of the Maven build lifecycle, but we can also manually execute ```bash From 6ae070e1ffcd041b298695225b3e53c304fcec36 Mon Sep 17 00:00:00 2001 From: Samuel Audet Date: Tue, 12 Mar 2019 13:29:51 +0900 Subject: [PATCH 4/4] Fix formatting --- .../src/main/java/org/bytedeco/opencv/opencv_core/CvArr.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opencv/src/main/java/org/bytedeco/opencv/opencv_core/CvArr.java b/opencv/src/main/java/org/bytedeco/opencv/opencv_core/CvArr.java index 05b34184cbe..cd7e6419d26 100644 --- a/opencv/src/main/java/org/bytedeco/opencv/opencv_core/CvArr.java +++ b/opencv/src/main/java/org/bytedeco/opencv/opencv_core/CvArr.java @@ -15,7 +15,7 @@ @Override public int arrayWidth() { throw new UnsupportedOperationException(); } @Override public int arrayHeight() { throw new UnsupportedOperationException(); } @Override public IplROI arrayROI() { throw new UnsupportedOperationException(); } - @Override public long arraySize() { throw new UnsupportedOperationException(); } + @Override public long arraySize() { throw new UnsupportedOperationException(); } @Override public BytePointer arrayData() { throw new UnsupportedOperationException(); } - @Override public long arrayStep() { throw new UnsupportedOperationException(); } + @Override public long arrayStep() { throw new UnsupportedOperationException(); } }