FastLED 3.9.15
Loading...
Searching...
No Matches
blur.h
Go to the documentation of this file.
1#pragma once
2
3#include "fl/gfx/canvas.h"
4#include "fl/stl/int.h"
5#include "fl/stl/span.h"
8#include "fl/stl/noexcept.h"
9
10namespace fl {
11namespace gfx {
12
16
30void blur1d(fl::span<CRGB> leds, fract8 blur_amount) FL_NOEXCEPT;
31
33inline void blur1d(CRGB *leds, u16 numLeds, fract8 blur_amount) FL_NOEXCEPT {
35}
36
53 const XYMap &xymap) FL_NOEXCEPT;
54
61
66 FASTLED_DEPRECATED("Use blur2d(..., const XYMap& xymap) instead");
67
75 const XYMap &xymap) FL_NOEXCEPT;
76
83
87 const XYMap &xymap) FL_NOEXCEPT;
88
95
101
106
111
113
120template <int hRadius, int vRadius, typename RGB_T>
121void blurGaussian(Canvas<RGB_T> &canvas, alpha8 dimFactor) FL_NOEXCEPT;
122
125template <int hRadius, int vRadius, typename RGB_T>
126void blurGaussian(Canvas<RGB_T> &canvas, alpha16 dimFactor) FL_NOEXCEPT;
127
129template <int hRadius, int vRadius, typename RGB_T>
132}
133
140template <int hRadius, int vRadius, typename RGB_T>
141void blurGaussian(CanvasMapped<RGB_T> &canvas, alpha8 dimFactor) FL_NOEXCEPT;
142
144template <int hRadius, int vRadius, typename RGB_T>
145void blurGaussian(CanvasMapped<RGB_T> &canvas, alpha16 dimFactor) FL_NOEXCEPT;
146
147} // namespace gfx
148
149// Span-based bindings — forward fl::blur* to fl::gfx::blur*
165
166// Canvas-based bindings — forward fl::blur* to fl::gfx::blur*
176
177// Legacy raw-pointer bindings — forward fl::blur* to fl::gfx::blur*
178inline void blur1d(CRGB *leds, u16 numLeds, fract8 blur_amount) FL_NOEXCEPT {
179 gfx::blur1d(leds, numLeds, blur_amount);
180}
185FASTLED_DEPRECATED("Use blur2d(..., const XYMap& xymap) instead") FL_NOEXCEPT
188 FL_DISABLE_WARNING(deprecated-declarations)
191}
200
201} // namespace fl
fl::CRGB leds[NUM_LEDS]
XYMap xymap
Canvas types for gfx primitives (implementation)
Generic canvas for any pixel type (e.g.
Definition gfx.h:51
void blur2d(fl::span< CRGB > leds, fl::u8 width, fl::u8 height, fract8 blur_amount, const XYMap &xymap)
Two-dimensional blur filter (span version).
Definition blur.cpp.hpp:87
void blur1d(fl::span< CRGB > leds, fract8 blur_amount)
One-dimensional blur filter (span version).
Definition blur.cpp.hpp:69
void blurRows(fl::span< CRGB > leds, fl::u8 width, fl::u8 height, fract8 blur_amount, const XYMap &xyMap)
Perform a blur1d() on every row of a rectangular matrix (span version).
Definition blur.cpp.hpp:133
void blurColumns(fl::span< CRGB > leds, fl::u8 width, fl::u8 height, fract8 blur_amount, const XYMap &xyMap)
Perform a blur1d() on every column of a rectangular matrix (span version).
Definition blur.cpp.hpp:172
u8 fract8
Fixed-Point Fractional Types.
Definition s16x16x4.h:161
void blurGaussian(Canvas< RGB_T > &canvas, alpha8 dimFactor)
Compile-time Gaussian blur with independent H/V radii.
unsigned char u8
Definition stdint.h:131
void blurColumns(fl::span< CRGB > leds, u8 width, u8 height, fract8 blur_amount, const XYMap &xymap) FL_NOEXCEPT
Definition blur.h:161
u8 u8 height
Definition blur.h:186
u8 u8 fract8 blur_amount
Definition blur.h:186
u8 width
Definition blur.h:186
void blurRows(fl::span< CRGB > leds, u8 width, u8 height, fract8 blur_amount, const XYMap &xymap) FL_NOEXCEPT
Definition blur.h:157
void blur2d(fl::span< CRGB > leds, u8 width, u8 height, fract8 blur_amount, const XYMap &xymap) FL_NOEXCEPT
Definition blur.h:153
void blur1d(fl::span< CRGB > leds, fract8 blur_amount) FL_NOEXCEPT
Definition blur.h:150
Base definition for an LED controller.
Definition crgb.hpp:179
#define FL_DISABLE_WARNING(warning)
#define FL_DISABLE_WARNING_PUSH
#define FL_DISABLE_WARNING_POP
#define FASTLED_DEPRECATED(msg)
#define FL_NOEXCEPT
Representation of an 8-bit RGB pixel (Red, Green, Blue)
Definition crgb.h:38
Unsigned 16-bit alpha / brightness — UNORM16.
Definition alpha.h:87
Unsigned 8-bit alpha / brightness — UNORM8.
Definition alpha.h:42
Simple rectangular canvas for graphics operations Combines a pixel buffer with dimensions for cache-o...
Definition canvas.h:66