62 float getf(
size_t x)
const;
67 int8_t
geti8(
size_t x)
const {
return static_cast<int8_t
>(
geti16(
x) >> 8); }
79 uint16_t v2 =
static_cast<uint16_t
>(value);
81 return static_cast<uint8_t
>(v2 >> 8);
83 return static_cast<uint8_t
>(
84 ((
static_cast<uint16_t
>(value) + 32768)) >> 8);
89 bool has(
size_t x)
const;
93 void set(
size_t x,
float value);
138 float getf(
size_t x,
size_t y)
const;
142 int16_t
geti16(
size_t x,
size_t y)
const;
146 return static_cast<int8_t
>(
geti16(
x,
y) >> 8);
157 uint16_t v2 =
static_cast<uint16_t
>(value);
159 return static_cast<uint8_t
>(v2 >> 8);
161 return static_cast<uint8_t
>(
162 ((
static_cast<uint16_t
>(value) + 32768)) >> 8);
167 bool has(
size_t x,
size_t y)
const;
172 void setf(
size_t x,
size_t y,
float value);
174 void seti16(
size_t x,
size_t y, int16_t value);
UISlider dampening("Dampening", 6.0f, 0.0f, 10.0f, 0.1f)
void set(size_t x, float value)
fl::scoped_array< int16_t > grid2
int16_t geti16(size_t x) const
int getDampenening() const
void setHalfDuplex(bool on)
int16_t geti16Previous(size_t x) const
int8_t geti8(size_t x) const
uint8_t getu8(size_t x) const
void setSpeed(float something)
fl::scoped_array< int16_t > grid1
bool getHalfDuplex() const
float getf(size_t x) const
~WaveSimulation1D_Real()=default
WaveSimulation1D_Real(uint32_t length, float speed=0.16f, int dampening=6)
void setDampening(int damp)
int16_t geti16Previous(size_t x, size_t y) const
bool getHalfDuplex() const
int8_t geti8(size_t x, size_t y) const
~WaveSimulation2D_Real()=default
bool has(size_t x, size_t y) const
fl::scoped_array< int16_t > grid1
void setHalfDuplex(bool on)
void setf(size_t x, size_t y, float value)
int16_t geti16(size_t x, size_t y) const
int getDampenening() const
fl::scoped_array< int16_t > grid2
void setSpeed(float something)
void seti16(size_t x, size_t y, int16_t value)
uint8_t getu8(size_t x, size_t y) const
WaveSimulation2D_Real(uint32_t W, uint32_t H, float speed=0.16f, float dampening=6.0f)
uint32_t getWidth() const
uint32_t getHeight() const
float getf(size_t x, size_t y) const
void setDampening(int damp)
Implements the FastLED namespace macros.
float fixed_to_float(int16_t f)
int16_t float_to_fixed(float f)
Implements a simple red square effect for 2D LED grids.