add python bindings for numpy

This commit is contained in:
Bechir Braham
2024-03-11 16:05:54 +01:00
parent 25d282717c
commit c4c88c50d1
5 changed files with 49 additions and 2 deletions

View File

@ -1,6 +1,7 @@
#include <cstdint>
#include <filesystem>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include <string>
#include "aare/defs.hpp"
@ -27,10 +28,13 @@ PYBIND11_MODULE(_aare, m) {
py::class_<Frame<uint16_t>>(m, "_Frame16")
.def(py::init<std::byte*, ssize_t, ssize_t>())
.def("get", &Frame<uint16_t>::get)
.def("get_array", &Frame<uint16_t>::get_array)
.def_property_readonly("rows", &Frame<uint16_t>::rows)
.def_property_readonly("cols", &Frame<uint16_t>::cols)
.def_property_readonly("bitdepth", &Frame<uint16_t>::bitdepth);