37 lines
1.0 KiB
C++
37 lines
1.0 KiB
C++
/*
|
|
* 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 "ArTrackingState.hpp"
|
|
#include "Math/CameraIntrinsic.hpp"
|
|
#include "Math/Timestamp.hpp"
|
|
|
|
namespace OpenVulkano::AR
|
|
{
|
|
struct ArFrameMetadata
|
|
{
|
|
Math::CameraIntrinsicWithResolution intrinsic;
|
|
Math::Matrix4f transformation, projection;
|
|
float exposureTime, exposureOffset, lightIntensity, lightColorTemp;
|
|
Math::Timestamp timestamp, timestampDepth;
|
|
ArTrackingState trackingState;
|
|
float physicalPixelSize = 0;
|
|
|
|
[[nodiscard]] std::string ToYaml() const;
|
|
|
|
[[nodiscard]] std::string ToXML() const;
|
|
|
|
static ArFrameMetadata FromXML(const char* xml, size_t length);
|
|
|
|
static ArFrameMetadata FromYaml(const char* yaml, size_t length);
|
|
|
|
static ArFrameMetadata FromContent(const char* content, size_t length)
|
|
{
|
|
return content[0] == '<' ? FromXML(content, length) : FromYaml(content, length);
|
|
}
|
|
};
|
|
} |