MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
Projection.hpp File Reference

NDC-to-value mappings, inverse to the forward placement performed by geometry functions. More...

#include "Bounds.hpp"
+ Include dependency graph for Projection.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  MayaFlux
 Main namespace for the Maya Flux audio engine.
 
namespace  MayaFlux::Kinesis
 

Functions

std::function< float(glm::vec2)> MayaFlux::Kinesis::angle_fraction (AABB2D region, float angle_start, float angle_end, const std::function< glm::vec2()> &live_offset={}) noexcept
 angle_fraction centred on a region.
 
std::function< float(glm::vec2)> MayaFlux::Kinesis::angle_fraction (glm::vec2 center, float angle_start, float angle_end, const std::function< glm::vec2()> &live_offset={}) noexcept
 Fraction along an angular sweep about center.
 
std::function< float(glm::vec2)> MayaFlux::Kinesis::axis_fraction (AABB2D bounds, float handle_extent=0.F, bool horizontal=true, const std::function< glm::vec2()> &live_offset={}) noexcept
 Fraction along one axis of bounds, inverse to fader placement.
 
std::function< float(glm::vec2)> MayaFlux::Kinesis::path_fraction (std::span< const glm::vec2 > points, const std::function< glm::vec2()> &live_offset={})
 Normalized arc-length position of the closest point on a polyline.
 
std::function< float(glm::vec2)> MayaFlux::Kinesis::scaled (std::function< float(glm::vec2)> norm, float lo, float hi)
 Rescale a normalized projection onto an arbitrary range.
 
std::function< glm::vec2(glm::vec2)> MayaFlux::Kinesis::unit_square (AABB2D bounds, const std::function< glm::vec2()> &live_offset={}) noexcept
 Unit-square coordinates of a point within bounds.
 

Detailed Description

NDC-to-value mappings, inverse to the forward placement performed by geometry functions.

Each function returns a callable suitable for direct use as the projection argument of Portal::Forma::Geometry::wire_drag. They are pure: no window, no context, no element. A projection paired with the geometry function that shares its parameters is what makes a control draggable.

Every function below also takes an optional live_offset callable, defaulted to empty and a no-op when omitted. Every existing call site is unaffected. When supplied, it shifts the cursor position into the frame the projection's fixed geometry (bounds/center/path, captured at construction) was computed in, rather than re-deriving that geometry per call. This is the inverse of translating the drawn control by the same offset. It has no dependency on Portal::Forma: the caller supplies the accessor (e.g. a Scrollable's live offset), and this file only ever calls it.

Definition in file Projection.hpp.