28 Rmask2 = ((1 << (2 + pixelOps.
getRloss())) - 1) <<
30 Gmask2 = ((1 << (2 + pixelOps.
getGloss())) - 1) <<
32 Bmask2 = ((1 << (2 + pixelOps.
getBloss())) - 1) <<
39 Rshift3 = (Rshift1 + 0) & 31;
40 Gshift3 = (Gshift1 + 10) & 31;
41 Bshift3 = (Bshift1 + 20) & 31;
44 memset(tab, 0,
sizeof(tab));
49 if (factor == f)
return;
53 uint32_t r = std::rotl((p & Rmask1), Rshift1) |
54 std::rotl((p & Rmask2), Rshift2);
55 uint32_t
g = std::rotl((p & Gmask1), Gshift1) |
56 std::rotl((p & Gmask2), Gshift2);
57 uint32_t b = std::rotl((p & Bmask1), Bshift1) |
58 std::rotl((p & Bmask2), Bshift2);
59 t = (((r * factor) >> 8) << 0) |
60 (((
g * factor) >> 8) << 10) |
61 (((b * factor) >> 8) << 20);
Helper class to perform 'pixel x scalar' calculations.
constexpr auto enumerate(Iterable &&iterable)
Heavily inspired by Nathan Reed's blog post: Python-Like enumerate() In C++17 http://reedbeta....
This file implemented 3 utility functions: