MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ TextureContainer() [5/5]

MayaFlux::Kakshya::TextureContainer::TextureContainer ( uint32_t  width,
uint32_t  height,
ImageFormat  format,
LayerCount  layers 
)
protected

Construct with exactly layers layers, which may be zero.

Definition at line 40 of file TextureContainer.cpp.

41 : m_width(width)
46{
47 m_chain = std::make_shared<DataProcessingChain>();
48 const size_t element_count = static_cast<size_t>(m_width) * m_height * m_channels;
49
50 for (uint32_t i = 0; i < layers.value; ++i) {
51 m_data.emplace_back(make_empty_storage(m_format, element_count));
52 }
53
54 m_layer_image_cache.resize(m_data.size());
55
56 m_normalised_cache.resize(m_data.size());
57
58 m_normalised_dirty = std::vector<std::atomic<bool>>(m_data.size());
59 for (auto& flag : m_normalised_dirty)
60 flag.store(true, std::memory_order_relaxed);
61
62 m_cpu_stale = std::vector<std::atomic<bool>>(m_data.size());
63 for (auto& flag : m_cpu_stale)
64 flag.store(false, std::memory_order_relaxed);
65
68
69 m_ready_for_processing.store(true);
70
72 "TextureContainer created: {}x{} layers={} fmt={} bpp={}",
73 m_width, m_height, m_data.size(), static_cast<int>(m_format), m_bpp);
74}
#define MF_INFO(comp, ctx,...)
bool format
uint32_t width
uint32_t height
std::vector< std::atomic< bool > > m_normalised_dirty
std::vector< std::atomic< bool > > m_cpu_stale
Per layer: the GPU image in m_layer_image_cache holds the content, m_data does not.
std::shared_ptr< DataProcessingChain > m_chain
std::vector< Portal::Graphics::ImageCacheEntry > m_layer_image_cache
std::vector< std::vector< float > > m_normalised_cache
void resize(size_t n)
Replace the slot array with n default-constructed Seqlock instances.
Definition SeqLock.hpp:339
static size_t get_bytes_per_pixel(ImageFormat format)
Get bytes per pixel for a format.
static uint32_t get_channel_count(ImageFormat format)
Get the number of color channels for a given format.
@ ContainerProcessing
Container operations (Kakshya - file/stream/region processing)
@ Kakshya
Containers[Signalsource, Stream, File], Regions, DataProcessors.
DataVariant make_empty_storage(ImageFormat format, size_t element_count)
Allocate a zeroed DataVariant of the alternative backing a format.
std::shared_ptr< T > store(std::shared_ptr< T > obj)
Transfer ownership of an existing object to the persistent store for process lifetime.
Definition Persist.hpp:28

References MayaFlux::Journal::ContainerProcessing, MayaFlux::Journal::Kakshya, m_bpp, m_chain, m_channels, m_cpu_stale, m_data, m_format, m_height, m_layer_image_cache, m_normalised_cache, m_normalised_dirty, m_ready_for_processing, m_slot_locks, m_width, MayaFlux::Kakshya::make_empty_storage(), MF_INFO, MayaFlux::Memory::SeqlockArray::resize(), setup_dimensions(), and MayaFlux::Kakshya::TextureContainer::LayerCount::value.

+ Here is the call graph for this function: