Allow switch vector to span

This commit is contained in:
Georg Hagen
2025-05-19 23:14:32 +02:00
parent 31deaeec14
commit 410d2514d5
6 changed files with 10 additions and 9 deletions

View File

@@ -18,6 +18,7 @@
#include "Image/ExifBuilder.hpp"
#include "Image/XmpBuilder.hpp"
#include "Image/JpegWithTagsWriter.hpp"
#include <array>
#include <fstream>
#include <iostream>
#if __has_include("turbojpeg.h")
@@ -137,7 +138,7 @@ namespace OpenVulkano::AR
colorWriter->AddFile(fileName.c_str(), outBuffer, size);
if (jpgWriter) [[unlikely]]
{
jpgWriter->WriteImageData({ outBuffer, size }, false); // Keep open, livetime is managed outside
jpgWriter->WriteImageData({ outBuffer, size }, false); // Keep open, lifetime is managed outside
}
}
tjFree(outBuffer);
@@ -150,7 +151,7 @@ namespace OpenVulkano::AR
//BlockProfiler profile("Save AR Frame - Depth");
if (!depthWriter || !confWriter) return;
auto depthImg = arFrame->GetDepthImage();
std::vector<std::pair<const void*, size_t>> buffers(2);
std::array<std::pair<const void*, size_t>, 2> buffers;
{ // TODO handle alternative depth formats!!!!
//BlockProfiler profile("Save AR Frame - Depth");
PfmHeader depthHeader(static_cast<uint32_t>(depthImg.depth.resolution.x), static_cast<uint32_t>(depthImg.depth.resolution.y), 5.0f, false);