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

CSS easing function — maps a normalized progress t ∈ [0,1] to an eased progress p ∈ [0,1]. More...

#include <css_animation.hpp>

Public Types

enum class  Kind {
  linear , ease , ease_in , ease_out ,
  ease_in_out , cubic_bezier , steps_start , steps_end
}

Public Member Functions

float at (float t) const
 Evaluate the easing at progress t ∈ [0,1].

Static Public Member Functions

static float cubic_bezier_y (float x, float p1x, float p1y, float p2x, float p2y)
 Evaluate a CSS cubic-bezier(p1x, p1y, p2x, p2y) at progress x.
static CssEasing from_keyword (const std::string &s)
 Parse a CSS easing keyword. Unrecognized → linear.

Public Attributes

Kind kind = Kind::ease
 CSS spec — transition-timing-function defaults to ease, NOT linear.
float p1x = 0.25f
 Cubic-bezier control points.
float p1y = 0.1f
float p2x = 0.25f
float p2y = 1.0f
int steps_count = 1

Detailed Description

CSS easing function — maps a normalized progress t ∈ [0,1] to an eased progress p ∈ [0,1].

Pulp follows the CSS Animations Module Level 1 vocabulary; advanced spec values (steps(), cubic-bezier) are parsed into structured forms below and evaluated here.

Member Enumeration Documentation

◆ Kind

enum class pulp::view::CssEasing::Kind
strong
Enumerator
linear 
ease 
ease_in 
ease_out 
ease_in_out 
cubic_bezier 
steps_start 
steps_end 

Member Function Documentation

◆ at()

float pulp::view::CssEasing::at ( float t) const
inline

Evaluate the easing at progress t ∈ [0,1].

◆ cubic_bezier_y()

float pulp::view::CssEasing::cubic_bezier_y ( float x,
float p1x,
float p1y,
float p2x,
float p2y )
inlinestatic

Evaluate a CSS cubic-bezier(p1x, p1y, p2x, p2y) at progress x.

Newton-Raphson solve for x(u) → u, then evaluate y(u). 6 iterations is plenty for 1/255 precision.

◆ from_keyword()

CssEasing pulp::view::CssEasing::from_keyword ( const std::string & s)
inlinestatic

Parse a CSS easing keyword. Unrecognized → linear.

Member Data Documentation

◆ kind

Kind pulp::view::CssEasing::kind = Kind::ease

CSS spec — transition-timing-function defaults to ease, NOT linear.

Default-constructed CssEasing matches the spec so declarations like transition: opacity 200ms (no explicit timing token) animate with the right curve out of the box.

◆ p1x

float pulp::view::CssEasing::p1x = 0.25f

Cubic-bezier control points.

Default initializes to the ease curve (cubic-bezier(0.25, 0.1, 0.25, 1)) so the matrix view of kind and the explicit control-point view stay coherent.

◆ p1y

float pulp::view::CssEasing::p1y = 0.1f

◆ p2x

float pulp::view::CssEasing::p2x = 0.25f

◆ p2y

float pulp::view::CssEasing::p2y = 1.0f

◆ steps_count

int pulp::view::CssEasing::steps_count = 1

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