753 {
756 constexpr s16x16 kBaseFreq(0.23f);
757 constexpr s16x16 neg_one(-1.0f);
758 constexpr s16x16 one(1.0f);
759
760 const i32 *fade_lut =
mState.fade_lut;
761
762
765
766 for (int i = 0; i < w; i++) {
767 s16x16 fx = s16x16(i) * freqX + scrollX;
769 fx.raw(), 0, fade_lut,
mPermX);
772 mState.x_prof[i] = clamped.raw();
773 }
774
775 if (
mParams.reverse_x_profile) {
776 for (int i = 0; i < w / 2; i++) {
777 i32 tmp =
mState.x_prof[i];
779 mState.x_prof[w - 1 - i] = tmp;
780 }
781 }
782
783
786
787 for (int i = 0; i < h; i++) {
788 s16x16 fx = s16x16(i) * freqY + scrollY;
790 fx.raw(), 0, fade_lut,
mPermY);
793 mState.y_prof[i] = clamped.raw();
794 }
795
796
797 for (int i = 0; i < w; i++) {
798 i32 bias_raw = s16x16(
mNoiseBias.getX(i)).raw();
800 neg_one.raw(), one.raw());
801 }
802 for (int i = 0; i < h; i++) {
803 i32 bias_raw = s16x16(
mNoiseBias.getY(i)).raw();
805 neg_one.raw(), one.raw());
806 }
807}
static i32 clamp_q16(i32 v, i32 lo, i32 hi)
static constexpr FASTLED_FORCE_INLINE s16x16 clamp(s16x16 x, s16x16 lo, s16x16 hi) FL_NOEXCEPT
static constexpr FASTLED_FORCE_INLINE s16x16 from_raw(i32 raw) FL_NOEXCEPT
static fl::i32 pnoise2d_raw(fl::i32 fx_raw, fl::i32 fy_raw, const fl::i32 *fade_lut, const fl::u8 *perm)