Skip to content

Commit

Permalink
Fix builds for OpenCV
Browse files Browse the repository at this point in the history
  • Loading branch information
saudet committed Jun 16, 2024
1 parent 0486b03 commit 93103dc
Show file tree
Hide file tree
Showing 13 changed files with 135 additions and 132 deletions.
221 changes: 114 additions & 107 deletions opencv/opencv.patch

Large diffs are not rendered by default.

22 changes: 9 additions & 13 deletions opencv/src/gen/java/org/bytedeco/opencv/global/opencv_core.java
Original file line number Diff line number Diff line change
Expand Up @@ -1237,12 +1237,8 @@ public class opencv_core extends org.bytedeco.opencv.helper.opencv_core {
@Namespace("cv::hal") public static native void magnitude64f(@Const DoublePointer x, @Const DoublePointer y, DoublePointer dst, int n);
@Namespace("cv::hal") public static native void magnitude64f(@Const DoubleBuffer x, @Const DoubleBuffer y, DoubleBuffer dst, int n);
@Namespace("cv::hal") public static native void magnitude64f(@Const double[] x, @Const double[] y, double[] dst, int n);
@Namespace("cv::hal") public static native void polarToCart32f(@Const FloatPointer mag, @Const FloatPointer angle, FloatPointer x, FloatPointer y, int n, @Cast("bool") boolean angleInDegrees);
@Namespace("cv::hal") public static native void polarToCart32f(@Const FloatBuffer mag, @Const FloatBuffer angle, FloatBuffer x, FloatBuffer y, int n, @Cast("bool") boolean angleInDegrees);
@Namespace("cv::hal") public static native void polarToCart32f(@Const float[] mag, @Const float[] angle, float[] x, float[] y, int n, @Cast("bool") boolean angleInDegrees);
@Namespace("cv::hal") public static native void polarToCart64f(@Const DoublePointer mag, @Const DoublePointer angle, DoublePointer x, DoublePointer y, int n, @Cast("bool") boolean angleInDegrees);
@Namespace("cv::hal") public static native void polarToCart64f(@Const DoubleBuffer mag, @Const DoubleBuffer angle, DoubleBuffer x, DoubleBuffer y, int n, @Cast("bool") boolean angleInDegrees);
@Namespace("cv::hal") public static native void polarToCart64f(@Const double[] mag, @Const double[] angle, double[] x, double[] y, int n, @Cast("bool") boolean angleInDegrees);


@Namespace("cv::hal") public static native void sqrt32f(@Const FloatPointer src, FloatPointer dst, int len);
@Namespace("cv::hal") public static native void sqrt32f(@Const FloatBuffer src, FloatBuffer dst, int len);
@Namespace("cv::hal") public static native void sqrt32f(@Const float[] src, float[] dst, int len);
Expand Down Expand Up @@ -1921,7 +1917,7 @@ public class opencv_core extends org.bytedeco.opencv.helper.opencv_core {
@Namespace("cv") public static native @Cast("unsigned") @Name("saturate_cast<unsigned>") int unsignedSaturateCast(@Cast("uchar") byte v);
@Namespace("cv") public static native @Cast("uint64") @Name("saturate_cast<uint64>") long uint64SaturateCast(@Cast("uchar") byte v);
@Namespace("cv") public static native @Cast("int64") @Name("saturate_cast<int64>") long int64SaturateCast(@Cast("uchar") byte v);
@Namespace("cv") public static native @ByVal @Cast("cv::float16_t*") @Name("saturate_cast<cv::float16_t>") hfloat float16SaturateCast(@Cast("uchar") byte v);
@Namespace("cv") public static native @ByVal @Name("saturate_cast<cv::hfloat>") hfloat float16SaturateCast(@Cast("uchar") byte v);
/** \overload */
/** \overload */
@Namespace("cv") public static native @Cast("uchar") @Name("saturate_cast<uchar>") byte ucharSaturateCast(@Cast("ushort") short v);
Expand All @@ -1932,7 +1928,7 @@ public class opencv_core extends org.bytedeco.opencv.helper.opencv_core {
@Namespace("cv") public static native @Cast("unsigned") @Name("saturate_cast<unsigned>") int unsignedSaturateCast(@Cast("ushort") short v);
@Namespace("cv") public static native @Cast("uint64") @Name("saturate_cast<uint64>") long uint64SaturateCast(@Cast("ushort") short v);
@Namespace("cv") public static native @Cast("int64") @Name("saturate_cast<int64>") long int64SaturateCast(@Cast("ushort") short v);
@Namespace("cv") public static native @ByVal @Cast("cv::float16_t*") @Name("saturate_cast<cv::float16_t>") hfloat float16SaturateCast(@Cast("ushort") short v);
@Namespace("cv") public static native @ByVal @Name("saturate_cast<cv::hfloat>") hfloat float16SaturateCast(@Cast("ushort") short v);
/** \overload */
/** \overload */
@Namespace("cv") public static native @Cast("uchar") @Name("saturate_cast<uchar>") byte ucharSaturateCast(@Cast("unsigned") int v);
Expand All @@ -1943,7 +1939,7 @@ public class opencv_core extends org.bytedeco.opencv.helper.opencv_core {
@Namespace("cv") public static native @Cast("unsigned") @Name("saturate_cast<unsigned>") int unsignedSaturateCast(@Cast("unsigned") int v);
@Namespace("cv") public static native @Cast("uint64") @Name("saturate_cast<uint64>") long uint64SaturateCast(@Cast("unsigned") int v);
@Namespace("cv") public static native @Cast("int64") @Name("saturate_cast<int64>") long int64SaturateCast(@Cast("unsigned") int v);
@Namespace("cv") public static native @ByVal @Cast("cv::float16_t*") @Name("saturate_cast<cv::float16_t>") hfloat float16SaturateCast(@Cast("unsigned") int v);
@Namespace("cv") public static native @ByVal @Name("saturate_cast<cv::hfloat>") hfloat float16SaturateCast(@Cast("unsigned") int v);
/** \overload */
/** \overload */
@Namespace("cv") public static native @Cast("uchar") @Name("saturate_cast<uchar>") byte ucharSaturateCast(float v);
Expand All @@ -1954,7 +1950,7 @@ public class opencv_core extends org.bytedeco.opencv.helper.opencv_core {
@Namespace("cv") public static native @Cast("unsigned") @Name("saturate_cast<unsigned>") int unsignedSaturateCast(float v);
@Namespace("cv") public static native @Cast("uint64") @Name("saturate_cast<uint64>") long uint64SaturateCast(float v);
@Namespace("cv") public static native @Cast("int64") @Name("saturate_cast<int64>") long int64SaturateCast(float v);
@Namespace("cv") public static native @ByVal @Cast("cv::float16_t*") @Name("saturate_cast<cv::float16_t>") hfloat float16SaturateCast(float v);
@Namespace("cv") public static native @ByVal @Name("saturate_cast<cv::hfloat>") hfloat float16SaturateCast(float v);
/** \overload */
@Namespace("cv") public static native @Cast("uchar") @Name("saturate_cast<uchar>") byte ucharSaturateCast(double v);
@Namespace("cv") public static native @Cast("schar") @Name("saturate_cast<schar>") byte scharSaturateCast(double v);
Expand All @@ -1964,7 +1960,7 @@ public class opencv_core extends org.bytedeco.opencv.helper.opencv_core {
@Namespace("cv") public static native @Cast("unsigned") @Name("saturate_cast<unsigned>") int unsignedSaturateCast(double v);
@Namespace("cv") public static native @Cast("uint64") @Name("saturate_cast<uint64>") long uint64SaturateCast(double v);
@Namespace("cv") public static native @Cast("int64") @Name("saturate_cast<int64>") long int64SaturateCast(double v);
@Namespace("cv") public static native @ByVal @Cast("cv::float16_t*") @Name("saturate_cast<cv::float16_t>") hfloat float16SaturateCast(double v);
@Namespace("cv") public static native @ByVal @Name("saturate_cast<cv::hfloat>") hfloat float16SaturateCast(double v);
/** \overload */
@Namespace("cv") public static native @Cast("uchar") @Name("saturate_cast<uchar>") byte ucharSaturateCast(@Cast("int64") long v);
@Namespace("cv") public static native @Cast("schar") @Name("saturate_cast<schar>") byte scharSaturateCast(@Cast("int64") long v);
Expand All @@ -1974,7 +1970,7 @@ public class opencv_core extends org.bytedeco.opencv.helper.opencv_core {
@Namespace("cv") public static native @Cast("unsigned") @Name("saturate_cast<unsigned>") int unsignedSaturateCast(@Cast("int64") long v);
@Namespace("cv") public static native @Cast("uint64") @Name("saturate_cast<uint64>") long uint64SaturateCast(@Cast("int64") long v);
@Namespace("cv") public static native @Cast("int64") @Name("saturate_cast<int64>") long int64SaturateCast(@Cast("int64") long v);
@Namespace("cv") public static native @ByVal @Cast("cv::float16_t*") @Name("saturate_cast<cv::float16_t>") hfloat float16SaturateCast(@Cast("int64") long v);
@Namespace("cv") public static native @ByVal @Name("saturate_cast<cv::hfloat>") hfloat float16SaturateCast(@Cast("int64") long v);
/** \overload */
// we intentionally do not clip negative numbers, to make -1 become 0xffffffff etc.

Expand All @@ -1987,7 +1983,7 @@ public class opencv_core extends org.bytedeco.opencv.helper.opencv_core {
@Namespace("cv") public static native @Cast("unsigned") @Name("saturate_cast<unsigned>") int unsignedSaturateCast(@ByVal hfloat v);
@Namespace("cv") public static native @Cast("uint64") @Name("saturate_cast<uint64>") long uint64SaturateCast(@ByVal hfloat v);
@Namespace("cv") public static native @Cast("int64") @Name("saturate_cast<int64>") long int64SaturateCast(@ByVal hfloat v);
@Namespace("cv") public static native @ByVal @Cast("cv::float16_t*") @Name("saturate_cast<cv::float16_t>") hfloat float16SaturateCast(@ByVal hfloat v);
@Namespace("cv") public static native @ByVal @Name("saturate_cast<cv::hfloat>") hfloat float16SaturateCast(@ByVal hfloat v);

// in theory, we could use a LUT for 8u/8s->16f conversion,
// but with hardware support for FP32->FP16 conversion the current approach is preferable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class ClassificationModel extends Model {
return new ClassificationModel((Pointer)this).offsetAddress(i);
}

public ClassificationModel() { super((Pointer)null); allocate(); }
@Deprecated public ClassificationModel() { super((Pointer)null); allocate(); }
@Deprecated private native void allocate();

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class DetectionModel extends Model {
public DetectionModel(@Const @ByRef Net network) { super((Pointer)null); allocate(network); }
private native void allocate(@Const @ByRef Net network);

public DetectionModel() { super((Pointer)null); allocate(); }
@Deprecated public DetectionModel() { super((Pointer)null); allocate(); }
@Deprecated private native void allocate();

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class Model extends Pointer {
return new Model((Pointer)this).offsetAddress(i);
}

public Model() { super((Pointer)null); allocate(); }
@Deprecated public Model() { super((Pointer)null); allocate(); }
@Deprecated private native void allocate();

public Model(@Const @ByRef Model arg0) { super((Pointer)null); allocate(arg0); }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class TextDetectionModel_DB extends TextDetectionModel {
return new TextDetectionModel_DB((Pointer)this).offsetAddress(i);
}

public TextDetectionModel_DB() { super((Pointer)null); allocate(); }
@Deprecated public TextDetectionModel_DB() { super((Pointer)null); allocate(); }
@Deprecated private native void allocate();

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class TextDetectionModel_EAST extends TextDetectionModel {
return new TextDetectionModel_EAST((Pointer)this).offsetAddress(i);
}

public TextDetectionModel_EAST() { super((Pointer)null); allocate(); }
@Deprecated public TextDetectionModel_EAST() { super((Pointer)null); allocate(); }
@Deprecated private native void allocate();

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class TextRecognitionModel extends Model {
return new TextRecognitionModel((Pointer)this).offsetAddress(i);
}

public TextRecognitionModel() { super((Pointer)null); allocate(); }
@Deprecated public TextRecognitionModel() { super((Pointer)null); allocate(); }
@Deprecated private native void allocate();

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public native void matchImagePoints(@ByVal GpuMatVector detectedCorners, @ByVal
public native void generateImage(@ByVal Size outSize, @ByVal GpuMat img, int marginSize/*=0*/, int borderBits/*=1*/);
public native void generateImage(@ByVal Size outSize, @ByVal GpuMat img);

public Board() { super((Pointer)null); allocate(); }
@Deprecated public Board() { super((Pointer)null); allocate(); }
@Deprecated private native void allocate();

@Opaque public static class Impl extends Pointer {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,6 @@ private native void allocate(@Const @ByRef Size size, float squareLength, float
public native @Cast("bool") boolean checkCharucoCornersCollinear(@ByVal UMat charucoIds);
public native @Cast("bool") boolean checkCharucoCornersCollinear(@ByVal GpuMat charucoIds);

public CharucoBoard() { super((Pointer)null); allocate(); }
@Deprecated public CharucoBoard() { super((Pointer)null); allocate(); }
@Deprecated private native void allocate();
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class GraphicalCodeDetector extends Pointer {
return new GraphicalCodeDetector((Pointer)this).offsetAddress(i);
}

public GraphicalCodeDetector() { super((Pointer)null); allocate(); }
@Deprecated public GraphicalCodeDetector() { super((Pointer)null); allocate(); }
@Deprecated private native void allocate();

public GraphicalCodeDetector(@Const @ByRef GraphicalCodeDetector arg0) { super((Pointer)null); allocate(arg0); }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,6 @@ private native void allocate(@Const @ByRef Size size, float markerLength, float
public native float getMarkerLength();
public native float getMarkerSeparation();

public GridBoard() { super((Pointer)null); allocate(); }
@Deprecated public GridBoard() { super((Pointer)null); allocate(); }
@Deprecated private native void allocate();
}
Original file line number Diff line number Diff line change
Expand Up @@ -395,9 +395,9 @@ public void map(InfoMap infoMap) {
.put(new Info("cv::saturate_cast<unsigned>").javaNames("unsignedSaturateCast"))
.put(new Info("cv::saturate_cast<uint64>").javaNames("uint64SaturateCast"))
.put(new Info("cv::saturate_cast<int64>").javaNames("int64SaturateCast"))
.put(new Info("cv::saturate_cast<cv::float16_t>", "saturate_cast<float16_t>").javaNames("float16SaturateCast"))
.put(new Info("cv::saturate_cast<cv::hfloat>", "cv::saturate_cast<cv::float16_t>", "saturate_cast<float16_t>").javaNames("float16SaturateCast"))

.put(new Info("cv::normL2Sqr", "cv::normL1", "cv::seqPopMulti").skip())
.put(new Info("cv::normL2Sqr", "cv::normL1", "cv::seqPopMulti", "cv::hal::polarToCart32f", "cv::hal::polarToCart64f").skip())

.put(new Info("cv::Formatted(cv::Mat&, cv::Formatter*, int*)").javaText(
"public Formatted(@Const @ByRef Mat m, @Const Formatter fmt,\n"
Expand Down

0 comments on commit 93103dc

Please sign in to comment.