20 fl::vector<fl::i32> polar_theta_raw;
21 fl::vector<fl::i32> distance_raw;
22 fl::vector<fl::i32> sqrt_distance_raw;
23 fl::vector<fl::u16> pixel_idx;
28 bool fade_lut_initialized = false;
30 FPVizState() : fade_lut{}, fade_lut_initialized(
false) {}
34 void ensureCache(Engine *e) {
35 const int num_x = e->num_x;
36 const int num_y = e->num_y;
37 const int total_pixels = num_x * num_y;
39 if (count != total_pixels) {
40 const int padded = (total_pixels + 3) & ~3;
41 polar_theta_raw.resize(padded, 0);
42 distance_raw.
resize(padded, 0);
43 sqrt_distance_raw.
resize(padded, 0);
44 pixel_idx.
resize(padded, 0);
47 for (
int x = 0;
x < num_x;
x++) {
48 for (
int y = 0;
y < num_y;
y++) {
49 polar_theta_raw[idx] = fl::s16x16(e->polar_theta[
x][
y]).raw();
50 distance_raw[idx] = fl::s16x16(e->distance[
x][
y]).raw();
51 sqrt_distance_raw[idx] = fl::s16x16(e->distance[
x][
y]).sqrt().raw();
52 pixel_idx[idx] = e->mCtx->xyMapFn(
x,
y, e->mCtx->xyMapUserData);
59 if (!fade_lut_initialized) {
61 fade_lut_initialized =
true;
Alignment macros and utilities for FastLED.
void resize(fl::size n) FL_NOEXCEPT
struct FL_ALIGNAS(4) Wave3BitExpansionLut
Lookup table for nibble-to-waveform expansion in wave3 format (32 bytes)
Base definition for an LED controller.
static void init_fade_lut(fl::i32 *table)