The Yoda namespace — core utilities for the doxyYoda demo. More...
Namespaces | |
| namespace | palette |
| Color palette constants from the Solarized scheme. | |
Classes | |
| class | ScopedTimer |
| A simple RAII-based timer for benchmarking. More... | |
| class | Vec2 |
| A 2D vector with common geometric operations. More... | |
Typedefs | |
| using | Vec2d = Vec2<double> |
| Convenience alias for a double-precision 2D vector. | |
| using | Vec2i = Vec2<int> |
| Convenience alias for an integer 2D vector. | |
Enumerations | |
| enum class | Interpolation { Linear , Cosine , Cubic , CatmullRom } |
| Interpolation methods available for smoothing operations. More... | |
Functions | |
| template<typename T> | |
| std::optional< T > | find_if (const std::vector< T > &values, std::function< bool(const T &)> pred) |
| Find the first element satisfying a predicate. | |
| double | lerp (double a, double b, double t) |
| Linearly interpolate between two values. | |
| template<typename T> | |
| std::vector< T > | map (const std::vector< T > &values, std::function< T(T)> fn) |
| Apply a function element-wise to a vector of values. | |
The Yoda namespace — core utilities for the doxyYoda demo.
This namespace contains example classes, functions, and types that exercise every major Doxygen documentation construct.
| using yoda::Vec2d = Vec2<double> |
| using yoda::Vec2i = Vec2<int> |
|
strong |
Interpolation methods available for smoothing operations.
Demonstrates enum documentation with per-enumerator descriptions.
| Enumerator | |
|---|---|
| Linear | Simple linear interpolation: \( f(t) = a + t(b - a) \). |
| Cosine | Cosine-smoothed interpolation. |
| Cubic | Cubic Hermite interpolation. |
| CatmullRom | Catmull-Rom spline interpolation. |
| std::optional< T > yoda::find_if | ( | const std::vector< T > & | values, |
| std::function< bool(const T &)> | pred ) |
Find the first element satisfying a predicate.
| T | Element type. |
| values | The input container. |
| pred | A unary predicate. |
std::nullopt.Definition at line 228 of file yoda.hpp.
|
inline |
Linearly interpolate between two values.
Computes:
\[ \text{lerp}(a, b, t) = (1 - t) \cdot a + t \cdot b \]
| a | Start value. |
| b | End value. |
| t | Interpolation factor in \([0, 1]\). |
Definition at line 185 of file yoda.hpp.
| std::vector< T > yoda::map | ( | const std::vector< T > & | values, |
| std::function< T(T)> | fn ) |
Apply a function element-wise to a vector of values.
| T | Element type. |
| values | Input values. |
| fn | The transformation function. |
fn applied to each element.Example usage:
std::ranges::transform with C++20 instead. Definition at line 206 of file yoda.hpp.