FastLED 3.9.15
Loading...
Searching...
No Matches

◆ test_scale_u8_16()

void simd_test::test_scale_u8_16 ( TestResult & result)

Definition at line 93 of file simd_tests.cpp.

93 {
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}
platforms::simd_u8x16 simd_u8x16
Definition types.h:24
expected< T, E > result
Alias for expected (Rust-style naming)
Definition result.h:31
unsigned char uint8_t
Definition s16x16x4.h:209
bool compare_u8_arrays(const uint8_t *a, const uint8_t *b, size_t count)
Compare two uint8_t arrays element-wise.

References compare_u8_arrays().

Referenced by setup().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: