FastLED 3.9.15
Loading...
Searching...
No Matches

◆ noiseCylinderHSV8()

CHSV fl::noiseCylinderHSV8 ( float angle,
float height,
u32 time,
float radius = 1.0f )

Generate HSV8 (8-bit) noise for a cylinder pattern.

Calls noiseCylinderHSV16() and scales each component down to 8-bit.

Parameters
anglePosition around the cylinder (radians, 0 to 2π)
heightVertical position on the cylinder
timeAnimation time parameter
radiusNoise zoom level (level of detail). Larger values = coarser pattern, smaller = more detail (default 1.0)
Returns
HSV8 (CHSV) color with 8-bit components

Definition at line 196 of file noise.cpp.hpp.

196 {
197 HSV16 hsv16 = noiseCylinderHSV16(angle, height, time, radius);
198
199 // Scale 16-bit components down to 8-bit using bit shift with rounding
200 // This preserves the relative position in the value range
201 u8 h = (hsv16.h + 128) >> 8;
202 u8 s = (hsv16.s + 128) >> 8;
203 u8 v = (hsv16.v + 128) >> 8;
204
205 return CHSV(h, s, v);
206}
HSV16 noiseCylinderHSV16(float angle, float height, u32 time, float radius)
Cylinder noise functions - sample three z-slices for independent component evolution.
fl::hsv8 CHSV
Definition chsv.h:11
unsigned char u8
Definition stdint.h:131
fl::u64 time() FL_NOEXCEPT
Alias for millis64() - returns 64-bit millisecond time.
Definition chrono.h:346
u8 u8 height
Definition blur.h:186
u16 v
Definition hsv16.h:12
u16 h
Definition hsv16.h:10
u16 s
Definition hsv16.h:11

References fl::HSV16::h, height, noiseCylinderHSV16(), fl::HSV16::s, time(), and fl::HSV16::v.

+ Here is the call graph for this function: