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

Classes

class  CameraContainer
 Single-slot live video container for camera device streams. More...
 
struct  ContainerDataStructure
 Container structure for consistent dimension ordering. More...
 
class  ContiguousAccessProcessor
 
class  CursorAccessProcessor
 Independent cursor reader for DynamicSoundStream, writing exclusively to a dynamic slot allocated at attach time. More...
 
class  DataAccess
 Type-erased accessor for NDData with semantic view construction. More...
 
struct  DataConverter
 
struct  DataConverter< From, To, std::enable_if_t< ArithmeticData< From > &&ArithmeticData< To > &&!std::is_same_v< From, To > &&!GlmType< From > &&!GlmType< To > > >
 
struct  DataConverter< From, To, std::enable_if_t< ArithmeticData< From > &&ComplexData< To > &&!GlmType< From > &&!GlmType< To > > >
 
struct  DataConverter< From, To, std::enable_if_t< ArithmeticData< From > &&GlmType< To > &&!GlmType< From > > >
 
struct  DataConverter< From, To, std::enable_if_t< ComplexData< From > &&ArithmeticData< To > &&!GlmType< From > &&!GlmType< To > > >
 
struct  DataConverter< From, To, std::enable_if_t< ComplexData< From > &&ComplexData< To > &&!GlmType< From > &&!GlmType< To > &&!std::is_same_v< From, To > > >
 
struct  DataConverter< From, To, std::enable_if_t< GlmType< From > &&ArithmeticData< To > &&!GlmType< To > > >
 
struct  DataConverter< From, To, std::enable_if_t< GlmType< From > &&GlmType< To > &&!std::is_same_v< From, To > &&(glm_component_count< From >()==glm_component_count< To >())> >
 
struct  DataConverter< T, T >
 
struct  DataDimension
 Minimal dimension descriptor focusing on structure only. More...
 
class  DataInsertion
 Type-erased writer for NDData with semantic construction. More...
 
class  DataProcessingChain
 Manages collection of data processors or flexible, composable pipelines. More...
 
class  DataProcessor
 Interface for processing data within SignalSourceContainer objects. More...
 
class  DynamicRegionProcessor
 Extends RegionOrganizationProcessor with dynamic, runtime reorganization capabilities. More...
 
class  DynamicSoundStream
 Dynamic capacity streaming audio container with automatic resizing and circular buffering. More...
 
class  EigenAccess
 Type-erased accessor for converting DataVariant to Eigen types. More...
 
class  EigenInsertion
 Type-erased writer for converting Eigen types to DataVariant. More...
 
class  FileContainer
 Marker interface for containers backed by file storage (in-memory only). More...
 
class  FrameAccessProcessor
 
struct  MeshAccess
 Non-owning read view over a pair of DataVariant streams representing interleaved vertex bytes and a flat uint32_t index array. More...
 
struct  MeshData
 Owning CPU-side representation of a loaded or generated mesh. More...
 
class  MeshInsertion
 Write counterpart to MeshAccess. More...
 
struct  MeshSubrange
 Byte-range descriptor for one submesh within the shared index buffer. More...
 
class  NDDataContainer
 Abstract interface for N-dimensional data containers. More...
 
struct  OrganizedRegion
 A structured audio region with metadata and transition information. More...
 
struct  Region
 Represents a point or span in N-dimensional space. More...
 
struct  RegionCache
 Stores cached data for a region, with metadata for cache management. More...
 
class  RegionCacheManager
 Manages caching of region data for efficient access and eviction. More...
 
struct  RegionGroup
 Organizes related signal regions into a categorized collection. More...
 
struct  RegionHash
 
class  RegionOrganizationProcessor
 Data-driven processor for organizing and processing non-linear audio regions. More...
 
class  RegionProcessorBase
 Base class for N-dimensional region processors. More...
 
struct  RegionSegment
 Represents a discrete segment of audio data with caching capabilities. More...
 
class  SignalSourceContainer
 Data-driven interface for managing arbitrary processable signal sources. More...
 
class  SoundFileContainer
 File-backed audio container with complete streaming functionality. More...
 
class  SoundStreamContainer
 Concrete base implementation for streaming audio containers. More...
 
class  SpatialRegionProcessor
 Parallel spatial extraction processor for image-modality containers. More...
 
