MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Kinesis Namespace Reference

Namespaces

namespace  detail
 
namespace  Discrete
 
namespace  ForceFields
 
namespace  Stochastic
 

Classes

struct  BasisMatrices
 
struct  HitResult
 Entity id and perpendicular distance from the ray axis. More...
 
struct  NavigationConfig
 Tuning parameters for a first-person fly-navigation controller. More...
 
struct  NavigationState
 Mutable first-person navigation state. More...
 
struct  ProximityConfig
 
struct  QuadGeometry
 Textured quad vertex data together with its semantic layout descriptor. More...
 
struct  QueryResult
 Result entry from a spatial query, carrying entity id and squared distance. More...
 
struct  Ray
 Origin and normalized direction in world space. More...
 
struct  SamplerBounds
 Spatial domain for vertex generation. More...
 
struct  SampleResult
 Position, color, orientation, and scalar derived from spatial sampling. More...
 
class  SpatialIndex
 Lock-free spatial acceleration structure with atomic snapshot publication. More...
 
struct  SpatialSnapshot
 Immutable spatial snapshot published atomically for lock-free reads. More...
 
struct  Tendency
 Typed, composable, stateless callable from domain D to range R. More...
 
struct  ViewTransform
 View and projection matrices as a named push constant slot. More...
 

Typedefs

using EdgeList = std::vector< std::pair< size_t, size_t > >
 
using ScalarField = Tendency< float, float >
 
using SpatialField = Tendency< glm::vec3, float >
 
using SpatialIndex3D = SpatialIndex< glm::vec3 >
 
using SpatialIndexND = SpatialIndex< Eigen::VectorXd >
 
using TemporalField = Tendency< float, float >
 
using UVField = Tendency< glm::vec3, glm::vec2 >
 
using VectorField = Tendency< glm::vec3, glm::vec3 >
 

Enumerations

enum class  DistanceMetric : uint8_t { EUCLIDEAN , EUCLIDEAN_SQUARED , MANHATTAN , CHEBYSHEV }
 Distance computation strategy for spatial queries. More...
 
enum class  InterpolationMode : uint8_t {
  LINEAR , CATMULL_ROM , CUBIC_HERMITE , CUBIC_BEZIER ,
  QUADRATIC_BEZIER , BSPLINE , COSINE , CUSTOM
}
 Mathematical interpolation methods. More...
 
enum class  ProximityMode : uint8_t {
  K_NEAREST , RADIUS_THRESHOLD , MINIMUM_SPANNING_TREE , GABRIEL_GRAPH ,
  RELATIVE_NEIGHBORHOOD_GRAPH , SEQUENTIAL , NEAREST_NEIGHBOR , CUSTOM
}
 
enum class  SpatialDistribution : uint8_t {
  RANDOM_VOLUME , RANDOM_SURFACE , GRID , SPHERE_VOLUME ,
  SPHERE_SURFACE , UNIFORM_GRID , RANDOM_SPHERE , RANDOM_CUBE ,
  PERLIN_FIELD , BROWNIAN_PATH , STRATIFIED_CUBE , SPLINE_PATH ,
  LISSAJOUS , FIBONACCI_SPHERE , FIBONACCI_SPIRAL , TORUS ,
  EMPTY
}
 Spatial distribution mode for point cloud and particle generation. More...
 

Functions

std::vector< Nodes::LineVertexapply_color_gradient (const std::vector< glm::vec3 > &positions, const std::vector< glm::vec3 > &colors, const std::vector< float > &color_positions={}, float default_thickness=1.0F)
 Apply color interpolation to position vertices.
 
void apply_mouse_delta (NavigationState &state, float dx, float dy)
 Apply a mouse delta to yaw and pitch.
 
void apply_rotation (std::vector< glm::vec3 > &vertices, const glm::vec3 &axis, float angle, const glm::vec3 &origin=glm::vec3(0))
 Apply rotation to vertex set around arbitrary axis.
 
