2#include <ossia/detail/typelist.hpp>
5#include <boost/mp11/algorithm.hpp>
6#include <boost/mp11/list.hpp>
11using list = ossia::tl<
13 quadraticIn, quadraticOut, quadraticInOut,
14 cubicIn, cubicOut, cubicInOut,
15 quarticIn, quarticOut, quarticInOut,
16 quinticIn, quinticOut, quinticInOut,
17 sineIn, sineOut, sineInOut,
18 circularIn, circularOut, circularInOut,
19 exponentialIn, exponentialOut, exponentialInOut,
20 elasticIn, elasticOut, elasticInOut,
21 backIn, backOut, backInOut,
22 bounceIn, bounceOut, bounceInOut,
26constexpr void for_each(
auto&& func) {
27 func.template operator()<
29 quadraticIn, quadraticOut, quadraticInOut,
30 cubicIn, cubicOut, cubicInOut,
31 quarticIn, quarticOut, quarticInOut,
32 quinticIn, quinticOut, quinticInOut,
33 sineIn, sineOut, sineInOut,
34 circularIn, circularOut, circularInOut,
35 exponentialIn, exponentialOut, exponentialInOut,
36 elasticIn, elasticOut, elasticInOut,
37 backIn, backOut, backInOut,
38 bounceIn, bounceOut, bounceInOut,
45template <
typename Easing,
typename Y>
46constexpr auto make_easing(Y start, Y end)
noexcept
48 return [start, end](Y ratio)
constexpr noexcept {
49 return easing::ease{}(start, end, Easing{}(ratio));
54constexpr void make_easing(
auto& res, std::string_view easing, Y start, Y end)
noexcept
56 auto apply_if_easing = [&res, easing, start, end]<
typename Easing>()
noexcept {
57 constexpr auto name = Easing::name();
60 res = make_easing<Easing, Y>(start, end);
65 easing::for_each([apply_if_easing]<
typename... Easings>() {
66 (apply_if_easing.template operator()<Easings>() || ...);
71constexpr void make_easing(
auto& res, std::string_view easing)
noexcept
73 auto apply_if_easing = [&res, easing]<
typename Easing>()
noexcept {
74 constexpr auto name = Easing::name();
82 easing::for_each([apply_if_easing]<
typename... Easings>() {
83 (apply_if_easing.template operator()<Easings>() || ...);