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

Function ff_print_error_stats

tests/fl/fx/2d/flowfield.hpp:76–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74}
75
76void ff_print_error_stats(const FfErrorStats &stats, const char *test_name) {
77 fl::printf("\n=== %s ===\n", test_name);
78 fl::printf("Total pixels: %d\n", stats.total_pixels);
79 fl::printf("Pixels with error: %d (%.1f%%)\n",
80 stats.pixels_with_error,
81 100.0 * stats.pixels_with_error / stats.total_pixels);
82 fl::printf("Max error: %d\n", stats.max_error);
83 fl::printf("Avg error: %.2f\n", stats.avg_error);
84 fl::printf("Std dev: %.2f\n", stats.std_dev);
85 fl::printf("\nError distribution:\n");
86 fl::printf(" >1 LSB: %d pixels (%.1f%%)\n",
87 stats.pixels_over_1bit,
88 100.0 * stats.pixels_over_1bit / stats.total_pixels);
89 fl::printf(" >2 LSB: %d pixels (%.1f%%)\n",
90 stats.pixels_over_2bit,
91 100.0 * stats.pixels_over_2bit / stats.total_pixels);
92 fl::printf(" >4 LSB: %d pixels (%.1f%%)\n",
93 stats.pixels_over_4bit,
94 100.0 * stats.pixels_over_4bit / stats.total_pixels);
95
96 fl::printf("\nHistogram (first 20 buckets):\n");
97 for (int i = 0; i < 20 && i <= stats.max_error; i++) {
98 if (stats.histogram[i] > 0) {
99 fl::printf(" Error=%2d: %4d pixels (%.1f%%)\n",
100 i, stats.histogram[i],
101 100.0 * stats.histogram[i] / stats.total_pixels);
102 }
103 }
104}
105
106int count_diff_pixels(const CRGB *a, const CRGB *b, int count) {
107 int diff = 0;

Callers 1

flowfield.hppFile · 0.85

Calls 1

printfFunction · 0.85

Tested by

no test coverage detected