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

Lightweight Vulkan image wrapper for MayaFlux processing pipeline. More...

#include <VKImage.hpp>

+ Collaboration diagram for MayaFlux::Core::VKImage:

Public Types

enum class  Usage : uint8_t {
  TEXTURE_2D , RENDER_TARGET , DEPTH_STENCIL , STORAGE ,
  TRANSFER_SRC , TRANSFER_DST , STAGING
}
 
enum class  Type : uint8_t { TYPE_1D , TYPE_2D , TYPE_3D , TYPE_CUBE }
 

Public Member Functions

 VKImage (uint32_t width, uint32_t height, uint32_t depth, vk::Format format, Usage usage, Type type=Type::TYPE_2D, uint32_t mip_levels=1, uint32_t array_layers=1, Kakshya::DataModality modality=Kakshya::DataModality::IMAGE_COLOR)
 Construct an uninitialized VKImage.
 
 VKImage ()=default
 
 ~VKImage ()=default
 
 VKImage (const VKImage &)=delete
 
VKImageoperator= (const VKImage &)=delete
 
 VKImage (VKImage &&) noexcept=default
 
VKImageoperator= (VKImage &&) noexcept=default
 
vk::Image get_image () const
 Get VkImage handle (VK_NULL_HANDLE if not initialized)
 
vk::ImageView get_image_view () const
 Get VkImageView handle (VK_NULL_HANDLE if not initialized)
 
vk::DeviceMemory get_memory () const
 Get VkDeviceMemory handle (VK_NULL_HANDLE if not initialized)
 
vk::Sampler get_sampler () const
 Get VkSampler handle (VK_NULL_HANDLE if none assigned)
 
const VKImageResourcesget_image_resources () const
 Get all image resources at once.
 
void set_image (vk::Image image)
 Set VkImage handle after backend allocation.
 
void set_image_view (vk::ImageView view)
 Set VkImageView handle after backend allocation.
 
void set_memory (vk::DeviceMemory memory)
 Set VkDeviceMemory handle after backend allocation.
 
void set_sampler (vk::Sampler sampler)
 Set VkSampler handle (optional)
 
void set_image_resources (const VKImageResources &resources)
 Set all image resources at once.
 
bool is_initialized () const
 Check whether Vulkan handles are present (image registered)
 
uint32_t get_width () const
 
uint32_t get_height () const
 
uint32_t get_depth () const
 
vk::Format get_format () const
 
Usage get_usage () const
 
Type get_type () const
 
uint32_t get_mip_levels () const
 
uint32_t get_array_layers () const
 
Kakshya::DataModality get_modality () const
 
const std::vector< Kakshya::DataDimension > & get_dimensions () const
 Get the inferred data dimensions for the image contents.
 
void set_modality (Kakshya::DataModality modality)
 Update the semantic modality and re-infer dimensions.
 
vk::ImageLayout get_current_layout () const
 Get current image layout (for synchronization)
 
void set_current_layout (vk::ImageLayout layout)
 Set current layout (called after transitions)
 
vk::ImageUsageFlags get_usage_flags () const
 Get appropriate VkImageUsageFlags based on Usage.
 
vk::MemoryPropertyFlags get_memory_properties () const
 Get appropriate VkMemoryPropertyFlags based on Usage.
 
vk::ImageAspectFlags get_aspect_flags () const
 Get appropriate VkImageAspectFlags based on format.
 
bool is_host_visible () const
 Whether this image should be host-visible (staging images)
 
size_t get_size_bytes () const
 Get total size in bytes (for memory allocation)
 

Private Member Functions

void infer_dimensions_from_parameters ()
 Infer Kakshya::DataDimension entries from image parameters.
 

Private Attributes

VKImageResources m_resources
 
uint32_t m_width { 0 }
 
uint32_t m_height { 0 }
 
uint32_t m_depth { 1 }
 
vk::Format m_format { vk::Format::eUndefined }
 
Usage m_usage { Usage::TEXTURE_2D }
 
Type m_type { Type::TYPE_2D }
 
uint32_t m_mip_levels { 1 }
 
uint32_t m_array_layers { 1 }
 
vk::ImageLayout m_current_layout { vk::ImageLayout::eUndefined }
 
Kakshya::DataModality m_modality
 
std::vector< Kakshya::DataDimensionm_dimensions
 

Detailed Description

Lightweight Vulkan image wrapper for MayaFlux processing pipeline.

VKImage is a backend-level representation of a GPU image/texture. Like VKBuffer, it is a semantic container that stores metadata and Vulkan handles but does not perform allocation itself. The backend (VulkanBackend) handles actual resource creation via BufferService-style patterns.

Responsibilities:

  • Store image dimensions, format, usage intent, and semantic modality
  • Provide inferred data dimensions for processors and pipeline inspection
  • Hold Vulkan handles (VkImage, VkImageView, VkDeviceMemory) assigned by backend
  • Provide convenience helpers for Vulkan creation flags and memory properties
  • Track current layout for automatic layout transitions

Does NOT handle:

Integration points:

  • Created by Portal::Graphics::TextureLoom
  • Allocated by VulkanBackend::initialize_image()
  • Wrapped by Kakshya::Visual::TextureStream (future)
  • Used by Yantra::Graphics::RenderPipeline (future)

Definition at line 49 of file VKImage.hpp.


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