-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Is it possible to add the ability to pass an iterator into the encoder (without having an effect on performance)?
I tried looking through the code but it was a bit too complex for me.
Why I ask is that in case you have BGR data, you currently have to convert it beforehand.
Which means going through everything just to convert it,
it's very fast though, but I would imagine it being faster if it could be done when the data is actually being encoded.
Here's an example of BGR to RGB:
pub fn bgr_to_rgb(b: &mut [u8]) {
// swap R<->B to convert BGR->RGB
b.chunks_exact_mut(3).for_each(|l| l.swap(0, 2));
}Now if we could pass an iterator the swap could be done on-the-fly which might be more cache friendly as well.
Thoughts on this?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request