-
-
Notifications
You must be signed in to change notification settings - Fork 852
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
Introduce PixelTypeInfo.HasAlpha #1396
Comments
I can see us adding |
@JimBobSquarePants so you prefer the non-breaking variant? Honestly, now it looks like a safer way to go to me. |
Yeah, it's a safe clever approach. Big fan! |
I might be misreading the purpose of this, but did you consider support for pixel formats that are already premultiplied? TIFF and DirectX (among others) support alpha in both forms. I recall we had a chat about this somewhere, although I've since lost track of it... I set up a generic pixel format descriptor type here which borrows heavily from WIC's pluggable pixel format model and describes alpha using an enum if you're looking for inspiration. |
Oh I remember this stuff yeah, will definitely have to use it as a source of inspiration! |
@saucecontrol do I get this right?
@JimBobSquarePants edited my proposal, let's go with the non-breaking version + enum for |
Yep, that's right. DirectX uses |
I much prefer your naming. |
I've started this. |
Motivation
By introducing a property to observe whether a given pixel type has an alpha, we can then use it in our processors to omit unnecessary alpha premultiplication. Might be also interesting for users working with
Image.Identify
.We need to make sure it's value is properly filled:
Identify
implementations (PNG, BMP)IPixel
-s)API alternatives
In #1394 (reply in thread) I forgot that extending
IPixel
is actually a breaking change. Non-breaking variant:The text was updated successfully, but these errors were encountered: