MCPcopy Create free account
hub / github.com/colmap/colmap / ArrayFromNormalMap

Function ArrayFromNormalMap

src/pycolmap/mvs/normal_map.cc:19–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17#endif
18
19py::array_t<float> ArrayFromNormalMap(const NormalMap& self) {
20 const std::vector<ssize_t> shape = {static_cast<ssize_t>(self.GetHeight()),
21 static_cast<ssize_t>(self.GetWidth()),
22 static_cast<ssize_t>(self.GetDepth())};
23 py::array_t<float> output(shape);
24 py::buffer_info output_info = output.request();
25 float* output_ptr = reinterpret_cast<float*>(output_info.ptr);
26 std::memcpy(output_ptr, self.GetPtr(), self.GetNumBytes());
27 return output;
28}
29
30NormalMap NormalMapFromArray(py::array_t<float, py::array::c_style> array) {
31 if (array.ndim() != 3) {

Callers

nothing calls this directly

Calls 5

GetHeightMethod · 0.45
GetWidthMethod · 0.45
GetDepthMethod · 0.45
GetPtrMethod · 0.45
GetNumBytesMethod · 0.45

Tested by

no test coverage detected