RTC Toolkit 5.0.0
Loading...
Searching...
No Matches
Namespaces | Macros | Functions
matrixBufferPy.cpp File Reference

Implementation of the embedded Python module for MatrixBuffer classes. More...

#include <rtctk/componentFramework/matrixBuffer.hpp>
#include <rtctk/componentFramework/matrixBufferPy.hpp>
#include <rtctk/config.hpp>
#include <pybind11/embed.h>
#include <pybind11/numpy.h>
#include <pybind11/pybind11.h>
#include <pybind11/stl_bind.h>

Namespaces

namespace  rtctk
 
namespace  rtctk::componentFramework
 

Macros

#define MB(TYPE, NAME)
 

Functions

 rtctk::componentFramework::PYBIND11_EMBEDDED_MODULE (Import_Matrix_Buffer, mod)
 
py::module RTCTK_API rtctk::componentFramework::LoadMatrixBufferPyBinds ()
 Imports the embedded Python module to access supported C++ MatrixBuffer objects.
 

Detailed Description

Implementation of the embedded Python module for MatrixBuffer classes.

Macro Definition Documentation

◆ MB

#define MB ( TYPE,
NAME )
Value:
py::class_<MatrixBuffer<TYPE>>(mod, NAME, py::buffer_protocol()) \
.def_buffer([](MatrixBuffer<TYPE>& mat) -> py::buffer_info { \
return py::buffer_info(mat.data(), \
sizeof(TYPE), \
py::format_descriptor<TYPE>::format(), \
2, \
{mat.GetNrows(), mat.GetNcols()}, \
{sizeof(TYPE) * mat.GetNcols(), sizeof(TYPE)}); \
});
A buffer class representing 2D matrix data.
Definition matrixBuffer.hpp:28