-
Notifications
You must be signed in to change notification settings - Fork 584
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
Add alpha count associated constant to Pixel trait #956
Comments
Do you think that the Pixel trait interface is otherwise relatively reasonable? Looking at it, I'm somewhat skeptical that there is really all that much generic code that can be written against it without making a bunch more assumptions. This proposal is a (small) step in the right direction, but much more drastic API changes might be necessary. Given that we're not yet at 1.0, now is the time to get the interface right. |
I think its overall pretty fine. I think that some of the methods shouldn't be mandatory. For example if it were possible to get the |
@lazypassion It would help if there were as many methods with default provided implementations as possible. The methods that you added for example could be provided as default implementations as well. Which others can be default implemented as well? |
Yes exactly. The rest of the map and apply functions can have defaults as well as the pixel conversion functions. |
I would like to be able to get the number of alpha values of the Pixel type found in an image buffer.
My specific use case for this functionality is:
This is to write generic code over gray scale and color images in an imperative style as opposed to using
apply_with_alpha
The alternative using
apply_with_alpha
looks like this by @HeroicKatora :This might also be useful if someone needs to get the alpha count in the case there is an alpha value for each color channel.
The text was updated successfully, but these errors were encountered: