diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e1f9154a70..7a982914fc5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ + * Map `std::vector >` for `CCheckerDetector.getListColorChecker()` ([issue bytedeco/javacpp#571](https://github.com/bytedeco/javacpp/issues/571)) * Include missing `opencv2/mcc/ccm.hpp` header file in presets for OpenCV ([discussion bytedeco/javacpp#568](https://github.com/bytedeco/javacpp/discussions/568)) * Fix a few incorrectly mapped instances of `std::unordered_map` for PyTorch ([issue #1164](https://github.com/bytedeco/javacpp-presets/issues/1164)) * Migrate builds for Leptonica and Tesseract to CMake ([issue #1163](https://github.com/bytedeco/javacpp-presets/issues/1163)) diff --git a/opencv/src/gen/java/org/bytedeco/opencv/global/opencv_mcc.java b/opencv/src/gen/java/org/bytedeco/opencv/global/opencv_mcc.java index 4103baf6a40..ad642382725 100644 --- a/opencv/src/gen/java/org/bytedeco/opencv/global/opencv_mcc.java +++ b/opencv/src/gen/java/org/bytedeco/opencv/global/opencv_mcc.java @@ -4,6 +4,7 @@ import org.bytedeco.opencv.opencv_mcc.*; +import org.bytedeco.javacpp.annotation.Index; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; @@ -32,6 +33,9 @@ public class opencv_mcc extends org.bytedeco.opencv.presets.opencv_mcc { static { Loader.load(); } +// Targeting ../opencv_mcc/CCheckerVector.java + + // Parsed from // This file is part of OpenCV project. diff --git a/opencv/src/gen/java/org/bytedeco/opencv/opencv_mcc/CChecker.java b/opencv/src/gen/java/org/bytedeco/opencv/opencv_mcc/CChecker.java index 87e2450f788..41b644d9c7e 100644 --- a/opencv/src/gen/java/org/bytedeco/opencv/opencv_mcc/CChecker.java +++ b/opencv/src/gen/java/org/bytedeco/opencv/opencv_mcc/CChecker.java @@ -2,6 +2,7 @@ package org.bytedeco.opencv.opencv_mcc; +import org.bytedeco.javacpp.annotation.Index; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; diff --git a/opencv/src/gen/java/org/bytedeco/opencv/opencv_mcc/CCheckerDetector.java b/opencv/src/gen/java/org/bytedeco/opencv/opencv_mcc/CCheckerDetector.java index dc01e6c608a..be39c3614d9 100644 --- a/opencv/src/gen/java/org/bytedeco/opencv/opencv_mcc/CCheckerDetector.java +++ b/opencv/src/gen/java/org/bytedeco/opencv/opencv_mcc/CCheckerDetector.java @@ -2,6 +2,7 @@ package org.bytedeco.opencv.opencv_mcc; +import org.bytedeco.javacpp.annotation.Index; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; @@ -137,6 +138,7 @@ public class CCheckerDetector extends Algorithm { /** \brief Get the list of all detected colorcheckers * @return checkers vector of colorcheckers */ + public native @ByVal CCheckerVector getListColorChecker(); /** \brief Returns the implementation of the CCheckerDetector. * diff --git a/opencv/src/gen/java/org/bytedeco/opencv/opencv_mcc/CCheckerDraw.java b/opencv/src/gen/java/org/bytedeco/opencv/opencv_mcc/CCheckerDraw.java index d7771b241d1..94ee32b0f71 100644 --- a/opencv/src/gen/java/org/bytedeco/opencv/opencv_mcc/CCheckerDraw.java +++ b/opencv/src/gen/java/org/bytedeco/opencv/opencv_mcc/CCheckerDraw.java @@ -2,6 +2,7 @@ package org.bytedeco.opencv.opencv_mcc; +import org.bytedeco.javacpp.annotation.Index; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; diff --git a/opencv/src/gen/java/org/bytedeco/opencv/opencv_mcc/CCheckerVector.java b/opencv/src/gen/java/org/bytedeco/opencv/opencv_mcc/CCheckerVector.java new file mode 100644 index 00000000000..e239bd0b8a9 --- /dev/null +++ b/opencv/src/gen/java/org/bytedeco/opencv/opencv_mcc/CCheckerVector.java @@ -0,0 +1,101 @@ +// Targeted by JavaCPP version 1.5.8-SNAPSHOT: DO NOT EDIT THIS FILE + +package org.bytedeco.opencv.opencv_mcc; + +import org.bytedeco.javacpp.annotation.Index; +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.bytedeco.javacpp.presets.javacpp.*; +import static org.bytedeco.openblas.global.openblas_nolapack.*; +import static org.bytedeco.openblas.global.openblas.*; +import org.bytedeco.opencv.opencv_core.*; +import static org.bytedeco.opencv.global.opencv_core.*; +import org.bytedeco.opencv.opencv_imgproc.*; +import static org.bytedeco.opencv.global.opencv_imgproc.*; +import static org.bytedeco.opencv.global.opencv_imgcodecs.*; +import org.bytedeco.opencv.opencv_videoio.*; +import static org.bytedeco.opencv.global.opencv_videoio.*; +import org.bytedeco.opencv.opencv_highgui.*; +import static org.bytedeco.opencv.global.opencv_highgui.*; +import org.bytedeco.opencv.opencv_flann.*; +import static org.bytedeco.opencv.global.opencv_flann.*; +import org.bytedeco.opencv.opencv_features2d.*; +import static org.bytedeco.opencv.global.opencv_features2d.*; +import org.bytedeco.opencv.opencv_calib3d.*; +import static org.bytedeco.opencv.global.opencv_calib3d.*; +import org.bytedeco.opencv.opencv_dnn.*; +import static org.bytedeco.opencv.global.opencv_dnn.*; + +import static org.bytedeco.opencv.global.opencv_mcc.*; + +@Name("std::vector >") @Properties(inherit = org.bytedeco.opencv.presets.opencv_mcc.class) +public class CCheckerVector extends Pointer { + static { Loader.load(); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public CCheckerVector(Pointer p) { super(p); } + public CCheckerVector(CChecker value) { this(1); put(0, value); } + public CCheckerVector(CChecker ... array) { this(array.length); put(array); } + public CCheckerVector() { allocate(); } + public CCheckerVector(long n) { allocate(n); } + private native void allocate(); + private native void allocate(@Cast("size_t") long n); + public native @Name("operator =") @ByRef CCheckerVector put(@ByRef CCheckerVector x); + + public boolean empty() { return size() == 0; } + public native long size(); + public void clear() { resize(0); } + public native void resize(@Cast("size_t") long n); + + @Index(function = "at") public native @Ptr CChecker get(@Cast("size_t") long i); + public native CCheckerVector put(@Cast("size_t") long i, CChecker value); + + public native @ByVal Iterator insert(@ByVal Iterator pos, @Ptr CChecker value); + public native @ByVal Iterator erase(@ByVal Iterator pos); + public native @ByVal Iterator begin(); + public native @ByVal Iterator end(); + @NoOffset @Name("iterator") public static class Iterator extends Pointer { + public Iterator(Pointer p) { super(p); } + public Iterator() { } + + public native @Name("operator ++") @ByRef Iterator increment(); + public native @Name("operator ==") boolean equals(@ByRef Iterator it); + public native @Name("operator *") @Ptr CChecker get(); + } + + public CChecker[] get() { + CChecker[] array = new CChecker[size() < Integer.MAX_VALUE ? (int)size() : Integer.MAX_VALUE]; + for (int i = 0; i < array.length; i++) { + array[i] = get(i); + } + return array; + } + @Override public String toString() { + return java.util.Arrays.toString(get()); + } + + public CChecker pop_back() { + long size = size(); + CChecker value = get(size - 1); + resize(size - 1); + return value; + } + public CCheckerVector push_back(CChecker value) { + long size = size(); + resize(size + 1); + return put(size, value); + } + public CCheckerVector put(CChecker value) { + if (size() != 1) { resize(1); } + return put(0, value); + } + public CCheckerVector put(CChecker ... array) { + if (size() != array.length) { resize(array.length); } + for (int i = 0; i < array.length; i++) { + put(i, array[i]); + } + return this; + } +} + diff --git a/opencv/src/gen/java/org/bytedeco/opencv/opencv_mcc/ColorCorrectionModel.java b/opencv/src/gen/java/org/bytedeco/opencv/opencv_mcc/ColorCorrectionModel.java index 93f66082aeb..feb6abe18a5 100644 --- a/opencv/src/gen/java/org/bytedeco/opencv/opencv_mcc/ColorCorrectionModel.java +++ b/opencv/src/gen/java/org/bytedeco/opencv/opencv_mcc/ColorCorrectionModel.java @@ -2,6 +2,7 @@ package org.bytedeco.opencv.opencv_mcc; +import org.bytedeco.javacpp.annotation.Index; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; diff --git a/opencv/src/gen/java/org/bytedeco/opencv/opencv_mcc/DetectorParameters.java b/opencv/src/gen/java/org/bytedeco/opencv/opencv_mcc/DetectorParameters.java index 21bd0d81810..50bc3dcc098 100644 --- a/opencv/src/gen/java/org/bytedeco/opencv/opencv_mcc/DetectorParameters.java +++ b/opencv/src/gen/java/org/bytedeco/opencv/opencv_mcc/DetectorParameters.java @@ -2,6 +2,7 @@ package org.bytedeco.opencv.opencv_mcc; +import org.bytedeco.javacpp.annotation.Index; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; diff --git a/opencv/src/main/java/org/bytedeco/opencv/presets/opencv_mcc.java b/opencv/src/main/java/org/bytedeco/opencv/presets/opencv_mcc.java index 46e42b2d2ed..2d1dd2f34df 100644 --- a/opencv/src/main/java/org/bytedeco/opencv/presets/opencv_mcc.java +++ b/opencv/src/main/java/org/bytedeco/opencv/presets/opencv_mcc.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Samuel Audet + * Copyright (C) 2020-2022 Samuel Audet * * Licensed either under the Apache License, Version 2.0, or (at your option) * under the terms of the GNU General Public License as published by @@ -44,7 +44,9 @@ ) public class opencv_mcc implements InfoMapper { @Override public void map(InfoMap infoMap) { - + infoMap.put(new Info().javaText("import org.bytedeco.javacpp.annotation.Index;")) + .put(new Info("cv::Ptr ").annotations("@Ptr").valueTypes("CChecker")) + .put(new Info("std::vector >").pointerTypes("CCheckerVector").define()); } }