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

◆ exported_record_count()

std::optional< uint32_t > MayaFlux::Yantra::VisionInternal::exported_record_count ( const std::shared_ptr< Portal::Graphics::GpuBufferHandle > &  handle,
size_t  stride_vec4 
)
inline

Clamped record count from an exported buffer's vec4 header, or nullopt when the buffer isn't readable.

Shared by every read_exported_* decode: header[0].x holds the count as uint bits, clamped to the buffer's actual capacity at stride_vec4 per record (one header vec4 assumed).

Definition at line 338 of file DispatchLayouts.hpp.

341{
342 if (!handle || !handle->mapped_ptr || handle->size_bytes < sizeof(glm::vec4))
343 return std::nullopt;
344
345 const auto* header = static_cast<const glm::vec4*>(handle->mapped_ptr);
346 const size_t capacity = (handle->size_bytes / sizeof(glm::vec4) - 1U) / stride_vec4;
347 return static_cast<uint32_t>(std::min<size_t>(std::bit_cast<uint32_t>(header[0].x), capacity));
348}

Referenced by MayaFlux::Yantra::VisionGpuExecutor::read_exported_keypoints(), and MayaFlux::Yantra::VisionGpuExecutor::read_exported_tracks().

+ Here is the caller graph for this function: