MCPcopy Create free account
hub / github.com/Tencent/tgfx / applyTo

Method applyTo

src/gpu/Swizzle.cpp:36–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36Color Swizzle::applyTo(const Color& color) const {
37 int idx;
38 uint32_t k = key;
39 // Index of the input color that should be mapped to output r.
40 idx = static_cast<int>(k & 15);
41 float outR = ComponentIdxToFloat(color, idx);
42 k >>= 4;
43 idx = static_cast<int>(k & 15);
44 float outG = ComponentIdxToFloat(color, idx);
45 k >>= 4;
46 idx = static_cast<int>(k & 15);
47 float outB = ComponentIdxToFloat(color, idx);
48 k >>= 4;
49 idx = static_cast<int>(k & 15);
50 float outA = ComponentIdxToFloat(color, idx);
51 return {outR, outG, outB, outA};
52}
53} // namespace tgfx

Callers 1

drawAsClearMethod · 0.80

Calls 1

ComponentIdxToFloatFunction · 0.85

Tested by

no test coverage detected