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

Function near_eq

tests/fl/gfx/blur.cpp:830–832  ·  view source on GitHub ↗

Helper: check two pixel values are within ±tolerance per channel.

Source from the content-addressed store, hash-verified

828
829// Helper: check two pixel values are within ±tolerance per channel.
830static bool near_eq(uint8_t a, uint8_t b, int tol = 1) {
831 return (a >= b ? a - b : b - a) <= tol;
832}
833
834FL_TEST_CASE("CanvasMapped non-rect matches Canvas within 1 LSB - R1") {
835 const int W = 8, H = 8, N = W * H;

Callers 1

blur.cppFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected