Projects an inclusive MIDI pitch range onto piano-roll rows. More...
#include <viewport_projection.hpp>
Public Member Functions | |
| float | y_at (std::uint8_t pitch) const noexcept |
| std::uint8_t | pitch_at (float y) const noexcept |
| float | row_height () const noexcept |
| constexpr std::uint8_t | lowest_pitch () const noexcept |
| constexpr std::uint8_t | highest_pitch () const noexcept |
| constexpr PixelSpan | pixels () const noexcept |
Static Public Member Functions | |
| static runtime::Result< PitchProjection, ViewportProjectionError > | create (std::uint8_t lowest_pitch, std::uint8_t highest_pitch, PixelSpan pixels) noexcept |
Projects an inclusive MIDI pitch range onto piano-roll rows.
Screen y increases downward, so the highest pitch owns the first row. A pitch projects to the center of its row without clipping, so renderers can cull notes outside the visible range. Inverse lookup returns the visible row that contains y and clamps outside input to the visible pitch endpoints.
|
staticnoexcept |
|
inlinenodiscardconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
|
nodiscardnoexcept |
|
inlinenodiscardconstexprnoexcept |
|
nodiscardnoexcept |
|
nodiscardnoexcept |