Closed ripytide closed 2 months ago
Also mentioned in https://github.com/kornelski/rust-rgb/issues/39#issuecomment-835298062
The only issue is that bytemuck's syntax is more verbose, since cast_slice()
etc are not trait methods, but standalone functions in the bytemuck crate.
I don't see the utility of the
ComponentBytes
andAsPixels
traits compared to a user simply usingbytemuck
'scast_slice()
andcast_slice_mut()
methods. This could easily be achieved by optionally implementingbytemuck::Pod
for all the pixel structs. Then a user could enable that crate-feature and usebytemuck
to do conversions as they need.In addition, having an crate-local implementation has had soundness flaws in the past in #35 so removing it would reduce that risk.