gp-97 / generative

Generative arts library in Rust
Apache License 2.0
21 stars 1 forks source link

Consider using the RGBA type for the color pixels. #10

Open joseluis opened 3 years ago

joseluis commented 3 years ago

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.

gp-97 commented 3 years ago

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.

joseluis commented 3 years ago

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.

gp-97 commented 3 years ago

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