Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
saudet committed Jan 11, 2024
1 parent 75db09b commit a3a8957
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 47 deletions.
18 changes: 9 additions & 9 deletions opencv/src/gen/java/org/bytedeco/opencv/global/opencv_core.java
Original file line number Diff line number Diff line change
Expand Up @@ -12225,6 +12225,15 @@ storage is built in memory as a hierarchy of file nodes (see FileNode)
* \relates cv::FileStorage
* \{ */

@Namespace("cv") public static native void write(@ByRef FileStorage fs, int value);

@Namespace("cv") public static native void write(@ByRef FileStorage fs, float value);

@Namespace("cv") public static native void write(@ByRef FileStorage fs, double value);

@Namespace("cv") public static native void write(@ByRef FileStorage fs, @Str BytePointer value);
@Namespace("cv") public static native void write(@ByRef FileStorage fs, @Str String value);

@Namespace("cv") public static native void write(@ByRef FileStorage fs, @Const @ByRef Point value);

@Namespace("cv") public static native void write(@ByRef FileStorage fs, @Const @ByRef Point2f value);
Expand Down Expand Up @@ -12259,15 +12268,6 @@ storage is built in memory as a hierarchy of file nodes (see FileNode)

@Namespace("cv") public static native void write(@ByRef FileStorage fs, @Const @ByRef Scalar value);

@Namespace("cv") public static native void write(@ByRef FileStorage fs, int value);

@Namespace("cv") public static native void write(@ByRef FileStorage fs, float value);

@Namespace("cv") public static native void write(@ByRef FileStorage fs, double value);

@Namespace("cv") public static native void write(@ByRef FileStorage fs, @Str BytePointer value);
@Namespace("cv") public static native void write(@ByRef FileStorage fs, @Str String value);

@Namespace("cv") public static native void write(@ByRef FileStorage fs, @Const @ByRef Range r );

@Namespace("cv") public static native void write(@ByRef FileStorage fs, @Str BytePointer name, @Const @ByRef Range r );
Expand Down
65 changes: 27 additions & 38 deletions opencv/src/main/java/org/bytedeco/opencv/presets/opencv_core.java
Original file line number Diff line number Diff line change
Expand Up @@ -425,48 +425,37 @@ public void map(InfoMap infoMap) {
.put(new Info("cv::read<int>(const cv::FileNode&, cv::Complex<int>&, const cv::Complex<int>&)").skip())
.put(new Info("cv::read<_Tp,std>(const cv::FileNode&, _Tp&, const _Tp&)").skip()) // Really template<typename _Tp, typename std::enable_if< std::is_enum<_Tp>::value >::type* = nullptr> read(...)

// Without this info, Algorithm.read will be mapped to cv::read
.put(new Info("cv::Algorithm::read")
);

for (String c: new String[] { "cv::Point_", "cv::Point3_", "cv::Size_", "cv::Complex", "cv::Rect_", "cv::Scalar_" }) {
for (String t : new String[]{"int", "float", "double"}) {
if (c.equals("cv::Complex") && t.equals("int")) continue;
infoMap
.put(new Info(
"cv::write<" + c + "<" + t + "> >(cv::FileStorage&, const cv::String&, const _Tp&)",
"cv::write<" + c + "<" + t + "> >(cv::FileStorage&, const cv::String&, const " + c + "<" + t + ">&)"
).define())
.put(new Info(
"cv::write<" + c + "<" + t + "> >(cv::FileStorage&, const _Tp&)",
"cv::write<" + c + "<" + t + "> >(cv::FileStorage&, const " + c + "<" + t + ">&)"
).define())
;
// Without this info, Algorithm.read() gets mapped to cv::read
.put(new Info("cv::Algorithm::read"));

for (String c : new String[] {"int", "float", "double", "cv::String"}) {
infoMap.put(new Info("cv::write<" + c + ">(cv::FileStorage&, const _Tp&)",
"cv::write<" + c + ">(cv::FileStorage&, const " + c + "&)").define());
}

for (String c : new String[] {"cv::Point_", "cv::Point3_", "cv::Size_", "cv::Complex", "cv::Rect_", "cv::Scalar_"}) {
for (String t : new String[] {"int", "float", "double"}) {
if (c.equals("cv::Complex") && t.equals("int")) {
continue;
}
infoMap.put(new Info("cv::write<" + c + "<" + t + "> >(cv::FileStorage&, const cv::String&, const _Tp&)",
"cv::write<" + c + "<" + t + "> >(cv::FileStorage&, const cv::String&, const " + c + "<" + t + ">&)",
"cv::write<" + c + "<" + t + "> >(cv::FileStorage&, const _Tp&)",
"cv::write<" + c + "<" + t + "> >(cv::FileStorage&, const " + c + "<" + t + ">&)").define());
}
for (String c: new String[] { "int", "float", "double", "cv::String" }) {
infoMap.put(new Info(
"cv::write<" + c + ">(cv::FileStorage&, const _Tp&)",
"cv::write<" + c + ">(cv::FileStorage&, const " + c + "&)"
).define());
}
for (String c: infoMap.keySet().toArray(new String[0])) {
if (c.startsWith("std::vector<")) {
String arg = c.substring(12, c.length() - 1);
infoMap
.put(new Info(
"cv::write<" + arg + (arg.endsWith(">") ? " " : "") + ">(cv::FileStorage&, const std::vector<_Tp>&)",
"cv::write<" + arg + (arg.endsWith(">") ? " " : "") + ">(cv::FileStorage&, const " + c + "&)",

"cv::write<" + arg + (arg.endsWith(">") ? " " : "") + ">(cv::FileStorage&, const cv::String&, const std::vector<_Tp>&)",
"cv::write<" + arg + (arg.endsWith(">") ? " " : "") + ">(cv::FileStorage&, const cv::String&, const " + c + "&)",

"cv::read<" + arg + (arg.endsWith(">") ? " " : "") + ">(const cv::FileNode&, std::vector<_Tp>&, const std::vector<_Tp>&)",
"cv::read<" + arg + (arg.endsWith(">") ? " " : "") + ">(const cv::FileNode&, " + c + "&, const " + c + "&)"
).define());
}
}

for (String c : infoMap.keySet().toArray(new String[0])) {
if (c.startsWith("std::vector<")) {
c = c.substring(12, c.length() - 1);
infoMap.put(new Info("cv::write<" + c + (c.endsWith(">") ? " " : "") + ">(cv::FileStorage&, const std::vector<_Tp>&)",
"cv::write<" + c + (c.endsWith(">") ? " " : "") + ">(cv::FileStorage&, const " + c + "&)",
"cv::write<" + c + (c.endsWith(">") ? " " : "") + ">(cv::FileStorage&, const cv::String&, const std::vector<_Tp>&)",
"cv::write<" + c + (c.endsWith(">") ? " " : "") + ">(cv::FileStorage&, const cv::String&, const " + c + "&)",
"cv::read<" + c + (c.endsWith(">") ? " " : "") + ">(const cv::FileNode&, std::vector<_Tp>&, const std::vector<_Tp>&)",
"cv::read<" + c + (c.endsWith(">") ? " " : "") + ">(const cv::FileNode&, " + c + "&, const " + c + "&)").define());
}
}
}

public static class Functor extends FunctionPointer {
Expand Down

0 comments on commit a3a8957

Please sign in to comment.