Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::view::motion::TraceBuilder Class Reference

#include <motion.hpp>

Public Types

using ValueSampler = std::function<double()>
using Component = std::pair<std::string, ValueSampler>

Public Member Functions

TraceBuilder & value (std::string name, ValueSampler sampler, int precision=3, double epsilon=0.0001)
 Single-scalar metric. The sampler is invoked once per sampler tick.
TraceBuilder & multi (std::string name, std::vector< Component > components, int precision=3, double epsilon=0.0001)
 Multi-component metric (e.g., a 2D point).
TraceBuilder & geometry (std::string name, pulp::view::View &target, std::vector< GeometryProperty > props={GeometryProperty::MinX, GeometryProperty::MinY, GeometryProperty::Width, GeometryProperty::Height}, GeometrySpace space=GeometrySpace::Window, GeometrySource source=GeometrySource::Layout, int precision=2, double epsilon=0.1)
 Geometry metric over a target view.
TraceBuilder & scroll_geometry (std::string name, pulp::view::ScrollView &target, std::vector< ScrollProperty > props={ ScrollProperty::ContentOffsetX, ScrollProperty::ContentOffsetY, ScrollProperty::VisibleRectMinY, ScrollProperty::VisibleRectHeight, }, int precision=2, double epsilon=0.1)
 Scroll-geometry metric over a ScrollView.
TraceBuilder & with_provenance (Provenance p)
 Attach a provenance envelope to the trace.
TraceHandle attach ()
 Register the trace with the coordinator and return an owning handle.

Friends

class Coordinator

Member Typedef Documentation

◆ Component

◆ ValueSampler

using pulp::view::motion::TraceBuilder::ValueSampler = std::function<double()>

Member Function Documentation

◆ attach()

TraceHandle pulp::view::motion::TraceBuilder::attach ( )

Register the trace with the coordinator and return an owning handle.

◆ geometry()

TraceBuilder & pulp::view::motion::TraceBuilder::geometry ( std::string name,
pulp::view::View & target,
std::vector< GeometryProperty > props = {GeometryProperty::MinX, GeometryProperty::MinY, GeometryProperty::Width, GeometryProperty::Height},
GeometrySpace space = GeometrySpace::Window,
GeometrySource source = GeometrySource::Layout,
int precision = 2,
double epsilon = 0.1 )

Geometry metric over a target view.

Presentation currently falls back to Layout.

◆ multi()

TraceBuilder & pulp::view::motion::TraceBuilder::multi ( std::string name,
std::vector< Component > components,
int precision = 3,
double epsilon = 0.0001 )

Multi-component metric (e.g., a 2D point).

Components are sampled together and emitted as one log line.

◆ scroll_geometry()

TraceBuilder & pulp::view::motion::TraceBuilder::scroll_geometry ( std::string name,
pulp::view::ScrollView & target,
std::vector< ScrollProperty > props = { ScrollProperty::ContentOffsetX, ScrollProperty::ContentOffsetY, ScrollProperty::VisibleRectMinY, ScrollProperty::VisibleRectHeight, },
int precision = 2,
double epsilon = 0.1 )

Scroll-geometry metric over a ScrollView.

Emits the requested ScrollProperty set as a multi-component sample using camelCase component names ("contentOffsetX", "visibleRectMinY", …) so fixture diffs read naturally next to geometry() traces. Passing an empty props list defaults to the most common 4 properties (ContentOffsetX, ContentOffsetY, VisibleRectMinY, VisibleRectHeight).

◆ value()

TraceBuilder & pulp::view::motion::TraceBuilder::value ( std::string name,
ValueSampler sampler,
int precision = 3,
double epsilon = 0.0001 )

Single-scalar metric. The sampler is invoked once per sampler tick.

◆ with_provenance()

TraceBuilder & pulp::view::motion::TraceBuilder::with_provenance ( Provenance p)

Attach a provenance envelope to the trace.

Emitted once on the trace's TraceStarted event.

◆ Coordinator

friend class Coordinator
friend

The documentation for this class was generated from the following file:
  • /home/runner/work/pulp/pulp/core/view/include/pulp/view/motion.hpp