Expand ArFrame API with additional getters

This commit is contained in:
Georg Hagen
2024-07-29 14:57:23 +02:00
parent be47451ad2
commit 631d108be4
2 changed files with 22 additions and 2 deletions

View File

@@ -7,6 +7,8 @@
#include "ArFrame.hpp"
#include "ArSession.hpp"
#include "ArRecorder.hpp"
#include <iostream>
#include <fstream>
namespace OpenVulkano::AR
{
@@ -26,6 +28,11 @@ namespace OpenVulkano::AR
void ArFrame::SaveToFile(const std::filesystem::path& path, bool downsample)
{
m_session->GetRecorder().SaveToFile(shared_from_this(), path, downsample);
std::string metaContent = GetFrameMetadata().ToXML();
std::string metaPath = path.string() + std::string(".meta");
std::ofstream file (metaPath, std::ios::out);
file << metaContent;
file.close();
}
const Scene::Texture* ArFrame::GetImageTexture()
@@ -38,4 +45,4 @@ namespace OpenVulkano::AR
{
if (m_texture) m_session->ReturnTexture(m_texture);
}
}
}