Closed tuzz closed 11 months ago
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()
);
Perfect, thanks! I'll close this now.
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.