9 , memory_layout(layout)
126 if (expected_roles.empty()) {
130 if (
dimensions.size() != expected_roles.size()) {
134 for (
size_t i = 0; i <
dimensions.size(); ++i) {
135 if (
dimensions[i].role != expected_roles[i]) {
157 auto it = std::ranges::find(expected_roles, role);
158 if (it != expected_roles.end()) {
159 return std::distance(expected_roles.begin(), it);
162 for (
size_t i = 0; i <
dimensions.size(); ++i) {
193 uint64_t time_size = 0;
194 uint64_t channel_size = 1;
198 time_size = dim.size;
200 channel_size = dim.size;
204 return time_size * channel_size;
261 size_t frame_size = 1;
264 frame_size *= dim.size;
const std::vector< float > * pixels
DataModality
Data modality types for cross-modal analysis.
@ DEPTH_MAP
[height, width, components] - range/disparity image
@ AUDIO_MULTICHANNEL
Multi-channel audio.
@ SPECTRAL_2D
2D spectral data (time + frequency)
@ AUDIO_1D
1D audio signal
@ VIDEO_DEPTH
[frames, height, width, components] - streaming range data
@ UNKNOWN
Unknown or undefined modality.
@ VOLUMETRIC_3D
3D volumetric data
@ VIDEO_GRAYSCALE
3D video (time + 2D grayscale)
@ VIDEO_COLOR
4D video (time + 2D + color)
@ TENSOR_ND
N-dimensional tensor.
@ IMAGE_COLOR
2D RGB/RGBA image
@ IMAGE_2D
2D image (grayscale or single channel)
MemoryLayout
Memory layout for multi-dimensional data.
OrganizationStrategy
Data organization strategy for multi-channel/multi-frame data.
@ PLANAR
Separate DataVariant per logical unit (LLL...RRR for stereo)
@ INTERLEAVED
Single DataVariant with interleaved data (LRLRLR for stereo)
std::vector< DataDimension > dimensions
size_t get_frame_size() const
static ContainerDataStructure audio_planar()
Create structure for planar audio data.
uint64_t get_samples_count_per_channel() const
static ContainerDataStructure image_planar()
Create structure for planar image data.
uint64_t get_channel_count() const
uint64_t get_pixels_count() const
uint64_t get_total_elements() const
static ContainerDataStructure image_interleaved()
Create structure for interleaved image data.
uint64_t get_component_count() const
std::vector< DataDimension::Role > get_expected_dimension_roles() const
Get the expected dimension roles for this structure's modality.
OrganizationStrategy organization
ContainerDataStructure()=default
size_t get_expected_variant_count(const std::vector< DataDimension > &dimensions) const
Calculate expected number of data variants for given dimensions.
bool validate_dimensions(const std::vector< DataDimension > &dimensions) const
Validate that dimensions match this structure's expectations.
static ContainerDataStructure audio_interleaved()
Create structure for interleaved audio data.
uint64_t get_height() const
uint64_t get_samples_count() const
uint64_t get_variant_size() const
uint64_t get_width() const
size_t get_frame_count() const
size_t get_dimension_index_for_role(const std::vector< DataDimension > &dimensions, DataDimension::Role role) const
Find the index of a dimension with the specified role.
Container structure for consistent dimension ordering.
Role
Semantic role of the dimension.
@ FREQUENCY
Spectral/frequency axis.
@ SPATIAL_Y
Spatial Y axis.
@ TIME
Temporal progression (samples, frames, steps)
@ SPATIAL_Z
Spatial Z axis.
@ DEPTH
Distance from the observation point (depth, disparity, range)
@ CHANNEL
Parallel streams (audio channels, color channels)
@ SPATIAL_X
Spatial X axis (images, tensors)