MCPcopy Create free account
hub / github.com/FastLED/FastLED / inoise16

Function inoise16

src/noise.cpp.hpp:425–439  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

423}
424
425fl::u16 inoise16(fl::u32 x, fl::u32 y, fl::u32 z, fl::u32 t) {
426 fl::i32 ans = inoise16_raw(x,y,z,t);
427 ans = ans + 19052L;
428 fl::u32 pan = ans;
429 // pan = (ans * 220L) >> 7. That's the same as:
430 // pan = (ans * 440L) >> 8. And this way avoids a 7X four-byte shift-loop on AVR.
431 // Identical math, except for the highest bit, which we don't care about anyway,
432 // since we're returning the 'middle' 16 out of a 32-bit value anyway.
433 pan *= 440L;
434 return (pan>>8);
435
436 // return scale16by8(pan,220)<<1;
437 // return ((inoise16_raw(x,y,z)+19052)*220)>>7;
438 // return scale16by8(inoise16_raw(x,y,z)+19052,220)<<1;
439}
440
441fl::u16 inoise16(fl::u32 x, fl::u32 y, fl::u32 z) {
442 fl::i32 ans = inoise16_raw(x,y,z);

Callers 15

fill_raw_noise16into8Function · 0.85
fill_raw_2dnoise16Function · 0.85
fill_raw_2dnoise16into8Function · 0.85
ValueMethod · 0.85
noiseRingHSV16Function · 0.85
noiseRingCRGBFunction · 0.85
noiseSphereHSV16Function · 0.85
noiseSphereCRGBFunction · 0.85
noiseCylinderHSV16Function · 0.85
noiseCylinderCRGBFunction · 0.85
circleNoiseGenMethod · 0.85
FL_TEST_FILEFunction · 0.85

Calls 1

inoise16_rawFunction · 0.85

Tested by

no test coverage detected