| 17 | #endif |
| 18 | |
| 19 | py::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 | |
| 30 | NormalMap NormalMapFromArray(py::array_t<float, py::array::c_style> array) { |
| 31 | if (array.ndim() != 3) { |
nothing calls this directly
no test coverage detected