kornelski / rust-rgb

struct RGB for sharing pixels between crates
https://lib.rs/rgb
MIT License
97 stars 19 forks source link

More inherent trait impls #91

Closed ripytide closed 2 months ago

ripytide commented 2 months ago

Fleshes out the macro in formats/mod.rs to implement all of the traits on the pixel types that are in v0.8 the only ones I've left out are: bytemuck traits as they will be added in a separate module which can be enabled optionally (I'll make another PR for this) and FromIterator which is not a valid implementation as FromIterator is not supposed to panic which it will do in v0.8 (this means I'll add it in the legacy module when I get around to that PR).

It also adds an extra Div and DivAssign impl which were missing from v0.8 for some reason so I though I'd add them for consistency with the other ops traits.