Expand xmp builder

This commit is contained in:
Georg Hagen
2025-02-13 23:26:12 +01:00
parent c8599c0631
commit fc70941cab
3 changed files with 8 additions and 1 deletions

View File

@@ -18,6 +18,7 @@
#include "Math/Range.hpp" #include "Math/Range.hpp"
#include "Base/UUID.hpp" #include "Base/UUID.hpp"
#include <filesystem> #include <filesystem>
#include <fmt/chrono.h>
template<> struct fmt::formatter<OpenVulkano::ByteSize> template<> struct fmt::formatter<OpenVulkano::ByteSize>
{ {

View File

@@ -95,6 +95,11 @@ namespace OpenVulkano::Image
return *this; return *this;
} }
[[maybe_unused]] XmpBuilder& XmpBuilder::SetCreateDate(const std::time_t time)
{
return SetCreateDate(fmt::format("{:%FT%T%Ez}", fmt::localtime(time)));
}
[[maybe_unused]] XmpBuilder& XmpBuilder::SetCreateDate(const std::string& createDate) [[maybe_unused]] XmpBuilder& XmpBuilder::SetCreateDate(const std::string& createDate)
{ {
xmpData << "<xmp:CreateDate>" << createDate << "</xmp:CreateDate>"; xmpData << "<xmp:CreateDate>" << createDate << "</xmp:CreateDate>";

View File

@@ -28,6 +28,7 @@ namespace OpenVulkano::Image
[[maybe_unused]] XmpBuilder& SetFocalLength(float focalLengthMM); [[maybe_unused]] XmpBuilder& SetFocalLength(float focalLengthMM);
[[maybe_unused]] XmpBuilder& SetExposureTime(double exposureTime); [[maybe_unused]] XmpBuilder& SetExposureTime(double exposureTime);
[[maybe_unused]] XmpBuilder& SetCreateDate(const std::time_t time);
[[maybe_unused]] XmpBuilder& SetCreateDate(const std::string& createDate); [[maybe_unused]] XmpBuilder& SetCreateDate(const std::string& createDate);
[[maybe_unused]] std::string Close() { return Finalize(); } [[maybe_unused]] std::string Close() { return Finalize(); }