Silence some warnings
This commit is contained in:
@@ -10,6 +10,7 @@
|
|||||||
#include <pugixml.hpp>
|
#include <pugixml.hpp>
|
||||||
#include <fmt/format.h>
|
#include <fmt/format.h>
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
|
#include <fstream>
|
||||||
|
|
||||||
namespace OpenVulkano::AR
|
namespace OpenVulkano::AR
|
||||||
{
|
{
|
||||||
@@ -21,7 +22,7 @@ namespace OpenVulkano::AR
|
|||||||
: ArSessionMetadata(type, format, confRange, resolution, frameRate, SystemInfo::GetDeviceModelName(), SystemInfo::GetOsNameHumanReadable())
|
: ArSessionMetadata(type, format, confRange, resolution, frameRate, SystemInfo::GetDeviceModelName(), SystemInfo::GetOsNameHumanReadable())
|
||||||
{}
|
{}
|
||||||
|
|
||||||
ArSessionMetadata ArSessionMetadata::FromXML(const std::string& filePath)
|
ArSessionMetadata ArSessionMetadata::FromXML(const std::filesystem::path& filePath)
|
||||||
{
|
{
|
||||||
pugi::xml_document doc;
|
pugi::xml_document doc;
|
||||||
pugi::xml_parse_result result = doc.load_file(filePath.c_str());
|
pugi::xml_parse_result result = doc.load_file(filePath.c_str());
|
||||||
@@ -49,9 +50,10 @@ namespace OpenVulkano::AR
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
ArSessionMetadata ArSessionMetadata::FromYaml(const std::string& filePath)
|
ArSessionMetadata ArSessionMetadata::FromYaml(const std::filesystem::path& filePath)
|
||||||
{
|
{
|
||||||
YAML::Node meta = YAML::LoadFile(filePath);
|
std::ifstream fin(filePath);
|
||||||
|
YAML::Node meta = YAML::Load(fin);
|
||||||
|
|
||||||
ArSessionMetadata metadata = {
|
ArSessionMetadata metadata = {
|
||||||
ArType::GetFromName(meta["Type"].Scalar()),
|
ArType::GetFromName(meta["Type"].Scalar()),
|
||||||
@@ -150,4 +152,4 @@ Version: {}
|
|||||||
type.GetName(), depthFormat.GetName(), static_cast<int>(confidenceRange.min), static_cast<int>(confidenceRange.max),
|
type.GetName(), depthFormat.GetName(), static_cast<int>(confidenceRange.min), static_cast<int>(confidenceRange.max),
|
||||||
imageResolution.x, imageResolution.y, frameRate, device, os, version, FinishedRecordingInfoToYaml());
|
imageResolution.x, imageResolution.y, frameRate, device, os, version, FinishedRecordingInfoToYaml());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,8 +60,8 @@ namespace OpenVulkano::AR
|
|||||||
|
|
||||||
static bool DirHasMetadata(const std::filesystem::path& dirPath);
|
static bool DirHasMetadata(const std::filesystem::path& dirPath);
|
||||||
|
|
||||||
[[deprecated]] static ArSessionMetadata FromXML(const std::string& filePath);
|
static ArSessionMetadata FromXML(const std::filesystem::path& filePath);
|
||||||
|
|
||||||
[[deprecated]] static ArSessionMetadata FromYaml(const std::string& filePath);
|
static ArSessionMetadata FromYaml(const std::filesystem::path& filePath);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -42,7 +42,7 @@ namespace OpenVulkano::Image
|
|||||||
return Math::Vector2i { -1, -1 };
|
return Math::Vector2i { -1, -1 };
|
||||||
}
|
}
|
||||||
Math::Vector2i res = {};
|
Math::Vector2i res = {};
|
||||||
int size = 0, jpegSubsamp = 0;
|
int jpegSubsamp = 0;
|
||||||
int status = tjDecompressHeader2(jpegDecompressor, reinterpret_cast<unsigned char*>(image.Data()), image.Size(),
|
int status = tjDecompressHeader2(jpegDecompressor, reinterpret_cast<unsigned char*>(image.Data()), image.Size(),
|
||||||
&res.x, &res.y, &jpegSubsamp);
|
&res.x, &res.y, &jpegSubsamp);
|
||||||
if (status != 0)
|
if (status != 0)
|
||||||
|
|||||||
@@ -58,6 +58,30 @@ namespace OpenVulkano::Math
|
|||||||
{
|
{
|
||||||
if (e1 > e2) std::swap(e1, e2);
|
if (e1 > e2) std::swap(e1, e2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename T, qualifier Q>
|
||||||
|
T maxVal(const glm::tvec3<T, Q>& vec)
|
||||||
|
{
|
||||||
|
return std::max(vec.x, std::max(vec.y, vec.z));
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T, qualifier Q>
|
||||||
|
T maxVal(const glm::tvec4<T, Q>& vec)
|
||||||
|
{
|
||||||
|
return std::max(std::max(vec.x, vec.y), std::max(vec.z, vec.w));
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T, qualifier Q>
|
||||||
|
T minVal(const glm::tvec3<T, Q>& vec)
|
||||||
|
{
|
||||||
|
return std::min(vec.x, std::min(vec.y, vec.z));
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T, qualifier Q>
|
||||||
|
T minVal(const glm::tvec4<T, Q>& vec)
|
||||||
|
{
|
||||||
|
return std::min(std::min(vec.x, vec.y), std::min(vec.z, vec.w));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T> using Matrix2_SIMD = glm::tmat2x2<T, glm::aligned>;
|
template<typename T> using Matrix2_SIMD = glm::tmat2x2<T, glm::aligned>;
|
||||||
|
|||||||
@@ -30,6 +30,10 @@ namespace OpenVulkano::Math
|
|||||||
|
|
||||||
RGB10A2(TYPE value = 0) : value(value) {}
|
RGB10A2(TYPE value = 0) : value(value) {}
|
||||||
|
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wunused-result"
|
||||||
|
#pragma clang diagnostic ignored "-Wunused-result"
|
||||||
template<typename T, typename = std::enable_if_t<std::is_integral_v<TYPE>>>
|
template<typename T, typename = std::enable_if_t<std::is_integral_v<TYPE>>>
|
||||||
void Set(Vector3<T> vec3)
|
void Set(Vector3<T> vec3)
|
||||||
{
|
{
|
||||||
@@ -50,6 +54,8 @@ namespace OpenVulkano::Math
|
|||||||
vec4 &= VALUE_BITMASK;
|
vec4 &= VALUE_BITMASK;
|
||||||
SetUnchecked(vec4);
|
SetUnchecked(vec4);
|
||||||
}
|
}
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
|
||||||
template<typename T, typename = std::enable_if_t<std::is_floating_point_v<T>>>
|
template<typename T, typename = std::enable_if_t<std::is_floating_point_v<T>>>
|
||||||
void Set(const Vector3<T>& vec3)
|
void Set(const Vector3<T>& vec3)
|
||||||
|
|||||||
Reference in New Issue
Block a user