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
I am using the PySide6 library and end up with a QImage. I would like to get the raw data of this image into a Matrix in Julia and the best approach to do that seems to involve obtaining the pointer to the image in memory and then doing an unsafe_wrap in Julia. However, I have no clue how to get the pointer from Python to a Julia Ptr{T} type. Currently, in Julia I have this object: PyObject <memory at 0x0000016112C022C0> and want a Ptr{Float64}(...)
This is similar to #868 but this should not be a void pointer and it seems that ctypes does not support c_float_p which would be the type of my raw image data. There might be some way to do this with ctypes still but is there any way to do this without an external library? Any help would be appreciated, thanks!
The text was updated successfully, but these errors were encountered:
Closing this issue as it's more of a Python-library usage question than a PyCall issue per se. You might ask about it on Julia Discourse if you can't figure it out.
Hm didn't think to look at the Python options, been a bit stuck in Julia-land. In case anyone else runs into this you can use the numpy function below to take a pointer in python and get a numpy array.
I am using the PySide6 library and end up with a QImage. I would like to get the raw data of this image into a Matrix in Julia and the best approach to do that seems to involve obtaining the pointer to the image in memory and then doing an
unsafe_wrap
in Julia. However, I have no clue how to get the pointer from Python to a JuliaPtr{T}
type. Currently, in Julia I have this object:PyObject <memory at 0x0000016112C022C0>
and want a Ptr{Float64}(...)This is similar to #868 but this should not be a void pointer and it seems that ctypes does not support c_float_p which would be the type of my raw image data. There might be some way to do this with ctypes still but is there any way to do this without an external library? Any help would be appreciated, thanks!
The text was updated successfully, but these errors were encountered: