Replies: 1 comment
-
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.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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