MCPcopy Create free account
hub / github.com/AdaCompNUS/summit / GetRawDataAsBuffer

Function GetRawDataAsBuffer

PythonAPI/carla/source/libcarla/SensorData.cpp:125–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123
124template <typename T>
125static auto GetRawDataAsBuffer(T &self) {
126 auto *data = reinterpret_cast<unsigned char *>(self.data());
127 auto size = static_cast<Py_ssize_t>(sizeof(typename T::value_type) * self.size());
128#if PY_MAJOR_VERSION >= 3
129 auto *ptr = PyMemoryView_FromMemory(reinterpret_cast<char *>(data), size, PyBUF_READ);
130#else
131 auto *ptr = PyBuffer_FromMemory(data, size);
132#endif
133 return boost::python::object(boost::python::handle<>(ptr));
134}
135
136template <typename T>
137static void ConvertImage(T &self, EColorConverter cc) {

Callers

nothing calls this directly

Calls 2

dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected