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 "Base/UUID.hpp"
#include <filesystem>
#include <fmt/chrono.h>
template<> struct fmt::formatter<OpenVulkano::ByteSize>
{
@@ -191,4 +192,4 @@ struct fmt::formatter<OpenVulkano::UUID> : fmt::formatter<std::string>
{
return fmt::format_to(ctx.out(), "{}", uuid.string());
}
};
};

View File

@@ -94,6 +94,11 @@ namespace OpenVulkano::Image
xmpData << fmt::format("<exif:ExposureTime>{0}</exif:ExposureTime><aux:ExposureTime>{0}</aux:ExposureTime>", exposureTime);
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)
{

View File

@@ -28,6 +28,7 @@ namespace OpenVulkano::Image
[[maybe_unused]] XmpBuilder& SetFocalLength(float focalLengthMM);
[[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]] std::string Close() { return Finalize(); }