Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void from_cairo_format(Uint32 & c)
- {
- #ifdef _WIN32
- Uint8 r = (c >> 24) & 0xff;
- Uint8 g = (c >> 16) & 0xff;
- Uint8 b = (c >> 8) & 0xff;
- Uint8 a = c & 0xff;
- #else
- Uint8 a = (c >> 24) & 0xff;
- Uint8 r = (c >> 16) & 0xff;
- Uint8 g = (c >> 8) & 0xff;
- Uint8 b = c & 0xff;
- #endif
- const unsigned div = inverse_table_[a];
- unpremultiply(r, div);
- unpremultiply(g, div);
- unpremultiply(b, div);
- c = (static_cast<Uint32>(a) << 24) | (static_cast<Uint32>(r) << 16) | (static_cast<Uint32>(g) << 8) | static_cast<Uint32>(b);
- }
Advertisement
Add Comment
Please, Sign In to add comment