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

◆ save_volume() [1/2]

MAYAFLUX_API bool MayaFlux::save_volume ( const std::shared_ptr< Buffers::VolumeGridBuffer > &  volume,
const std::string &  suggested_name,
const IO::VolumeWriteOptions &  options 
)

Present a native save-file dialog filtered to volume formats and save volume to the chosen path via IOManager::save_volume().

Blocks until the user confirms or cancels. The download and encode task are queued asynchronously. Returns false on cancellation, backend error, or if Portal::System is not initialized.

Parameters
volumeSource VolumeGridBuffer to download and encode.
suggested_nameFilename pre-filled in the dialog name field.
optionsWriter options forwarded to IOManager.

Definition at line 526 of file Depot.cpp.

530{
531 if (!require_portal("save_volume"))
532 return false;
533
534 auto iom = get_io_manager();
535 if (!iom) {
536 MF_ERROR(Journal::Component::API, Journal::Context::Runtime,
537 "save_volume: IOManager unavailable");
538 return false;
539 }
540
541 return Portal::System::Dialog::save_file<bool>(
542 [&iom, &volume, &options](const fs::path& p) {
543 return iom->save_volume(volume, p.string(), options);
544 },
545 [](Core::SystemDialogError) { },
546 suggested_name,
547 k_volume_filters);
548}
#define MF_ERROR(comp, ctx,...)
std::shared_ptr< IO::IOManager > get_io_manager()
Retrieves the global IOManager instance for file loading and buffer management.
Definition Depot.cpp:575

References MayaFlux::Journal::API, get_io_manager(), MF_ERROR, and MayaFlux::Journal::Runtime.

+ Here is the call graph for this function: