FastLED 3.10.8
Loading...
Searching...
No Matches
xypath_renderer.cpp.hpp
Go to the documentation of this file.
1
2
3#include "fl/math/math.h"
4
5#include "fl/stl/assert.h"
6#include "fl/log/log.h"
7#include "fl/gfx/xypath.h"
9#include "fl/gfx/splat.h"
10#include "fl/stl/noexcept.h"
11
12namespace fl {
13
17
19 vec2f xy = mPath->compute(alpha);
20 vec2f out = tx.transform(xy);
21 out = mGridTransform.transform(out);
22 return out;
23}
24
26 // 1) continuous point, in “pixel‐centers” coordinates [0.5 … W–0.5]
27 if (!mDrawBoundsSet) {
28 FL_WARN("XYPathRenderer::at_subpixel: draw bounds not set");
29 return Tile2x2_u8();
30 }
31 vec2f xy = at(alpha);
32
33 // 1) shift back so whole‐pixels go 0…W–1, 0…H–1
34 xy.x -= 0.5f;
35 xy.y -= 0.5f;
36
37 return splat(xy);
38}
39
40} // namespace fl
unsigned int xy(unsigned int x, unsigned int y)
TransformFloat & transform() FL_NO_EXCEPT
XYPathGeneratorPtr mPath
TransformFloat mTransform
TransformFloat mGridTransform
vec2f compute_float(float alpha, const TransformFloat &tx) FL_NO_EXCEPT
Tile2x2_u8 at_subpixel(float alpha) FL_NO_EXCEPT
XYPathRenderer(XYPathGeneratorPtr path, TransformFloat transform=TransformFloat()) FL_NO_EXCEPT
vec2f at(float alpha) FL_NO_EXCEPT
#define FL_WARN(...)
Definition log.h:437
Centralized logging categories for FastLED hardware interfaces and subsystems.
u8 u8 fract8 blur_amount FL_NO_EXCEPT
Definition blur.h:186
vec2< float > vec2f
Definition geometry.h:333
Tile2x2_u8 splat(vec2f xy) FL_NO_EXCEPT
"Splat" as in "splat pixel rendering" takes a pixel value in float x,y coordinates and "splats" it in...
Definition splat.cpp.hpp:15
Base definition for an LED controller.
Definition crgb.hpp:179