FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

add support for disabling anti-aliasing in BitmapBackend by jonaspleyer · Pull Request #711 · plotters-rs/plotters · GitHub

add support for disabling anti-aliasing in BitmapBackend - #711

Open
jonaspleyer wants to merge 4 commits into
plotters-rs:masterfrom
jonaspleyer:aliasing
Open

add support for disabling anti-aliasing in BitmapBackend#711
jonaspleyer wants to merge 4 commits into
plotters-rs:masterfrom
jonaspleyer:aliasing

Conversation

Copy link
Copy Markdown
Contributor

Description

This PR arose from a personal need where I wanted to quickly draw some geometries but they had to be solid of identical color. In this scenario, anti-aliasing is actually undesirable. Since I saw no functionality to disable this, I added it.

The PR does not yet contain any tests. I would love to hear some feedback if this approach is reasonable.
The introduction of a new defaulted method fn use_anti_aliasing(&self) -> bool to the DrawingBackend trait would probably be classified as a minor change by Rust's semver-specs https://doc.rust-lang.org/cargo/reference/semver.html#trait-new-parameter-default thus requiring a minor version bump. However, I am happy to hear any feedback on this.

Example Usage

let (x, y) = ..;
let mut buffer = vec![0u8; x*y*3];
BitMapBackend::with_buffer(&mut buffer, (x, y))
    .anti_aliasing(false)
    .into_drawing_area();

Copy link
Copy Markdown

Could you please fix the clippy warnings and the CI errors? Otherwise looks like fine code

Copy link
Copy Markdown
Contributor Author

The CI errors are due to the build script yeslogic-fontconfig-sys-6.0.0/build.rs:8:48 and are only relevant for the runners on ubuntu. The clippy checks of the CI seemed to pass. What do you mean by fixing them? Did I miss something?

Copy link
Copy Markdown

@jonaspleyer The approach looks good! The project is in a maintenance state right now, so tests would be appreciated to lower a contribution to the sum burden!

(not a maintainer, just aware)

Copy link
Copy Markdown

Following up @jonaspleyer

Copy link
Copy Markdown
Contributor Author

I will check if I can find the time to write some tests. However I am currently very busy and so it might take a while.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL