File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 88%eigen_typemaps(Vec3)
99
1010%include <aliceVision/sfmData/Observation.i>
11+
12+ // We don't want to have a direct access to rgb
13+ // It's easier to wrap it around a Vec3
14+ // As it's already binded to numpy
15+ %ignore aliceVision::sfmData::Landmark::rgb;
16+
17+ // Add new swig only C++ code
18+ %extend aliceVision::sfmData::Landmark {
19+
20+ // From RgbColor to Vec3
21+ Vec3 getRgb () const {
22+ Vec3 ret;
23+
24+ ret.x () = $self->rgb .r ();
25+ ret.y () = $self->rgb .g ();
26+ ret.z () = $self->rgb .b ();
27+
28+ return ret;
29+ }
30+
31+ // From Vec3 to RgbColor
32+ void setRgb (Vec3 value) {
33+ $self->rgb .r () = value.x ();
34+ $self->rgb .g () = value.y ();
35+ $self->rgb .b () = value.z ();
36+ }
37+
38+ // If the user asks for the rgb property
39+ // It is not a direct access to the rgb
40+ // variable but a getter/setter
41+ %pythoncode %{
42+ rgb = property (getRgb, setRgb)
43+ %}
44+ }
45+
1146%include <aliceVision/sfmData/Landmark.hpp>
1247
1348%{
You can’t perform that action at this time.
0 commit comments