Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image_Pixmap().Data pointer? #67

Open
cylopa opened this issue Oct 6, 2020 · 3 comments
Open

Image_Pixmap().Data pointer? #67

cylopa opened this issue Oct 6, 2020 · 3 comments

Comments

@cylopa
Copy link

cylopa commented Oct 6, 2020

I am trying to convert V3d_View contents into a QPixmap object.
Using V3d_View we can Dump contents of the View to an image file. Using ToPixMap we can dump them to an Image_PixMap object. But Image_Pixmap.Data() returns an int? There is also InitWrapper method that takes a pointer as int?

@cylopa
Copy link
Author

cylopa commented Oct 7, 2020

Could Image_Pixmap.Data() return as bytes object?

So we can do something like this:
`
image_pixmap = Image_PixMap()
v3d_view.ToPixMap(image_pixmap, width, height)
data_bytes: bytes = image_pixmap.Data() # Currently returns an int.

q_pixmap = QPixmap()
q_bytearray = QByteArray(data_bytes)
q_pixmap.loadFromData(q_bytearray)
`

@cylopa
Copy link
Author

cylopa commented Oct 8, 2020

Or could it return a memoryview object?

data_bytes: memoryview= image_pixmap.Data()

@trelau
Copy link
Owner

trelau commented Jan 18, 2021

This seems pretty low-level, what are you trying to achieve?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants