Replies: 2 comments 3 replies
-
The best would be to avoid conversion altogether. (ie: trying to always operate with a SharedPixelBuffer. But there might be optimizations to do in slint/internal/core/graphics/image.rs Lines 129 to 139 in df7657d Maybe Vec::from(pixel_slice.as_pixels()) and would be more optimized in debug mode. |
Beta Was this translation helpful? Give feedback.
-
convert_into_slint_image() does two things: (1) convert into a rgba8 image It would be interesting to know how long step (1) takes. Perhaps there's a way to make it so that the decoder creates rgba8 right away and so that this step vanishes. For (2) - if it turns out to be costly - we would need a way adopt a Vec's data. That would require changing the SharedVector internals to allow for an indirection that we typically don't need. Perhaps another option that might work with today's APIs would be to use image-rs lower level APIs to create a Reader, determine dimensions, allocate a SharedPixelBuffer and decode directly into it. Not sure if that's always possible or at what other cost this comes. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently I'm using code similar to
In debug build, jpg image 5184x3495(~18 million pixels) which weight is 19.1 MB loads in ~1.1 second
In release build it takes lower amount of time
Is there any way to decrease convert time between formats especially in debug builds?
Beta Was this translation helpful? Give feedback.
All reactions