class  StreamContainer
 Data-driven interface for temporal stream containers with navigable read position. More...
 
struct  StreamSlice
 A bounded region of a DynamicSoundStream with associated playback parameters. More...
 
class  StructuredView
 Span-like view that interprets flat data as structured types (glm::vec3, etc.) More...
 
struct  TextureAccess
 Memory-compatible view of a DataVariant for texel upload. More...
 
class  TextureContainer
 SignalSourceContainer wrapping GPU texture data as addressable pixel bytes. More...
 
struct  VertexAccess
 Memory-compatible view of a DataVariant for vertex buffer upload. More...
 
struct  VertexAccessConfig
 Default attribute values for shader-compatible vertex conversion. More...
 
struct  VertexAttributeLayout
 Semantic description of a single vertex attribute. More...
 
struct  VertexLayout
 Complete description of vertex data layout in a buffer. More...
 
class  VideoFileContainer
 File-backed video container — semantic marker over VideoStreamContainer. More...
 
class  VideoStreamContainer
 Concrete base implementation for streaming video containers. More...
 
class  WindowAccessProcessor
 Default DataProcessor for WindowContainer. More...
 
class  WindowContainer
 SignalSourceContainer wrapping a live GLFW/Vulkan window surface. More...
 

Typedefs

using DataVariant = std::variant< std::vector< double >, std::vector< float >, std::vector< uint8_t >, std::vector< uint16_t >, std::vector< uint32_t >, std::vector< std::complex< float > >, std::vector< std::complex< double > >, std::vector< glm::vec2 >, std::vector< glm::vec3 >, std::vector< glm::vec4 >, std::vector< glm::mat4 > >
 Multi-type data storage for different precision needs.
 
using RegionOrganizer = std::function< void(std::vector< OrganizedRegion > &, std::shared_ptr< SignalSourceContainer >)>
 Function type for dynamic region reorganization.
 
using RegionTaper = std::function< void(std::span< double >)>
 Per-region taper applied in-place before the write callback is invoked.
 
using RegionWriteFn = std::function< void(size_t region_idx, uint32_t channel, std::span< double >)>
 Callback invoked once per region per channel during iteration.
 

Enumerations

enum class  ComplexConversionStrategy : uint8_t { MAGNITUDE , REAL_PART , IMAG_PART , SQUARED_MAGNITUDE }
 Strategy for converting complex numbers to real values. More...
 
enum class  DataModality : uint8_t {
  AUDIO_1D , AUDIO_MULTICHANNEL , IMAGE_2D , IMAGE_COLOR ,
  VIDEO_GRAYSCALE , VIDEO_COLOR , TEXTURE_2D , TENSOR_ND ,
  SPECTRAL_2D , VOLUMETRIC_3D , VERTEX_POSITIONS_3D , VERTEX_NORMALS_3D ,
  VERTEX_TANGENTS_3D , VERTEX_COLORS_RGB , VERTEX_COLORS_RGBA , TEXTURE_COORDS_2D ,
  TRANSFORMATION_MATRIX , SCALAR_F32 , UNKNOWN
}
 Data modality types for cross-modal analysis. More...
 
enum class  GpuDataFormat : uint8_t {
  FLOAT32 , VEC2_F32 , VEC3_F32 , VEC4_F32 ,
  FLOAT64 , VEC2_F64 , VEC3_F64 , VEC4_F64 ,
  INT32 , UINT32 , UINT8 , UINT16
}
 GPU data formats with explicit precision levels. More...
 
enum class  MatrixInterpretation : uint8_t {
  SCALAR , COMPLEX , VEC2 , VEC3 ,
  VEC4 , MAT4 , AUTO
}
 How to interpret Eigen matrix rows/columns. More...
 
enum class  MemoryLayout : uint8_t { ROW_MAJOR , COLUMN_MAJOR }
 Memory layout for multi-dimensional data. More...
 
enum class  OrganizationStrategy : uint8_t { INTERLEAVED , PLANAR , HYBRID , USER_DEFINED }
 Data organization strategy for multi-channel/multi-frame data. More...
 
enum class  ProcessingState : uint8_t {
  IDLE , READY , PROCESSING , PROCESSED ,
  NEEDS_REMOVAL , ERROR
}
 Represents the current processing lifecycle state of a container. More...
 
enum class  RegionSelectionPattern : uint8_t {
  ALL , SEQUENTIAL , RANDOM , ROUND_ROBIN ,
  WEIGHTED , OVERLAP , EXCLUSIVE , CUSTOM
}
 Describes how regions are selected for processing or playback. More...
 
enum class  RegionState : uint8_t {
  IDLE , LOADING , READY , ACTIVE ,
  TRANSITIONING , UNLOADING
}
 Processing state for regions. More...
 
enum class  RegionTransition : uint8_t {
  IMMEDIATE , CROSSFADE , OVERLAP , GATED ,
  CALLBACK
}
 Describes how transitions between regions are handled. More...
 

Functions

void add_reference_region (std::vector< std::pair< std::string, Region > > &refs, const std::string &name, const Region &region)
 Add a named reference region to a reference list.
 
void add_region_group (std::unordered_map< std::string, RegionGroup > &groups, const RegionGroup &group)
 Add a RegionGroup to a group map.
 
std::vector< uint64_t > advance_position (const std::vector< uint64_t > &current_positions, const std::vector< uint64_t > &frames_per_channel, const ContainerDataStructure &structure, bool looping_enabled, const Region &loop_region)
 Advance current positions by specified frames per channel, with optional looping.
 
std::vector< uint64_t > advance_position (const std::vector< uint64_t > &current_positions, uint64_t frames_to_advance, const ContainerDataStructure &structure, bool looping_enabled, const Region &loop_region)
 Advance current positions by a number of frames, with optional looping.
 
std::unordered_map< std::string, std::any > analyze_access_pattern (const Region &region, const std::shared_ptr< SignalSourceContainer > &container)
 Determine optimal memory access pattern for region.
 
std::optional< VertexAccessas_line_vertex_access (const DataVariant &variant, const VertexAccessConfig &config={})
 Convert DataVariant to line-vertex-compatible bytes.
 
std::optional< MeshAccessas_mesh_access (const DataVariant &vertex_variant, const DataVariant &index_variant, const VertexLayout &layout, std::optional< RegionGroup > submeshes=std::nullopt)
 Construct a MeshAccess from two DataVariant instances.
 
std::optional< VertexAccessas_mesh_vertex_access (const DataVariant &variant, const VertexAccessConfig &config={})
 Convert DataVariant to mesh-vertex-compatible bytes.
 
std::optional< VertexAccessas_point_vertex_access (const DataVariant &variant, const VertexAccessConfig &config={})
 Convert DataVariant to point-vertex-compatible bytes.
 
std::optional< TextureAccessas_texture_access (const DataVariant &variant)
 Extract a TextureAccess from a DataVariant.
 
std::optional< VertexAccessas_vertex_access (const DataVariant &variant)
 Extract a VertexAccess from a DataVariant.
 
uint64_t calculate_frame_size (const std::vector< DataDimension > &dimensions)
 Calculate the frame size (number of elements per frame) for a set of dimensions.
 
uint64_t calculate_frame_size_for_dimension (const std::vector< DataDimension > &dimensions, size_t primary_dim=0)
 Calculate the frame size for a specific primary dimension.
 
Region calculate_output_region (const std::vector< uint64_t > &current_pos, const std::vector< uint64_t > &output_shape)
 Calculate output region bounds from current position and shape.
 
Region calculate_output_region (uint64_t current_frame, uint64_t frames_to_process, const std::shared_ptr< SignalSourceContainer > &container)
 Calculate output region for frame-based processing.
 
uint64_t calculate_region_size (const Region &region)
 Calculate the total number of elements in a region.
 
std::vector< uint64_t > calculate_strides (const std::vector< DataDimension > &dimensions)
 Calculate memory strides for each dimension (row-major order).
 
uint64_t calculate_total_elements (const std::vector< DataDimension > &dimensions)
 Calculate the total number of elements in an N-dimensional container.
 
void clamp_coordinates_to_bounds (std::vector< uint64_t > &coords, const std::vector< DataDimension > &dimensions)
 Clamp coordinates to valid container bounds.
 
template<typename From , typename To >
requires (ComplexData<From> && ArithmeticData<To>)
void convert_complex (std::span< From > source, std::span< To > destination, ComplexConversionStrategy strategy)
 Legacy interface - redirects to convert_data.
 
template<typename From , typename To >
std::span< To > convert_data (std::span< From > source, std::vector< To > &storage, ComplexConversionStrategy strategy=ComplexConversionStrategy::MAGNITUDE)
 Convert a span of one data type to another (with type conversion).
 
template<ProcessableData T>
std::span< T > convert_variant (const DataVariant &variant, ComplexConversionStrategy strategy=ComplexConversionStrategy::MAGNITUDE)
 
template<ProcessableData T>
std::span< T > convert_variant (DataVariant &variant, ComplexConversionStrategy strategy=ComplexConversionStrategy::MAGNITUDE)
 Get const span from DataVariant without conversion (zero-copy for matching types)
 
std::span< double > convert_variant_to_double (DataVariant &data, ComplexConversionStrategy strategy=ComplexConversionStrategy::MAGNITUDE)
 Convert variant to double span.
 
template<ProcessableData T>
std::vector< std::span< T > > convert_variants (const std::vector< DataVariant > &variants, ComplexConversionStrategy strategy=ComplexConversionStrategy::MAGNITUDE)
 
uint64_t coordinates_to_linear (const std::vector< uint64_t > &coords, const std::vector< DataDimension > &dimensions)
 Convert N-dimensional coordinates to a linear index for interleaved data.
 
std::pair< size_t, uint64_t > coordinates_to_planar_indices (const std::vector< uint64_t > &coords, const std::vector< DataDimension > &dimensions)
 Convert coordinates to planar indices (channel vector + frame index).
 
std::unordered_map< std::string, std::any > create_coordinate_mapping (const std::shared_ptr< SignalSourceContainer > &container)
 Create coordinate mapping information for container.
 
std::vector< std::unordered_map< std::string, std::any > > create_dimension_info (const std::vector< DataDimension > &dimensions)
 Create structured dimension information.
 
template<typename T >
std::vector< std::vector< T > > deinterleave_channels (std::span< const T > interleaved, size_t num_channels)
 Deinterleave a single vector into multiple channels.
 
std::vector< DataDimensiondetect_data_dimensions (const DataVariant &data)
 Detect data dimensions from a DataVariant.
 
std::vector< DataDimensiondetect_data_dimensions (const std::vector< DataVariant > &variants)
 
std::vector< Kakshya::DataDimensiondetect_data_dimensions (const std::vector< Kakshya::DataVariant > &variants)
 Detect data dimensions from a vector of DataVariants.
 
DataModality detect_data_modality (const std::vector< DataDimension > &dimensions)
 Detects data modality from dimension information.
 
DataModality detect_data_modality (const std::vector< DataDimension > &dimensions, const DataVariant &source)
 Detect data modality from dimensions and source variant scalar type.
 
std::vector< std::unordered_map< std::string, std::any > > extract_all_regions_info (const std::shared_ptr< SignalSourceContainer > &container)
 Extract all regions from container's region groups.
 
DataVariant extract_channel_data (const std::shared_ptr< SignalSourceContainer > &container, uint32_t channel_index)
 Extract data from a specific channel.
 
template<ProcessableData From, ProcessableData To>
std::span< To > extract_data (std::span< const From > source, std::vector< To > &destination, ComplexConversionStrategy strategy=ComplexConversionStrategy::MAGNITUDE)
 Concept-based data extraction with type conversion.
 
std::vector< int > extract_dimension_roles (const std::vector< DataDimension > &dimensions)
 Extract dimension roles as integers.
 
std::vector< uint64_t > extract_dimension_sizes (const std::vector< DataDimension > &dimensions)
 Extract dimension sizes.
 
template<ProcessableData T>
std::span< T > extract_frame (const std::vector< std::span< T > > &channel_spans, uint64_t frame_index, std::vector< T > &output_buffer) noexcept
 Extract a single frame from planar data (returns interleaved).
 
template<ProcessableData T>
constexpr std::span< T > extract_frame (std::span< T > data, uint64_t frame_index, uint64_t frame_size) noexcept
 Extract a single frame of data from a span.
 
template<ProcessableData T>
std::span< T > extract_from_variant (const DataVariant &variant, std::vector< T > &storage, ComplexConversionStrategy strategy=ComplexConversionStrategy::MAGNITUDE)
 Get typed span from DataVariant using concepts.
 
