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

◆ resolve_bytes()

std::optional< Kakshya::DataVariant > MayaFlux::Buffers::DataReadProcessor::resolve_bytes ( )

Finish the read as raw bytes.

Waits for a device-local transfer when necessary. Call outside the graphics processing thread. A pixel read yields its raw pixel bytes. Returns nullopt if no result is pending or the pending result is a MeshBuffer copy; use resolve_mesh() for that.

Definition at line 323 of file DataReadProcessor.cpp.

324{
325 auto pending = collect_result(ReadKind::Bytes);
326 if (!pending) {
327 return std::nullopt;
328 }
329
330 if (pending->image) {
331 const auto* begin = static_cast<const uint8_t*>(pending->image->data());
332 return Kakshya::DataVariant { std::vector<uint8_t>(begin, begin + pending->image->byte_size()) };
333 }
334
335 return Kakshya::DataVariant { std::move(pending->bytes) };
336}
std::unique_ptr< PendingRead > collect_result(ReadKind kind)
std::variant< std::vector< double >, std::vector< float >, std::vector< uint8_t >, std::vector< uint16_t >, std::vector< uint32_t >, std::vector< std::complex< float > >, std::vector< std::complex< double > >, std::vector< glm::vec2 >, std::vector< glm::vec3 >, std::vector< glm::vec4 >, std::vector< glm::mat4 > > DataVariant
Multi-type data storage for different precision needs.
Definition NDData.hpp:70

References Bytes, and collect_result().

Referenced by MayaFlux::Kriya::detail::resolve_graphics_read().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: