601{
603 if (bytes.empty())
604 return { std::span<const uint8_t> {} };
605
608
609 if (element_size == 2) {
610 return { std::span<const uint16_t>(
611 reinterpret_cast<const uint16_t*>(bytes.data()), elements) };
612 }
613 if (element_size == 4) {
614 return { std::span<const float>(
615 reinterpret_cast<const float*>(bytes.data()), elements) };
616 }
617 return { std::span<const uint8_t>(bytes.data(), elements) };
618}
size_t get_frame_element_count() const
Elements in one frame: width * height * channels.
std::span< const uint8_t > get_frame_pixels(uint64_t frame_index) const
Get raw pixel data for a single frame as a byte span.
Portal::Graphics::ImageFormat m_format
size_t storage_element_size(ImageFormat format)