template<typename T >
std::optional< T > extract_from_variant_at (const DataVariant &variant, uint64_t pos)
 Extract a value of type T from a DataVariant at a specific position.
 
std::unordered_map< std::string, std::any > extract_group_bounds_info (const RegionGroup &group)
 Extract bounds information from region group.
 
template<typename T >
std::vector< std::vector< T > > extract_group_data (const std::vector< std::span< const T > > &source_spans, const RegionGroup &group, const std::vector< DataDimension > &dimensions, OrganizationStrategy organization)
 Extract data for multiple regions from multi-channel source data.
 
template<typename T >
std::vector< T > extract_nd_region (std::span< const T > src, const Region &region, const std::vector< DataDimension > &dims)
 Extract the data described by region from src using the container's dimension descriptors.
 
std::vector< std::span< double > > extract_numeric_data (const std::shared_ptr< SignalSourceContainer > &container)
 Extracts numeric data from container with fallback handling.
 
void extract_processed_data (const std::vector< DataVariant > &pd, OrganizationStrategy organization, uint64_t num_channels, uint32_t ch, std::span< double > output)
 Extract one channel's samples from a processed dynamic data block.
 
std::unordered_map< std::string, std::any > extract_processing_state_info (const std::shared_ptr< SignalSourceContainer > &container)
 Extract processing state information from container.
 
std::unordered_map< std::string, std::any > extract_processor_info (const std::shared_ptr< SignalSourceContainer > &container)
 Extract processor information from container.
 
template<typename T >
std::vector< std::vector< T > > extract_region (const std::vector< std::vector< T > > &source_data, const Region &region, const std::vector< DataDimension > &dimensions)
 Extract a region of data from vector of vectors (planar data).
 
template<typename T >
std::vector< T > extract_region (const std::vector< T > &data, const Region &region, const std::vector< DataDimension > &dimensions)
 Extract a region of data from a vector using a Region and dimension info.
 
std::unordered_map< std::string, std::any > extract_region_bounds_info (const Region &region)
 Extract structured bounds information from region.
 
std::vector< double > extract_region_channel (const Region &region, const std::shared_ptr< SignalSourceContainer > &container, uint32_t channel)
 Extract samples for a single channel within a Region from a container.
 
template<typename T >
std::vector< T > extract_region_data (const std::span< const T > &source_data, const Region &region, const std::vector< DataDimension > &dimensions)
 Extract a region of data from a flat data span using a Region and dimension info.
 
template<typename T >
std::vector< std::vector< T > > extract_region_data (const std::vector< std::span< const T > > &source_data, const Region &region, const std::vector< DataDimension > &dimensions, bool flatten=false)
 Extract region data from planar storage (separate per channel/variant)
 
template<typename T >
auto extract_region_data (const std::vector< std::span< const T > > &source_spans, const Region &region, const std::vector< DataDimension > &dimensions, OrganizationStrategy organization)
 Extract a region of data with organization strategy.
 
template<typename T >
std::vector< std::vector< T > > extract_segments_data (const std::vector< RegionSegment > &segments, const std::vector< std::span< const T > > &source_spans, const std::vector< DataDimension > &dimensions, OrganizationStrategy organization)
 Extract data for multiple segments from multi-channel source data.
 
std::vector< std::unordered_map< std::string, std::any > > extract_segments_metadata (const std::vector< RegionSegment > &segments)
 Extract metadata from region segments.
 
int find_dimension_by_role (const std::vector< DataDimension > &dimensions, DataDimension::Role role)
 Find the index of a dimension by its semantic role.
 
std::vector< std::pair< std::string, Region > > find_references_in_region (const std::vector< std::pair< std::string, Region > > &refs, const Region &region)
 Find all references in a reference list that overlap a given region.
 
std::optional< size_t > find_region_for_position (const std::vector< uint64_t > &position, const std::vector< Region > &regions)
 Find optimal region containing given position.
 
std::optional< size_t > find_region_for_position (const std::vector< uint64_t > &position, std::vector< OrganizedRegion > regions)
 Find the index of the region containing the given position.
 
std::vector< Regionfind_regions_containing_coordinates (const RegionGroup &group, const std::vector< uint64_t > &coordinates)
 Find all regions in a RegionGroup that contain the given coordinates.
 
std::vector< Regionfind_regions_with_attribute (const RegionGroup &group, const std::string &key, const std::any &value)
 Find all regions in a RegionGroup with a specific attribute value.
 
std::vector< Regionfind_regions_with_label (const RegionGroup &group, const std::string &label)
 Find all regions in a RegionGroup with a given label.
 
template<typename T >
std::vector< T > flatten_channels (const std::vector< std::vector< T > > &channel_data)
 Flatten a vector of channel data into a single vector.
 
Kakshya::DataVariant from_eigen_matrix (const Eigen::MatrixXd &matrix, MatrixInterpretation interpretation=MatrixInterpretation::AUTO)
 Convenience function for direct conversion.
 
Kakshya::DataVariant from_eigen_vector (const Eigen::VectorXd &vec)
 Convenience function for vector conversion.
 
Region get_bounding_region (const RegionGroup &group)
 Get the bounding region that contains all regions in a RegionGroup.
 
template<typename T >
std::optional< T > get_metadata_value (const std::unordered_map< std::string, std::any > &metadata, const std::string &key)
 Get a value from a metadata map by key.
 
std::vector< DataDimensionget_non_channel_dimensions (const std::vector< DataDimension > &dimensions)
 Get all non-channel dimensions from a list of dimensions.
 
std::optional< Regionget_reference_region (const std::vector< std::pair< std::string, Region > > &refs, const std::string &name)
 Get a named reference region from a reference list.
 
template<typename T >
std::optional< T > get_region_attribute (const Region &region, const std::string &key)
 Get an attribute value from a Region by key.
 
std::optional< RegionGroupget_region_group (const std::unordered_map< std::string, RegionGroup > &groups, const std::string &name)
 Get a RegionGroup by name from a group map.
 
std::type_index get_variant_type_index (const DataVariant &data)
 Get type index from DataVariant.
 
template<typename T >
std::vector< T > interleave_channels (const std::vector< std::vector< T > > &channels)
 Interleave multiple channels of data into a single vector.
 
bool is_readback_available (const std::shared_ptr< Core::Window > &window)
 Check whether a completed frame is currently available for readback.
 
bool is_region_access_contiguous (const Region &region, const std::shared_ptr< SignalSourceContainer > &container)
 Check if region access will be contiguous in memory.
 
bool is_segment_complete (const OrganizedRegion &region, size_t segment_index)
 
bool is_structured_modality (DataModality modality)
 Check if a modality represents structured data (vectors, matrices).
 
void iterate_region_channels (const std::vector< Region > &regions, const std::shared_ptr< SignalSourceContainer > &source, uint32_t num_channels, const RegionTaper &taper, const RegionWriteFn &write_fn)
 Iterate over a set of regions, extracting per-channel samples and dispatching them to a write callback.
 
std::vector< uint64_t > linear_to_coordinates (uint64_t index, const std::vector< DataDimension > &dimensions)
 Convert a linear index to N-dimensional coordinates for interleaved data.
 
std::shared_ptr< SoundFileContainermake_sound_file_container (std::vector< std::vector< double > > channel_data, uint32_t num_channels, uint32_t sample_rate=48000, OrganizationStrategy org=OrganizationStrategy::PLANAR)
 Construct a fully populated SoundFileContainer from computed channel data.
 
std::string_view modality_to_string (DataModality modality)
 Convert DataModality enum to string representation.
 
double position_to_time (uint64_t position, double sample_rate)
 Convert position (samples/frames) to time (seconds) given a sample rate.
 
std::pair< uint32_t, uint32_t > query_surface_extent (const std::shared_ptr< Core::Window > &window)
 Query the current pixel dimensions of the window's swapchain.
 
Core::GraphicsSurfaceInfo::SurfaceFormat query_surface_format (const std::shared_ptr< Core::Window > &window)
 Query the actual vk::Format in use by the window's live swapchain, translated back to the MayaFlux surface format enum.
 
DataAccess readback_region (const std::shared_ptr< Core::Window > &window, uint32_t x_offset, uint32_t y_offset, uint32_t pixel_width, uint32_t pixel_height, DataVariant &out_variant)
 Read a pixel rectangle from the last completed swapchain frame into a DataVariant whose element type matches the live swapchain format.
 
bool regions_intersect (const Region &r1, const Region &r2) noexcept
 Test whether two N-dimensional regions overlap on every shared axis.
 
Region remove_channel_dimension (const Region &region, const std::vector< DataDimension > &dimensions)
 Remove the channel dimension from a Region.
 
void remove_reference_region (std::vector< std::pair< std::string, Region > > &refs, const std::string &name)
 Remove a named reference region from a reference list.
 
void remove_region_group (std::unordered_map< std::string, RegionGroup > &groups, const std::string &name)
 Remove a RegionGroup by name from a group map.
 
void safe_copy_data_variant (const DataVariant &input, DataVariant &output)
 Safely copy data from a DataVariant to another DataVariant, handling type conversion.
 
std::span< const double > safe_copy_data_variant_to_span (const DataVariant &input, std::vector< double > &output)
 Safely copy data from a DataVariant to a span of doubles.
 
template<typename T >
void safe_copy_typed_variant (const DataVariant &input, DataVariant &output)
 Safely copy data from a DataVariant to another DataVariant of a specific type.
 
Region scale_region (const Region &region, const std::vector< double > &factors)
 Scale a Region about its center by the given factors.
 
void set_metadata_value (std::unordered_map< std::string, std::any > &metadata, const std::string &key, std::any value)
 Set a value in a metadata map (key-value).
 
template<typename T >
void set_or_update_region_data (std::span< T > dest_data, std::span< const T > source_data, const Region &region, const std::vector< DataDimension > &dimensions)
 Write or update a region of data in a flat data span (interleaved).
 
template<typename T >
void set_or_update_region_data (std::vector< std::span< T > > &dest_spans, const std::vector< std::span< const T > > &source_data, const Region &region, const std::vector< DataDimension > &dimensions)
 Write or update a region of data in planar storage.
 
template<typename T >
void set_or_update_region_data (std::vector< std::span< T > > &dest_spans, const std::vector< std::span< const T > > &source_data, const Region &region, const std::vector< DataDimension > &dimensions, OrganizationStrategy organization)
 Write or update a region of data with organization strategy.
 
void set_region_attribute (Region &region, const std::string &key, std::any value)
 Set an attribute value on a Region.
 
void sort_regions_by_attribute (std::vector< Region > &regions, const std::string &attr_name)
 Sort a vector of Regions by a specific attribute (numeric).
 
void sort_regions_by_dimension (std::vector< Region > &regions, size_t dimension)
 Sort a vector of Regions by a specific dimension.
 
uint64_t time_to_position (double time, double sample_rate)
 Convert time (seconds) to position (samples/frames) given a sample rate.
 
Eigen::MatrixXd to_eigen_matrix (const Kakshya::DataVariant &variant)
 Convenience function for direct conversion.
 
Eigen::VectorXd to_eigen_vector (const Kakshya::DataVariant &variant)
 Convenience function for vector conversion.
 
std::vector< uint64_t > transform_coordinates (const std::vector< uint64_t > &coords, const std::vector< double > &scale_factors={}, const std::vector< int64_t > &offset_values={}, const std::unordered_map< std::string, std::any > &rotation_params={})
 Transform coordinates using scaling, translation, rotation.
 
bool transition_state (ProcessingState &current_state, ProcessingState new_state, std::function< void()> on_transition=nullptr)
 Perform a state transition for a ProcessingState, with optional callback.
 
Region translate_region (const Region &region, const std::vector< int64_t > &offset)
 Translate a Region by an offset vector.
 
std::pair< std::shared_ptr< SignalSourceContainer >, std::vector< DataDimension > > validate_container_for_analysis (const std::shared_ptr< SignalSourceContainer > &container)
 Validates container for analysis operations with comprehensive checks.
 
void validate_numeric_data_for_analysis (const std::vector< double > &data, const std::string &operation_name, size_t min_size=1)
 Validates numeric data for analysis operations.
 
bool validate_region_bounds (const Region &region, const std::vector< DataDimension > &dimensions)
 Validate region bounds against container dimensions.
 
bool validate_slice_bounds (const std::vector< uint64_t > &slice_start, const std::vector< uint64_t > &slice_end, const std::vector< DataDimension > &dimensions)
 Validate slice coordinates against container bounds.
 
std::vector< uint64_t > wrap_position_with_loop (const std::vector< uint64_t > &position, const Region &loop_region, bool looping_enabled)
 Wrap a position within loop boundaries if looping is enabled.