You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I am trying to wrap a small library into a python module, but I am struggling to understand how to wrap array pointers.
The function in question being void decodeSector(u8 channel, bool largeSamples, const u8 *input, s16 *output); where input is the pointer to a incoming byte array, and output is the pointer to the receiving array. Now, since input is read only I am pretty sure I can just use pybind11::bytes and cast to a byte pointer, but I am at a loss for the outgoing array. So what is the ideal approach for a situation like this?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
So I am trying to wrap a small library into a python module, but I am struggling to understand how to wrap array pointers.
The function in question being
void decodeSector(u8 channel, bool largeSamples, const u8 *input, s16 *output);
where input is the pointer to a incoming byte array, and output is the pointer to the receiving array. Now, since input is read only I am pretty sure I can just use pybind11::bytes and cast to a byte pointer, but I am at a loss for the outgoing array. So what is the ideal approach for a situation like this?Beta Was this translation helpful? Give feedback.
All reactions