generative icon indicating copy to clipboard operation
generative copied to clipboard

Consider using the RGBA type for the color pixels.

Open joseluis opened this issue 4 years ago • 3 comments

The rgb crate allows no-copy high-level interoperability. Its RGBA type implements the From and Into traits from/to a tuple of 4 values like the ones used right now.

It would make this crate much easier to use together with other graphic crates that uses other pixel color representations.

joseluis avatar Apr 30 '21 10:04 joseluis

Hey @joseluis thanks for suggestion. The reason why I am using tuples right now is that it is just a temporary workaround. I was waiting for photon_rs library to make their RGBA struct public, which they did in their yesterday's release. I am taking a couple of days off and will work upon the changes afterwards. Also if this rgb crate is better suited, I would be more than happy to use it instead.

gp-97 avatar Apr 30 '21 11:04 gp-97

Ok I see. Although their Rgba structure is much less versatile for inter-op.

It may still be useful to use the rgb::RGBA type at least for the outside API, since it wouldn't add any additional computational or memory cost, and wouldn't increase compilation times either.

joseluis avatar Apr 30 '21 11:04 joseluis

Yeah, thats logical. I will surely look into it.

gp-97 avatar Apr 30 '21 11:04 gp-97