Skip to content

Commit 6ec6675

Browse files
vrabaudNanQin555
authored andcommitted
Rename Mat::clone binding because it is used in Emscripten.
This is in emscripten 3.1.71 and above, cf emscripten-core/emscripten#22734 There was a temptative fix upstream to no avail: emscripten-core/emscripten#23132
1 parent bb6ea7d commit 6ec6675

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

modules/js/src/core_bindings.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ EMSCRIPTEN_BINDINGS(binding_utils)
524524
.function("colRange", select_overload<Mat(int, int)const>(&cv::Mat::colRange))
525525
.function("colRange", select_overload<Mat(const Range&)const>(&cv::Mat::colRange))
526526
.function("step1", select_overload<size_t(int)const>(&cv::Mat::step1))
527-
.function("clone", select_overload<Mat()const>(&cv::Mat::clone))
527+
.function("mat_clone", select_overload<Mat()const>(&cv::Mat::clone))
528528
.function("depth", select_overload<int()const>(&cv::Mat::depth))
529529
.function("col", select_overload<Mat(int)const>(&cv::Mat::col))
530530
.function("dot", select_overload<double(const Mat&, const Mat&)>(&binding_utils::matDot))

modules/js/test/test_mat.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ QUnit.test('test_mat_creation', function(assert) {
173173
// clone
174174
{
175175
let mat = cv.Mat.ones(5, 5, cv.CV_8UC1);
176-
let mat2 = mat.clone();
176+
let mat2 = mat.mat_clone();
177177

178178
assert.equal(mat.channels, mat2.channels);
179179
assert.equal(mat.size().height, mat2.size().height);

0 commit comments

Comments
 (0)