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

Feature: Add a new constructor that takes a ColorType #1988

Merged
merged 1 commit into from
Aug 26, 2023

Conversation

junderw
Copy link
Contributor

@junderw junderw commented Aug 26, 2023

I license past and future contributions under the dual MIT/Apache-2.0 license,
allowing licensees to choose either at their option.


Use case: I have a DynamicImage and I want to make a new one of the same type as the existing one but with a different width and height.

Currently this requires a large match.

Alternate solutions: Create another declarative macro for this specific use case.

However, I think DynamicImage::new(w, h, old_image.color()) looks better and is more ergonomic than another macro.

I am open to modifying this PR to fit any needs or invariants I was blind to.

@fintelia fintelia merged commit 81c9fed into image-rs:master Aug 26, 2023
35 checks passed
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.

2 participants