void apply_scale (std::vector< glm::vec3 > &vertices, const glm::vec3 &scale, const glm::vec3 &origin=glm::vec3(0))
 Apply non-uniform scaling to vertex set.
 
void apply_scroll (NavigationState &state, float ticks)
 Dolly eye along the current forward vector.
 
void apply_transform (std::vector< glm::vec3 > &vertices, const glm::mat4 &transform)
 Apply rigid transformation to vertex set.
 
void apply_translation (std::vector< glm::vec3 > &vertices, const glm::vec3 &displacement)
 Apply translation to vertex set.
 
std::vector< Nodes::LineVertexapply_uniform_color (const std::vector< glm::vec3 > &positions, const glm::vec3 &color, float default_thickness=1.0F)
 Apply uniform color to position vertices.
 
void apply_uniform_scale (std::vector< glm::vec3 > &vertices, float scale, const glm::vec3 &origin=glm::vec3(0))
 Apply uniform scaling to vertex set.
 
std::vector< Nodes::LineVertexapply_vertex_colors (const std::vector< glm::vec3 > &positions, const std::vector< glm::vec3 > &colors, float default_thickness=1.0F)
 Convert positions to LineVertex with per-vertex colors.
 
float aspect_ratio (uint32_t width, uint32_t height)
 Aspect ratio from pixel dimensions.
 
UVField axial_blend (const glm::vec3 &origin=glm::vec3(0.0F), float scale=1.0F, float blend=4.0F)
 axial_blend projection: blend of three axis-aligned planar projections
 
Eigen::VectorXd bspline_cubic (const Eigen::MatrixXd &control_points, double t)
 Uniform B-spline interpolation using Eigen matrices.
 
UVField cartesian (const glm::vec3 &axis=glm::vec3(0.0F, 0.0F, 1.0F), const glm::vec3 &origin=glm::vec3(0.0F), float scale=1.0F)
 cartesian projection along a chosen axis
 
Eigen::VectorXd catmull_rom_spline (const Eigen::MatrixXd &control_points, double t, double tension=0.5)
 Catmull-Rom spline interpolation using Eigen matrices.
 
template<typename A , typename B , typename C >
Tendency< A, C > chain (const Tendency< A, B > &first, const Tendency< B, C > &second)
 Sequential composition: evaluate first, feed result into second.
 
template<typename D >
Tendency< D, float > clamp (const Tendency< D, float > &t, float lo, float hi)
 Clamp scalar output to [lo, hi].
 
template<typename D , typename R , typename BinaryOp >
Tendency< D, R > combine (const Tendency< D, R > &a, const Tendency< D, R > &b, BinaryOp op)
 Combine two tendencies with a binary operation on their outputs.
 
double compute_arc_length (const Eigen::MatrixXd &points)
 Compute arc length of curve using trapezoidal rule.
 
Eigen::VectorXd compute_arc_length_table (const Eigen::MatrixXd &points)
 Compute arc length parameterization table.
 
std::vector< glm::vec3 > compute_convex_hull_2d (const std::vector< glm::vec3 > &vertices, const glm::vec3 &projection_normal=glm::vec3(0, 0, 1))
 Compute convex hull of vertex set (2D projection)
 
std::vector< Nodes::LineVertexcompute_path_curvature (const std::vector< Nodes::LineVertex > &path_vertices, float curvature_scale, size_t stride=1)
 Compute curvature vectors along a path (2nd derivative approximation)
 
std::vector< Nodes::LineVertexcompute_path_normals (const std::vector< Nodes::LineVertex > &path_vertices, float normal_length, size_t stride=1)
 Compute normal vectors along a piecewise-linear path.
 
std::vector< Nodes::LineVertexcompute_path_tangents (const std::vector< Nodes::LineVertex > &path_vertices, float tangent_length, size_t stride=1)
 Compute tangent vectors along a piecewise-linear path.
 
ViewTransform compute_view_transform (NavigationState &state, float aspect)
 Compute a ViewTransform from the current NavigationState.
 
template<typename D , typename R >
Tendency< D, R > constant (R value)
 Tendency returning a fixed value regardless of input.
 
Eigen::MatrixXd create_rotation_matrix (double angle, uint32_t axis=2, uint32_t dimensions=2)
 Create N-dimensional rotation matrix.
 
Eigen::MatrixXd create_rotation_scaling_matrix (double angle, const std::vector< double > &scale_factors, uint32_t axis=2, uint32_t dimensions=2)
 Compose rotation then scaling: S * R.
 
Eigen::MatrixXd create_scaling_matrix (const std::vector< double > &scale_factors)
 Create diagonal scaling matrix from per-axis factors.
 
Eigen::VectorXd create_translation_vector (const std::vector< double > &offsets)
 Create translation vector (not a matrix; affine embedding is caller's concern)
 
Eigen::MatrixXd create_uniform_scaling_matrix (double scale, uint32_t dimensions)
 Create uniform scaling matrix.
 
Eigen::VectorXd cubic_bezier (const Eigen::MatrixXd &control_points, double t)
 Cubic Bezier interpolation using Eigen matrices.
 
Eigen::VectorXd cubic_hermite (const Eigen::MatrixXd &endpoints, const Eigen::MatrixXd &tangents, double t)
 Cubic Hermite interpolation using Eigen matrices.
 
EdgeList custom_proximity_graph (const Eigen::MatrixXd &points, const std::function< EdgeList(const Eigen::MatrixXd &)> &connection_function)
 Custom proximity graph via user function.
 
UVField cylindrical (const glm::vec3 &axis=glm::vec3(0.0F, 1.0F, 0.0F), const glm::vec3 &origin=glm::vec3(0.0F), float radius=1.0F, float height=1.0F)
 Cylindrical projection around a world axis.
 
SpatialField distance (const glm::vec3 &anchor, float radius, DistanceMetric metric=DistanceMetric::EUCLIDEAN)
 Normalized distance from an anchor point using the specified metric.
 
EdgeList gabriel_graph (const Eigen::MatrixXd &points)
 Compute Gabriel graph.
 
std::vector< glm::vec3 > generate_circle (const glm::vec3 &center, float radius, size_t segments, const glm::vec3 &normal=glm::vec3(0, 0, 1))
 Generate vertices along a circular path.
 
std::vector< glm::vec3 > generate_ellipse (const glm::vec3 &center, float semi_major, float semi_minor, size_t segments, const glm::vec3 &normal=glm::vec3(0, 0, 1))
 Generate vertices along an elliptical path.
 
Eigen::MatrixXd generate_interpolated_points (const Eigen::MatrixXd &control_points, Eigen::Index num_samples, InterpolationMode mode, double tension=0.5)
 Generate interpolated points from control points.
 
EdgeList generate_proximity_graph (const Eigen::MatrixXd &points, const ProximityConfig &config)
 Generate proximity graph using specified mode.
 
QuadGeometry generate_quad (glm::vec2 position=glm::vec2(0.0F), glm::vec2 scale=glm::vec2(1.0F), float rotation=0.0F)
 Generate a textured quad centred on the origin.
 
std::vector< glm::vec3 > generate_rectangle (const glm::vec3 &center, float width, float height, const glm::vec3 &normal=glm::vec3(0, 0, 1))
 Generate vertices of an axis-aligned rectangular path.
 
std::vector< glm::vec3 > generate_regular_polygon (const glm::vec3 &center, float radius, size_t sides, const glm::vec3 &normal=glm::vec3(0, 0, 1), float phase_offset=0.0F)
 Generate vertices of a regular n-gon.
 
SampleResult generate_sample_at (SpatialDistribution distribution, size_t index, size_t total, const SamplerBounds &bounds, Kinesis::Stochastic::Stochastic &rng)
 Generate a single sample at a specific index (for indexed/sequential modes).
 
std::vector< SampleResultgenerate_samples (SpatialDistribution distribution, size_t count, const SamplerBounds &bounds, Kinesis::Stochastic::Stochastic &rng)
 Generate a batch of spatially distributed samples.
 
bool in_bounds (double window_x, double window_y, uint32_t width, uint32_t height)
 Check if a window-space point is within bounds.
 
Eigen::VectorXd interpolate (const Eigen::MatrixXd &control_points, double t, InterpolationMode mode, double tension=0.5)
 Generic interpolation dispatcher.
 
Kakshya::DataVariant interpolate_nddata (const Kakshya::DataVariant &control_points, Eigen::Index num_samples, InterpolationMode mode, double tension=0.5)
 Process DataVariant through interpolation.
 
template<typename D >
Tendency< D, float > invert (const Tendency< D, float > &t)
 Negate a scalar-output tendency.
 
VectorField invert (const VectorField &t)
 Negate all components of a vector field.
 
EdgeList k_nearest_neighbors (const Eigen::MatrixXd &points, size_t k)
 Compute K-nearest neighbors graph.
 
template<typename D >
Tendency< D, float > lerp (const Tendency< D, float > &a, const Tendency< D, float > &b, const Tendency< D, float > &weight)
 Interpolate between two tendencies controlled by a weight tendency.
 
ViewTransform look_at (const glm::vec3 &eye, const glm::vec3 &target, const glm::vec3 &up=glm::vec3(0.0F, 1.0F, 0.0F))
 Construct view matrix from eye position, target, and up vector.
 
ViewTransform look_at_perspective (const glm::vec3 &eye, const glm::vec3 &target, float fov_radians, float aspect, float near, float far, const glm::vec3 &up=glm::vec3(0.0F, 1.0F, 0.0F))
 Construct complete ViewTransform from look-at and perspective parameters.
 
NavigationState make_navigation_state (const NavigationConfig &config)
 Construct a NavigationState from a NavigationConfig.
 
std::unique_ptr< SpatialIndex3Dmake_spatial_index_3d (float cell_size)
 Create a 3D spatial index with Euclidean squared distance.
 
std::unique_ptr< SpatialIndexNDmake_spatial_index_nd (float cell_size, uint32_t dimensions)
 Create an N-dimensional spatial index with Euclidean squared distance.
 
EdgeList minimum_spanning_tree (const Eigen::MatrixXd &points)
 Compute minimum spanning tree (Prim's algorithm)
 
EdgeList nearest_neighbor_graph (const Eigen::MatrixXd &points)
 Compute nearest neighbor graph.
 
ViewTransform ortho (float left, float right, float bottom, float top, float near=-1.0F, float far=1.0F)
 Construct orthographic projection matrix.
 
ViewTransform perspective (float fov_radians, float aspect, float near, float far)
 Construct perspective projection matrix.
 
float point_ray_distance_sq (const Ray &ray, const glm::vec3 &point, float *out_t=nullptr)
 Squared perpendicular distance from a point to an infinite ray.
 
void project_onto_plane (std::vector< glm::vec3 > &vertices, const glm::vec3 &plane_point, const glm::vec3 &plane_normal)
 Project vertices onto plane defined by normal.
 
Eigen::VectorXd quadratic_bezier (const Eigen::MatrixXd &control_points, double t)
 Quadratic Bezier interpolation using Eigen matrices.
 
EdgeList radius_threshold_graph (const Eigen::MatrixXd &points, double radius)
 Compute radius threshold graph.
 
std::optional< HitResultray_cast (const SpatialIndex3D &index, const Ray &ray, float tolerance)
 Find the closest entity to a ray within a tolerance radius.
 
std::vector< HitResultray_cast_all (const SpatialIndex3D &index, const Ray &ray, float tolerance)
 Find all entities within tolerance of a ray, sorted by distance.
 
EdgeList relative_neighborhood_graph (const Eigen::MatrixXd &points)
 Compute relative neighborhood graph.
 
Eigen::MatrixXd reparameterize_by_arc_length (const Eigen::MatrixXd &points, Eigen::Index num_samples)
 Reparameterize curve by arc length.
 
std::vector< Nodes::LineVertexreparameterize_by_arc_length (const std::vector< Nodes::LineVertex > &path_vertices, size_t num_samples)
 Resample path vertices for arc-length parameterization.
 
std::vector< glm::vec3 > sample_parametric_curve (const std::function< glm::vec3(float)> &curve, size_t samples)
 Sample parametric curve uniformly in parameter space.
 
template<typename D >
Tendency< D, float > scale (const Tendency< D, float > &t, float factor)
 Uniform scaling of a scalar-output tendency.
 
VectorField scale (const VectorField &t, float factor)
 Uniform scaling of a vector field.
 
Ray screen_to_ray (double window_x, double window_y, uint32_t width, uint32_t height, const ViewTransform &vt)
 Construct a world-space ray from window pixel coordinates.
 
template<typename D , typename R >
Tendency< D, R > select (const Tendency< D, float > &predicate, const Tendency< D, R > &then_t, const Tendency< D, R > &else_t)
 Select between two tendencies based on a predicate tendency.
 
EdgeList sequential_chain (const Eigen::MatrixXd &points)
 Compute sequential chain graph.
 
ScalarField sigmoid (float k, float midpoint=0.0F)
 Sigmoid: 1 / (1 + e^(-k * (x - midpoint)))
 
ScalarField smoothstep (float edge0, float edge1)
 Smoothstep: cubic Hermite interpolation between two edges.
 
void snap_ortho (NavigationState &state, int view)
 Snap to a named ortho view.
 
UVField spherical (const glm::vec3 &centre=glm::vec3(0.0F))
 Spherical projection from a centre point.
 
template<typename D >
Tendency< D, float > threshold (const Tendency< D, float > &t, float thresh)
 Zero output below threshold, pass through above.
 
Nodes::LineVertex to_line_vertex (const SampleResult &s, glm::vec2 thickness_range={ 1.0F, 2.0F }) noexcept
 Project SampleResult to LineVertex.
 
std::vector< Nodes::LineVertexto_line_vertices (std::span< const SampleResult > samples, glm::vec2 thickness_range={ 1.0F, 2.0F })
 Batch-project SampleResult vector to LineVertex.
 
Nodes::MeshVertex to_mesh_vertex (const SampleResult &s, glm::vec2 weight_range={ 0.0F, 1.0F }) noexcept
 Project SampleResult to MeshVertex.
 
std::vector< Nodes::MeshVertexto_mesh_vertices (std::span< const SampleResult > samples, glm::vec2 weight_range={ 0.0F, 1.0F })
 Batch-project SampleResult vector to MeshVertex.
 
glm::vec3 to_ndc (double window_x, double window_y, uint32_t width, uint32_t height)
 Convert window pixel coordinates to NDC.
 
glm::vec3 to_ndc_aspect (double window_x, double window_y, uint32_t width, uint32_t height)
 Convert window pixel coordinates to NDC, corrected for aspect ratio.
 
Nodes::PointVertex to_point_vertex (const SampleResult &s, glm::vec2 size_range={ 8.0F, 12.0F }) noexcept
 Project SampleResult to PointVertex.
 
std::vector< Nodes::PointVertexto_point_vertices (std::span< const SampleResult > samples, glm::vec2 size_range={ 8.0F, 12.0F })
 Batch-project SampleResult vector to PointVertex.
 
glm::vec2 to_window (const glm::vec3 &ndc, uint32_t width, uint32_t height)
 Convert NDC to window pixel coordinates.
 
ScalarField transfer_curve (const std::vector< float > &coefficients)
 Transfer curve from polynomial coefficients (highest power first)