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

Function test_scale_u8_16

examples/SIMD/simd_tests.cpp:93–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93void test_scale_u8_16(TestResult& result) {
94 uint8_t input[16] = {255, 128, 64, 32, 255, 128, 64, 32, 255, 128, 64, 32, 255, 128, 64, 32};
95 uint8_t expected[16] = {127, 64, 32, 16, 127, 64, 32, 16, 127, 64, 32, 16, 127, 64, 32, 16};
96 uint8_t output[16] = {0};
97
98 simd_u8x16 v = load_u8_16(input);
99 simd_u8x16 scaled = scale_u8_16(v, 128); // Scale by 0.5
100 store_u8_16(output, scaled);
101
102 if (!compare_u8_arrays(expected, output, 16)) {
103 result.fail("Scale operation produced incorrect results");
104 }
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};

Callers

nothing calls this directly

Calls 2

compare_u8_arraysFunction · 0.85
failMethod · 0.45

Tested by

no test coverage detected