Replies: 1 comment 4 replies
-
I'm not sure that function would be a good fit, but perhaps we could add a these two functions like in the image crate: https://docs.rs/image/latest/image/struct.ImageBuffer.html#method.from_vec (but shared_vector in the name). @ogoffart what do you think? |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi I'm writing an image gallery where the images are the same size but sometimes in landscape, sometimes in portrait.
Basically the idea is to only create a
SharedPixelBuffer
at the initialization and then directly change the data depending on the image to display. The issue is when the orientation changes, AFAIK I then have to re create aSharedPixelBuffer
, even though the data size has not changed.A work around I have tested is adding a swap_width_height function to
SharedPixelBuffer
like so :Was wondering if such a function would be a good addition or if there's another way of going about it.
Beta Was this translation helpful? Give feedback.
All reactions