Closed joe-saronic closed 6 months ago
I like the direction, I'd just have some minor nits about the trait methods (e.g., pixel
-> pixels_f32
and maybe adding pixel_u8
), and the trait implementations (e.g., not sure if implementing for [u8;N]
is good idea (e.g., maybe a thin newtype pattern would be better to avoid accidentally passing the wrong type).
That said, I'll merge this PR, the cleanup can be a separate PR.
Thanks!
Thanks! I would be happy to do the fixes, but it's probably faster if you do. When can I expect the new version to be released?
Also, if you add pixel_u8
, I would vote for it to be optional. The nice thing about only supporting f32
is that I can have random input like RGB with 16 bits for G or something. If I have to convert to u8
first, a lot more information is lost.
I would be happy to do the fixes, but it's probably faster if you do. When can I expect the new version to be released?
I'm having a look right now, if everything goes well soon™️ (~few days).
Thank you!
I just pushed some changes regarding the YUV / RGB buffer handling to master
, feel free to have a look and comment.
I added some comments to the last commit. I like the approach that you took with this. It's got all the functionality I want, but much cleaner.
Version 0.6 has been released. It contains this PR, and some moderate API changes. It should not take more than a few minutes to upgrade to the new API surface. Feel free to file a follow-up PR / bug report if there are issues.
Thanks! I'm already purging much of my code to use the new API.
Ah, the Panics
line was probably an old copy-paste error. Thanks!
You're very welcome.
I recently came across a situation in which I had RGB data encoded in a slightly different format from the one
YuvBuffer
currently expects. The processing already uses a callback internally, so I factored it out into a public trait, with a backwards compatible implementation for[u8; N]
.I also added some implementations for the cases I care about with
u32
data (coming in from acairo
Surface
).Two other tweaks:
YuvBuffer
now checks for evenness of dimensions during construction, not every time it is populatedYuvBuffer