Mercurial > mxe-octave
annotate src/of-image-1-namespace.patch @ 5892:cb17f5f87a0f
of-image: Cleanup patch.
* src/of-image-1-namespace.patch: Remove unnecessary hunk from patch.
author | Markus Mützel <markus.muetzel@gmx.de> |
---|---|
date | Thu, 26 Aug 2021 17:54:30 +0200 |
parents | 77bfbb7d8094 |
children |
rev | line source |
---|---|
5855
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
1 diff -uNr a/src/bwconncomp.cc b/src/bwconncomp.cc |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
2 --- a/src/bwconncomp.cc 2020-02-02 08:20:08.000000000 -0500 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
3 +++ b/src/bwconncomp.cc 2021-08-20 03:40:55.040903123 -0400 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
4 @@ -30,7 +30,7 @@ |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
5 #include <octave/oct-map.h> |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
6 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
7 #include "connectivity.h" |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
8 -using namespace octave::image; |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
9 +using namespace octave_image; |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
10 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
11 static std::vector<std::vector<octave_idx_type>> |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
12 connected_components (const boolNDArray& BW, const connectivity& conn) |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
13 diff -uNr a/src/bwlabeln.cc b/src/bwlabeln.cc |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
14 --- a/src/bwlabeln.cc 2020-02-02 08:20:08.000000000 -0500 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
15 +++ b/src/bwlabeln.cc 2021-08-20 03:41:02.785032122 -0400 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
16 @@ -32,7 +32,7 @@ |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
17 #define WANTS_OCTAVE_IMAGE_VALUE 1 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
18 #include "octave-wrappers.h" |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
19 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
20 -using namespace octave::image; |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
21 +using namespace octave_image; |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
22 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
23 static union_find |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
24 pre_label (NDArray& L, const connectivity& conn) |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
25 diff -uNr a/src/conndef.cc b/src/conndef.cc |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
26 --- a/src/conndef.cc 2020-02-02 08:20:08.000000000 -0500 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
27 +++ b/src/conndef.cc 2021-08-20 03:41:12.149188253 -0400 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
28 @@ -19,7 +19,7 @@ |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
29 #include "config.h" |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
30 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
31 #include "connectivity.h" |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
32 -using namespace octave::image; |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
33 +using namespace octave_image; |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
34 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
35 // The conndef() function is really really simple and could have easily |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
36 // been a m file (actually it once was, check the hg log if it ever needs |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
37 diff -uNr a/src/connectivity.cc b/src/connectivity.cc |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
38 --- a/src/connectivity.cc 2020-02-02 08:20:08.000000000 -0500 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
39 +++ b/src/connectivity.cc 2021-08-20 03:41:18.001285906 -0400 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
40 @@ -25,7 +25,7 @@ |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
41 #define WANTS_OCTAVE_IMAGE_VALUE 1 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
42 #include "octave-wrappers.h" |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
43 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
44 -using namespace octave::image; |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
45 +using namespace octave_image; |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
46 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
47 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
48 connectivity::connectivity (const boolNDArray& mask_arg) |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
49 @@ -296,7 +296,7 @@ |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
50 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
51 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
52 connectivity |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
53 -octave::image::conndef (const octave_value& _val) |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
54 +octave_image::conndef (const octave_value& _val) |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
55 { |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
56 octave_image::value val (_val); |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
57 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
58 diff -uNr a/src/connectivity.h b/src/connectivity.h |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
59 --- a/src/connectivity.h 2020-02-02 08:20:08.000000000 -0500 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
60 +++ b/src/connectivity.h 2021-08-20 03:41:28.897467898 -0400 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
61 @@ -29,10 +29,8 @@ |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
62 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
63 #include <octave/ov.h> |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
64 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
65 -namespace octave |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
66 +namespace octave_image |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
67 { |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
68 - namespace image |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
69 - { |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
70 class connectivity |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
71 { |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
72 public: |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
73 @@ -89,14 +87,13 @@ |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
74 }; |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
75 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
76 connectivity conndef (const octave_value& val); |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
77 - } |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
78 } |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
79 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
80 // Templated methods |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
81 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
82 template<class T, class P> |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
83 T |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
84 -octave::image::connectivity::create_padded (const T& image, const P& val) const |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
85 +octave_image::connectivity::create_padded (const T& image, const P& val) const |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
86 { |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
87 const octave_idx_type pad_ndims = std::min (mask.ndims (), image.ndims ()); |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
88 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
89 @@ -117,7 +114,7 @@ |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
90 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
91 template<class T> |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
92 void |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
93 -octave::image::connectivity::unpad (T& image) const |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
94 +octave_image::connectivity::unpad (T& image) const |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
95 { |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
96 const octave_idx_type pad_ndims = std::min (mask.ndims (), image.ndims ()); |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
97 const dim_vector padded_size = image.dims (); |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
98 @@ -134,7 +131,7 @@ |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
99 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
100 template<class P> |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
101 P |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
102 -octave::image::connectivity::min_value (void) |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
103 +octave_image::connectivity::min_value (void) |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
104 { |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
105 if (typeid (P) == typeid (bool)) |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
106 return false; |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
107 @@ -144,7 +141,7 @@ |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
108 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
109 template<class T, class P> |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
110 void |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
111 -octave::image::connectivity::set_padding (const dim_vector& size, |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
112 +octave_image::connectivity::set_padding (const dim_vector& size, |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
113 const dim_vector& padded_size, |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
114 T& im, const P& val) |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
115 { |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
116 diff -uNr a/src/imerode.cc b/src/imerode.cc |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
117 --- a/src/imerode.cc 2020-02-02 08:20:08.000000000 -0500 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
118 +++ b/src/imerode.cc 2021-08-20 03:42:06.186092277 -0400 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
119 @@ -32,7 +32,7 @@ |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
120 #define WANTS_OCTAVE_IMAGE_VALUE 1 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
121 #include "octave-wrappers.h" |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
122 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
123 -using namespace octave::image; |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
124 +using namespace octave_image; |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
125 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
126 // How this works: |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
127 // |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
128 diff -uNr a/src/imreconstruct.cc b/src/imreconstruct.cc |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
129 --- a/src/imreconstruct.cc 2020-02-02 08:20:08.000000000 -0500 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
130 +++ b/src/imreconstruct.cc 2021-08-20 03:42:11.690184639 -0400 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
131 @@ -36,7 +36,7 @@ |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
132 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
133 #include "connectivity.h" |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
134 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
135 -using namespace octave::image; |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
136 +using namespace octave_image; |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
137 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
138 #define WANTS_OCTAVE_IMAGE_VALUE 1 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
139 #include "octave-wrappers.h" |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
140 diff -uNr a/src/strel.cc b/src/strel.cc |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
141 --- a/src/strel.cc 2020-02-02 08:20:08.000000000 -0500 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
142 +++ b/src/strel.cc 2021-08-20 03:39:35.059577831 -0400 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
143 @@ -35,7 +35,7 @@ |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
144 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
145 // Expects a @strel object, or a boolean matrix (or something |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
146 // that can be converted into one with bool_matrix_value() |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
147 -octave::image::strel::strel (const octave_value& arg) |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
148 +octave_image::strel::strel (const octave_value& arg) |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
149 { |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
150 octave_value se = arg; |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
151 // We are only creating a strel object here so that we can use |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
152 @@ -105,7 +105,7 @@ |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
153 return; |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
154 } |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
155 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
156 -octave::image::strel::strel (const boolNDArray& nhood, const NDArray& height) |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
157 +octave_image::strel::strel (const boolNDArray& nhood, const NDArray& height) |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
158 : nhood (nhood), height (height) |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
159 { |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
160 ini_ctor (); |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
161 @@ -114,7 +114,7 @@ |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
162 return; |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
163 } |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
164 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
165 -octave::image::strel::strel (const boolNDArray& nhood, const NDArray& height, |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
166 +octave_image::strel::strel (const boolNDArray& nhood, const NDArray& height, |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
167 const Array<octave_idx_type>& origin) |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
168 : nhood (nhood), height (height), origin (origin) |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
169 { |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
170 @@ -125,25 +125,25 @@ |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
171 } |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
172 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
173 boolNDArray |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
174 -octave::image::strel::get_nhood (void) const |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
175 +octave_image::strel::get_nhood (void) const |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
176 { |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
177 return nhood; |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
178 } |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
179 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
180 octave_idx_type |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
181 -octave::image::strel::get_nnz (void) const |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
182 +octave_image::strel::get_nnz (void) const |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
183 { |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
184 return nnz; |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
185 } |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
186 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
187 Array<octave_idx_type> |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
188 -octave::image::strel::get_origin (void) const |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
189 +octave_image::strel::get_origin (void) const |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
190 { |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
191 return origin; |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
192 } |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
193 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
194 -octave::image::strel |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
195 -octave::image::strel::operator () (const octave_idx_type& i) const |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
196 +octave_image::strel |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
197 +octave_image::strel::operator () (const octave_idx_type& i) const |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
198 { |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
199 assert (i >= 0 && i < octave_idx_type (decomposition.size ())); |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
200 return decomposition[i]; |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
201 @@ -151,7 +151,7 @@ |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
202 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
203 // Number of strel elements after decomposition |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
204 octave_idx_type |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
205 -octave::image::strel::numel (void) const |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
206 +octave_image::strel::numel (void) const |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
207 { |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
208 return octave_idx_type (decomposition.size ()); |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
209 } |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
210 @@ -163,8 +163,8 @@ |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
211 // center of the matrix, there will be no change. |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
212 // The reason for this is so that we can keep the origin in matrices with |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
213 // sides with an even length. |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
214 -octave::image::strel |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
215 -octave::image::strel::reflect (void) const |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
216 +octave_image::strel |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
217 +octave_image::strel::reflect (void) const |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
218 { |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
219 boolNDArray ref_nhood (size); |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
220 NDArray ref_height (size); |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
221 @@ -178,11 +178,11 @@ |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
222 for (octave_idx_type dim = 0; dim < ndims; dim++) |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
223 ref_origin(dim) = size(dim) - origin(dim) -1; |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
224 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
225 - return octave::image::strel (ref_nhood, ref_height, ref_origin); |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
226 + return octave_image::strel (ref_nhood, ref_height, ref_origin); |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
227 } |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
228 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
229 void |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
230 -octave::image::strel::set_origin (const Array<octave_idx_type>& sub) |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
231 +octave_image::strel::set_origin (const Array<octave_idx_type>& sub) |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
232 { |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
233 origin = sub; |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
234 validate_origin (); |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
235 @@ -190,7 +190,7 @@ |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
236 } |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
237 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
238 bool |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
239 -octave::image::strel::flat (void) const |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
240 +octave_image::strel::flat (void) const |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
241 { |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
242 bool flat = true; |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
243 if (! height.all_elements_are_zero ()) |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
244 @@ -220,7 +220,7 @@ |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
245 // linear shift is [0 1 11 21 22] |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
246 // The second element is the matching height for each. |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
247 Array<octave_idx_type> |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
248 -octave::image::strel::offsets (const dim_vector& cum_size) const |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
249 +octave_image::strel::offsets (const dim_vector& cum_size) const |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
250 { |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
251 Array<octave_idx_type> sub (dim_vector (ndims, 1), 0); |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
252 Array<octave_idx_type> offsets (dim_vector (nnz, 1)); |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
253 @@ -244,7 +244,7 @@ |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
254 // at coordinates (0,0) of the input matrix and we need enough padding for |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
255 // it. If the shape is "full", then we add the double. |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
256 Array<octave_idx_type> |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
257 -octave::image::strel::pre_pad (const octave_idx_type& mt_ndims, |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
258 +octave_image::strel::pre_pad (const octave_idx_type& mt_ndims, |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
259 const std::string& shape) const |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
260 { |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
261 Array<octave_idx_type> pad (dim_vector (mt_ndims, 1), 0); |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
262 @@ -274,7 +274,7 @@ |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
263 } |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
264 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
265 Array<octave_idx_type> |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
266 -octave::image::strel::post_pad (const octave_idx_type& mt_ndims, |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
267 +octave_image::strel::post_pad (const octave_idx_type& mt_ndims, |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
268 const std::string& shape) const |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
269 { |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
270 Array<octave_idx_type> pad (dim_vector (mt_ndims, 1), 0); |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
271 @@ -304,7 +304,7 @@ |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
272 } |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
273 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
274 void |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
275 -octave::image::strel::ini_ctor () |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
276 +octave_image::strel::ini_ctor () |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
277 { |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
278 size = nhood.dims (); |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
279 ndims = nhood.ndims (); |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
280 @@ -313,7 +313,7 @@ |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
281 } |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
282 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
283 Array<octave_idx_type> |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
284 -octave::image::strel::default_origin () |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
285 +octave_image::strel::default_origin () |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
286 { |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
287 Array<octave_idx_type> origin (dim_vector (ndims, 1)); |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
288 for (octave_idx_type dim = 0; dim < ndims; dim++) |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
289 @@ -323,14 +323,14 @@ |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
290 } |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
291 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
292 void |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
293 -octave::image::strel::end_ctor (void) |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
294 +octave_image::strel::end_ctor (void) |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
295 { |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
296 if (decomposition.empty ()) |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
297 decomposition.push_back (*this); |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
298 } |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
299 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
300 void |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
301 -octave::image::strel::validate_origin (void) |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
302 +octave_image::strel::validate_origin (void) |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
303 { |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
304 assert (ndims == origin.numel ()); |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
305 for (octave_idx_type dim = 0; dim < ndims; dim++) |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
306 diff -uNr a/src/strel.h b/src/strel.h |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
307 --- a/src/strel.h 2020-02-02 08:20:08.000000000 -0500 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
308 +++ b/src/strel.h 2021-08-20 03:40:39.204639691 -0400 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
309 @@ -45,10 +45,8 @@ |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
310 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
311 #include <octave/ov.h> |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
312 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
313 -namespace octave |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
314 +namespace octave_image |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
315 { |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
316 - namespace image |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
317 - { |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
318 class strel |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
319 { |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
320 public: |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
321 @@ -109,14 +107,13 @@ |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
322 void validate_origin (void); |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
323 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
324 }; |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
325 - } |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
326 } |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
327 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
328 // Define it on header or we we need to instantiate it for all |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
329 // possible classes in strel.cc |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
330 template<class P> |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
331 Array<P> |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
332 -octave::image::strel::true_heights (void) const |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
333 +octave_image::strel::true_heights (void) const |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
334 { |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
335 Array<P> true_heights (dim_vector (nnz, 1)); |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
336 for (octave_idx_type ind = 0, found = 0; found < nnz; ind++) |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
337 diff -uNr a/src/watershed.cc b/src/watershed.cc |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
338 --- a/src/watershed.cc 2020-02-02 08:20:08.000000000 -0500 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
339 +++ b/src/watershed.cc 2021-08-20 03:40:18.700299337 -0400 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
340 @@ -26,7 +26,7 @@ |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
341 #include "octave-wrappers.h" |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
342 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
343 #include "connectivity.h" |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
344 -using namespace octave::image; |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
345 +using namespace octave_image; |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
346 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
347 template<class T> |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
348 static boolNDArray |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
349 @@ -297,7 +297,7 @@ |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
350 |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
351 connectivity conn; |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
352 if (nargin > 1) |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
353 - conn = octave::image::conndef (args(1)); |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
354 + conn = octave_image::conndef (args(1)); |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
355 else |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
356 { |
77bfbb7d8094
patches for recent Octave namespace changes
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
357 try |