FastLED
3.9.15
Loading...
Searching...
No Matches
fft_impl.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
fl/stl/span.h
"
4
#include "
fl/stl/string.h
"
5
#include "
fl/stl/unique_ptr.h
"
6
#include "
fl/stl/noexcept.h
"
7
8
namespace
fl
{
9
namespace
audio
{
10
11
class
Sample
;
// Forward declare in fl::audio (correct namespace)
12
13
namespace
fft
{
14
15
class
Context
;
16
struct
Args
;
17
18
// Example:
19
// Impl fft(512, 16);
20
// auto sample = SINE WAVE OF 512 SAMPLES
21
// fft.run(buffer, &out);
22
// FL_WARN("Impl output: " << out); // 16 bands of output.
23
class
Impl
{
24
public
:
25
// Result indicating success or failure of the Impl run (in which case
26
// there will be an error message).
27
struct
Result
{
28
Result
(
bool
ok
,
const
string
&
error
) :
ok
(
ok
),
error
(
error
) {}
29
bool
ok
=
false
;
30
fl::string
error
;
31
};
32
// Default values for the Impl.
33
Impl
(
const
Args
&
args
);
34
~Impl
()
FL_NOEXCEPT
;
35
36
fl
::size
sampleSize
() const;
37
// Note that the sample sizes MUST match the samples size passed into the
38
// constructor.
39
Result
run
(const
Sample
&
sample
,
Bins
*out);
40
Result
run
(
span
<const i16>
sample
,
Bins
*out);
41
// Info on what the frequency the bins represent
42
fl
::
string
info
() const;
43
44
// Disable copy and move constructors and assignment operators
45
Impl
(const
Impl
&)
FL_NOEXCEPT
= delete;
46
Impl
&operator=(const
Impl
&)
FL_NOEXCEPT
= delete;
47
Impl
(
Impl
&&)
FL_NOEXCEPT
= delete;
48
Impl
&operator=(
Impl
&&)
FL_NOEXCEPT
= delete;
49
50
private:
51
fl
::
unique_ptr
<
Context
>
mContext
;
52
};
53
54
}
// namespace fft
55
}
// namespace audio
56
};
// namespace fl
fl::audio::Sample
Definition
audio.h:22
fl::audio::fft::Bins
Definition
fft.h:44
fl::audio::fft::Context
Definition
fft_impl.cpp.hpp:59
fl::audio::fft::Impl::run
Result run(const Sample &sample, Bins *out)
Definition
fft_impl.cpp.hpp:1157
fl::audio::fft::Impl::Impl
Impl(const Args &args)
Definition
fft_impl.cpp.hpp:1133
fl::audio::fft::Impl::mContext
fl::unique_ptr< Context > mContext
Definition
fft_impl.h:51
fl::audio::fft::Impl::sampleSize
fl::size sampleSize() const
Definition
fft_impl.cpp.hpp:1150
fl::audio::fft::Impl::info
fl::string info() const
Definition
fft_impl.cpp.hpp:1141
fl::audio::fft::Impl::~Impl
~Impl() FL_NOEXCEPT
Definition
fft_impl.cpp.hpp:1139
fl::span
Definition
span.h:385
fl::string
Definition
string.h:193
fl::unique_ptr
Definition
unique_ptr.h:36
fl::audio::fft
Definition
audio.h:12
fl::audio
Definition
audio.cpp.hpp:15
fl::sample
CRGB sample(const CRGB *grid, const XYMap &xyMap, float x, float y, SampleMode mode)
Sample a pixel from a 2D CRGB grid at floating-point coordinates.
Definition
sample.cpp.hpp:9
fl
Base definition for an LED controller.
Definition
crgb.hpp:179
noexcept.h
args
corkscrew_args args
Definition
old.h:149
FL_NOEXCEPT
#define FL_NOEXCEPT
span.h
string.h
fl::audio::fft::Args
Definition
fft.h:124
fl::audio::fft::Impl::Result::Result
Result(bool ok, const string &error)
Definition
fft_impl.h:28
fl::audio::fft::Impl::Result::ok
bool ok
Definition
fft_impl.h:29
fl::audio::fft::Impl::Result::error
fl::string error
Definition
fft_impl.h:30
fl::audio::fft::Impl::Result
Definition
fft_impl.h:27
unique_ptr.h
fl
audio
fft
fft_impl.h
Generated on Tue Jun 16 2026 00:06:58 for FastLED by
1.13.2