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

Distinguish premultiplied alpha vs non-premultiplied alpha #4

Open
nigeltao opened this issue May 24, 2021 · 2 comments
Open

Distinguish premultiplied alpha vs non-premultiplied alpha #4

nigeltao opened this issue May 24, 2021 · 2 comments

Comments

@nigeltao
Copy link

Feature request: have the pfg tool and/or the docs state whether various formats-with-alpha use premultiplied (associated) or non-premultiplied (unassociated) alpha.

For example, https://www.cairographics.org/manual/cairo-Image-Surfaces.html#cairo-format-t states that CAIRO_FORMAT_ARGB32 uses premultiplied alpha. Quoting from that link: "50% transparent red is 0x80800000, not 0x80ff0000".

Is CAIRO_FORMAT_ARGB32 equivalent to SDL_PIXELFORMAT_ARGB8888 (in terms of alpha semantics, not just byte order) or would I have to do a "premul to non-premul" conversion? I think that's the sort of question that's within the Pixel Format Guide's scope.

@nigeltao
Copy link
Author

Confusingly, while CAIRO_FORMAT_ARGB32 uses premultiplied alpha, cairo_set_source_rgba uses non-premultiplied alpha, AFAICT.

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

No branches or pull requests

1 participant