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

SignalSourceContainer wrapping GPU texture data as addressable pixel bytes. More...

#include <TextureContainer.hpp>

+ Inheritance diagram for MayaFlux::Kakshya::TextureContainer:
+ Collaboration diagram for MayaFlux::Kakshya::TextureContainer:

Public Member Functions

void add_region_group (const RegionGroup &group) override
 Add a named group of regions to the container.
 
std::vector< DataAccessall_channel_data () override
 Get all channel data as accessors.
 
bool all_dimensions_consumed () const override
 No-op.
 
std::span< const float > as_float (uint32_t layer=0) const
 Typed view over the float variant.
 
std::span< const uint16_t > as_uint16 (uint32_t layer=0) const
 Typed view over the uint16 variant.
 
std::span< const uint8_t > as_uint8 (uint32_t layer=0) const
 Typed view over the uint8 variant.
 
size_t byte_size () const
 Total byte count of the pixel buffer.
 
DataAccess channel_data (size_t channel_index) override
 Get channel data with semantic interpretation.
 
void clear () override
 Clear all data in the container.
 
uint64_t coordinates_to_linear_index (const std::vector< uint64_t > &coords) const override
 Convert coordinates to linear index based on current memory layout.
 
void create_default_processor () override
 No-op.
 
void from_image (const std::shared_ptr< Core::VKImage > &image, uint32_t layer=0)
 Download pixel data from a VKImage into this container.
 
std::unordered_map< std::string, RegionGroupget_all_region_groups () const override
 Get all region groups in the container.
 
uint32_t get_channel_count () const
 
const std::vector< DataVariant > & get_data () override
 Get a reference to the raw data stored in the container.
 
std::shared_ptr< DataProcessorget_default_processor () const override
 Get the current default data processor.
 
std::vector< DataDimensionget_dimensions () const override
 Get the dimensions describing the structure of the data.
 
Portal::Graphics::ImageFormat get_format () const
 
std::span< const double > get_frame (uint64_t frame_index) const override
 Returns a normalized double view of one pixel row.
 
uint64_t get_frame_size () const override
 Get the number of elements that constitute one "frame".
 
void get_frames (std::span< double > output, uint64_t start_frame, uint64_t num_frames) const override
 Copy a range of pixel rows into output as normalized doubles.
 
uint32_t get_height () const
 
uint32_t get_layer_count () const
 
MemoryLayout get_memory_layout () const override
 Get the memory layout used by this container.
 
uint64_t get_num_frames () const override
 Get the number of frames in the primary (temporal) dimension.
 
const std::vector< DataVariant > & get_processed_data () const override
 Get a const reference to the processed data buffer.
 
std::vector< DataVariant > & get_processed_data () override
 Get a mutable reference to the processed data buffer.
 
std::shared_ptr< DataProcessingChainget_processing_chain () override
 Get the current processing chain for this container.
 
ProcessingState get_processing_state () const override
 Get the current processing state of the container.
 
const void * get_raw_data () const override
 Get a raw pointer to the underlying data storage.
 
std::vector< DataVariantget_region_data (const Region &region) const override
 Get data for a specific region.
 
const RegionGroupget_region_group (const std::string &name) const override
 Get a region group by name.
 
std::vector< DataVariantget_region_group_data (const RegionGroup &) const override
 Get data for multiple regions efficiently.
 
std::vector< DataVariantget_segments_data (const std::vector< RegionSegment > &segments) const override
 Get data for multiple region segments efficiently.
 
const ContainerDataStructureget_structure () const override
 
ContainerDataStructureget_structure () override
 Get the data structure defining this container's layout.
 
uint64_t get_total_elements () const override
 Get the total number of elements in the container.
 
double get_value_at (const std::vector< uint64_t > &coordinates) const override
 Get a single value at the specified coordinates.
 
uint32_t get_width () const
 
bool has_active_readers () const override
 No-op.
 
bool has_data () const override
 Check if the container currently holds any data.
 
bool has_processing_token (int ch) const
 
bool is_ready_for_processing () const override
 Check if the container is ready for processing.
 
bool is_region_loaded (const Region &) const override
 Check if a region is loaded in memory.
 
std::vector< uint64_t > linear_index_to_coordinates (uint64_t index) const override
 Convert linear index to coordinates based on current memory layout.
 
void load_region (const Region &) override
 No-op.
 
void lock () override
 Acquire a lock for thread-safe access.
 
void mark_buffers_for_processing (bool) override
 No-op.
 
void mark_buffers_for_removal () override
 No-op.
 
void mark_dimension_consumed (uint32_t, uint32_t) override
 No-op.
 
void mark_ready_for_processing (bool ready) override
 Mark the container as ready or not ready for processing.
 
TextureContaineroperator= (const TextureContainer &)=delete
 
TextureContaineroperator= (TextureContainer &&)=delete
 
std::span< uint8_t > pixel_bytes (uint32_t layer=0)
 Read-write byte-level view over the pixel buffer.
 
std::span< const uint8_t > pixel_bytes (uint32_t layer=0) const
 Read-only byte-level view over the pixel buffer.
 
void process_default () override
 No-op.
 
uint32_t register_dimension_reader (uint32_t) override
 No-op.
 
void register_state_change_callback (std::function< void(const std::shared_ptr< SignalSourceContainer > &, ProcessingState)> cb) override
 Register a callback to be invoked on processing state changes.
 
void remove_region_group (const std::string &name) override
 Remove a region group by name.
 
void reset_processing_token ()
 
size_t row_stride () const
 Byte count of one complete pixel row.
 
void set_default_processor (const std::shared_ptr< DataProcessor > &p) override
 Set the default data processor for this container.
 
void set_memory_layout (MemoryLayout layout) override
 Set the memory layout for this container.
 
void set_pixels (std::span< const float > data, uint32_t layer=0)
 Replace the layer's pixel buffer with a float source.
 
void set_pixels (std::span< const uint16_t > data, uint32_t layer=0)
 Replace the layer's pixel buffer with a uint16 source.
 
void set_pixels (std::span< const uint8_t > data, uint32_t layer=0)
 Replace the layer's pixel buffer with a byte source.
 
void set_processing_chain (const std::shared_ptr< DataProcessingChain > &c) override
 Set the processing chain for this container.
 
void set_region_data (const Region &region, const std::vector< DataVariant > &data) override
 Write DataVariant bytes into the pixel buffer at the region bounds.
 
void set_structure (ContainerDataStructure s) override
 Set the data structure for this container.
 
void set_value_at (const std::vector< uint64_t > &coordinates, double value) override
 Set a single value at the specified coordinates.
 
 TextureContainer (const std::shared_ptr< Core::VKImage > &image, Portal::Graphics::ImageFormat format)
 Construct from an existing VKImage, downloading its pixel data.
 
 TextureContainer (const TextureContainer &)=delete
 
 TextureContainer (TextureContainer &&)=delete
 
 TextureContainer (uint32_t width, uint32_t height, Portal::Graphics::ImageFormat format, uint32_t layers=1)
 Construct an empty container with declared dimensions.
 
std::shared_ptr< Core::VKImageto_image (uint32_t layer=0) const
 Upload the pixel buffer to a new VKImage via TextureLoom.
 
bool try_acquire_processing_token (int ch)
 
bool try_lock () override
 Attempt to acquire a lock without blocking.
 
void unload_region (const Region &) override
 No-op.
 
void unlock () override
 Release a previously acquired lock.
 
void unregister_dimension_reader (uint32_t) override
 No-op.
 
void unregister_state_change_callback () override
 Unregister the state change callback, if any.
 
void update_processing_state (ProcessingState state) override
 Update the processing state of the container.
 
 ~TextureContainer () override=default
 
- Public Member Functions inherited from MayaFlux::Kakshya::SignalSourceContainer
 ~SignalSourceContainer () override=default
 
- Public Member Functions inherited from MayaFlux::Kakshya::NDDataContainer
virtual ~NDDataContainer ()=default
 

Private Member Functions

void setup_dimensions ()
 

Private Attributes

size_t m_bpp {}
 
std::shared_ptr< DataProcessingChainm_chain
 
std::vector< DataVariantm_channel_cache
 Backing storage for per-channel DataVariants returned by channel_data().
 
uint32_t m_channels {}
 
std::vector< DataVariantm_data
 
std::shared_mutex m_data_mutex
 
Portal::Graphics::ImageFormat m_format {}
 
std::vector< double > m_frame_cache
 Row cache backing the double span returned by get_frame().
 
uint32_t m_height {}
 
std::vector< DataVariantm_processed_data
 
std::atomic< ProcessingStatem_processing_state { ProcessingState::IDLE }
 
std::atomic< int > m_processing_token { -1 }
 
std::shared_ptr< DataProcessorm_processor
 
std::atomic< bool > m_ready_for_processing { false }
 
std::unordered_map< std::string, RegionGroupm_region_groups
 
std::function< void(const std::shared_ptr< SignalSourceContainer > &, ProcessingState)> m_state_cb
 
std::mutex m_state_mutex
 
ContainerDataStructure m_structure
 
uint32_t m_width {}
 

Detailed Description

SignalSourceContainer wrapping GPU texture data as addressable pixel bytes.

TextureContainer is the Kakshya-layer representation of a 2D texture. It owns a flat interleaved RGBA/float pixel buffer matching the declared ImageFormat, described with IMAGE_COLOR or IMAGE_2D dimensions.

The container is the data carrier for Yantra::Texture workflow pipelines. GPU materialization is intentionally not automatic: callers drive upload and download explicitly via from_image() and to_image(), keeping the container decoupled from any specific VKImage lifetime.

Dimension convention (IMAGE_COLOR, INTERLEAVED): dims[0] -> SPATIAL_Y (height) dims[1] -> SPATIAL_X (width) dims[2] -> CHANNEL (bytes per pixel for format)

Processing model: No default processor is created. The container holds bytes passively. Workflow operations receive and return TextureContainer instances; TextureExecutionContext dispatches compute shaders against them.

Definition at line 37 of file TextureContainer.hpp.


The documentation for this class was generated from the following files: