Add support for saving color images directly to file

This commit is contained in:
Georg Hagen
2024-07-04 09:07:31 +02:00
parent 5b6fde2aaf
commit 4af5dbd596
3 changed files with 34 additions and 10 deletions

View File

@@ -50,6 +50,7 @@ namespace OpenVulkano::AR
size_t archiveSize = 2_GiB;
bool downsampleColor = true;
bool highResFramesInSeparateArchive = true;
bool saveHighResFrames = true;
bool asyncRecording = true;
};
@@ -81,7 +82,7 @@ namespace OpenVulkano::AR
void Write(ArFrame* frame, bool highRes = false);
void WriteMetadata(ArFrame* frame, MultiPartArchiveWriter* metaWriter);
void WriteColorImage(ArFrame* arFrame, MultiPartArchiveWriter* colorWriter, bool highRes) const;
void WriteColorImage(ArFrame* arFrame, MultiPartArchiveWriter* colorWriter, const std::filesystem::path* path, bool highRes) const;
void WriteDepthImage(ArFrame *arFrame, MultiPartArchiveWriter* depthWriter, MultiPartArchiveWriter* confWriter);
public:
@@ -93,6 +94,8 @@ namespace OpenVulkano::AR
void SaveHighResolution(const std::shared_ptr<ArFrame>& frame);
void SaveToFile(const std::shared_ptr<ArFrame>& frame, const std::filesystem::path& path, bool downsample = false);
/**
* Starts the recording of the owning AR session
*/
@@ -178,12 +181,14 @@ namespace OpenVulkano::AR
* Checks if a separate archive is used for the high res frames.
* @return true = using the separate archive file; false = using the normal archive files
*/
bool GetHighResFramesInSeparateArchive() const { return m_settings.highResFramesInSeparateArchive; }
bool GetHighResFramesInSeparateArchive() const { return m_settings.highResFramesInSeparateArchive; }
void SetArchivePartMaxFileSize(size_t maxPartSize = 2_GiB) { m_settings.archiveSize = maxPartSize; }
void SetArchivePartMaxFileSize(size_t maxPartSize = 2_GiB) { m_settings.archiveSize = maxPartSize; }
size_t GetArchivePartMaxFileSize() const { return m_settings.archiveSize; }
size_t GetArchivePartMaxFileSize() const { return m_settings.archiveSize; }
const RecordingSettings& GetRecordingSettings() const { return m_settings; }
void SetRecordHighResImages(bool recHighRes = true) { m_settings.saveHighResFrames = recHighRes; }
};
}