Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

add support for disabling anti-aliasing in BitmapBackend #711

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

Open
jonaspleyer wants to merge 4 commits into plotters-rs:master
base: master
Choose a base branch
Loading
from jonaspleyer:aliasing

Conversation

@jonaspleyer
Copy link
Contributor

@jonaspleyer jonaspleyer commented Jan 4, 2026

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();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /