Add interfaces for getting textures from ar frames

This commit is contained in:
2024-07-05 14:08:04 +02:00
parent 86e7681a8d
commit 7e9c568779
7 changed files with 65 additions and 2 deletions

View File

@@ -22,4 +22,20 @@ namespace OpenVulkano::AR
else
m_session->GetRecorder().Save(shared_from_this());
}
void ArFrame::SaveToFile(const std::filesystem::path& path, bool downsample)
{
m_session->GetRecorder().SaveToFile(shared_from_this(), path, downsample);
}
const Scene::Texture* ArFrame::GetImageTexture()
{
if (!m_texture) m_texture = m_session->MakeTexture(this);
return m_texture;
}
ArFrame::~ArFrame()
{
if (m_texture) m_session->ReturnTexture(m_texture);
}
}