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

Provide bits_per_pixel and num_components as ColorType methods #1002

Merged
merged 1 commit into from Sep 7, 2019
Merged

Provide bits_per_pixel and num_components as ColorType methods #1002

merged 1 commit into from Sep 7, 2019

Conversation

dobrakmato
Copy link
Contributor

@dobrakmato dobrakmato commented Aug 4, 2019

It is possible to get ColorType by calling .color() on DynamicImage but bits_per_pixel() nor num_components() function are available because they are not exported.

This PR exports them so they are available to use with ColorType structs returned from DynamicImage.

@nwin, @ccgn @HeroicKatora


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

@HeroicKatora
Copy link
Member

HeroicKatora commented Aug 15, 2019

I agree that these would make sense. Their exposed interface should simply be inherent methods on ColorType instead though, so maybe create inherent ones that forward to the current free functions instead of exporting the free functions.

@HeroicKatora
Copy link
Member

Sorry for the wait for such a small change.

@dobrakmato dobrakmato changed the title Export ColorType related functions bits_per_pixel and num_components WIP: Export ColorType related functions bits_per_pixel and num_components Aug 15, 2019
@dobrakmato dobrakmato changed the title WIP: Export ColorType related functions bits_per_pixel and num_components Export ColorType related functions bits_per_pixel and num_components Aug 16, 2019
@dobrakmato dobrakmato changed the title Export ColorType related functions bits_per_pixel and num_components Provide bits_per_pixel and num_components as ColorType methods Aug 16, 2019
Copy link
Member

@HeroicKatora HeroicKatora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seeing the full methods reminded me to think of the return type.

src/color.rs Outdated Show resolved Hide resolved
src/color.rs Outdated Show resolved Hide resolved
@HeroicKatora
Copy link
Member

@dobrakmato Is there something we can help you with for progressing this PR?

@dobrakmato
Copy link
Contributor Author

dobrakmato commented Aug 30, 2019 via email

@HeroicKatora HeroicKatora merged commit 3fb764d into image-rs:master Sep 7, 2019
@HeroicKatora
Copy link
Member

Thank you!

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.

None yet

3 participants