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
Currently, this method takes a mutable slice, but it does not need to if the Image is used as the source.
For my use case, I do not have mutable ownership of the source image because I am using the same source image across multiple threads. I am therefore having to unsafely cast the immutable slice to a mutable slice to adhere to the interface:
Please would you be able to change the interface so that from_slice_u8 can be called with an immutable slice, or provide an alternative method for this? Thank you for maintaining a very useful crate.
The text was updated successfully, but these errors were encountered:
tuzz
changed the title
Allow passing an immutable slice to fast_image_resize::from_slice_u8
Allow passing an immutable slice to Image::from_slice_u8
Dec 5, 2023
Image is optional helper. It is mainly useful to create a destination image. Resizer::resize() accepts &DynamicImageView.
You can create DynamicImageView directly from immutable slice:
let source_view = DynamicImageView::U8x4(ImageView::from_buffer(width, height, slice_u8).unwrap());
Currently, this method takes a mutable slice, but it does not need to if the Image is used as the source.
For my use case, I do not have mutable ownership of the source image because I am using the same source image across multiple threads. I am therefore having to unsafely cast the immutable slice to a mutable slice to adhere to the interface:
Please would you be able to change the interface so that
from_slice_u8
can be called with an immutable slice, or provide an alternative method for this? Thank you for maintaining a very useful crate.The text was updated successfully, but these errors were encountered: