MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Buffers::TextureProcessor Class Reference

Internal processor: handles CPU→GPU transfers for TextureBuffer. More...

#include <TextureProcessor.hpp>

+ Inheritance diagram for MayaFlux::Buffers::TextureProcessor:
+ Collaboration diagram for MayaFlux::Buffers::TextureProcessor:

Public Member Functions

 TextureProcessor ()
 
 ~TextureProcessor () override
 
- Public Member Functions inherited from MayaFlux::Buffers::BufferProcessor
virtual ~BufferProcessor ()=default
 Virtual destructor for proper cleanup of derived classes.
 
void process (std::shared_ptr< Buffer > buffer)
 Applies a computational transformation to the data in the provided buffer.
 
virtual void set_processing_token (ProcessingToken token)
 Gets the preferred processing backend for this processor.
 
virtual ProcessingToken get_processing_token () const
 Gets the current processing token for this buffer.
 
virtual bool is_compatible_with (std::shared_ptr< Buffer >) const
 Checks if this processor can handle the specified buffer type.
 

Protected Member Functions

void on_attach (std::shared_ptr< Buffer > buffer) override
 Called when this processor is attached to a buffer.
 
void on_detach (std::shared_ptr< Buffer > buffer) override
 Called when this processor is detached from a buffer.
 
void processing_function (std::shared_ptr< Buffer > buffer) override
 The core processing function that must be implemented by derived classes.
 
- Protected Member Functions inherited from MayaFlux::Buffers::VKBufferProcessor
void initialize_buffer_service ()
 
void initialize_compute_service ()
 

Private Member Functions

void initialize_gpu_resources ()
 Initialize all GPU resources:
 
void upload_initial_geometry ()
 Upload initial quad geometry based on default or custom vertices.
 
void upload_initial_pixels ()
 Upload initial pixel data to GPU texture.
 
void update_geometry_if_dirty ()
 Regenerate quad vertices if transform changed, upload if needed.
 
void update_pixels_if_dirty ()
 Re-upload pixels to GPU if they changed.
 
std::shared_ptr< Core::VKImagecreate_gpu_texture ()
 Create VKImage for texture storage.
 
void generate_quad_vertices (std::vector< uint8_t > &out_bytes)
 Generate quad vertices respecting current transform Handles both default quad and custom vertices.
 

Private Attributes

std::shared_ptr< TextureBufferm_texture_buffer
 

Additional Inherited Members

- Protected Attributes inherited from MayaFlux::Buffers::VKBufferProcessor
Registry::Service::BufferServicem_buffer_service = nullptr
 
Registry::Service::ComputeServicem_compute_service = nullptr
 
- Protected Attributes inherited from MayaFlux::Buffers::BufferProcessor
ProcessingToken m_processing_token { ProcessingToken::AUDIO_BACKEND }
 

Detailed Description

Internal processor: handles CPU→GPU transfers for TextureBuffer.

TextureProcessor is automatically created and attached by TextureBuffer. Users never instantiate or interact with it directly.

Responsibilities:

  • Initialize GPU texture (VKImage)
  • Upload pixel data to GPU (initial + dirty updates)
  • Generate and upload quad geometry respecting transform
  • Detect changes and re-upload as needed

All work is invisible to the user. They just modify TextureBuffer (set_pixel_data, set_position, etc.) and it "just works."

Definition at line 29 of file TextureProcessor.hpp.


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