Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::view::DecibelScale Struct Reference

Maps decibels to a vertical pixel position on a linear axis (dB is already logarithmic in amplitude, so the axis itself is linear in dB). More...

#include <graph_scale.hpp>

Public Member Functions

float to_y (float db) const
float to_decibels (float py) const
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 looks for first).

Public Attributes

float min_db = -24.0f
float max_db = 24.0f
float y = 0.0f
 top edge, pixels
float height = 0.0f
 axis height, pixels

Detailed Description

Maps decibels to a vertical pixel position on a linear axis (dB is already logarithmic in amplitude, so the axis itself is linear in dB).

y grows downward, as in screen coordinates: max_db sits at the top.

Member Function Documentation

◆ ticks()

std::vector< float > pulp::view::DecibelScale::ticks ( float step_db) const

Gridline values every step_db, always including 0 dB when it is in range (the unity line a reader looks for first).

◆ to_decibels()

float pulp::view::DecibelScale::to_decibels ( float py) const

◆ to_y()

float pulp::view::DecibelScale::to_y ( float db) const

Member Data Documentation

◆ height

float pulp::view::DecibelScale::height = 0.0f

axis height, pixels

◆ max_db

float pulp::view::DecibelScale::max_db = 24.0f

◆ min_db

float pulp::view::DecibelScale::min_db = -24.0f

◆ y

float pulp::view::DecibelScale::y = 0.0f

top edge, pixels


The documentation for this struct was generated from the following file: