MCPcopy Create free account
hub / github.com/FastLED/FastLED / test_blend_u8_16

Function test_blend_u8_16

examples/SIMD/simd_tests.cpp:107–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105}
106
107void test_blend_u8_16(TestResult& result) {
108 uint8_t a_data[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
109 uint8_t b_data[16] = {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255};
110 uint8_t expected[16] = {127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127};
111 uint8_t output[16] = {0};
112
113 simd_u8x16 a = load_u8_16(a_data);
114 simd_u8x16 b = load_u8_16(b_data);
115 simd_u8x16 c = blend_u8_16(a, b, 128); // 50% blend
116 store_u8_16(output, c);
117
118 if (!compare_u8_arrays(expected, output, 16)) {
119 result.fail("Blend operation produced incorrect results");
120 }
121}
122
123// ============================================================================
124// Comparison Tests

Callers

nothing calls this directly

Calls 2

compare_u8_arraysFunction · 0.85
failMethod · 0.45

Tested by

no test coverage detected