kornelski / rust-rgb

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

New crate file structure. #74

Closed ripytide closed 3 months ago

ripytide commented 3 months ago

This would be invisible to consumers of the crate but it would make work on this crate much easier. This is related to #72 in that everything appears to the consumers at the top level when importing from rgb. i.e use rgb::Grb instead of use rgb::alt::Grb.

My ideal crate structure:

src/lib.rs:

mod rgb;
mod rgba;
#[feature = "grb"]
mod grb;
mod gray;
mod gray_alpha
...

pub use rgb::Rgb;
pub use rgba::Rgba;
#[feature = "grb"]
pub use grb::Grb;
...

src/rgb.rs:

struct Rgb {
...
}

impl Pixel for Rgb {
...
}