Merge pull request #4594 from DedeHai/perlin_noise
Adding perlin noise replacement for fastled functions
This commit is contained in:
@@ -395,6 +395,15 @@ void userConnected();
|
||||
void userLoop();
|
||||
|
||||
//util.cpp
|
||||
#ifdef ESP8266
|
||||
#define HW_RND_REGISTER RANDOM_REG32
|
||||
#else // ESP32 family
|
||||
#include "soc/wdev_reg.h"
|
||||
#define HW_RND_REGISTER REG_READ(WDEV_RND_REG)
|
||||
#endif
|
||||
#define inoise8 perlin8 // fastled legacy alias
|
||||
#define inoise16 perlin16 // fastled legacy alias
|
||||
#define hex2int(a) (((a)>='0' && (a)<='9') ? (a)-'0' : ((a)>='A' && (a)<='F') ? (a)-'A'+10 : ((a)>='a' && (a)<='f') ? (a)-'a'+10 : 0)
|
||||
int getNumVal(const String* req, uint16_t pos);
|
||||
void parseNumber(const char* str, byte* val, byte minv=0, byte maxv=255);
|
||||
bool getVal(JsonVariant elem, byte* val, byte minv=0, byte maxv=255);
|
||||
@@ -424,6 +433,16 @@ um_data_t* simulateSound(uint8_t simulationId);
|
||||
uint8_t get_random_wheel_index(uint8_t pos);
|
||||
CRGB getCRGBForBand(int x, uint8_t *fftResult, int pal); //WLEDMM netmindz ar palette
|
||||
char *cleanUpName(char *in); // to clean up a name that was read from file
|
||||
uint32_t hashInt(uint32_t s);
|
||||
int32_t perlin1D_raw(uint32_t x, bool is16bit = false);
|
||||
int32_t perlin2D_raw(uint32_t x, uint32_t y, bool is16bit = false);
|
||||
int32_t perlin3D_raw(uint32_t x, uint32_t y, uint32_t z, bool is16bit = false);
|
||||
uint16_t perlin16(uint32_t x);
|
||||
uint16_t perlin16(uint32_t x, uint32_t y);
|
||||
uint16_t perlin16(uint32_t x, uint32_t y, uint32_t z);
|
||||
uint8_t perlin8(uint16_t x);
|
||||
uint8_t perlin8(uint16_t x, uint16_t y);
|
||||
uint8_t perlin8(uint16_t x, uint16_t y, uint16_t z);
|
||||
|
||||
// fast (true) random numbers using hardware RNG, all functions return values in the range lowerlimit to upperlimit-1
|
||||
// note: for true random numbers with high entropy, do not call faster than every 200ns (5MHz)
|
||||
|
||||
Reference in New Issue
Block a user