MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ save_volume() [1/2]

bool MayaFlux::IO::save_volume ( const Kakshya::VolumeData data,
const std::string &  filepath,
const VolumeWriteOptions options = {} 
)

Save already-downloaded VolumeData to disk via the registry.

Pure CPU, no thread restrictions. For callers holding a VolumeData from download_volume, from a future reader, or built procedurally.

ImageExport has no equivalent because IOManager::save_image(ImageData) covers that case asynchronously. A synchronous data-to-file path is worth having here: it is what a test exercising a writer calls, and what a shutdown flush calls.

Definition at line 197 of file VolumeTransfer.cpp.

201{
202 auto writer = VolumeWriterRegistry::instance().create_writer(filepath);
203 if (!writer) {
204 MF_ERROR(Journal::Component::IO, Journal::Context::FileIO,
205 "save_volume: no writer registered for extension of '{}'", filepath);
206 return false;
207 }
208
209 const bool ok = writer->write(filepath, data, options);
210 if (!ok) {
211 MF_ERROR(Journal::Component::IO, Journal::Context::FileIO,
212 "save_volume: writer failed: {}", writer->get_last_error());
213 }
214 return ok;
215}
#define MF_ERROR(comp, ctx,...)

References MayaFlux::IO::VolumeWriterRegistry::create_writer(), MayaFlux::Journal::FileIO, MayaFlux::IO::VolumeWriterRegistry::instance(), MayaFlux::Journal::IO, and MF_ERROR.

Referenced by save_volume(), and MayaFlux::IO::VolumeCapture::VolumeCapture().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: