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

◆ sample()

CRGB fl::sample ( const CRGB * grid,
const XYMap & xyMap,
float x,
float y,
SampleMode mode = SampleMode::SAMPLE_BILINEAR )

Sample a pixel from a 2D CRGB grid at floating-point coordinates.

Parameters
gridPixel buffer (row-major or XYMap-indexed)
xyMapCoordinate-to-index mapping for the grid
xFloating-point x coordinate
yFloating-point y coordinate
modeInterpolation mode (default: SAMPLE_BILINEAR)

Definition at line 9 of file sample.cpp.hpp.

10 {
11 if (mode == SampleMode::SAMPLE_BILINEAR) {
12 return sampleBilinear(grid, xyMap, x, y);
13 }
14 return sampleNearest(grid, xyMap, x, y);
15}
fl::XYMap xyMap
int y
Definition simple.h:93
int x
Definition simple.h:92
CRGB sampleNearest(const CRGB *grid, const XYMap &xyMap, float x, float y)
Nearest-neighbor sample from a 2D CRGB grid.
@ SAMPLE_BILINEAR
Bilinear interpolation (smooth)
Definition sample.h:15
CRGB sampleBilinear(const CRGB *grid, const XYMap &xyMap, float x, float y)
Bilinear interpolation sample from a 2D CRGB grid.

References SAMPLE_BILINEAR, sampleBilinear(), sampleNearest(), x, xyMap, and y.

Referenced by fl::audio::Context::Context(), fl::audio::AutoGain::~AutoGain(), fl::audio::Processor::~Processor(), fl::audio::SignalConditioner::~SignalConditioner(), fl::audio::SignalConditioner::applyNoiseGate(), fl::third_party::SoftwareMpeg1Decoder::audioDecodeCallback(), fl::audio::Reactive::computeRMS(), fl::audio::Processor::createWithAutoInput(), fl::third_party::Mp3HelixDecoder::decodeToAudioSamples(), fl::Fx2dTo1d::draw(), fl::audio::Sample::fft(), fl::audio::SignalConditioner::filterSpikes(), fl::audio::Context::getFFT(), fl::third_party::plm_audio_read_samples(), fl::audio::AutoGain::process(), fl::audio::Reactive::processFFT(), fl::audio::Reactive::processSample(), fl::audio::SignalConditioner::processSample(), fl::audio::IInput::readAll(), fl::audio::anonymous_namespace{audio.cpp.hpp}::GuardedFFT::run(), fl::audio::fft::FFT::run(), fl::audio::fft::Impl::run(), fl::audio::fft::Impl::run(), fl::audio::Context::setSample(), fl::audio::Processor::update(), and fl::audio::Reactive::updateVolumeAndPeak().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: