32 float to_x(
float hz)
const;
45 std::vector<float>
ticks()
const;
61 float to_y(
float db)
const;
66 std::vector<float>
ticks(
float step_db)
const;
85 std::span<float> out);
Hover-cursor tracking for platform window hosts.
Definition fwd.hpp:27
@ px
Absolute pixels.
Definition geometry.hpp:393
void resample_spectrum_log(std::span< const float > bins_db, float sample_rate, const LogFrequencyScale &scale, std::span< float > out)
Resample a real-FFT magnitude array (bins spanning DC..Nyquist) onto out.size() log-spaced frequencie...
@ scale
Definition css_animation.hpp:126
Maps decibels to a vertical pixel position on a linear axis (dB is already logarithmic in amplitude,...
Definition graph_scale.hpp:55
std::vector< float > ticks(float step_db) const
Gridline values every step_db, always including 0 dB when it is in range (the unity line a reader loo...
float to_y(float db) const
float height
axis height, pixels
Definition graph_scale.hpp:59
float max_db
Definition graph_scale.hpp:57
float min_db
Definition graph_scale.hpp:56
float y
top edge, pixels
Definition graph_scale.hpp:58
float to_decibels(float py) const
Maps frequency (Hz) to a horizontal pixel position on a logarithmic axis.
Definition graph_scale.hpp:23
float frequency_at(std::size_t index, std::size_t count) const
Frequency of point index of count, log-spaced across the axis, so point i lands on evenly spaced pixe...
float to_x(float hz) const
Pixel x of a frequency.
float width
axis width, pixels
Definition graph_scale.hpp:27
float x
left edge, pixels
Definition graph_scale.hpp:26
static bool is_major_tick(float hz)
True for decade boundaries (100, 1k, 10k) — the lines conventionally drawn heavier and labeled.
float to_frequency(float px) const
Frequency at a pixel x. Inverse of to_x().
float max_hz
Definition graph_scale.hpp:25
std::vector< float > ticks() const
Gridline frequencies in a 1-2-5 sequence per decade (20, 30, 50, 100, 200, …) clipped to [min_hz,...
float min_hz
Definition graph_scale.hpp:24