Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-export pixel format types when bitmap_backend feature is enabled #377

Closed
Tracked by #380
38 opened this issue Jun 24, 2022 · 2 comments
Closed
Tracked by #380

Re-export pixel format types when bitmap_backend feature is enabled #377

38 opened this issue Jun 24, 2022 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@38
Copy link
Member

38 commented Jun 24, 2022

We need to re-export the pixel format types as well for usability.

See the following question in discussions.

--

Hello,
It's a silly thing but I can't figure out where to find RGBPixel for the bitmap back-end.

Recently, the back-ends were merged into plotters itself. To accommodate for this, I've modded my Cargo.toml as thus:

plotters = { git = "https://github.com/plotters-rs/plotters.git", default_features = false, features = ["line_series", "ttf", "bitmap_backend"] }
#plotters-bitmap = { git = "https://github.com/plotters-rs/plotters-bitmap.git" } # No longer needed.

And in my source file I have:

use plotters::prelude::*;
use plotters_bitmap::bitmap_pixel::RGBPixel;   // <-- This is WRONG.
//use plotters_bitmap::BitMapBackend; // Not needed anymore, is part of the prelude.

The issue is that I can't figure-out the path to RBGPixel now...

Originally posted by @TomDeRybel in #376

@38 38 added enhancement New feature or request good first issue Good for newcomers labels Jun 24, 2022
@FlareFlo
Copy link

Should the Pixel formats be exported under the prelude?

@38
Copy link
Member Author

38 commented Jun 25, 2022

Should the Pixel formats be exported under the prelude?

Yes, I think so, as long as people use it from the prelude, that actually make sense.

This also reminds me it would be nice if we can put all the automatically imported backends under some namespace.

What's your idea on this?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants