Introduce ArFrameMetadata to relly less on virtual functions for metadata getters
This commit is contained in:
44
openVulkanoCpp/AR/ArSessionMetadata.hpp
Normal file
44
openVulkanoCpp/AR/ArSessionMetadata.hpp
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "AR/ArType.hpp"
|
||||
#include "AR/ArDepthFormat.hpp"
|
||||
#include "Math/Range.hpp"
|
||||
|
||||
namespace openVulkanoCpp::AR
|
||||
{
|
||||
struct ArSessionMetadata
|
||||
{
|
||||
ArType type;
|
||||
ArDepthFormat depthFormat;
|
||||
Math::Range<uint8_t> confidenceRange;
|
||||
|
||||
ArSessionMetadata() noexcept
|
||||
: ArSessionMetadata(ArType::UNKNOWN, ArDepthFormat::UNAVAILABLE, {0,0})
|
||||
{}
|
||||
|
||||
ArSessionMetadata(ArType type, ArDepthFormat format, Math::Range<uint8_t> confRange) noexcept
|
||||
: type(type), depthFormat(format), confidenceRange(confRange)
|
||||
{}
|
||||
|
||||
ArSessionMetadata(const std::string& dirPath);
|
||||
|
||||
[[nodiscard]] std::string ToXML() const;
|
||||
|
||||
[[nodiscard]] std::string ToYaml() const;
|
||||
|
||||
float GetConfidenceNormalisationFactor() const
|
||||
{
|
||||
return 1.0f / static_cast<float>(confidenceRange.max);
|
||||
}
|
||||
|
||||
static ArSessionMetadata FromXML(const std::string& filePath);
|
||||
|
||||
static ArSessionMetadata FromYaml(const std::string& filePath);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user